chiark / gitweb /
more template work
[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
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
2257512d
RK
49 @include{macros.tmpl}
50}@#
460b9539 51<html>
52 <head>
2257512d 53@include{stdhead.tmpl}@#
04024c2c 54 <title>@if{@isplaying}
2257512d
RK
55 {@playing{@part{@id}{title}}}
56 {@label{playing.title}}</title>
460b9539 57 </head>
58 <body>
04024c2c
RK
59@include{topbar.tmpl}
60 <h1>@label{playing.title}</h1>
460b9539 61
04024c2c 62@# Extra control buttons for the management page
2257512d 63 @ifmanage{
328248ba 64 <div class=mgmt>
1a3dba67
RK
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>
328248ba 96 </div>
2257512d 97 }{}
460b9539 98
04024c2c
RK
99@# Only display the table if there is something to put in it
100@if{@or{@isplaying}{@isqueue}}{
460b9539 101 <table class=playing>
102 <tr class=headings>
04024c2c
RK
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>
460b9539 109 <th class=button>&nbsp;</th>
2257512d 110 @ifmanage{
1a3dba67
RK
111 <th class=imgbutton>&nbsp;</th>
112 <th class=imgbutton>&nbsp;</th>
113 <th class=imgbutton>&nbsp;</th>
114 <th class=imgbutton>&nbsp;</th>
2257512d 115 }{}
460b9539 116 </tr>
af106f2d
RK
117 @if{@isplaying}{
118 <tr class=nowplaying>
1a3dba67 119 <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
af106f2d
RK
120 </tr>
121 }
2257512d 122 @playing{
af106f2d 123 <tr class=playing>
1a3dba67
RK
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 }{}
af106f2d 137 </tr>
2257512d 138 }
460b9539 139 @if{@isqueue@}{
af106f2d 140 <tr class=next>
1a3dba67 141 <td colspan=@ifmanage{11}{7}@>@label{playing.next}</td>
af106f2d 142 </tr>
2257512d 143 }
460b9539 144 @queue{
af106f2d 145 <tr class=@parity@>
1a3dba67
RK
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 }
af106f2d 159 </tr>
2257512d 160 }
460b9539 161 </table>
2257512d 162}
460b9539 163
a2c4ad5f 164@include{topbarend.tmpl}@#
460b9539 165 </body>
166</html>
2257512d 167@discard{
460b9539 168Local variables:
169mode:sgml
170sgml-always-quote-attributes:nil
171sgml-indent-step:1
172sgml-indent-data:t
173End:
2257512d 174}@