From 2708f14ce4f650c3e33cfc0c17039e35f1ddefe7 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 14 Dec 2019 08:34:30 +0100 Subject: [PATCH] make user page of logged in user easily accessible --- src/View/Scaffold.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/View/Scaffold.hs b/src/View/Scaffold.hs index e79c9de..1ff73c4 100644 --- a/src/View/Scaffold.hs +++ b/src/View/Scaffold.hs @@ -30,9 +30,17 @@ scaffold -> H.Html -> H.Html scaffold l10n locale mcookie page content = template page $ do - H.header $ H.nav $ H.ul $ + H.header $ H.nav $ H.ul $ do H.li $ H.a H.! HA.href ("/" <> fromString (show $ linkURI userSelectLink)) $ - H.toHtml $ localize l10n locale $ gettext "Home" + H.toHtml $ translate "Home" + maybe + (return ()) + (\uid -> + H.li $ H.a H.! HA.href ("/" <> + (fromString $ show $ linkURI $ userOverviewLink (read uid) Nothing)) $ + H.toHtml $ translate "User Page" + ) + (getLogin mcookie) H.hr when (isJust message) (H.div H.! HA.id "message" H.! HA.class_ "message" $