chiark / gitweb /
084f5c3c5553fe8470ea2667d4488f5f262256d5
[disorder] / templates / playing.tmpl
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <!--
3 This file is part of DisOrder.
4 Copyright (C) 2004-2008 Richard Kettlewell
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
20 -->
21 @discard{
22   @define {ifmanage} {yes no}
23           {@if {@eq {@arg{action}}{manage}}
24                {@yes}
25                {@no}}
26   @define {back} {}
27           {@ifmanage{&amp;back=manage}{}}
28   @include{macros.tmpl}
29 }@#
30 <html>
31  <head>
32 @include{stdhead.tmpl}@#
33   <title>@if{@isplaying}
34             {@playing{@part{@id}{title}}}
35             {@label{playing.title}}</title>
36  </head>
37  <body>
38 @include{topbar.tmpl}
39    <h1>@label{playing.title}</h1>
40
41 @# Extra control buttons for the management page
42    @ifmanage{
43    <div class=mgmt>
44    <p class=mgmt>
45     @if{@paused}{
46 @# Paused
47       <a class=button
48       href="@url?action=resume@back"
49        title="@label{playing.resumeverbose}">@label{playing.pause}</a>
50       </a>
51       <img width=16 height=16 class=imgbutton src="@image{enabled}">
52     }{
53 @# Not paused
54       <a class=button
55       href="@url?action=pause@back"
56        title="@label{playing.pauseverbose}">@label{playing.pause}</a>
57       </a>
58       <img width=16 height=16 class=imgbutton src="@image{disabled}">
59     }
60     @if{@random-enabled}{
61 @# Random play enabled
62       <a class=button
63       href="@url?action=random-disable@back"
64        title="@label{playing.randomdisableverbose}">@label{playing.random}</a>
65       </a>
66       <img width=16 height=16 class=imgbutton src="@image{enabled}">
67     }{
68 @# Random play disabled
69       <a class=button
70       href="@url?action=random-enable@back"
71        title="@label{playing.randomenableverbose}">@label{playing.random}</a>
72       </a>
73       <img width=16 height=16 class=imgbutton src="@image{disabled}">
74     }
75     @if{@enabled}{
76 @# Play enabled
77       <a class=button
78       href="@url?action=disable@back"
79        title="@label{playing.disableverbose}">@label{playing.playing}</a>
80       </a>
81       <img width=16 height=16 class=imgbutton src="@image{enabled}">
82     }{
83 @# Play disabled
84       <a class=button
85       href="@url?action=enable@back"
86        title="@label{playing.enableverbose}">@label{playing.playing}</a>
87       </a>
88       <img width=16 height=16 class=imgbutton src="@image{disabled}">
89     }
90 @# Volume form
91     <form class=volume action="@url" method=POST
92      enctype="multipart/form-data" accept-charset=utf-8>
93     <span class=volume>
94      @label{playing.volume}
95 @# Volume up button
96      @right{volume}{
97        <a class=imgbutton
98         href="@url?action=volume&#38;delta=-@label{volume.resolution}@back">
99          <img class=button src="@image{down}"
100               alt="@label{volume.reduce}"
101               title="@label{volume.reduceverbose}">
102        </a>
103      }{
104        <img class=button src="@image{nodown}">
105      }
106 @# Volume value widgets
107      @label{volume.left} <input size=3 name=left type=text value="@volume:left@">
108      @label{volume.right} <input size=3 name=right type=text value="@volume:right@">
109      <input name=back type=hidden value="@thisurl@?back=manage">
110 @# Volume set button
111      @right{volume}{
112        <button class=search name=submit type=submit>
113          @label{volume.set}
114        </button><input name=action type=hidden value=volume>
115      }
116 @# Volume down button
117      @right{volume}{
118        <a class=imgbutton
119           href="@url?action=volume&#38;delta=@label{volume.resolution}@back">
120           <img class=button
121                src="@image{up}"
122                alt="@label{volume.increase}"
123                title="@label{volume.increaseverbose}">
124        </a>
125      }{
126        <img class=button src="@image{noup}">
127      }
128     </form>
129     </span>
130     </p>
131     </div>
132    }{}
133
134 @# Only display the table if there is something to put in it
135 @if{@or{@isplaying}{@isqueue}}{
136    <table class=playing>
137      <tr class=headings>
138       <th class=when>@label{heading.when}</th>
139       <th class=who>@label{heading.who}</th>
140       <th class=artist>@label{heading.artist}</th>
141       <th class=album>@label{heading.album}</th>
142       <th class=title>@label{heading.title}</th>
143       <th class=length>@label{heading.length}</th>
144       <th class=button>&nbsp;</th>
145       @ifmanage{
146       <th class=imgbutton>&nbsp;</th>
147       <th class=imgbutton>&nbsp;</th>
148       <th class=imgbutton>&nbsp;</th>
149       <th class=imgbutton>&nbsp;</th>
150       }{}
151      </tr>
152      @playing{
153      <tr class=nowplaying>
154       <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
155      </tr>
156      <tr class=playing>
157       <td class=when>@when{@id}</td>
158       <td class=who>@if{@eq{@who{@id}}{}}
159                        {@if{@eq{@state{@id}}{random}}
160                            {@label{playing.randomtrack}}
161                            {&nbsp;}}
162                        {@who{@id}}
163       </td>
164       <td class=artist>@right{play}
165                              {<a class=directory
166                                  href="@url?action=choose&amp;directory=@urlquote{@dirname{@dirname{@track}}}"
167                                  title="@label{playing.artistverbose}">@part{@id}{short}{artist}</a>}
168                              {<span class=directory
169                                     title="@part{artist}@">@part{short}{artist}</span>}
170       </td>
171       <td class=album>@right{play}
172                             {<a class=directory
173                                 href="@url?action=choose&amp;directory=@urlquote{@dirname{@track}}"
174                                 title="@label{playing.albumverbose}">@part{short}{album}</a>}
175                             {<span class=directory
176                                    title="@part{album}@">@part{short}{album}</span>}
177       </td>
178       <td class=title><span title="@part{@id}{title}">@part{@id}{short}{title}</span></td>
179       <td class=length>@length{@id}</td>
180       <td class=imgbutton>@if{@removabl{@id}}
181                              {<a class=imgbutton
182                                  href="@url?action=scratch&#38;id=@id@back">
183                               <img class=button src="@image{scratch}"
184                                    title="@label{playing.scratchverbose}"
185                                    alt="@label{playing.scratch}"></a>}
186                              {<img class=button src="@image{noscratch}"
187                                    title="@label{playing.scratchverbose}"
188                                    alt="@label{playing.scratch}">}
189       </td>
190       @ifmanage{
191       <td class=imgbutton>&nbsp;</td>
192       <td class=imgbutton>&nbsp;</td>
193       <td class=imgbutton>&nbsp;</td>
194       <td class=imgbutton>&nbsp;</td>
195       }{}
196      </tr>
197      }
198      @if{@isqueue@}{
199      <tr class=next>
200       <td colspan=@ifmanage{11}{7}@>@label{playing.next}</td>
201      </tr>
202      }
203      @queue{
204      <tr class=@parity@>
205       <td class=when>@when</td>
206       <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{queue.randomtrack}}{&nbsp;}@}{@who@}</td>
207       <td class=artist>@right{play}{<a class=directory
208        title="@part{@id}{artist}@"
209        href="@url?action=choose&amp;directory=@urlquote{@dirname{@dirname{@track}@}@}@"
210        >@part{@id}{short}{artist}</a>}{<span class=directory
211        title="@part{@id}{artist}@"
212        >@part{@id}{short}{artist}</span>}</td>
213       <td class=album>@right{play}{<a class=directory
214        title="@part{@id}{album}@"
215        href="@url?action=choose&amp;directory=@urlquote{@dirname{@track}@}@"
216        >@part{@id}{short}{album}</a>}{<span class=directory
217        title="@part{@id}{album}@"
218        >@part{@id}{short}{album}@}</td>
219       <td class=title><span
220        title="@part{@id}{title}@">@part{@id}{short}{title}</span></td>
221       <td class=length>@length</td>
222       <td class=imgbutton>@if{@removable@}{<a class=imgbutton
223        href="@url?action=remove&#38;id=@id@@back"><img
224        class=button src="@image{scratch}"
225        title="@label{playing.removeverbose}" 
226        alt="@label{playing.remove}"></a>}{<img
227        class=button src="@image{noscratch}"
228        title="@label{playing.removeverbose}"
229        alt="@label{playing.remove}">}</td>
230
231       @if{@eq{@arg{action}}{manage}}{
232       @if{@or{@isfirst@}
233              {@not{@movable@}@}@}{
234      <!-- cannot move up -->
235      <td class=imgbutton>
236       <img
237        class=button src="@image{noupall}"
238        title="@label{playing.upallverbose}" alt="">
239      <td class=imgbutton>
240       <img
241        class=button src="@image{noup}"
242        title="@label{playing.upverbose}" alt="">
243          }{
244      <!-- can move up -->
245      <td class=imgbutton>
246       <a class=imgbutton
247         href="@url?action=move&#38;id=@id@&#38;delta=2147483647@back"><img
248        class=button src="@image{upall}"
249        title="@label{playing.upallverbose}"
250        alt="@label{playing.upall}"></a>
251      <td class=imgbutton>
252      <a class=imgbutton
253         href="@url?action=move&#38;id=@id@&#38;delta=1@back"><img
254        class=button src="@image{up}"
255        title="@label{playing.upverbose}" alt="@label{playing.up}"></a>
256          }
257
258       @if{@or{@islast@}
259              {@not{@movable@}@}@}{
260      <!-- cannot move down -->
261      <td class=imgbutton>
262       <img
263        class=button src="@image{nodownall}"
264        title="@label{playing.downallverbose}" alt="">
265      <td class=imgbutton>
266       <img
267        class=button src="@image{nodown}"
268        title="@label{playing.downverbose}" alt="">
269          }{
270      <!-- can move down -->
271      <td class=imgbutton>
272       <a class=imgbutton
273         href="@url?action=move&#38;id=@id@&#38;delta=-2147483647@back"><img
274        class=button src="@image{downall}"
275        title="@label{playing.downallverbose}"
276        alt="@label{playing.downall}"></a>
277      <td class=imgbutton>
278      <a class=imgbutton
279         href="@url?action=move&#38;id=@id@&#38;delta=-1@back"><img
280        class=button src="@image{down}"
281        title="@label{playing.downverbose}" alt="@label{playing.down}"></a>
282          }
283       }
284      </tr>
285      }
286    </table>
287 }
288
289 @include{topbarend}@#
290  </body>
291 </html>
292 @discard{
293 Local variables:
294 mode:sgml
295 sgml-always-quote-attributes:nil
296 sgml-indent-step:1
297 sgml-indent-data:t
298 End:
299 }@