chiark / gitweb /
new @argq expansion; more template fiddling
[disorder] / templates / choose.tmpl
index 10ccf22808912ffda1de419bb41b03c5a88ea1e7..0b084917dcb874c19bd2a4572b10157f2c49926d 100644 (file)
@@ -26,124 +26,122 @@ USA
 @stdmenu{choose}
    <h1>@label:choose.title@</h1>
   
-  @#{always have the first-letter bar, if choosealpha enabled}@
-  @if{@eq{@label:sidebar.choosewhich@}{choosealpha}@}{
-
+  @if{@eq{@label{sidebar.choosewhich}}{choosealpha}}
+     {
    <p class=choosealpha>
     <a title="Directories starting with 'a'"
-    href="@url@?action=choose&#38;regexp=^(the )?a">A</a> |
+    href="@url?action=choose&#38;regexp=^(the )?a">A</a> |
     <a title="Directories starting with 'b'"
-    href="@url@?action=choose&#38;regexp=^(the )?b">B</a> |
+    href="@url?action=choose&#38;regexp=^(the )?b">B</a> |
     <a title="Directories starting with 'c'"
-    href="@url@?action=choose&#38;regexp=^(the )?c">C</a> |
+    href="@url?action=choose&#38;regexp=^(the )?c">C</a> |
     <a title="Directories starting with 'd'"
-    href="@url@?action=choose&#38;regexp=^(the )?d">D</a> |
+    href="@url?action=choose&#38;regexp=^(the )?d">D</a> |
     <a title="Directories starting with 'e'"
-    href="@url@?action=choose&#38;regexp=^(the )?e">E</a> |
+    href="@url?action=choose&#38;regexp=^(the )?e">E</a> |
     <a title="Directories starting with 'f'"
-    href="@url@?action=choose&#38;regexp=^(the )?f">F</a> |
+    href="@url?action=choose&#38;regexp=^(the )?f">F</a> |
     <a title="Directories starting with 'g'"
-    href="@url@?action=choose&#38;regexp=^(the )?g">G</a> |
+    href="@url?action=choose&#38;regexp=^(the )?g">G</a> |
     <a title="Directories starting with 'h'"
-    href="@url@?action=choose&#38;regexp=^(the )?h">H</a> |
+    href="@url?action=choose&#38;regexp=^(the )?h">H</a> |
     <a title="Directories starting with 'i'"
-    href="@url@?action=choose&#38;regexp=^(the )?i">I</a> |
+    href="@url?action=choose&#38;regexp=^(the )?i">I</a> |
     <a title="Directories starting with 'j'"
-    href="@url@?action=choose&#38;regexp=^(the )?j">J</a> |
+    href="@url?action=choose&#38;regexp=^(the )?j">J</a> |
     <a title="Directories starting with 'k'"
-    href="@url@?action=choose&#38;regexp=^(the )?k">K</a> |
+    href="@url?action=choose&#38;regexp=^(the )?k">K</a> |
     <a title="Directories starting with 'l'"
-    href="@url@?action=choose&#38;regexp=^(the )?l">L</a> |
+    href="@url?action=choose&#38;regexp=^(the )?l">L</a> |
     <a title="Directories starting with 'm'"
-    href="@url@?action=choose&#38;regexp=^(the )?m">M</a> |
+    href="@url?action=choose&#38;regexp=^(the )?m">M</a> |
     <a title="Directories starting with 'n'"
-    href="@url@?action=choose&#38;regexp=^(the )?n">N</a> |
+    href="@url?action=choose&#38;regexp=^(the )?n">N</a> |
     <a title="Directories starting with 'o'"
-    href="@url@?action=choose&#38;regexp=^(the )?o">O</a> |
+    href="@url?action=choose&#38;regexp=^(the )?o">O</a> |
     <a title="Directories starting with 'p'"
-    href="@url@?action=choose&#38;regexp=^(the )?p">P</a> |
+    href="@url?action=choose&#38;regexp=^(the )?p">P</a> |
     <a title="Directories starting with 'q'"
-    href="@url@?action=choose&#38;regexp=^(the )?q">Q</a> |
+    href="@url?action=choose&#38;regexp=^(the )?q">Q</a> |
     <a title="Directories starting with 'r'"
-    href="@url@?action=choose&#38;regexp=^(the )?r">R</a> |
+    href="@url?action=choose&#38;regexp=^(the )?r">R</a> |
     <a title="Directories starting with 's'"
-    href="@url@?action=choose&#38;regexp=^(the )?s">S</a> |
+    href="@url?action=choose&#38;regexp=^(the )?s">S</a> |
     <a title="Directories starting with 't'"
-    href="@url@?action=choose&#38;regexp=^(?!the [^t])t">T</a> |
+    href="@url?action=choose&#38;regexp=^(?!the [^t])t">T</a> |
     <a title="Directories starting with 'u'"
-    href="@url@?action=choose&#38;regexp=^(the )?u">U</a> |
+    href="@url?action=choose&#38;regexp=^(the )?u">U</a> |
     <a title="Directories starting with 'v'"
-    href="@url@?action=choose&#38;regexp=^(the )?v">V</a> |
+    href="@url?action=choose&#38;regexp=^(the )?v">V</a> |
     <a title="Directories starting with 'w'"
-    href="@url@?action=choose&#38;regexp=^(the )?w">W</a> |
+    href="@url?action=choose&#38;regexp=^(the )?w">W</a> |
     <a title="Directories starting with 'x'"
-    href="@url@?action=choose&#38;regexp=^(the )?x">X</a> |
+    href="@url?action=choose&#38;regexp=^(the )?x">X</a> |
     <a title="Directories starting with 'y'"
-    href="@url@?action=choose&#38;regexp=^(the )?y">Y</a> |
+    href="@url?action=choose&#38;regexp=^(the )?y">Y</a> |
     <a title="Directories starting with 'z'"
-    href="@url@?action=choose&#38;regexp=^(the )?z">Z</a> |
+    href="@url?action=choose&#38;regexp=^(the )?z">Z</a> |
     <a title="Directories starting with anything else"
-    href="@url@?action=choose&#38;regexp=^[^a-z]">*</a>
+    href="@url?action=choose&#38;regexp=^[^a-z]">*</a>
    </p>
-  }@
+}
+
+@# TODO navigation...
+
+   <div class=directories>
+    <div class=filesdirectories>
+     @dirs{@arg{dir}}{@arg{re}}{
+      <p class=entry>
+       <a href="@url?action=choose&#38;dir=@urlquote{@track}">
+        <img class=button src="@image{directory}" alt="">
+        @display
+       </a>
+      </p>}
+    </div>
+   </div>
 
