add tooltips
This commit is contained in:
parent
fe3009d83b
commit
8bc70a85c6
4 changed files with 9 additions and 9 deletions
|
@ -114,13 +114,13 @@ webAppFormAuthToken = do
|
||||||
webapp <- lift getYesod
|
webapp <- lift getYesod
|
||||||
[whamlet|<input type="hidden" name="auth" value="#{secretToken webapp}">|]
|
[whamlet|<input type="hidden" name="auth" value="#{secretToken webapp}">|]
|
||||||
|
|
||||||
{- A button with an icon, and maybe label, that can be clicked to perform
|
{- A button with an icon, and maybe label or tooltip, that can be
|
||||||
- some action.
|
- clicked to perform some action.
|
||||||
- With javascript, clicking it POSTs the Route, and remains on the same
|
- With javascript, clicking it POSTs the Route, and remains on the same
|
||||||
- page.
|
- page.
|
||||||
- With noscript, clicking it GETs the Route. -}
|
- With noscript, clicking it GETs the Route. -}
|
||||||
actionButton :: Route WebApp -> (Maybe String) -> String -> String -> Widget
|
actionButton :: Route WebApp -> (Maybe String) -> (Maybe String) -> String -> String -> Widget
|
||||||
actionButton route label buttonclass iconclass = $(widgetFile "actionbutton")
|
actionButton route label tooltip buttonclass iconclass = $(widgetFile "actionbutton")
|
||||||
|
|
||||||
type UrlRenderFunc = Route WebApp -> [(Text, Text)] -> Text
|
type UrlRenderFunc = Route WebApp -> [(Text, Text)] -> Text
|
||||||
type UrlRenderer = MVar (UrlRenderFunc)
|
type UrlRenderer = MVar (UrlRenderFunc)
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<a class="#{buttonclass}" href="@{route}" onclick="(function( $ ) { $.post('@{route}'); })( jQuery ); return false;">
|
<a title="#{fromMaybe "" tooltip}" class="#{buttonclass}" href="@{route}" onclick="(function( $ ) { $.post('@{route}'); })( jQuery ); return false;">
|
||||||
<i class="#{iconclass}"></i> #{fromMaybe "" label}
|
<i class="#{iconclass}"></i> #{fromMaybe "" label}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<div .bar style="width: #{percent};">
|
<div .bar style="width: #{percent};">
|
||||||
<div .btn-group .span2>
|
<div .btn-group .span2>
|
||||||
$if isrunning info
|
$if isrunning info
|
||||||
^{actionButton (PauseTransferR transfer) Nothing "btn" "icon-pause"}
|
^{actionButton (PauseTransferR transfer) Nothing (Just "pause") "btn" "icon-pause"}
|
||||||
$else
|
$else
|
||||||
^{actionButton (StartTransferR transfer) Nothing "btn" "icon-play"}
|
^{actionButton (StartTransferR transfer) Nothing (Just "continue") "btn" "icon-play"}
|
||||||
^{actionButton (CancelTransferR transfer) Nothing "btn" "icon-remove"}
|
^{actionButton (CancelTransferR transfer) Nothing (Just "cancel") "btn" "icon-remove"}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
$maybe reldir <- relDir webapp
|
$maybe reldir <- relDir webapp
|
||||||
<ul .nav .pull-right>
|
<ul .nav .pull-right>
|
||||||
<li>
|
<li>
|
||||||
^{actionButton FileBrowserR (Just "Files") "" "icon-folder-open icon-white"}
|
^{actionButton FileBrowserR (Just "Files") (Just "Click to open a file browser") "" "icon-folder-open icon-white"}
|
||||||
<li .dropdown #menu1>
|
<li .dropdown #menu1>
|
||||||
<a .dropdown-toggle data-toggle="dropdown" href="#menu1">
|
<a .dropdown-toggle data-toggle="dropdown" href="#menu1">
|
||||||
Current Repository: #{reldir}
|
Current Repository: #{reldir}
|
||||||
|
|
Loading…
Reference in a new issue