1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-23 12:52:31 +03:00

Style text buttons differently

This commit is contained in:
Artyom 2016-02-20 00:09:49 +03:00
parent c45d3bc18e
commit 28cf201a06
2 changed files with 9 additions and 6 deletions

View File

@ -209,7 +209,6 @@ renderCategoryHeading category =
h2_ $ do
-- TODO: make category headings anchor links
toHtml (category^.title)
" "
textButton "edit" $ js_startCategoryHeadingEdit [category^.catId]
renderCategoryHeadingEdit :: Category -> Html ()
@ -218,7 +217,6 @@ renderCategoryHeadingEdit category =
let handler = js_submitCategoryHeadingEdit
(category^.catId, js_thisValue)
input_ [type_ "text", value_ (category^.title), submitFunc handler]
" "
textButton "cancel" $ js_cancelCategoryHeadingEdit [category^.catId]
renderCategory :: Category -> Html ()
@ -417,10 +415,9 @@ textButton
:: Text -- ^ Button text
-> Text -- ^ Onclick handler
-> Html ()
textButton caption handler = span_ $ do
"["
a_ [href_ "javascript:void(0)", onclick_ handler] (toHtml caption)
"]"
textButton caption handler =
span_ [class_ "textButton"] $
a_ [href_ "javascript:void(0)", onclick_ handler] (toHtml caption)
lucid :: Html a -> ActionT IO a
lucid = html . TL.toStrict . renderText

View File

@ -10,3 +10,9 @@
.pros, .cons {
margin: 0px 5px; }
.textButton {
margin-left: 1em; }
.textButton::before {content: "[";}
.textButton::after {content: "]";}