chiark / gitweb /
more template work
[disorder] / templates / playing.tmpl
... / ...
CommitLineData
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2<!--
3This file is part of DisOrder.
4Copyright (C) 2004-2008 Richard Kettlewell
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-->
21@discard{
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
29 href="@url?action=@action@back"@class}@q{@state
30 title="@label{playing.@q{action}verbose}">
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}"
44 alt="@label{volume.@dir}"
45 title="@label{volume.@q{@dir}verbose}">
46 </a>}
47 {<img class=button src="@image{no@dir}">}}
48
49 @include{macros.tmpl}
50}@#
51<html>
52 <head>
53@include{stdhead.tmpl}@#
54 <title>@if{@isplaying}
55 {@playing{@part{@id}{title}}}
56 {@label{playing.title}}</title>
57 </head>
58 <body>
59@include{topbar.tmpl}
60 <h1>@label{playing.title}</h1>
61
62@# Extra control buttons for the management page
63 @ifmanage{
64 <div class=mgmt>
65 <p class=mgmt>
66 @if{@paused}
67 {@onoff{class}{resume}{enabled}}
68 {@onoff{class}{pause}{disabled}}
69 @if{@random-enabled}
70 {@onoff{random}{randomdisable}{enabled}}
71 {@onoff{random}{randomenable}{disabled}}
72 @if{@enabled}
73 {@onoff{playing}{disable}{enabled}}
74 {@onoff{playing}{enable}{disabled}}
75 <form class=volume method=POST
76 action="@url"
77 enctype="multipart/form-data" accept-charset=utf-8>
78 <span class=volume>
79 @label{playing.volume}
80 @vbutton{up}{+}
81 @label{volume.left}
82 <input size=3 name=left type=text value="@volume{left}">
83 @label{volume.right}
84 <input size=3 name=right type=text value="@volume{right}">
85 <input name=back type=hidden value="@thisurl@?back=manage">
86 @right{volume}{
87 <button class=search name=submit type=submit>
88 @label{volume.set}
89 </button>
90 <input name=action type=hidden value=volume>
91 }
92 @vbutton{down}{-}
93 </span>
94 </form>
95 </p>
96 </div>
97 }{}
98
99@# Only display the table if there is something to put in it
100@if{@or{@isplaying}{@isqueue}}{
101 <table class=playing>
102 <tr class=headings>
103 <th class=when>@label{heading.when}</th>
104 <th class=who>@label{heading.who}</th>
105 <th class=artist>@label{heading.artist}</th>
106 <th class=album>@label{heading.album}</th>
107 <th class=title>@label{heading.title}</th>
108 <th class=length>@label{heading.length}</th>
109 <th class=button>&nbsp;</th>
110 @ifmanage{
111 <th class=imgbutton>&nbsp;</th>
112 <th class=imgbutton>&nbsp;</th>
113 <th class=imgbutton>&nbsp;</th>
114 <th class=imgbutton>&nbsp;</th>
115 }{}
116 </tr>
117 @if{@isplaying}{
118 <tr class=nowplaying>
119 <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
120 </tr>
121 }
122 @playing{
123 <tr class=playing>
124 <td class=when>@mwhen{playing}{@id}</td>
125 <td class=who>@mwho{playing}{@id}</td>
126 <td class=artist>@martist{playing}{@track}</td>
127 <td class=album>@malbum{playing}{@track}</td>
128 <td class=title>@mtitle{playing}{@track}</td>
129 <td class=length>@length{@id}</td>
130 <td class=imgbutton>@mremove{playing}{@id}</td>
131 @ifmanage{
132 <td class=imgbutton>&nbsp;</td>
133 <td class=imgbutton>&nbsp;</td>
134 <td class=imgbutton>&nbsp;</td>
135 <td class=imgbutton>&nbsp;</td>
136 }{}
137 </tr>
138 }
139 @if{@isqueue@}{
140 <tr class=next>
141 <td colspan=@ifmanage{11}{7}@>@label{playing.next}</td>
142 </tr>
143 }
144 @queue{
145 <tr class=@parity@>
146 <td class=when>@mwhen{queue}{@id}</td>
147 <td class=who>@mwho{queue}{@id}</td>
148 <td class=artist>@martist{queue}{@track}</td>
149 <td class=album>@malbum{queue}{@track}</td>
150 <td class=title>@mtitle{queue}{@track}</td>
151 <td class=length>@length</td>
152 <td class=imgbutton>@mremove{queue}{@id}</td>
153 @ifmanage{
154 <td class=imgbutton>@mmove{@id}{upall}{2147483647}</td>
155 <td class=imgbutton>@mmove{@id}{up}{1}</td>
156 <td class=imgbutton>@mmove{@id}{down}{-1}</td>
157 <td class=imgbutton>@mmove{@id}{downall}{-2147483647}</td>
158 }
159 </tr>
160 }
161 </table>
162}
163
164@include{topbarend.tmpl}@#
165 </body>
166</html>
167@discard{
168Local variables:
169mode:sgml
170sgml-always-quote-attributes:nil
171sgml-indent-step:1
172sgml-indent-data:t
173End:
174}@