diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-08 19:57:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-08 19:57:15 -0400 |
commit | e59b0a1c884b4222162b444d0d306f67f2a6ca30 (patch) | |
tree | 78c2b8c0cfe9c6c52e31b0de2b4a730a7f080635 /templates | |
parent | e6e0877378af85293356b1c7d644a6df6cc40415 (diff) |
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.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/sidebar/alert.hamlet | 16 |
1 files changed, 11 insertions, 5 deletions
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 @@ -<div .alert .fade .in .#{divclass} :block:.alert-block ##{alertid} :closable:onclick="(function( $ ) { $.get('@{CloseAlert i}') })( jQuery );"> +<div .alert .fade .in .#{divclass} :block:.alert-block ##{alertid} :closable:onclick="(function( $ ) { $.get('@{CloseAlert aid}') })( jQuery );"> $if closable <a .close>×</a> - $maybe h <- heading + $maybe h <- renderAlertHeader alert $if block <h4 .alert-heading> - $case icon + $case alertIcon alert $of Nothing $of Just name <i .icon-#{name}></i> # #{h} $else - $case icon + $case alertIcon alert $of Nothing $of Just name <i .icon-#{name}></i> # <strong>#{h}</strong> # - #{message} + #{renderAlertMessage alert} + $case alertButton alert + $of Nothing + $of Just button + <br> + <a .btn .btn-primary href="#{buttonUrl button}"> + #{buttonLabel button} |