From e59b0a1c884b4222162b444d0d306f67f2a6ca30 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Sep 2012 19:57:15 -0400 Subject: first pass at alert buttons They work fine. But I had to go to a lot of trouble to get Yesod to render routes in a pure function. It may instead make more sense to have each alert have an assocated IO action, and a single route that runs the IO action of a given alert id. I just wish I'd realized that before the past several hours of struggling with something Yesod really doesn't want to allow. --- templates/sidebar/alert.hamlet | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/sidebar/alert.hamlet b/templates/sidebar/alert.hamlet index 85ff58482..a873d171f 100644 --- a/templates/sidebar/alert.hamlet +++ b/templates/sidebar/alert.hamlet @@ -1,18 +1,24 @@ -
+
$if closable × - $maybe h <- heading + $maybe h <- renderAlertHeader alert $if block

- $case icon + $case alertIcon alert $of Nothing $of Just name # #{h} $else - $case icon + $case alertIcon alert $of Nothing $of Just name # #{h} # - #{message} + #{renderAlertMessage alert} + $case alertButton alert + $of Nothing + $of Just button +
+ + #{buttonLabel button} -- cgit v1.2.3