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}
51 @menuitem{@current}{playing}{true}
52 @menuitem{@current}{recent}{true}
53 @menuitem{@current}{choose}{@right{play}}
54 @menuitem{@current}{manage}{true}
55 @menuitem{@current}{new}{true}
56 @menuitem{@current}{login}{true}
57 @menuitem{@current}{help}{true}
58 @menuitem{@current}{about}{true}
65 @# @current is the name of the current page (not necessarily the action that
67 @# @name is the name of the menu item
68 @# @available is true if the menu item is available, else false
70 @define {menuitem} {current name available}
72 { <a @if{@eq{@current}{@name}}
75 @if{@eq{name}{playing}}
77 { href="@url?action=@name"}
78 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</a>}
79 { <span class=invalidmenu
80 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</span>}}
83 @# Standard footer text
86 <a href="http://www.greenend.org.uk/rjk/disorder/"
87 title="DisOrder web site">DisOrder
89 © 2003-2008 Richard Kettlewell et al
92 @# Expand to the time that @id will be played
93 @# @what is the section
94 @# @id is the track ID
95 @define {mwhen} {what id}
98 @# Expand to the 'who' field for @id
99 @# @what is the section
100 @# @id is the track ID
101 @define {mwho} {what id}
102 {@if{@eq{@who{@id}}{}}
103 {@if{@eq{@state{@id}}{random}}
104 {@label{@what.randomtrack}}
108 @# Expand to the artist for @track
109 @# @what is the section
110 @# @track is the track name
111 @define {martist} {what track}
114 href="@url?action=choose&dir=@urlquote{@dirname{@dirname{@track}}}"
115 title="@label{playing.artistverbose}">@part{@track}{artist}{short}</a>}
116 {<span class=directory
117 title="@part{@track}{artist}">@part{@track}{artist}{short}</span>}}
119 @# Expand to the album for @track
120 @# @what is the section
121 @# @track is the track name
122 @define {malbum} {what track}
125 href="@url?action=choose&dir=@urlquote{@dirname{@track}}"
126 title="@label{playing.albumverbose}">@part{@track}{album}{short}</a>}
127 {<span class=directory
128 title="@part{@track}{album}">@part{@track}{album}{short}</span>}}
130 @# Expand to the title for @track
131 @# @what is the section
132 @# @track is the track name
133 @define {mtitle} {what track}
134 {<span title="@part{@track}{title}">@part{@track}{title}{short}</span>}
136 @# As @mtitle but make a link to play the track
137 @# @what is the section
138 @# @track is the track name
139 @define {mtitleplay} {what track}
140 {<a title="@part{@track}{title}" href="@url?action=play&track=@urlquote{@track}&back=@urlquote{@thisurl}">@part{@track}{title}{short}</a>}
142 @# Expand to the remove/scratch entry for @id
143 @# @what is the section
144 @# @id is the track ID
145 @define {mremove} {what id}
146 {@if{@removable{@id}}
148 href="@url?action=remove&id=@id@back">
149 <img class=button src="@image{remove}"
150 width=@width height=@height
151 title="@label{@what.removeverbose}"
152 alt="@label{@what.scratch}">
154 {<img class=button src="@image{noremove}"
155 width=@width height=@height
156 title="@label{@what.removeverbose}"
157 alt="@label{@what.scratch}">}}
159 @# Expand to a move button
160 @# @id is the track ID
161 @# @dir should be a direction: up, upall, down or downall
162 @# @delta should be the distance, +ve for up and -ve for down
163 @# This macro calls @movable to check that the move is possible.
164 @define {mmove} {id dir delta}
165 {@if{@movable{@id}{@delta}}
167 href="@url?action=move&id=@id&delta=@delta@back">
168 <img class=button src="@image{@dir}"
169 width=@width height=@height
170 title="@label{playing.@q{@dir}verbose}"
171 alt="@label{playing.@dir}">
173 {<img class=button src="@image{no@dir}"
174 width=@width height=@height
175 title="@label{playing.@q{@dir}verbose}"
176 alt="@label{playing.@dir}">}}
178 @# Size of input box for preferences forms
179 @define{prefsize}{}{40}
181 @# Expand to the weight of a track. This macro knows the default weight,
182 @# and does two lookups, which is rather inelegant.
183 @# @track is the track name.
184 @define{weight}{track}{@if{@eq{@pref{@track}{weight}}{}}
186 {@pref{@track}{weight}}}
188 @# Expand to preference form section for a track
189 @# @index is the track number
190 @# @track is the track name
191 @define {mprefs} {index track}
193 <p class="prefs_head">Preferences for <span class="prefs_track">@quote{@resolve{@track}}</span>:</p>
194 <input type=hidden name="@index@__track" value="@quote{@resolve{@track}}">
197 <th class="prefs_name">@label{prefs.name}</th>
198 <th class="prefs_value">@label{prefs.value}</th>
201 <td class="prefs_name">@label{heading.title}</td>
202 <td class="prefs_value">
203 <input size=@prefsize type=text name="@index@__title"
204 value="@part{@track}{title}{display}">
208 <td class="prefs_name">@label{heading.album}</td>
209 <td class="prefs_value">
210 <input size=@prefsize type=text name="@index@__album"
211 value="@part{@track}{album}{display}">
215 <td class="prefs_name">@label{heading.artist}</td>
216 <td class="prefs_value">
217 <input size=@prefsize type=text name="@index@__artist"
218 value="@part{@track}{artist}{display}">
222 <td class="prefs_name">@label{prefs.tags}</td>
223 <td class="prefs_value">
224 <input size=@prefsize type=text name="@index@__tags"
225 value="@pref{@track}{tags}">
229 <td class="prefs_name">@label{prefs.weight}</td>
230 <td class="prefs_value">
231 <input size=@prefsize type=text name="@index@__weight"
232 value="@weight{@track}">
236 <td class="prefs_name">@label{prefs.random}</td>
237 <td class="prefs_value">
238 <input type=checkbox value=true
239 name="@index@__random"
240 @if{@ne{@pref{@track}{pick_at_random}}{0}}
249 sgml-always-quote-attributes:nil