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