chiark / gitweb /
CHANGES -> CHANGES.html
[disorder] / templates / macros.tmpl
index 1da66d402cdde054fd3e3722dc6b09a9e075fbd4..9f31132ac2363165178e412e3a689cb5690257d6 100644 (file)
@@ -56,20 +56,19 @@ and then redefines macros as desired.
 @menuitem{@current}{new}{true}
 @menuitem{@current}{login}{true}
 @menuitem{@current}{help}{true}
-@menuitem{@current}{about}{true}
    </p>
    <div class=logo>
-    <a href="http://www.greenend.org.uk/rjk/disorder/">
-     <img src="@image{logosmall}"
-          style="border-style:none"
-          alt="DisOrder"
-          title="Quack quack!  Visit the DisOrder website">
-    </a>
+@menuicon{@current}{about}{true}{logosmall}
    </div>
   <div style="clear:both"></div>
   </div>
 }
 
+@define {menuurl} {name}
+        {@if{@eq{name}{playing}}
+           {@url}
+           {@url?action=@name}}
+
 @# Menu entry
 @#  Used by @stdmenu
 @#  @current is the name of the current page (not necessarily the action that
@@ -82,13 +81,37 @@ and then redefines macros as desired.
             {    <a @if{@eq{@current}{@name}}
                        {class=activemenu}
                        {class=inactivemenu}
-@if{@eq{name}{playing}}
-   {       href="@url"}
-   {       href="@url?action=@name"}
+       href="@menuurl{@name}"
        title="@label{menu.@q{@name}verbose}">@label{menu.@name}</a>}
             {    <span class=invalidmenu 
           title="@label{menu.@q{@name}verbose}">@label{menu.@name}</span>}}
 
+@# Icon-based menu entry (very similar to @menuitem)
+@#  Used by @stdmenu
+@#  @current is the name of the current page
+@#  @name is the name of the menu item
+@#  @available is true if the menu item is available, else false
+@#  @icon is the name of the icon
+@#  
+@define {menuicon} {current name available icon}  
+        {@if{@available}
+            {    <a class=menuicon
+       href="@menuurl{@name}">
+     <img @if{@eq{@current}{@name}}
+             {class=activemenu}
+             {class=inactivemenu}
+          title="@label{menu.@q{@name}verbose}"
+          alt="@label{menu.@name}"
+          src="@image{@icon}">
+    </a>}
+            {    <span class=menuicon>
+     <img @if{@eq{@current}{@name}}
+             {class=activemenu}
+             {class=inactivemenu}
+          title="@label{menu.@q{@name}verbose}"
+          alt="@label{menu.@name}"
+          src="@image{@icon@_inactive}">
+    </a>}}
 
 @# Standard footer text
 @define {credits} {}