1 This file is part of DisOrder.
2 Copyright (C) 2008 Richard Kettlewell
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 ------------------------------------------------------------------------
24 This file is read before any other template. Its output is discarded
25 but side effects (definitions of macros) are retained. To override it,
26 create /etc/disorder/macros.tmpl that includes this file by absolute path
27 and then redefines macros as desired.
28 ------------------------------------------------------------------------
31 @# Standard width and height of an image
32 @define {width} {} {16}
33 @define {height} {} {16}
35 @# Standard <head> text
36 @# @name is the name of this page, for the <title> element
37 @define {stdhead} {name}
39 <title>@label{@name.title}</title>}
41 @# Non-displaying <head> text
42 @define {quiethead} {}
43 { <link rel=stylesheet
45 href="@label{url.static}/disorder.css">}
48 @# @current is the name of the current page, e.g. choosealpha, login
49 @define {stdmenu} {current}
52 @menuitem{@current}{playing}{true}
53 @menuitem{@current}{recent}{true}
54 @menuitem{@current}{choose}{@right{play}}
55 @menuitem{@current}{manage}{true}
56 @menuitem{@current}{new}{true}
57 @menuitem{@current}{login}{true}
58 @menuitem{@current}{help}{true}
59 @menuitem{@current}{about}{true}
62 <a href="http://www.greenend.org.uk/rjk/disorder/">
63 <img src="@image{logosmall}"
64 style="border-style:none"
66 title="Quack quack! Visit the DisOrder website">
69 <div style="clear:both"></div>
75 @# @current is the name of the current page (not necessarily the action that
77 @# @name is the name of the menu item
78 @# @available is true if the menu item is available, else false
80 @define {menuitem} {current name available}
82 { <a @if{@eq{@current}{@name}}
85 @if{@eq{name}{playing}}
87 { href="@url?action=@name"}
88 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</a>}
89 { <span class=invalidmenu
90 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</span>}}
93 @# Standard footer text
96 <a href="http://www.greenend.org.uk/rjk/disorder/"
97 title="DisOrder web site">DisOrder
99 © 2003-2008 Richard Kettlewell et al
102 @# Expand to the time that @id will be played
103 @# @what is the section
104 @# @id is the track ID
105 @define {mwhen} {what id}
108 @# Expand to the 'who' field for @id
109 @# @what is the section
110 @# @id is the track ID
111 @define {mwho} {what id}
112 {@if{@eq{@who{@id}}{}}
113 {@if{@eq{@state{@id}}{random}}
114 {@label{@what.randomtrack}}
118 @# Expand to the artist for @track
119 @# @what is the section
120 @# @track is the track name
121 @define {martist} {what track}
124 href="@url?action=choose&dir=@urlquote{@dirname{@dirname{@track}}}"
125 title="@label{playing.artistverbose}">@part{@track}{artist}{short}</a>}
126 {<span class=directory
127 title="@part{@track}{artist}">@part{@track}{artist}{short}</span>}}
129 @# Expand to the album for @track
130 @# @what is the section
131 @# @track is the track name
132 @define {malbum} {what track}
135 href="@url?action=choose&dir=@urlquote{@dirname{@track}}"
136 title="@label{playing.albumverbose}">@part{@track}{album}{short}</a>}
137 {<span class=directory
138 title="@part{@track}{album}">@part{@track}{album}{short}</span>}}
140 @# Expand to the title for @track
141 @# @what is the section
142 @# @track is the track name
143 @define {mtitle} {what track}
144 {<span title="@part{@track}{title}">@part{@track}{title}{short}</span>}
146 @# As @mtitle but make a link to play the track
147 @# @what is the section
148 @# @track is the track name
149 @define {mtitleplay} {what track}
150 {<a title="@part{@track}{title}" href="@url?action=play&track=@urlquote{@track}&back=@urlquote{@thisurl}">@part{@track}{title}{short}</a>}
152 @# Expand to the remove/scratch entry for @id
153 @# @what is the section
154 @# @id is the track ID
155 @define {mremove} {what id}
156 {@if{@removable{@id}}
158 href="@url?action=remove&id=@id@back">
159 <img class=button src="@image{remove}"
160 width=@width height=@height
161 title="@label{@what.removeverbose}"
162 alt="@label{@what.scratch}">
164 {<img class=button src="@image{noremove}"
165 width=@width height=@height
166 title="@label{@what.removeverbose}"
167 alt="@label{@what.scratch}">}}
169 @# Expand to a move button
170 @# @id is the track ID
171 @# @dir should be a direction: up, upall, down or downall
172 @# @delta should be the distance, +ve for up and -ve for down
173 @# This macro calls @movable to check that the move is possible.
174 @define {mmove} {id dir delta}
175 {@if{@movable{@id}{@delta}}
177 href="@url?action=move&id=@id&delta=@delta@back">
178 <img class=button src="@image{@dir}"
179 width=@width height=@height
180 title="@label{playing.@q{@dir}verbose}"
181 alt="@label{playing.@dir}">
183 {<img class=button src="@image{no@dir}"
184 width=@width height=@height
185 title="@label{playing.@q{@dir}verbose}"
186 alt="@label{playing.@dir}">}}
188 @# Size of input box for preferences forms
189 @define{prefsize}{}{40}
191 @# Expand to the weight of a track. This macro knows the default weight,
192 @# and does two lookups, which is rather inelegant.
193 @# @track is the track name.
194 @define{weight}{track}{@if{@eq{@pref{@track}{weight}}{}}
196 {@pref{@track}{weight}}}
198 @# Expand to preference form section for a track
199 @# @index is the track number
200 @# @track is the track name
201 @define {mprefs} {index track}
203 <p class="prefs_head">Preferences for <span class="prefs_track">@quote{@resolve{@track}}</span>:</p>
204 <input type=hidden name="@index@__track" value="@quote{@resolve{@track}}">
207 <th class="prefs_name">@label{prefs.name}</th>
208 <th class="prefs_value">@label{prefs.value}</th>
211 <td class="prefs_name">@label{heading.title}</td>
212 <td class="prefs_value">
213 <input size=@prefsize type=text name="@index@__title"
214 value="@part{@track}{title}{display}">
218 <td class="prefs_name">@label{heading.album}</td>
219 <td class="prefs_value">
220 <input size=@prefsize type=text name="@index@__album"
221 value="@part{@track}{album}{display}">
225 <td class="prefs_name">@label{heading.artist}</td>
226 <td class="prefs_value">
227 <input size=@prefsize type=text name="@index@__artist"
228 value="@part{@track}{artist}{display}">
232 <td class="prefs_name">@label{prefs.tags}</td>
233 <td class="prefs_value">
234 <input size=@prefsize type=text name="@index@__tags"
235 value="@pref{@track}{tags}">
239 <td class="prefs_name">@label{prefs.weight}</td>
240 <td class="prefs_value">
241 <input size=@prefsize type=text name="@index@__weight"
242 value="@weight{@track}">
246 <td class="prefs_name">@label{prefs.random}</td>
247 <td class="prefs_value">
248 <input type=checkbox value=true
249 name="@index@__random"
250 @if{@ne{@pref{@track}{pick_at_random}}{0}}
259 sgml-always-quote-attributes:nil