make code reusable
This commit is contained in:
parent
787b02e8b5
commit
fe06fc8880
1 changed files with 32 additions and 20 deletions
|
@ -77,27 +77,29 @@ userOverviewPage l10n locale method ud pos = scaffold l10n locale (initPage $
|
||||||
$ H.toHtml $ translate "Logout"
|
$ H.toHtml $ translate "Logout"
|
||||||
case method of
|
case method of
|
||||||
MT.PrimaryPass ->
|
MT.PrimaryPass ->
|
||||||
userSettingsPointer
|
userSettingsPointer l10n locale
|
||||||
MT.SecondaryPass ->
|
MT.SecondaryPass ->
|
||||||
productList
|
productList pos
|
||||||
MT.ChallengeResponse -> do
|
MT.ChallengeResponse -> do
|
||||||
userSettingsPointer
|
userSettingsPointer l10n locale
|
||||||
productList
|
productList pos
|
||||||
where
|
where
|
||||||
translate = localize l10n locale . gettext
|
translate = localize l10n locale . gettext
|
||||||
productBgStyle aid = HA.style $ mconcat
|
|
||||||
[ "background-image: url(#" <> aid <> ");" -- FILLME
|
userSettingsPointer
|
||||||
, "backgronud-color: blue;"
|
:: L10n
|
||||||
, "text-shadow:"
|
-> Locale
|
||||||
, " -1px 0 1px black,"
|
-> H.Html
|
||||||
, " 0 1px 1px black,"
|
userSettingsPointer l10n locale =
|
||||||
, " 1px 0 1px black,"
|
|
||||||
, " 0 -1px 1px black;"
|
|
||||||
]
|
|
||||||
userSettingsPointer =
|
|
||||||
H.a H.! HA.href ("/" <> (fromString $ show $ linkURI $ userManageLink)) $
|
H.a H.! HA.href ("/" <> (fromString $ show $ linkURI $ userManageLink)) $
|
||||||
H.toHtml $ translate "Manage user settings"
|
H.toHtml $ translate "Manage user settings"
|
||||||
productList =
|
where
|
||||||
|
translate = localize l10n locale . gettext
|
||||||
|
|
||||||
|
productList
|
||||||
|
:: [MT.ProductShortOverview]
|
||||||
|
-> H.Html
|
||||||
|
productList pos =
|
||||||
H.p $
|
H.p $
|
||||||
H.ul H.! HA.class_ "product_list" $
|
H.ul H.! HA.class_ "product_list" $
|
||||||
mapM_
|
mapM_
|
||||||
|
@ -110,6 +112,16 @@ userOverviewPage l10n locale method ud pos = scaffold l10n locale (initPage $
|
||||||
H.toHtml ident
|
H.toHtml ident
|
||||||
)
|
)
|
||||||
pos
|
pos
|
||||||
|
where
|
||||||
|
productBgStyle aid = HA.style $ mconcat
|
||||||
|
[ "background-image: url(#" <> aid <> ");" -- FILLME
|
||||||
|
, "backgronud-color: blue;"
|
||||||
|
, "text-shadow:"
|
||||||
|
, " -1px 0 1px black,"
|
||||||
|
, " 0 1px 1px black,"
|
||||||
|
, " 1px 0 1px black,"
|
||||||
|
, " 0 -1px 1px black;"
|
||||||
|
]
|
||||||
|
|
||||||
userNewPage
|
userNewPage
|
||||||
:: L10n
|
:: L10n
|
||||||
|
|
Loading…
Reference in a new issue