chiark / gitweb /
fatal() testing for dateparse()
[disorder] / templates / choose.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 <html>
22  <head>
23 @stdhead{choose}
24  </head>
25  <body>
26 @stdmenu{choose}
27    <h1>@label{choose.title}</h1>
28   
29   @if{@eq{@label{menu.choosewhich}}{choosealpha}}
30      {
31    <p class=choosealpha>
32     <a title="Directories starting with 'a'"
33     href="@url?action=choose&#38;re=^(the )?a">A</a> |
34     <a title="Directories starting with 'b'"
35     href="@url?action=choose&#38;re=^(the )?b">B</a> |
36     <a title="Directories starting with 'c'"
37     href="@url?action=choose&#38;re=^(the )?c">C</a> |
38     <a title="Directories starting with 'd'"
39     href="@url?action=choose&#38;re=^(the )?d">D</a> |
40     <a title="Directories starting with 'e'"
41     href="@url?action=choose&#38;re=^(the )?e">E</a> |
42     <a title="Directories starting with 'f'"
43     href="@url?action=choose&#38;re=^(the )?f">F</a> |
44     <a title="Directories starting with 'g'"
45     href="@url?action=choose&#38;re=^(the )?g">G</a> |
46     <a title="Directories starting with 'h'"
47     href="@url?action=choose&#38;re=^(the )?h">H</a> |
48     <a title="Directories starting with 'i'"
49     href="@url?action=choose&#38;re=^(the )?i">I</a> |
50     <a title="Directories starting with 'j'"
51     href="@url?action=choose&#38;re=^(the )?j">J</a> |
52     <a title="Directories starting with 'k'"
53     href="@url?action=choose&#38;re=^(the )?k">K</a> |
54     <a title="Directories starting with 'l'"
55     href="@url?action=choose&#38;re=^(the )?l">L</a> |
56     <a title="Directories starting with 'm'"
57     href="@url?action=choose&#38;re=^(the )?m">M</a> |
58     <a title="Directories starting with 'n'"
59     href="@url?action=choose&#38;re=^(the )?n">N</a> |
60     <a title="Directories starting with 'o'"
61     href="@url?action=choose&#38;re=^(the )?o">O</a> |
62     <a title="Directories starting with 'p'"
63     href="@url?action=choose&#38;re=^(the )?p">P</a> |
64     <a title="Directories starting with 'q'"
65     href="@url?action=choose&#38;re=^(the )?q">Q</a> |
66     <a title="Directories starting with 'r'"
67     href="@url?action=choose&#38;re=^(the )?r">R</a> |
68     <a title="Directories starting with 's'"
69     href="@url?action=choose&#38;re=^(the )?s">S</a> |
70     <a title="Directories starting with 't'"
71     href="@url?action=choose&#38;re=^(?!the [^t])t">T</a> |
72     <a title="Directories starting with 'u'"
73     href="@url?action=choose&#38;re=^(the )?u">U</a> |
74     <a title="Directories starting with 'v'"
75     href="@url?action=choose&#38;re=^(the )?v">V</a> |
76     <a title="Directories starting with 'w'"
77     href="@url?action=choose&#38;re=^(the )?w">W</a> |
78     <a title="Directories starting with 'x'"
79     href="@url?action=choose&#38;re=^(the )?x">X</a> |
80     <a title="Directories starting with 'y'"
81     href="@url?action=choose&#38;re=^(the )?y">Y</a> |
82     <a title="Directories starting with 'z'"
83     href="@url?action=choose&#38;re=^(the )?z">Z</a> |
84     <a title="Directories starting with anything else"
85     href="@url?action=choose&#38;re=^[^a-z]">*</a>
86    </p>
87 }
88
89 @# Always have a search form
90    <form class=search
91          action="@url"
92          method=POST
93          enctype="multipart/form-data" accept-charset=utf-8>
94      <p class=search>Enter search terms:
95        <input class=query name=query type=text value="@argq{query}"
96               size=50>
97        <button class=search name=submit type=submit>
98          @label{search.search}
99        </button>
100        <input name=action type=hidden value=choose>
101        <a class=button
102           href="@url?action=choose">
103          @label{search.clear}
104        </a>
105      </p>
106    </form>
107
108    @if{@ne{@arg{query}}{}}
109       {@# There's a search query
110   <table class=search>
111     <tr class=headings>
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 @right{prefs}{
117      <th class=button>&nbsp;</th>}
118     </tr>
119     @search{@arg{query}}{
120     <tr class=@parity>
121      <td class=artist>@martist{search}{@track}</td>
122      <td class=album>@malbum{search}{@track}</td>
123      <td class=title>@mtitleplay{search}{@track}</td>
124      <td class=length>@length{@track}</td>
125      @right{prefs}{
126      <td class=imgbutton>
127       <a class=imgbutton
128          href="@url?action=prefs&#38;track=@urlquote{@track}">
129        <img class=button src="@image{edit}"
130             title="@label{choose.prefsverbose}"
131             alt="@label{choose.prefs}">
132       </a>
133      </td>
134     </tr>}
135     }
136   </table>}
137       {@# No search query
138
139 @# We have the following possible cases:
140 @#  choose.which  dir       re       result
141 @#  choose        ""        -        Ask for top level
142 @#  choose        ""        present  Ask for top level with re applied
143 @#  choose        present   -        Ask for dir
144 @#  choose        present   re       Ask for dir with re applied
145 @#  choosealpha   ""        -        Nothing
146 @#  choosealpha   ""        present  Ask for top level with re applied
147 @#  choosealpha   present   -        Ask for dir
148 @#  choosealpha   present   re       Ask for dir with re applied
149 @#
150 @# So in fact the only oddity is choosealpha + no dir + no re.
151 @#
152 @# NB we don't really bother distinguishing between re being empty or absent,
153 @# and the server deliberately cooperates in this.
154
155    @if{@ne{@arg{dir}}{}}{
156    <p class=directoryname>@#
157 @breadcrumbs{@arg{dir}} 
158             {/<a href="@url?action=choose&#38;dir=@urlquote{@dir}">@#
159 @basename{@dir}</a>}:</p>}
160
161 @#  <p>dir=[@arg{dir}]<br>re=[@arg{re}]<br>which=@label{choose.which}</p>
162
163   @if{@or{@ne{@label{menu.choosewhich}}{choosealpha}}
164          {@ne{@arg{dir}}{}}
165          {@ne{@arg{re}}{}}}
166      {@#
167    <div class=directories>
168     <div class=filesdirectories>
169      @dirs{@arg{dir}}{@arg{re}}{
170       <p class=entry>
171        <a href="@url?action=choose&#38;dir=@urlquote{@track}">
172         <img class=button src="@image{directory}" alt="">
173         @display
174        </a>
175       </p>}
176     </div>
177    </div>
178
179 @define{sometracks}{template}{}
180
181    <div class=files>
182     <div class=filesdirectories>
183      @tracks{@arg{dir}}{@arg{re}}{
184       <p class=entry>
185 @define{sometracks}{template}{@template}@#
186        @right{prefs}{
187         <a class=imgprefs
188            href="@url?action=prefs&#38;track=@urlquote{@resolve{@track}}">
189          <img class=button
190               src="@image{edit}"
191               title="@label{choose.prefsverbose}"
192               alt="@label{choose.prefs}">
193         </a>
194        }@#
195        <a href="@url?action=play&#38;track=@urlquote{@track}&#38;back=@urlquote{@thisurl}"
196           title="@label{choose.play}">
197         @display
198        </a>
199        @if{@eq{@trackstate{@track}}{playing}}
200           {[<b>playing</b>]}
201        @if{@eq{@trackstate{@track}}{queued}}
202           {[<b>queued</b>]}
203       </p>}
204       @sometracks{
205       <p class=all>
206         @right{prefs}{
207         <a class=imgprefs
208            href="@url?action=prefs&#38;dir=@urlquote{@arg{dir}}">
209          <img class=button
210               src="@image{edit}"
211               title="@label{choose.allprefsverbose}"
212               alt="@label{choose.allprefs}">
213         </a>}
214         <a class=button
215            href="@url?action=play&#38;dir=@urlquote{@arg{dir}}&#38;back=@urlquote{@thisurl}">
216          @label{choose.playall}
217         </a>
218       </p>}
219     </div>
220    </div>
221    }
222    }
223
224 @credits
225  </body>
226 </html>
227 @discard{
228 Local variables:
229 mode:sgml
230 sgml-always-quote-attributes:nil
231 sgml-indent-step:1
232 sgml-indent-data:t
233 indent-tabs-mode:nil
234 fill-column:79
235 End:
236 }@#