chiark / gitweb /
Clean up properly in postrm.
[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 21@discard{
1a3dba67
RK
22
23 @# On/off button for pause etc
24 @# @class should be the class: pause, random, playing
25 @# @action should be the action to switch to the opposite state
26 @# @state should be the current state
27 @define {onoff} {class action state}
28 {<a class=button
99955407 29 href="@url?action=@action@back"
e194c231 30 title="@label{playing.@q{@action}verbose}">
1a3dba67
RK
31 @label{playing.@class}
32 </a>
33 <img width=@width height=@height class=imgbutton
34 src="@image{@state}">}
35
36 @# Volume up/down buttons
37 @# @dir is the direction: up or down
38 @# @sign is the sign: + or -
39 @define {vbutton}{dir sign}
40 {@right{volume}
41 {<a class=imgbutton
42 href="@url?action=volume&#38;delta=@sign@label{volume.resolution}@back">
43 <img class=button src="@image{@dir}"
30d85588 44 width=@width height=@height
1a3dba67
RK
45 alt="@label{volume.@dir}"
46 title="@label{volume.@q{@dir}verbose}">
47 </a>}
30d85588
RK
48 {<img class=button width=@width height=@height
49 src="@image{no@dir}">}}
1a3dba67 50
0d0253c9
RK
51 @# Expand to @yes for the Manage page and @no for the playing page
52 @define {ifmanage} {yes no}
53 {@if {@eq {@arg{action}}{manage}}
54 {@yes}
55 {@no}}
56
57 @# Expand to &back=manage or to nothing
58 @define {back} {}
59 {@ifmanage{&amp;back=manage}{}}
2257512d 60}@#
460b9539 61<html>
62 <head>
0d0253c9 63@quiethead
04024c2c 64 <title>@if{@isplaying}
2257512d
RK
65 {@playing{@part{@id}{title}}}
66 {@label{playing.title}}</title>
460b9539 67 </head>
68 <body>
0d0253c9 69@stdmenu{@ifmanage{manage}{playing}}
04024c2c 70 <h1>@label{playing.title}</h1>
460b9539 71
04024c2c 72@# Extra control buttons for the management page
2257512d 73 @ifmanage{
328248ba 74 <div class=mgmt>
1a3dba67
RK
75 <p class=mgmt>
76 @if{@paused}
d77d85a6
RK
77 {@onoff{pause}{resume}{enabled}}
78 {@onoff{pause}{pause}{disabled}}
1a3dba67
RK
79 @if{@random-enabled}
80 {@onoff{random}{randomdisable}{enabled}}
81 {@onoff{random}{randomenable}{disabled}}
82 @if{@enabled}
83 {@onoff{playing}{disable}{enabled}}
84 {@onoff{playing}{enable}{disabled}}
85 <form class=volume method=POST
86 action="@url"
87 enctype="multipart/form-data" accept-charset=utf-8>
88 <span class=volume>
89 @label{playing.volume}
90 @vbutton{up}{+}
91 @label{volume.left}
92 <input size=3 name=left type=text value="@volume{left}">
93 @label{volume.right}
94 <input size=3 name=right type=text value="@volume{right}">
858805c3 95 <input name=back type=hidden value="@quote{@thisurl}">
1a3dba67 96 @right{volume}{
8b15f02d 97 @submit{@label{volume.set}}
1a3dba67
RK
98 <input name=action type=hidden value=volume>
99 }
100 @vbutton{down}{-}
101 </span>
102 </form>
103 </p>
328248ba 104 </div>
2257512d 105 }{}
460b9539 106
04024c2c
RK
107@# Only display the table if there is something to put in it
108@if{@or{@isplaying}{@isqueue}}{
460b9539 109 <table class=playing>
110 <tr class=headings>
04024c2c
RK
111 <th class=when>@label{heading.when}</th>
112 <th class=who>@label{heading.who}</th>
113 <th class=artist>@label{heading.artist}</th>
114 <th class=album>@label{heading.album}</th>
115 <th class=title>@label{heading.title}</th>
116 <th class=length>@label{heading.length}</th>
460b9539 117 <th class=button>&nbsp;</th>
2257512d 118 @ifmanage{
1a3dba67
RK
119 <th class=imgbutton>&nbsp;</th>
120 <th class=imgbutton>&nbsp;</th>
121 <th class=imgbutton>&nbsp;</th>
122 <th class=imgbutton>&nbsp;</th>
2257512d 123 }{}
460b9539 124 </tr>
af106f2d
RK
125 @if{@isplaying}{
126 <tr class=nowplaying>
1a3dba67 127 <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
af106f2d
RK
128 </tr>
129 }
2257512d 130 @playing{
af106f2d 131 <tr class=playing>
1a3dba67
RK
132 <td class=when>@mwhen{playing}{@id}</td>
133 <td class=who>@mwho{playing}{@id}</td>
134 <td class=artist>@martist{playing}{@track}</td>
135 <td class=album>@malbum{playing}{@track}</td>
136 <td class=title>@mtitle{playing}{@track}</td>
137 <td class=length>@length{@id}</td>
138 <td class=imgbutton>@mremove{playing}{@id}</td>
139 @ifmanage{
140 <td class=imgbutton>&nbsp;</td>
141 <td class=imgbutton>&nbsp;</td>
142 <td class=imgbutton>&nbsp;</td>
143 <td class=imgbutton>&nbsp;</td>
144 }{}
af106f2d 145 </tr>
2257512d 146 }
99955407
RK
147 @if{@isqueue}{
148 <tr class=next>
149 <td colspan=@ifmanage{11}{7}>@label{playing.next}</td>
150 </tr>
2257512d 151 }
460b9539 152 @queue{
99955407
RK
153 <tr class=@parity>
154 <td class=when>@mwhen{queue}{@id}</td>
155 <td class=who>@mwho{queue}{@id}</td>
156 <td class=artist>@martist{queue}{@track}</td>
157 <td class=album>@malbum{queue}{@track}</td>
158 <td class=title>@mtitle{queue}{@track}</td>
159 <td class=length>@length{@id}</td>
160 <td class=imgbutton>@mremove{queue}{@id}</td>
161 @ifmanage{
162 <td class=imgbutton>@mmove{@id}{upall}{2147483647}</td>
163 <td class=imgbutton>@mmove{@id}{up}{1}</td>
164 <td class=imgbutton>@mmove{@id}{down}{-1}</td>
165 <td class=imgbutton>@mmove{@id}{downall}{-2147483647}</td>
166 }{}
167 </tr>
168 }
460b9539 169 </table>
2257512d 170}
460b9539 171
0d0253c9 172@credits
460b9539 173 </body>
174</html>
2257512d 175@discard{
460b9539 176Local variables:
177mode:sgml
178sgml-always-quote-attributes:nil
179sgml-indent-step:1
180sgml-indent-data:t
0d0253c9 181indent-tabs-mode:nil
460b9539 182End:
0d0253c9 183}@#