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 redefine 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}
61 @menuicon{@current}{about}{true}{logosmall}
63 <div style="clear:both"></div>
67 @define {menuurl} {name}
68 {@if{@eq{name}{playing}}
74 @# @current is the name of the current page (not necessarily the action that
76 @# @name is the name of the menu item
77 @# @available is true if the menu item is available, else false
79 @define {menuitem} {current name available}
81 { <a @if{@eq{@current}{@name}}
84 href="@menuurl{@name}"
85 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</a>}
86 { <span class=invalidmenu
87 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</span>}}
89 @# Icon-based menu entry (very similar to @menuitem)
91 @# @current is the name of the current page
92 @# @name is the name of the menu item
93 @# @available is true if the menu item is available, else false
94 @# @icon is the name of the icon
96 @define {menuicon} {current name available icon}
99 href="@menuurl{@name}">
100 <img @if{@eq{@current}{@name}}
103 title="@label{menu.@q{@name}verbose}"
104 alt="@label{menu.@name}"
107 { <span class=menuicon>
108 <img @if{@eq{@current}{@name}}
111 title="@label{menu.@q{@name}verbose}"
112 alt="@label{menu.@name}"
113 src="@image{@icon@_inactive}">
116 @# Standard footer text
119 <a href="http://www.greenend.org.uk/rjk/disorder/"
120 title="DisOrder web site">DisOrder
122 © 2003-2008 Richard Kettlewell et al
125 @# Expand to the time that @id will be played
126 @# @what is the section
127 @# @id is the track ID
128 @define {mwhen} {what id}
131 @# Expand to the 'who' field for @id
132 @# @what is the section
133 @# @id is the track ID
134 @define {mwho} {what id}
135 {@if{@eq{@who{@id}}{}}
136 {@if{@eq{@state{@id}}{random}}
137 {@label{@what.randomtrack}}
141 @# Expand to the artist for @track
142 @# @what is the section
143 @# @track is the track name
144 @define {martist} {what track}
147 href="@url?action=choose&dir=@urlquote{@dirname{@dirname{@track}}}"
148 title="@label{playing.artistverbose}">@part{@track}{artist}{short}</a>}
149 {<span class=directory
150 title="@part{@track}{artist}">@part{@track}{artist}{short}</span>}}
152 @# Expand to the album for @track
153 @# @what is the section
154 @# @track is the track name
155 @define {malbum} {what track}
158 href="@url?action=choose&dir=@urlquote{@dirname{@track}}"
159 title="@label{playing.albumverbose}">@part{@track}{album}{short}</a>}
160 {<span class=directory
161 title="@part{@track}{album}">@part{@track}{album}{short}</span>}}
163 @# Expand to the title for @track
164 @# @what is the section
165 @# @track is the track name
166 @define {mtitle} {what track}
167 {<span title="@part{@track}{title}">@part{@track}{title}{short}</span>}
169 @# As @mtitle but make a link to play the track
170 @# @what is the section
171 @# @track is the track name
172 @define {mtitleplay} {what track}
173 {<a title="@part{@track}{title}" href="@url?action=play&track=@urlquote{@track}&back=@urlquote{@thisurl}">@part{@track}{title}{short}</a>}
175 @# Expand to the remove/scratch entry for @id
176 @# @what is the section
177 @# @id is the track ID
178 @define {mremove} {what id}
179 {@if{@removable{@id}}
181 href="@url?action=remove&id=@id@back">
182 <img class=button src="@image{remove}"
183 width=@width height=@height
184 title="@label{@what.removeverbose}"
185 alt="@label{@what.scratch}">
187 {<img class=button src="@image{noremove}"
188 width=@width height=@height
189 title="@label{@what.removeverbose}"
190 alt="@label{@what.scratch}">}}
192 @# Expand to a move button
193 @# @id is the track ID
194 @# @dir should be a direction: up, upall, down or downall
195 @# @delta should be the distance, +ve for up and -ve for down
196 @# This macro calls @movable to check that the move is possible.
197 @define {mmove} {id dir delta}
198 {@if{@movable{@id}{@delta}}
200 href="@url?action=move&id=@id&delta=@delta@back">
201 <img class=button src="@image{@dir}"
202 width=@width height=@height
203 title="@label{playing.@q{@dir}verbose}"
204 alt="@label{playing.@dir}">
206 {<img class=button src="@image{no@dir}"
207 width=@width height=@height
208 title="@label{playing.@q{@dir}verbose}"
209 alt="@label{playing.@dir}">}}
211 @# Size of input box for preferences forms
212 @define{prefsize}{}{40}
214 @# Expand to the weight of a track. This macro knows the default weight,
215 @# and does two lookups, which is rather inelegant.
216 @# @track is the track name.
217 @define{weight}{track}{@if{@eq{@pref{@track}{weight}}{}}
219 {@pref{@track}{weight}}}
221 @# Expand to preference form section for a track
222 @# @index is the track number
223 @# @track is the track name
224 @define {mprefs} {index track}
226 <p class="prefs_head">Preferences for <span class="prefs_track">@quote{@resolve{@track}}</span>:</p>
227 <input type=hidden name="@index@__track" value="@quote{@resolve{@track}}">
230 <th class="prefs_name">@label{prefs.name}</th>
231 <th class="prefs_value">@label{prefs.value}</th>
234 <td class="prefs_name">@label{heading.title}</td>
235 <td class="prefs_value">
236 <input size=@prefsize type=text name="@index@__title"
237 value="@part{@track}{title}{display}">
241 <td class="prefs_name">@label{heading.album}</td>
242 <td class="prefs_value">
243 <input size=@prefsize type=text name="@index@__album"
244 value="@part{@track}{album}{display}">
248 <td class="prefs_name">@label{heading.artist}</td>
249 <td class="prefs_value">
250 <input size=@prefsize type=text name="@index@__artist"
251 value="@part{@track}{artist}{display}">
255 <td class="prefs_name">@label{prefs.tags}</td>
256 <td class="prefs_value">
257 <input size=@prefsize type=text name="@index@__tags"
258 value="@pref{@track}{tags}">
262 <td class="prefs_name">@label{prefs.weight}</td>
263 <td class="prefs_value">
264 <input size=@prefsize type=text name="@index@__weight"
265 value="@weight{@track}">
269 <td class="prefs_name">@label{prefs.random}</td>
270 <td class="prefs_value">
271 <input type=checkbox value=true
272 name="@index@__random"
273 @if{@ne{@pref{@track}{pick_at_random}}{0}}
280 @# Expand to a submit button
281 @# @text is the text to put inside the button
282 @define {submit} {text}
283 {<button class=button name=submit type=submit>@text</button>}
285 @# Expand to an action button
286 @# @text is the text to put inside the button
287 @# @long is the text to put in the caption
288 @# @action is the target action
289 @define {actbutton} {text long action}
290 {<form method=POST class=button action="@url">
291 <input type=hidden name=action value="@action">
292 <input type=submit name=submit value="@text" title="@long">
296 @# Used for inserting back= elements
298 @define {formback} {} {}
302 sgml-always-quote-attributes:nil