chiark / gitweb /
Use form-based buttons instead of hyperlinks
[disorder] / templates / playing.tmpl
index 29ddbe10c480c282e9904f330cf7944b13e8169a..147333cdf5f2b84919f3faeb683787f24a622ec5 100644 (file)
@@ -25,11 +25,9 @@ USA
   @#  @action should be the action to switch to the opposite state
   @#  @state should be the current state
   @define {onoff} {class action state}
-          {<a class=button
-              href="@url?action=@action@back"
-              title="@label{playing.@q{@action}verbose}">
-             @label{playing.@class}
-           </a>
+          {@actbutton{@label{playing.@class}}
+                     {@label{playing.@q{@action}verbose}}
+                     {@action}
            <img width=@width height=@height class=imgbutton
                 src="@image{@state}">}
 
@@ -54,9 +52,10 @@ USA
                 {@yes}
                 {@no}}
 
-  @# Expand to &back=manage or to nothing
-  @define {back} {}
-         {@ifmanage{&amp;back=manage}{}}
+  @ifmanage{
+    @define {back} {} {&amp;back=manage}
+    @define {formback} {} {<input type=hidden name=back value=manage>}
+  }{}
 }@#
 <html>
  <head>
@@ -94,11 +93,7 @@ USA
           <input size=3 name=right type=text value="@volume{right}">
           <input name=back type=hidden value="@quote{@thisurl}">
           @right{volume}{
-             <span class=button>
-             <button class=volume name=submit type=submit>
-               @label{volume.set}
-             </button>
-             </span>
+             @submit{@label{volume.set}}
             <input name=action type=hidden value=volume>
           }
           @vbutton{down}{-}