chiark / gitweb /
Set Debian version to 4.0 too
[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 2 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, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 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, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
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           {@actbutton{@label{playing.@class}}
29                      {@label{playing.@q{@action}verbose}}
30                      {@action}
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}"
42                          width=@width height=@height
43                          alt="@label{volume.@dir}"
44                          title="@label{volume.@q{@dir}verbose}">
45                   </a>}
46                  {<img class=button width=@width height=@height
47                        src="@image{no@dir}">}}
48
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
55   @ifmanage{
56     @define {back} {} {&amp;back=manage}
57     @define {formback} {} {<input type=hidden name=back value=manage>}
58   }{}
59 }@#
60 <html>
61  <head>
62 @quiethead
63   <title>@if{@isplaying}
64             {@playing{@part{@id}{title}}}
65             {@label{playing.title}}</title>
66  </head>
67  <body>
68 @stdmenu{@ifmanage{manage}{playing}}
69    <h1>@label{playing.title}</h1>
70
71 @# Extra control buttons for the management page
72    @ifmanage{
73    <div class=mgmt>
74      <p class=mgmt>
75        @if{@paused}
76           {@onoff{pause}{resume}{enabled}}
77           {@onoff{pause}{pause}{disabled}}
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}">
94            <input name=back type=hidden value="@quote{@thisurl}">
95            @right{volume}{
96              @submit{@label{volume.set}}
97              <input name=action type=hidden value=volume>
98            }
99            @vbutton{down}{-}
100          </span>
101        </form>
102       </p>
103     </div>
104    }{}
105
106 @# Only display the table if there is something to put in it
107 @if{@or{@isplaying}{@isqueue}}{
108    <table class=playing>
109      <tr class=headings>
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>
116       <th class=button>&nbsp;</th>
117       @ifmanage{
118         <th class=imgbutton>&nbsp;</th>
119         <th class=imgbutton>&nbsp;</th>
120         <th class=imgbutton>&nbsp;</th>
121         <th class=imgbutton>&nbsp;</th>
122       }{}
123      </tr>
124      @if{@isplaying}{
125        <tr class=nowplaying>
126         <td colspan=@ifmanage{11}{7}>@label{playing.now}</td>
127        </tr>
128      }
129      @playing{
130        <tr class=playing>
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         }{}
144        </tr>
145      }
146      @if{@isqueue}{
147       <tr class=next>
148        <td colspan=@ifmanage{11}{7}>@label{playing.next}</td>
149       </tr>
150      }
151      @queue{
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     }
168    </table>
169 }
170
171 @credits
172  </body>
173 </html>
174 @discard{
175 Local variables:
176 mode:sgml
177 sgml-always-quote-attributes:nil
178 sgml-indent-step:1
179 sgml-indent-data:t
180 indent-tabs-mode:nil
181 End:
182 }@#