chiark / gitweb /
Further hacking. Some actual success at runtime now.
[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;regexp=^(the )?a">A</a> |
34     <a title="Directories starting with 'b'"
35     href="@url?action=choose&#38;regexp=^(the )?b">B</a> |
36     <a title="Directories starting with 'c'"
37     href="@url?action=choose&#38;regexp=^(the )?c">C</a> |
38     <a title="Directories starting with 'd'"
39     href="@url?action=choose&#38;regexp=^(the )?d">D</a> |
40     <a title="Directories starting with 'e'"
41     href="@url?action=choose&#38;regexp=^(the )?e">E</a> |
42     <a title="Directories starting with 'f'"
43     href="@url?action=choose&#38;regexp=^(the )?f">F</a> |
44     <a title="Directories starting with 'g'"
45     href="@url?action=choose&#38;regexp=^(the )?g">G</a> |
46     <a title="Directories starting with 'h'"
47     href="@url?action=choose&#38;regexp=^(the )?h">H</a> |
48     <a title="Directories starting with 'i'"
49     href="@url?action=choose&#38;regexp=^(the )?i">I</a> |
50     <a title="Directories starting with 'j'"
51     href="@url?action=choose&#38;regexp=^(the )?j">J</a> |
52     <a title="Directories starting with 'k'"
53     href="@url?action=choose&#38;regexp=^(the )?k">K</a> |
54     <a title="Directories starting with 'l'"
55     href="@url?action=choose&#38;regexp=^(the )?l">L</a> |
56     <a title="Directories starting with 'm'"
57     href="@url?action=choose&#38;regexp=^(the )?m">M</a> |
58     <a title="Directories starting with 'n'"
59     href="@url?action=choose&#38;regexp=^(the )?n">N</a> |
60     <a title="Directories starting with 'o'"
61     href="@url?action=choose&#38;regexp=^(the )?o">O</a> |
62     <a title="Directories starting with 'p'"
63     href="@url?action=choose&#38;regexp=^(the )?p">P</a> |
64     <a title="Directories starting with 'q'"
65     href="@url?action=choose&#38;regexp=^(the )?q">Q</a> |
66     <a title="Directories starting with 'r'"
67     href="@url?action=choose&#38;regexp=^(the )?r">R</a> |
68     <a title="Directories starting with 's'"
69     href="@url?action=choose&#38;regexp=^(the )?s">S</a> |
70     <a title="Directories starting with 't'"
71     href="@url?action=choose&#38;regexp=^(?!the [^t])t">T</a> |
72     <a title="Directories starting with 'u'"
73     href="@url?action=choose&#38;regexp=^(the )?u">U</a> |
74     <a title="Directories starting with 'v'"
75     href="@url?action=choose&#38;regexp=^(the )?v">V</a> |
76     <a title="Directories starting with 'w'"
77     href="@url?action=choose&#38;regexp=^(the )?w">W</a> |
78     <a title="Directories starting with 'x'"
79     href="@url?action=choose&#38;regexp=^(the )?x">X</a> |
80     <a title="Directories starting with 'y'"
81     href="@url?action=choose&#38;regexp=^(the )?y">Y</a> |
82     <a title="Directories starting with 'z'"
83     href="@url?action=choose&#38;regexp=^(the )?z">Z</a> |
84     <a title="Directories starting with anything else"
85     href="@url?action=choose&#38;regexp=^[^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=search>
101      </p>
102    </form>
103
104    @if{@ne{@arg{query}}{}}
105       {
106 @# There's a search query
107   <table class=search>
108     <tr class=headings>
109      <th class=artist>@label{heading.artist}</th>
110      <th class=album>@label{heading.album}</th>
111      <th class=title>@label{heading.title}</th>
112      <th class=length>@label{heading.length}</th>
113 @right{prefs}{
114      <th class=button>&nbsp;</th>}
115     </tr>
116     @search{@arg{query}}{
117     <tr class=@parity>
118      <td class=artist>@martist{search}{@track}</td>
119      <td class=album>@malbum{search}{@track}</td>
120      <td class=title>@mtitle{search}{@track}</td>
121      <td class=length>@length{@id}</td>
122      @right{prefs}{
123      <td class=imgbutton>
124       <a class=imgbutton
125          href="@url?action=prefs&#38;0_file=@urlquote{@track}">
126        <img class=button src="@image{edit}"
127             title="@label{choose.prefsverbose}"
128             alt="@label{choose.prefs}">
129       </a>
130      </td>
131     </tr>}
132     }
133   </table>}
134       {
135 @# No search query
136
137 @# TODO navigation...
138
139    <div class=directories>
140     <div class=filesdirectories>
141      @dirs{@arg{dir}}{@arg{re}}{
142       <p class=entry>
143        <a href="@url?action=choose&#38;dir=@urlquote{@track}">
144         <img class=button src="@image{directory}" alt="">
145         @display
146        </a>
147       </p>}
148     </div>
149    </div>
150
151 @define{sometracks}{template}{}
152
153    <div class=files>
154     <div class=filesdirectories>
155      @dirs{@arg{dir}}{@arg{re}}{
156       <p class=entry>
157 @define{sometracks}{template}{@template}@#
158        @rights{prefs}{
159         <a class=imgprefs
160            href="@url?action=prefs&#38;0_file=@urlquote{@resolve{@track}}">
161          <img class=button
162               src="@image{edit}"
163               title="@label:choose.prefsverbose@"
164               alt="@label:choose.prefs@">
165         </a>
166        }@#
167        <a href="@url?action=play&#38;file=@urlquote{@track}&#38;back=@urlquote{@thisurl}"
168           title="@label{choose.play}">
169         @display
170        </a>
171        @if{@eq{@trackstate{@track}}{playing}}
172           {[<b>playing</b>]}
173        @if{@eq{@trackstate{@track}}{queued}}
174           {[<b>queued</b>]}
175       </p>}
176       @sometracks{
177       <p class=all>
178         @right{prefs}{
179         <a class=imgprefs
180            href="@url?action=prefs&#38;dir=@urlquote{@arg{dir}}">
181          <img class=button
182               src="@image{edit}"
183               title="@label:choose.allprefsverbose@"
184               alt="@label:choose.allprefs@">
185         </a>}
186         <a class=button
187            href="@url?action=play&#38;dir=@urlquote{@arg{dir}}"&#38;back=@urlquote{@thisurl}">
188          @label{choose.playall}
189         </a>
190       </p>}
191     </div>
192    </div>
193
194    }
195
196 @credits
197  </body>
198 </html>
199 @discard{
200 Local variables:
201 mode:sgml
202 sgml-always-quote-attributes:nil
203 sgml-indent-step:1
204 sgml-indent-data:t
205 indent-tabs-mode:nil
206 fill-column:79
207 End:
208 }@#