From 3b95af9c3a2e21cc5e6567b8ca08376d1c289528 Mon Sep 17 00:00:00 2001 Message-Id: <3b95af9c3a2e21cc5e6567b8ca08376d1c289528.1715504065.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 5 Jun 2008 15:15:59 +0100 Subject: [PATCH] Macro-ize (most) -based buttons Organization: Straylight/Edgeware From: Richard Kettlewell --- templates/choose.tmpl | 5 +---- templates/macros.tmpl | 13 +++++++++++++ templates/playing.tmpl | 8 +++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/templates/choose.tmpl b/templates/choose.tmpl index a405a25..06e04f6 100644 --- a/templates/choose.tmpl +++ b/templates/choose.tmpl @@ -96,10 +96,7 @@ USA size=50> @submit{@label{search.search}} - - @label{search.clear} - + @actbutton{@label{search.clear}}{}{choose}

diff --git a/templates/macros.tmpl b/templates/macros.tmpl index 2ec7205..5d33446 100644 --- a/templates/macros.tmpl +++ b/templates/macros.tmpl @@ -282,6 +282,19 @@ and then redefines macros as desired. @define {submit} {text} {} +@# 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} + {@text} + +@# Expands to &back=manage or to nothing depending on context; +@# see playing.tmpl. +@define {back} {} {} + Local variables: mode:sgml sgml-always-quote-attributes:nil diff --git a/templates/playing.tmpl b/templates/playing.tmpl index 07cbd6a..a7bb804 100644 --- a/templates/playing.tmpl +++ b/templates/playing.tmpl @@ -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} - { - @label{playing.@class} - + {@actbutton{@label{playing.@class}} + {@label{playing.@q{@action}verbose}} + {@action} } -- [mdw]