chiark / gitweb /
Update CHANGES.html
[disorder] / templates / playing.tmpl
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <!--
3 This file is part of DisOrder.
4 Copyright (C) 2004-2008 Richard Kettlewell
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 -->
19 @discard{
20
21   @# On/off button for pause etc
22   @#  @class should be the class: pause, random, playing
23   @#  @action should be the action to switch to the opposite state
24   @#  @state should be the current state
25   @define {onoff} {class action state}
26           {@actbutton{@label{playing.@class}}
27                      {@label{playing.@q{@action}verbose}}
28                      {@action}
29            <img width=@width height=@height class=imgbutton
30                 src="@image{@state}">}
31
32   @# Volume up/down buttons
33   @#  @dir is the direction: up or down
34   @#  @sign is the sign: + or -
35   @define {vbutton}{dir sign}
36           {@right{volume}
37                  {<a class=imgbutton
38                      href="@url?action=volume&#38;delta=@sign@label{volume.resolution}@back">
39                     <img class=button src="@image{@dir}"
40                          width=@width height=@height
41                          alt="@label{volume.@dir}"
42                          title="@label{volume.@q{@dir}verbose}">
43                   </a>}
44                  {<img class=button width=@width height=@height
45                        src="@image{no@dir}">}}
46
47   @# Expand to @yes for the Manage page and @no for the playing page
48   @define {ifmanage} {yes no}
49             {@if {@eq {@arg{action}}{manage}}
50                  {@yes}
51                  {@no}}
52
53   @ifmanage{
54     @define {back} {} {&amp;back=manage}
55     @define {formback} {} {<input type=hidden name=back value=manage>}
56   }{}
57 }@#
58 <html>
59  <head>
60 @quiethead
61   <title>@if{@isplaying}
62             {@playing{@part{@id}{title}}}
63             {@label{playing.title}}</title>
64  </head>
65  <body>
66 @stdmenu{@ifmanage{manage}{playing}}
67    <h1>@label{playing.title}</h1>
68
69 @# Extra control buttons for the management page
70    @ifmanage{
71    <div class=mgmt>
72      <p class=mgmt>
73        @if{@paused}
74           {@onoff{pause}{resume}{enabled}}
75           {@onoff{pause}{pause}{disabled}}
76        @if{@random-enabled}
77           {@onoff{random}{randomdisable}{enabled}}
78           {@onoff{random}{randomenable}{disabled}}
79        @if{@enabled}
80           {@onoff{playing}{disable}{enabled}}
81           {@onoff{playing}{enable}{disabled}}
82        <form class=volume method=POST
83              action="@url"
84              enctype="multipart/form-data" accept-charset=utf-8>
85          <span class=volume>
86            @label{playing.volume}
87            @vbutton{up}{+}
88            @label{volume.left}
89            <input size=3 name=left type=text value="@volume{left}">
90            @label{volume.right}
91            <input size=3 name=right type=text value="@volume{right}">
92            <input name=back type=hidden value="@quote{@thisurl}">
93            @right{volume}{
94              @submit{@label{volume.set}}
95              <input name=action type=hidden value=volume>
96            }
97            @vbutton{down}{-}
98          </span>
99        </form>
100       </p>
101     </div>
102    }{}
103
104 @# Only display the table if there is something to put in it
105 @if{@or{@isplaying}{@isqueue}}{
106    <table class=playing>
107      <tr class=headings>
108       <th class=when>@label{heading.when}</th>
109       <th class=who>@label{heading.who}</th>
110       <th class=artist>@label{heading.artist}</th>
111       <th class=album>@label{heading.album}</th>
112       <th class=title>@label{heading.title}</th>
113       <th class=length>@label{heading.length}</th>
114       <th class=button>&nbsp;</th>
115       @ifmanage{
116         <th class=imgbutton>&nbsp;</th>
117         <th class=imgbutton>&nbsp;</th>
118         <th class=imgbutton>&nbsp;</th>
119         <th class=imgbutton>&nbsp;</th>
120       }{}
121      </tr>
122      @if{@isplaying}{
123        <tr class=nowplaying>
124         <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
125        </tr>
126      }
127      @playing{
128        <tr class=playing>
129         <td class=when>@mwhen{playing}{@id}</td>
130         <td class=who>@mwho{playing}{@id}</td>
131         <td class=artist>@martist{playing}{@track}</td>
132         <td class=album>@malbum{playing}{@track}</td>
133         <td class=title>@mtitle{playing}{@track}</td>
134         <td class=length>@length{@id}</td>
135         <td class=imgbutton>@mremove{playing}{@id}</td>
136         @ifmanage{
137           <td class=imgbutton>&nbsp;</td>
138           <td class=imgbutton>&nbsp;</td>
139           <td class=imgbutton>&nbsp;</td>
140           <td class=imgbutton>&nbsp;</td>
141         }{}
142        </tr>
143      }
144      @if{@isqueue}{
145       <tr class=next>
146        <td colspan=@ifmanage{11}{7}>@label{playing.next}</td>
147       </tr>
148      }
149      @queue{
150       <tr class=@parity>
151        <td class=when>@mwhen{queue}{@id}</td>
152        <td class=who>@mwho{queue}{@id}</td>
153        <td class=artist>@martist{queue}{@track}</td>
154        <td class=album>@malbum{queue}{@track}</td>
155        <td class=title>@mtitle{queue}{@track}</td>
156        <td class=length>@length{@id}</td>
157        <td class=imgbutton>@mremove{queue}{@id}</td>
158        @ifmanage{
159          <td class=imgbutton>@mmove{@id}{upall}{2147483647}</td>
160          <td class=imgbutton>@mmove{@id}{up}{1}</td>
161          <td class=imgbutton>@mmove{@id}{down}{-1}</td>
162          <td class=imgbutton>@mmove{@id}{downall}{-2147483647}</td>
163        }{}
164       </tr>
165     }
166    </table>
167 }
168
169 @credits
170  </body>
171 </html>
172 @discard{
173 Local variables:
174 mode:sgml
175 sgml-always-quote-attributes:nil
176 sgml-indent-step:1
177 sgml-indent-data:t
178 indent-tabs-mode:nil
179 End:
180 }@#