-   @if{@ne{@arg:directory@}{}@}{
-   <p class=directoryname>@navigate{@arg:directory@}{/<a
-   href="@url@?action=choose&#38;directory=@urlquote{@fullname@}@">@basename@</a>}@:</p>
-   }@
+@define{sometracks}{template}{}
 
-   @if{@isdirectories@}{
-   <div class=directories><div class=filesdirectories>
-    <p class=heading>
-     @label:choose.directories@
-    </p>
-    @choose{directories}{
-    <p class=entry>
-     <a
-     href="@url@?action=choose&#38;directory=@urlquote{@file@}@"
-     title="@label:choose.directory@">
-     <img class=button
-      src="@image:directory@"
-      alt="">
-      @transform{@file@}{dir}{display}@
-     </a>
-    </p>
-    }@
-   </div></div>
-   }@
-   @if{@isfiles@}{
-   <div class=files><div class=filesdirectories>
-    <p class=heading>
-     @label:choose.files@
-    </p>
-    @choose{files}{
-    <p class=entry>
-    @right{prefs}{<a class=imgprefs
-     href="@url@?action=prefs&#38;0_file=@urlquote{@resolve{@file@}@}@"
-     ><img class=button
-      src="@image:edit@"
-      title="@label:choose.prefsverbose@"
-      alt="@label:choose.prefs@"></a>}@
-     <a
-     href="@url@?action=play&#38;file=@urlquote{@file@}@&#38;back=@urlquote{@thisurl@}@"
-     title="@label:choose.play@">@transform{@file@}{track}{display}@</a>
-     @if{@eq{@trackstate{@file@}@}{playing}@}{[<b>playing</b>]}@
-     @if{@eq{@trackstate{@file@}@}{queued}@}{[<b>queued</b>]}@
-    </p>
-    }@
-    <p class=all>
-     @right{prefs}{<a class=imgprefs
-     href="@url@?action=prefs&#38;directory=@urlquote{@arg:directory@}@&#38;back=@urlquote{@thisurl@}@"
-     ><img class=button 
-      src="@image:edit@"
-      title="@label:choose.allprefsverbose@"
-      alt="@label:choose.allprefs@"></a>}@
-     <a class=button href="@url@?action=play&#38;directory=@urlquote{@arg:directory@}@&#38;back=@urlquote{@thisurl@}@">
-      @label:choose.playall@
-     </a>
-    </p>
-   </div></div>
-   }@
+   <div class=files>
+    <div class=filesdirectories>
+     @dirs{@arg{dir}}{@arg{re}}{
+      <p class=entry>
+@define{sometracks}{template}{@template}@#
+       @rights{prefs}{
+        <a class=imgprefs
+           href="@url?action=prefs&#38;0_file=@urlquote{@resolve{@track}}">
+        <img class=button
+             src="@image{edit}"
+             title="@label:choose.prefsverbose@"
+             alt="@label:choose.prefs@">
+        </a>
+       }@#
+       <a href="@url?action=play&#38;file=@urlquote{@track}&#38;back=@urlquote{@thisurl}"
+          title="@label{choose.play}">
+        @display
+       </a>
+       @if{@eq{@trackstate{@track}}{playing}}
+          {[<b>playing</b>]}
+       @if{@eq{@trackstate{@track}}{queued}}
+          {[<b>queued</b>]}
+      </p>}
+      @sometracks{
+      <p class=all>
+        @right{prefs}{
+        <a class=imgprefs
+           href="@url?action=prefs&#38;dir=@urlquote{@arg{dir}}">
+         <img class=button
+              src="@image{edit}"
+              title="@label:choose.allprefsverbose@"
+              alt="@label:choose.allprefs@">
+        </a>}
+        <a class=button
+           href="@url?action=play&#38;dir=@urlquote{@arg{dir}}"&#38;back=@urlquote{@thisurl}">
+         @label{choose.playall}
+        </a>
+      </p>}
+    </div>
+   </div>
 
 @credits
  </body>