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}{login}{true}
56 @menuitem{@current}{help}{true}
57 @menuitem{@current}{about}{true}
64 @# @current is the name of the current page (not necessarily the action that
66 @# @name is the name of the menu item
67 @# @available is true if the menu item is available, else false
69 @define {menuitem} {current name available}
71 { <a @if{@eq{@current}{@name}}
74 @if{@eq{name}{playing}}
76 { href="@url?action=@name"}
77 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</a>}
78 { <span class=invalidmenu
79 title="@label{menu.@q{@name}verbose}">@label{menu.@name}</span>}}
82 @# Standard footer text
85 <a href="http://www.greenend.org.uk/rjk/disorder/"
86 title="DisOrder web site">DisOrder
88 © 2003-2008 Richard Kettlewell et al
91 @# Expand to the time that @id will be played
92 @# @what is the section
93 @# @id is the track ID
94 @define {mwhen} {what id}
97 @# Expand to the 'who' field for @id
98 @# @what is the section
99 @# @id is the track ID
100 @define {mwho} {what id}
101 {@if{@eq{@who{@id}}{}}
102 {@if{@eq{@state{@id}}{random}}
103 {@label{@what.randomtrack}}
107 @# Expand to the artist for @track
108 @# @what is the section
109 @# @track is the track name
110 @define {martist} {what track}
113 href="@url?action=choose&dir=@urlquote{@dirname{@dirname{@track}}}"
114 title="@label{playing.artistverbose}">@part{@track}{artist}{short}</a>}
115 {<span class=directory
116 title="@part{@track}{artist}">@part{@track}{artist}{short}</span>}}
118 @# Expand to the album for @track
119 @# @what is the section
120 @# @track is the track name
121 @define {malbum} {what track}
124 href="@url?action=choose&dir=@urlquote{@dirname{@track}}"
125 title="@label{playing.albumverbose}">@part{@track}{album}{short}</a>}
126 {<span class=directory
127 title="@part{@track}{album}">@part{@track}{album}{short}</span>}}
129 @# Expand to the title for @track
130 @# @what is the section
131 @# @track is the track name
132 @define {mtitle} {what track}
133 {<span title="@part{@track}{title}">@part{@track}{title}{short}</span>}
135 @# As @mtitle but make a link to play the track
136 @# @what is the section
137 @# @track is the track name
138 @define {mtitleplay} {what track}
139 {<a title="@part{@track}{title}" href="@url?action=play&file=@urlquote{@track}&back=@urlquote{@thisurl}">@part{@track}{title}{short}</a>}
141 @# Expand to the remove/scratch entry for @id
142 @# @what is the section
143 @# @id is the track ID
144 @define {mremove} {what id}
145 {@if{@removable{@id}}
147 href="@url?action=remove&id=@id@back">
148 <img class=button src="@image{remove}"
149 width=@width height=@height
150 title="@label{@what.removeverbose}"
151 alt="@label{@what.scratch}">
153 {<img class=button src="@image{noremove}"
154 width=@width height=@height
155 title="@label{@what.removeverbose}"
156 alt="@label{@what.scratch}">}}
158 @# Expand to a move button
159 @# @id is the track ID
160 @# @dir should be a direction: up, upall, down or downall
161 @# @delta should be the distance, +ve for up and -ve for down
162 @# This macro calls @movable to check that the move is possible.
163 @define {mmove} {id dir delta}
164 {@if{@movable{@id}{@delta}}
166 href="@url?action=move&id=@id&delta=@delta@back">
167 <img class=button src="@image{@dir}"
168 width=@width height=@height
169 title="@label{playing.@q{@dir}verbose}"
170 alt="@label{playing.@dir}">
172 {<img class=button src="@image{no@dir}"
173 width=@width height=@height
174 title="@label{playing.@q{@dir}verbose}"
175 alt="@label{playing.@dir}">}}
179 sgml-always-quote-attributes:nil