chiark / gitweb /
dirname/basename expansions; template fiddling
[disorder] / templates / playing.tmpl
CommitLineData
460b9539 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2<!--
3This file is part of DisOrder.
8f9616f1 4Copyright (C) 2004-2008 Richard Kettlewell
460b9539 5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19USA
20-->
2257512d
RK
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}@#
460b9539 30<html>
31 <head>
2257512d 32@include{stdhead.tmpl}@#
04024c2c 33 <title>@if{@isplaying}
2257512d
RK
34 {@playing{@part{@id}{title}}}
35 {@label{playing.title}}</title>
460b9539 36 </head>
37 <body>
04024c2c
RK
38@include{topbar.tmpl}
39 <h1>@label{playing.title}</h1>
460b9539 40
04024c2c 41@# Extra control buttons for the management page
2257512d 42 @ifmanage{
328248ba 43 <div class=mgmt>
460b9539 44 <p class=mgmt>
04024c2c
RK
45 @if{@paused}{
46@# Paused
47 <a class=button
2257512d 48 href="@url?action=resume@back"
04024c2c
RK
49 title="@label{playing.resumeverbose}">@label{playing.pause}</a>
50 </a>
51 <img width=16 height=16 class=imgbutton src="@image{enabled}">
460b9539 52 }{
04024c2c
RK
53@# Not paused
54 <a class=button
2257512d 55 href="@url?action=pause@back"
04024c2c
RK
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
2257512d 63 href="@url?action=random-disable@back"
04024c2c
RK
64 title="@label{playing.randomdisableverbose}">@label{playing.random}</a>
65 </a>
66 <img width=16 height=16 class=imgbutton src="@image{enabled}">
460b9539 67 }{
04024c2c
RK
68@# Random play disabled
69 <a class=button
2257512d 70 href="@url?action=random-enable@back"
04024c2c
RK
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
2257512d 78 href="@url?action=disable@back"
04024c2c
RK
79 title="@label{playing.disableverbose}">@label{playing.playing}</a>
80 </a>
81 <img width=16 height=16 class=imgbutton src="@image{enabled}">
460b9539 82 }{
2257512d 83@# Play disabled
04024c2c 84 <a class=button
2257512d 85 href="@url?action=enable@back"
04024c2c
RK
86 title="@label{playing.enableverbose}">@label{playing.playing}</a>
87 </a>
88 <img width=16 height=16 class=imgbutton src="@image{disabled}">
89 }
2257512d 90@# Volume form
04024c2c 91 <form class=volume action="@url" method=POST
460b9539 92 enctype="multipart/form-data" accept-charset=utf-8>
93 <span class=volume>
04024c2c
RK
94 @label{playing.volume}
95@# Volume up button
96 @right{volume}{
97 <a class=imgbutton
2257512d 98 href="@url?action=volume&#38;delta=-@label{volume.resolution}@back">
04024c2c
RK
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@">
2257512d 109 <input name=back type=hidden value="@thisurl@?back=manage">
04024c2c
RK
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
2257512d 119 href="@url?action=volume&#38;delta=@label{volume.resolution}@back">
04024c2c
RK
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 }
460b9539 128 </form>
129 </span>
328248ba 130 </p>
131 </div>
2257512d 132 }{}
460b9539 133
04024c2c
RK
134@# Only display the table if there is something to put in it
135@if{@or{@isplaying}{@isqueue}}{
460b9539 136 <table class=playing>
137 <tr class=headings>
04024c2c
RK
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>
460b9539 144 <th class=button>&nbsp;</th>
2257512d 145 @ifmanage{
460b9539 146 <th class=imgbutton>&nbsp;</th>
147 <th class=imgbutton>&nbsp;</th>
148 <th class=imgbutton>&nbsp;</th>
149 <th class=imgbutton>&nbsp;</th>
2257512d 150 }{}
460b9539 151 </tr>
2257512d 152 @playing{
460b9539 153 <tr class=nowplaying>
2257512d 154 <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
460b9539 155 </tr>
460b9539 156 <tr class=playing>
2257512d
RK
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{
460b9539 191 <td class=imgbutton>&nbsp;</td>
192 <td class=imgbutton>&nbsp;</td>
193 <td class=imgbutton>&nbsp;</td>
194 <td class=imgbutton>&nbsp;</td>
2257512d 195 }{}
460b9539 196 </tr>
2257512d 197 }
460b9539 198 @if{@isqueue@}{
199 <tr class=next>
2257512d 200 <td colspan=@ifmanage{11}{7}@>@label{playing.next}</td>
460b9539 201 </tr>
2257512d 202 }
460b9539 203 @queue{
204 <tr class=@parity@>
2257512d
RK
205 <td class=when>@when</td>
206 <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{queue.randomtrack}}{&nbsp;}@}{@who@}</td>
a31780f6 207 <td class=artist>@right{play}{<a class=directory
2257512d
RK
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>
a31780f6 213 <td class=album>@right{play}{<a class=directory
2257512d
RK
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>
61507e3c 219 <td class=title><span
2257512d
RK
220 title="@part{@id}{title}@">@part{@id}{short}{title}</span></td>
221 <td class=length>@length</td>
460b9539 222 <td class=imgbutton>@if{@removable@}{<a class=imgbutton
2257512d 223 href="@url?action=remove&#38;id=@id@@back"><img
04024c2c
RK
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}"
2257512d 229 alt="@label{playing.remove}">}</td>
d7ce365e 230
2257512d 231 @if{@eq{@arg{action}}{manage}}{
d7ce365e 232 @if{@or{@isfirst@}
233 {@not{@movable@}@}@}{
234 <!-- cannot move up -->
235 <td class=imgbutton>
460b9539 236 <img
04024c2c
RK
237 class=button src="@image{noupall}"
238 title="@label{playing.upallverbose}" alt="">
460b9539 239 <td class=imgbutton>
240 <img
04024c2c
RK
241 class=button src="@image{noup}"
242 title="@label{playing.upverbose}" alt="">
d7ce365e 243 }{
244 <!-- can move up -->
245 <td class=imgbutton>
460b9539 246 <a class=imgbutton
2257512d 247 href="@url?action=move&#38;id=@id@&#38;delta=2147483647@back"><img
04024c2c
RK
248 class=button src="@image{upall}"
249 title="@label{playing.upallverbose}"
250 alt="@label{playing.upall}"></a>
460b9539 251 <td class=imgbutton>
252 <a class=imgbutton
2257512d 253 href="@url?action=move&#38;id=@id@&#38;delta=1@back"><img
04024c2c
RK
254 class=button src="@image{up}"
255 title="@label{playing.upverbose}" alt="@label{playing.up}"></a>
2257512d 256 }
d7ce365e 257
258 @if{@or{@islast@}
259 {@not{@movable@}@}@}{
260 <!-- cannot move down -->
261 <td class=imgbutton>
262 <img
04024c2c
RK
263 class=button src="@image{nodownall}"
264 title="@label{playing.downallverbose}" alt="">
d7ce365e 265 <td class=imgbutton>
460b9539 266 <img
04024c2c
RK
267 class=button src="@image{nodown}"
268 title="@label{playing.downverbose}" alt="">
d7ce365e 269 }{
270 <!-- can move down -->
460b9539 271 <td class=imgbutton>
d7ce365e 272 <a class=imgbutton
2257512d 273 href="@url?action=move&#38;id=@id@&#38;delta=-2147483647@back"><img
04024c2c
RK
274 class=button src="@image{downall}"
275 title="@label{playing.downallverbose}"
276 alt="@label{playing.downall}"></a>
d7ce365e 277 <td class=imgbutton>
278 <a class=imgbutton
2257512d 279 href="@url?action=move&#38;id=@id@&#38;delta=-1@back"><img
04024c2c
RK
280 class=button src="@image{down}"
281 title="@label{playing.downverbose}" alt="@label{playing.down}"></a>
2257512d
RK
282 }
283 }
460b9539 284 </tr>
2257512d 285 }
460b9539 286 </table>
2257512d 287}
460b9539 288
2257512d 289@include{topbarend}@#
460b9539 290 </body>
291</html>
2257512d 292@discard{
460b9539 293Local variables:
294mode:sgml
295sgml-always-quote-attributes:nil
296sgml-indent-step:1
297sgml-indent-data:t
298End:
2257512d 299}@