module Handler.Info where

import Import
import Handler.Utils

import Development.GitRev

-- | Versionsgeschichte
getVersionR :: Handler TypedContent
getVersionR = selectRep $ do
  provideRep $
    return ($gitDescribe :: Text)
  provideRep getInfoR

-- | Impressum
getImpressumR :: Handler Html
getImpressumR = -- do
  siteLayoutMsg' MsgMenuImpressum $ do
    setTitleI MsgImpressumHeading
    $(i18nWidgetFile "imprint")


-- | Hinweise zu Datenschutz und Aufbewahrungspflichten
getDataProtR :: Handler Html
getDataProtR = -- do
  siteLayoutMsg' MsgMenuDataProt $ do
    setTitleI MsgDataProtHeading
    $(i18nWidgetFile "data-protection")


-- | Allgemeine Informationen
getInfoR :: Handler Html
getInfoR = -- do
  siteLayoutMsg MsgInfoHeading $ do
    setTitleI MsgInfoHeading
    let features = $(i18nWidgetFile "featureList")
        changeLog = $(i18nWidgetFile "changelog")
        knownBugs = $(i18nWidgetFile "knownBugs")
        gitInfo :: Text
        gitInfo  = $gitDescribe <> " (" <> $gitCommitDate <> ")"
    $(widgetFile "versionHistory")


getInfoLecturerR :: Handler Html
getInfoLecturerR =
  siteLayoutMsg' MsgInfoLecturerTitle $ do
    setTitleI MsgInfoLecturerTitle
    $(i18nWidgetFile "info-lecturer")

