chiark / gitweb /
Use form-based buttons instead of hyperlinks
[disorder] / templates / macros.tmpl
index 9f31132ac2363165178e412e3a689cb5690257d6..3132e570eaf9167051768e9c6b4be46e26dbf520 100644 (file)
@@ -277,6 +277,27 @@ and then redefines macros as desired.
    </table>
 }
 
    </table>
 }
 
+@# Expand to a submit button
+@#  @text is the text to put inside the button
+@define {submit} {text}
+        {<span class=buttonouter><button class=button name=submit type=submit><span class=buttoninner>@text</span></button></span>}
+
+@# Expand to an action button
+@#  @text is the text to put inside the button
+@#  @long is the text to put in the caption
+@#  @action is the target action
+@define {actbutton} {text long action}
+        {<form method=GET class=button action="@url">
+           <input type=hidden name=action value="@action">
+           <input type=submit name=submit value="@text" title="@long">
+@formback@#
+         </form>}
+@# TODO @back support
+
+@# Used for inserting back= elements
+@define {back} {} {}
+@define {formback} {} {}
+
 Local variables:
 mode:sgml
 sgml-always-quote-attributes:nil
 Local variables:
 mode:sgml
 sgml-always-quote-attributes:nil