git-annex/templates/sidebar/alert.hamlet
Joey Hess e59b0a1c88 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.
2012-09-08 19:57:15 -04:00

24 lines
722 B
Text

<div .alert .fade .in .#{divclass} :block:.alert-block ##{alertid} :closable:onclick="(function( $ ) { $.get('@{CloseAlert aid}') })( jQuery );">
$if closable
<a .close>&times;</a>
$maybe h <- renderAlertHeader alert
$if block
<h4 .alert-heading>
$case alertIcon alert
$of Nothing
$of Just name
<i .icon-#{name}></i> #
#{h}
$else
$case alertIcon alert
$of Nothing
$of Just name
<i .icon-#{name}></i> #
<strong>#{h}</strong> #
#{renderAlertMessage alert}
$case alertButton alert
$of Nothing
$of Just button
<br>
<a .btn .btn-primary href="#{buttonUrl button}">
#{buttonLabel button}