2019-09-08 10:48:57 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2019-09-08 15:27:38 +00:00
|
|
|
{-# LANGUAGE PackageImports #-}
|
2019-09-08 10:48:57 +00:00
|
|
|
module View.User where
|
|
|
|
|
|
|
|
import qualified Text.Blaze.Html5 as H
|
2019-09-08 15:27:38 +00:00
|
|
|
import qualified Text.Blaze.Html5.Attributes as H
|
|
|
|
|
|
|
|
import Data.Text.I18n
|
|
|
|
|
|
|
|
import Data.String (fromString)
|
|
|
|
|
|
|
|
-- imports from mateamt
|
|
|
|
|
|
|
|
import qualified "mateamt" Types as MT
|
|
|
|
|
|
|
|
-- internal imports
|
2019-09-08 10:48:57 +00:00
|
|
|
|
|
|
|
import Types
|
2019-09-08 15:27:38 +00:00
|
|
|
import View.Scaffold
|
2019-09-08 10:48:57 +00:00
|
|
|
|
|
|
|
type UserPage = H.Html
|
|
|
|
|
2019-09-08 15:27:38 +00:00
|
|
|
userPage
|
|
|
|
:: L10n
|
|
|
|
-> Locale
|
|
|
|
-> [MT.UserSummary]
|
|
|
|
-> UserPage
|
|
|
|
userPage l10n locale uss = scaffold l10n locale (initPage
|
|
|
|
{ pageTitle = gettext "Matebeamter - User list"
|
|
|
|
}) $ mapM_ (\(MT.UserSummary uid ident _) -> do
|
|
|
|
H.a H.! H.href ("#" <> fromString (show uid)) $ H.toHtml ident
|
|
|
|
) uss
|
|
|
|
|