Theme now used in wrapper, but not set from DB in Haskell yet.

This commit is contained in:
SJost 2018-06-12 10:30:04 +02:00
parent 21a96ce44d
commit 66f066fc95
3 changed files with 9 additions and 2 deletions

View File

@ -440,6 +440,10 @@ instance Yesod UniWorX where
courseRoute = CourseR courseTerm courseShorthand CShowR
in (c, courseRoute, ) <$> filterM (menuItemAccessCallback . menuItem) (pageActions courseRoute)
-- TODO: Lookup theme in Cookie/DB and set variable accordingly
-- let currentTheme = "theme--default"
let currentTheme = "theme--aberdeen-reds" :: Text
-- We break up the default layout into two components:
-- default-layout is the contents of the body tag, and
-- default-layout-wrapper is the entire page. Since the final

View File

@ -36,6 +36,7 @@ import Control.Monad.Writer (MonadWriter(..), execWriterT)
import Network.Mime
import qualified Data.Set as Set
import qualified Data.Map as Map
instance Eq (Unique Sheet) where
@ -92,7 +93,7 @@ makeSheetForm msId template = identForm FIDsheet $ \html -> do
<*> aopt utcTimeField (fsb "Lösung ab") (sfSolutionFrom <$> template)
<*> fileAFormOpt (fsb "Lösung")
<*> formToAForm (correctorForm msId (maybe [] sfCorrectors template))
-- <* submitButton
<* submitButton
return $ case result of
FormSuccess sheetResult
| errorMsgs <- validateSheet sheetResult
@ -220,7 +221,9 @@ getSShowR tid csh shn = do
{ dbtSQLQuery = fileData
, dbtColonnade = colonnadeFiles
, dbtAttrs = tableDefault
-- , dbtFilter = Map.empty -- TODO: Just for Testing. Gregor needs to explain what is needed here.
, dbtIdent = "files" :: Text
-- TODO: Add column for and visibility date
, dbtSorting = [ ( "type"
, SortColumn $ \(sheet `E.InnerJoin` sheetFile `E.InnerJoin` file) -> sheetFile E.^. SheetFileType
)

View File

@ -39,7 +39,7 @@ $newline never
}
<body .no-js>
<body .no-js .#{currentTheme}>
<!-- removes no-js class from body if client supports javascript -->
<script>
document.body.classList.remove('no-js');