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}
41 href="@label{url.static}/disorder.css">
42 <title>@label{@name.title}</title>}
44 @# Non-displaying <head> text
45 @define {quiethead} {}
48 href="@label{url.static}/disorder.css">}
51 @# @current is the name of the current page, e.g. choosealpha, login
52 @define {stdmenu} {current}
54 @menuitem{@current}{playing}{true}
55 @menuitem{@current}{choose}{@right{play}}
56 @menuitem{@current}{manage}{true}
57 @menuitem{@current}{login}{true}
58 @menuitem{@current}{help}{true}
59 @menuitem{@current}{about}{true}
66 @# @current is the name of the current page (not necessarily the action that
68 @# @name is the name of the menu item
69 @# @available is true if the menu item is available, else false
71 @define {menuitem} {current name available}
73 { <a @if{@eq{@current}{@name}}
76 @if{@eq{name}{playing}}
78 {href="@url?action=@name"}
79 title="@label{menu.@q{@name}verbose}"
80 @label{menu.@name}</a>}
81 { <span class=invaldmenu title="@label{menu.@q{@name}verbose}">
82 @label{menu.@name}</span>}}
85 @# Standard footer text
88 <a href="http://www.greenend.org.uk/rjk/disorder/"
89 title="DisOrder web site">DisOrder
91 © 2003-2008 Richard Kettlewell et al
94 @# Expand to the time that @id will be played
95 @# @what is the section
96 @# @id is the track ID
97 @define {mwhen} {what id}
100 @# Expand to the 'who' field for @id
101 @# @what is the section
102 @# @id is the track ID
103 @define {mwho} {what id}
104 {@if{@eq{@who{@id}}{}}
105 {@if{@eq{@state{@id}}{random}}
106 {@label{@what.randomtrack}}
110 @# Expand to the artist for @track
111 @# @what is the section
112 @# @track is the track name
113 @define {martist} {what track}
116 href="@url?action=choose&directory=@urlquote{@dirname{@dirname{@track}}}"
117 title="@label{@what.artistverbose}">@part{@track}{short}{artist}</a>}
118 {<span class=directory
119 title="@part{@track}{artist}@">@part{@track}{short}{artist}</span>}}
121 @# Expand to the album for @track
122 @# @what is the section
123 @# @track is the track name
124 @define {malbum} {what track}
127 href="@url?action=choose&directory=@urlquote{@dirname{@track}}"
128 title="@label{@what.albumverbose}">@part{@track}{short}{album}</a>}
129 {<span class=directory
130 title="@part{@track}{album}@">@part{@track}{short}{album}</span>}}
132 @# Expand to the title for @track
133 @# @what is the section
134 @# @track is the track name
135 @define {mtitle} {what track}
136 {<span title="@part{@track}{title}">@part{@track}{short}{title}</span>}
138 @# Expand to the remove/scratch entry for @id
139 @# @what is the section
140 @# @id is the track ID
141 @define {mremove} {what id}
142 {@if{@removable{@id}}
144 href="@url?action=remove&id=@id@back">
145 <img class=button src="@image{remove}"
146 width=@width height=@height
147 title="@label{@what.removeverbose}"
148 alt="@label{@what.scratch}">
150 {<img class=button src="@image{noremove}"
151 width=@width height=@height
152 title="@label{@what.removeverbose}"
153 alt="@label{@what.scratch}">}}
155 @# Expand to a move button
156 @# @id is the track ID
157 @# @dir should be a direction: up, upall, down or downall
158 @# @delta should be the distance, +ve for up and -ve for down
159 @# This macro calls @movable to check that the move is possible.
160 @define {mmove} {id dir delta}
161 {@if{@movable{@id}{@delta}}
163 href="@url?action=move&id=@id&delta=@delta@back">
164 <img class=button src="@image{@dir}"
165 width=@width height=@height
166 title="@label{playing.@q{@dir}verbose}"
167 alt="@label{playing.@dir}">
169 {<img class=button src="@image{no@dir}"
170 width=@width height=@height
171 title="@label{playing.@q{@dir}verbose}"
172 alt="@label{playing.@dir}">}}