chiark / gitweb /
Fiddle with playing.tmpl a bit. not fully translated
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 10 May 2008 12:22:27 +0000 (13:22 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 10 May 2008 12:22:27 +0000 (13:22 +0100)
server/actions.c
server/macros-disorder.c
templates/playing.tmpl

index 2bdb8c4..2332754 100644 (file)
@@ -135,6 +135,7 @@ static const struct action {
   /** @brief Action handler */
   void (*handler)(void);
 } actions[] = {
+#if 0
   { "confirm", act_confirm },
   { "disable", act_disable },
   { "edituser", act_edituser },
@@ -145,7 +146,9 @@ static const struct action {
   { "move", act_move },
   { "pause", act_pause },
   { "play", act_play },
+#endif
   { "playing", act_playing },
+#if 0
   { "prefs", act_prefs },
   { "random-disable", act_random_disable },
   { "random-enable", act_random_enable },
@@ -155,6 +158,7 @@ static const struct action {
   { "resume", act_resume },
   { "scratch", act_scratch },
   { "volume", act_volume },
+#endif
 };
 
 /** @brief Expand a template
index 7105be1..cc79657 100644 (file)
@@ -590,7 +590,7 @@ static int exp_enabled(int attribute((unused)) nargs,
   return mx_bool_result(output, enabled);
 }
 
-/* @trackstate{TRACK
+/* @trackstate{TRACK}
  *
  * Expands to "playing" if TRACK is currently playing, or "queue" if it is in
  * the queue, otherwise to nothing.
index b45d975..c016858 100644 (file)
@@ -1,3 +1,4 @@
+@include{macros.tmpl}@#
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <!--
 This file is part of DisOrder.
@@ -20,123 +21,142 @@ USA
 -->
 <html>
  <head>
-@include:stdhead@
-  <title>@if{@isplaying@}{@playing{@part:title@}@}{@label:playing.title@}@</title>
+@include{stdhead.tmpl}
+  <title>@if{@isplaying}
+             {@part{@playing}{title}@label{playing.title}}</title>
  </head>
  <body>
-@include{topbar}@
-   <h1>@label:playing.title@</h1>
+@include{topbar.tmpl}
+   <h1>@label{playing.title}</h1>
 
-   @#{extra control buttons for the management page}@
-   @if{@arg:mgmt@}{
+@# Extra control buttons for the management page
+   @if{@arg{mgmt}}{
    <div class=mgmt>
    <p class=mgmt>
-    @if{@paused@}{
-    <!-- paused -->
-    <a class=button
-    href="@url@?action=resume&#38;mgmt=true"
-     title="@label:playing.resumeverbose@">@label:playing.pause@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:enabled@">
+    @if{@paused}{
+@# Paused
+      <a class=button
+      href="@url?action=resume&#38;mgmt=true"
+       title="@label{playing.resumeverbose}">@label{playing.pause}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{enabled}">
     }{
-    <!-- not paused -->
-    <a class=button
-    href="@url@?action=pause&#38;mgmt=true"
-     title="@label:playing.pauseverbose@">@label:playing.pause@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:disabled@">
-    }@
-    @if{@random-enabled@}{
-    <!-- random played enabled -->
-    <a class=button
-    href="@url@?action=random-disable&#38;mgmt=true"
-     title="@label:playing.randomdisableverbose@">@label:playing.random@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:enabled@">
+@# Not paused
+      <a class=button
+      href="@url?action=pause&#38;mgmt=true"
+       title="@label{playing.pauseverbose}">@label{playing.pause}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{disabled}">
+    }
+    @if{@random-enabled}{
+@# Random play enabled
+      <a class=button
+      href="@url?action=random-disable&#38;mgmt=true"
+       title="@label{playing.randomdisableverbose}">@label{playing.random}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{enabled}">
     }{
-    <!-- random played disabled -->
-    <a class=button
-    href="@url@?action=random-enable&#38;mgmt=true"
-     title="@label:playing.randomenableverbose@">@label:playing.random@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:disabled@">
-    }@
-    @if{@enabled@}{
-    <!-- playing enabled -->
-    <a class=button
-    href="@url@?action=disable&#38;mgmt=true"
-     title="@label:playing.disableverbose@">@label:playing.playing@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:enabled@">
+@# Random play disabled
+      <a class=button
+      href="@url?action=random-enable&#38;mgmt=true"
+       title="@label{playing.randomenableverbose}">@label{playing.random}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{disabled}">
+    }
+    @if{@enabled}{
+@# Play enabled
+      <a class=button
+      href="@url?action=disable&#38;mgmt=true"
+       title="@label{playing.disableverbose}">@label{playing.playing}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{enabled}">
     }{
-    <!-- playing disabled -->
-    <a class=button
-    href="@url@?action=enable&#38;mgmt=true"
-     title="@label:playing.enableverbose@">@label:playing.playing@</a>
-    </a>
-    <img width=16 height=16 class=imgbutton src="@image:disabled@">
-    }@
-    <form class=volume action="@url@" method=POST
+@# Play disbaled
+      <a class=button
+      href="@url?action=enable&#38;mgmt=true"
+       title="@label{playing.enableverbose}">@label{playing.playing}</a>
+      </a>
+      <img width=16 height=16 class=imgbutton src="@image{disabled}">
+    }
+@3 Volume form
+    <form class=volume action="@url" method=POST
      enctype="multipart/form-data" accept-charset=utf-8>
     <span class=volume>
-     @label:playing.volume@
-     @right{volume}{<a class=imgbutton
-      href="@url@?action=volume&#38;delta=-@label:volume.resolution@&#38;back=@urlquote{@thisurl@?mgmt=true}@">
-      <img class=button src="@image:down@"
-       alt="@label:volume.reduce@" title="@label:volume.reduceverbose@">
-     </a>}{<img class=button src="@image:nodown@">}@
-     @label:volume.left@ <input size=3 name=left type=text value="@volume:left@">
-     @label:volume.right@ <input size=3 name=right type=text value="@volume:right@">
+     @label{playing.volume}
+@# Volume up button
+     @right{volume}{
+       <a class=imgbutton
+        href="@url?action=volume&#38;delta=-@label{volume.resolution}&#38;back=manage">
+         <img class=button src="@image{down}"
+              alt="@label{volume.reduce}"
+              title="@label{volume.reduceverbose}">
+       </a>
+     }{
+       <img class=button src="@image{nodown}">
+     }
+@# Volume value widgets
+     @label{volume.left} <input size=3 name=left type=text value="@volume:left@">
+     @label{volume.right} <input size=3 name=right type=text value="@volume:right@">
      <input name=back type=hidden value="@thisurl@?mgmt=true">
-     @right{volume}{<button class=search name=submit type=submit>
-      @label:volume.set@
-     </button><input name=action type=hidden value=volume>}@
-     @right{volume}{<a class=imgbutton
-      href="@url@?action=volume&#38;delta=@label:volume.resolution@&#38;back=@urlquote{@thisurl@?mgmt=true}@">
-      <img class=button src="@image:up@"
-       alt="@label:volume.increase@" title="@label:volume.increaseverbose@">
-     </a>}{<img class=button src="@image:noup@">}@
+@# Volume set button
+     @right{volume}{
+       <button class=search name=submit type=submit>
+         @label{volume.set}
+       </button><input name=action type=hidden value=volume>
+     }
+@# Volume down button
+     @right{volume}{
+       <a class=imgbutton
+          href="@url?action=volume&#38;delta=@label{volume.resolution}&#38;back=manage">
+          <img class=button
+               src="@image{up}"
+               alt="@label{volume.increase}"
+               title="@label{volume.increaseverbose}">
+       </a>
+     }{
+       <img class=button src="@image{noup}">
+     }
     </form>
     </span>
     </p>
     </div>
-   }@
+   }
 
-@#{only display the table if there is something to put in it}@
-@if{@or{@isplaying@}{@isqueue@}@}{
+@# Only display the table if there is something to put in it
+@if{@or{@isplaying}{@isqueue}}{
    <table class=playing>
      <tr class=headings>
-      <th class=when>@label:heading.when@</th>
-      <th class=who>@label:heading.who@</th>
-      <th class=artist>@label:heading.artist@</th>
-      <th class=album>@label:heading.album@</th>
-      <th class=title>@label:heading.title@</th>
-      <th class=length>@label:heading.length@</th>
+      <th class=when>@label{heading.when}</th>
+      <th class=who>@label{heading.who}</th>
+      <th class=artist>@label{heading.artist}</th>
+      <th class=album>@label{heading.album}</th>
+      <th class=title>@label{heading.title}</th>
+      <th class=length>@label{heading.length}</th>
       <th class=button>&nbsp;</th>
-      @if{@arg:mgmt@}{
+      @if{@arg{mgmt}}{
       <th class=imgbutton>&nbsp;</th>
       <th class=imgbutton>&nbsp;</th>
       <th class=imgbutton>&nbsp;</th>
       <th class=imgbutton>&nbsp;</th>
       }@
      </tr>
-     @if{@isplaying@}{
+     @if{@isplaying}{
      <tr class=nowplaying>
-      <td colspan=@if{@arg:mgmt@}{11}{7}@>@label:playing.now@</td>
+      <td colspan=@if{@arg{mgmt}}{11}{7}@>@label{playing.now}</td>
      </tr>
      @playing{
      <tr class=playing>
       <td class=when>@when@</td>
-      <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label:playing.randomtrack@}{&nbsp;}@}{@who@}@</td>
+      <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{playing.randomtrack}}{&nbsp;}@}{@who@}@</td>
       <td class=artist>@right{play}{<a class=directory
-       href="@url@?action=choose&amp;directory=@urlquote{@dirname{@dirname{@part:path@}@}@}@"
-       title="@label:playing.artistverbose@"
+       href="@url?action=choose&amp;directory=@urlquote{@dirname{@dirname{@part:path@}@}@}@"
+       title="@label{playing.artistverbose}"
        >@part{short}{artist}@</a>}{<span class=directory
        title="@part{artist}@"
        >@part{short}{artist}@</span>}@</td>
       <td class=album>@right{play}{<a class=directory
-       href="@url@?action=choose&amp;directory=@urlquote{@dirname{@part:path@}@}@"
-       title="@label:playing.albumverbose@"
+       href="@url?action=choose&amp;directory=@urlquote{@dirname{@part:path@}@}@"
+       title="@label{playing.albumverbose}"
        >@part{short}{album}@</a>}{<span class=directory
        title="@part{album}@"
        >@part{short}{album}@</span>}@</td>
@@ -144,14 +164,14 @@ USA
        title="@part{title}@">@part{short}{title}@</span></td>
       <td class=length>@length@</td>
       <td class=imgbutton>@if{@scratchable@}{<a class=imgbutton
-       href="@url@?action=scratch&#38;id=@id@&#38;mgmt=@arg:mgmt@"><img
-       class=button src="@image:scratch@"
-       title="@label:playing.scratchverbose@"
-       alt="@label:playing.scratch@"></a>}{<img
-       class=button src="@image:noscratch@"
-       title="@label:playing.scratchverbose@"
-       alt="@label:playing.scratch@">}@</td>
-      @if{@arg:mgmt@}{
+       href="@url?action=scratch&#38;id=@id@&#38;mgmt=@arg{mgmt}"><img
+       class=button src="@image{scratch}"
+       title="@label{playing.scratchverbose}"
+       alt="@label{playing.scratch}"></a>}{<img
+       class=button src="@image{noscratch}"
+       title="@label{playing.scratchverbose}"
+       alt="@label{playing.scratch}">}@</td>
+      @if{@arg{mgmt}}{
       <td class=imgbutton>&nbsp;</td>
       <td class=imgbutton>&nbsp;</td>
       <td class=imgbutton>&nbsp;</td>
@@ -161,21 +181,21 @@ USA
      }@}@
      @if{@isqueue@}{
      <tr class=next>
-      <td colspan=@if{@arg:mgmt@}{11}{7}@>@label:playing.next@</td>
+      <td colspan=@if{@arg{mgmt}}{11}{7}@>@label{playing.next}</td>
      </tr>
      @queue{
      <tr class=@parity@>
       <td class=when>@when@</td>
-      <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label:queue.randomtrack@}{&nbsp;}@}{@who@}@</td>
+      <td class=who>@if{@eq{@who@}{}@}{@if{@eq{@state@}{random}@}{@label{queue.randomtrack}}{&nbsp;}@}{@who@}@</td>
       <td class=artist>@right{play}{<a class=directory
        title="@part{artist}@"
-       href="@url@?action=choose&amp;directory=@urlquote{@dirname{@dirname{@part:path@}@}@}@"
+       href="@url?action=choose&amp;directory=@urlquote{@dirname{@dirname{@part:path@}@}@}@"
        >@part{short}{artist}@</a>}{<span class=directory
        title="@part{artist}@"
        >@part{short}{artist}@</span>}@</td>
       <td class=album>@right{play}{<a class=directory
        title="@part{album}@"
-       href="@url@?action=choose&amp;directory=@urlquote{@dirname{@part:path@}@}@"
+       href="@url?action=choose&amp;directory=@urlquote{@dirname{@part:path@}@}@"
        >@part{short}{album}@</a>}{<span class=directory
        title="@part{album}@"
        >@part{short}{album}@}@</td>
@@ -183,39 +203,39 @@ USA
        title="@part{title}@">@part{short}{title}@</span></td>
       <td class=length>@length@</td>
       <td class=imgbutton>@if{@removable@}{<a class=imgbutton
-       href="@url@?action=remove&#38;id=@id@&#38;mgmt=@arg:mgmt@"><img
-       class=button src="@image:scratch@"
-       title="@label:playing.removeverbose@
-       alt="@label:playing.remove@"></a>}{<img
-       class=button src="@image:noscratch@"
-       title="@label:playing.removeverbose@"
-       alt="@label:playing.remove@">}@</td>
+       href="@url?action=remove&#38;id=@id@&#38;mgmt=@arg{mgmt}"><img
+       class=button src="@image{scratch}"
+       title="@label{playing.removeverbose}
+       alt="@label{playing.remove}"></a>}{<img
+       class=button src="@image{noscratch}"
+       title="@label{playing.removeverbose}"
+       alt="@label{playing.remove}">}@</td>
 
-      @if{@arg:mgmt@}{
+      @if{@arg{mgmt}}{
       @if{@or{@isfirst@}
              {@not{@movable@}@}@}{
      <!-- cannot move up -->
      <td class=imgbutton>
       <img
-       class=button src="@image:noupall@"
-       title="@label:playing.upallverbose@" alt="">
+       class=button src="@image{noupall}"
+       title="@label{playing.upallverbose}" alt="">
      <td class=imgbutton>
       <img
-       class=button src="@image:noup@"
-       title="@label:playing.upverbose@" alt="">
+       class=button src="@image{noup}"
+       title="@label{playing.upverbose}" alt="">
          }{
      <!-- can move up -->
      <td class=imgbutton>
       <a class=imgbutton
-        href="@url@?action=move&#38;id=@id@&#38;delta=2147483647&#38;mgmt=true"><img
-       class=button src="@image:upall@"
-       title="@label:playing.upallverbose@"
-       alt="@label:playing.upall@"></a>
+        href="@url?action=move&#38;id=@id@&#38;delta=2147483647&#38;mgmt=true"><img
+       class=button src="@image{upall}"
+       title="@label{playing.upallverbose}"
+       alt="@label{playing.upall}"></a>
      <td class=imgbutton>
      <a class=imgbutton
-        href="@url@?action=move&#38;id=@id@&#38;delta=1&#38;mgmt=true"><img
-       class=button src="@image:up@"
-       title="@label:playing.upverbose@" alt="@label:playing.up@"></a>
+        href="@url?action=move&#38;id=@id@&#38;delta=1&#38;mgmt=true"><img
+       class=button src="@image{up}"
+       title="@label{playing.upverbose}" alt="@label{playing.up}"></a>
          }@
 
       @if{@or{@islast@}
@@ -223,25 +243,25 @@ USA
      <!-- cannot move down -->
      <td class=imgbutton>
       <img
-       class=button src="@image:nodownall@"
-       title="@label:playing.downallverbose@" alt="">
+       class=button src="@image{nodownall}"
+       title="@label{playing.downallverbose}" alt="">
      <td class=imgbutton>
       <img
-       class=button src="@image:nodown@"
-       title="@label:playing.downverbose@" alt="">
+       class=button src="@image{nodown}"
+       title="@label{playing.downverbose}" alt="">
          }{
      <!-- can move down -->
      <td class=imgbutton>
       <a class=imgbutton
-        href="@url@?action=move&#38;id=@id@&#38;delta=-2147483647&#38;mgmt=true"><img
-       class=button src="@image:downall@"
-       title="@label:playing.downallverbose@"
-       alt="@label:playing.downall@"></a>
+        href="@url?action=move&#38;id=@id@&#38;delta=-2147483647&#38;mgmt=true"><img
+       class=button src="@image{downall}"
+       title="@label{playing.downallverbose}"
+       alt="@label{playing.downall}"></a>
      <td class=imgbutton>
      <a class=imgbutton
-        href="@url@?action=move&#38;id=@id@&#38;delta=-1&#38;mgmt=true"><img
-       class=button src="@image:down@"
-       title="@label:playing.downverbose@" alt="@label:playing.down@"></a>
+        href="@url?action=move&#38;id=@id@&#38;delta=-1&#38;mgmt=true"><img
+       class=button src="@image{down}"
+       title="@label{playing.downverbose}" alt="@label{playing.down}"></a>
          }@
 
       }@