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
  let infoHeading = [whamlet|Re-Implementierung von <a href="https://uniworx.ifi.lmu.de/">UniWorX</a>|]
  siteLayout infoHeading $ do
    let features = $(widgetFile "featureList")
        gitInfo :: Text
        gitInfo  = $gitDescribe <> " (" <> $gitCommitDate <> ")"
    changeLog <- withUrlRenderer $(textFile "ChangeLog.md")
    $(widgetFile "versionHistory")

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

