diff --git a/src/Foundation.hs b/src/Foundation.hs index 08aedb126..94287ba49 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -250,7 +250,7 @@ uniworxMessages :: [UniWorXMessage] -> UniWorXMessages uniworxMessages = UniWorXMessages . map SomeMessage -- Menus and Favourites -data MenuType = NavbarAside | NavbarRight | NavbarSecondary | PageActionPrime | PageActionSecondary +data MenuType = NavbarAside | NavbarRight | NavbarSecondary | PageActionPrime | PageActionSecondary | Footer deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic) data MenuItem = MenuItem @@ -926,6 +926,8 @@ siteLayout headingOverride widget = do navbar = $(widgetFile "widgets/navbar") asidenav :: Widget asidenav = $(widgetFile "widgets/asidenav") + footer :: Widget + footer = $(widgetFile "widgets/footer") contentHeadline :: Maybe Widget contentHeadline = (toWidget <$> headingOverride) <|> (pageHeading =<< mcurrentRoute) breadcrumbsWgt :: Widget @@ -1066,7 +1068,7 @@ defaultLinks = fmap catMaybes . mapM runMaybeT $ -- Define the menu items of the , menuItemAccessCallback' = return True } , return MenuItem - { menuItemType = NavbarRight + { menuItemType = Footer , menuItemLabel = MsgMenuVersion , menuItemIcon = Just "book" , menuItemRoute = SomeRoute VersionR diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index 59f751286..2995c3b7d 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -218,15 +218,17 @@ getSheetListR tid ssh csh = do return $ CSubmissionR tid ssh csh sheetName cid' SubShowR in anchorCellM mkRoute (mkCid >>= \cid2 -> [whamlet|#{display cid2}|]) , sortable (Just "rating") (i18nCell MsgRating) - $ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, mbSub)} -> case mbSub of - Nothing -> mempty + $ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, mbSub)} -> + let stats = sheetTypeSum sheetType in -- for statistics over all shown rows + case mbSub of + Nothing -> cellTell mempty $ stats Nothing (Just (Entity sid Submission{..})) -> - let stats = sheetTypeSum sheetType submissionRatingPoints -- for statistics over all shown rows - mkCid = encrypt sid + let mkCid = encrypt sid mkRoute = do cid' <- mkCid return $ CSubmissionR tid ssh csh sheetName cid' CorrectionR - in cellTell stats $ anchorCellM mkRoute $(widgetFile "widgets/rating") + acell = anchorCellM mkRoute $(widgetFile "widgets/rating") + in cellTell acell $ stats submissionRatingPoints , sortable Nothing -- (Just "percent") (i18nCell MsgRatingPercent) diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index 3f7f9c62b..e5506de92 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -15,8 +15,11 @@ type CourseLink = (TermId, SchoolId, CourseShorthand) -- TODO: Refactor with Wit -------------------- -- Special cells -cellTell :: (Monoid a, IsDBTable m a) => a -> DBCell m a -> DBCell m a -cellTell = flip mappend . writerCell . tell +tellCell :: (Monoid a, IsDBTable m a) => a -> DBCell m a -> DBCell m a +tellCell = flip mappend . writerCell . tell + +cellTell :: (Monoid a, IsDBTable m a) => DBCell m a -> a -> DBCell m a +cellTell = flip tellCell indicatorCell :: IsDBTable m Any => DBCell m Any -- For dbTables that return a Bool to indicate content indicatorCell = writerCell . tell $ Any True diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index f9885fac9..b6b6ecdf7 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -1,13 +1,11 @@ $if not isModal + + ^{asidenav} ^{navbar}
- $if not isModal - - ^{asidenav} -
$if not isModal @@ -37,3 +35,7 @@ $if not isModal ^{widget} + + + $if not isModal + ^{footer} diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 32c8abac0..08c29a53a 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -7,7 +7,8 @@ --color-lightblack: #1A2A36; --color-lightwhite: #fcfffa; --color-grey: #B1B5C0; - --color-grey-light: #f4f5f6; + --color-grey-light: #efefef; + --color-grey-medium: #9A989E; --color-font: #34303a; --color-fontsec: #5b5861; @@ -19,6 +20,10 @@ /* DIMENSIONS */ --header-height: 100px; --header-height-collapsed: 60px; + + --asidenav-width-xl: 250px; + --asidenav-width-lg: 20%; + --asidenav-width-md: 50px; } * { @@ -41,7 +46,8 @@ body { body { /* DEFAULT LMU THEME */ - --color-primary: #0a9342; + --color-lmu-green: #0a9342; + --color-primary: var(--color-lmu-green); --color-light: #31cc72; --color-lighter: #35db7a; --color-dark: #087536; @@ -156,15 +162,12 @@ h4 { .main { position: relative; min-height: calc(100vh - var(--header-height)); - padding: 20px; - overflow: hidden; } @media (max-width: 768px) { .main { min-height: calc(100vh - var(--header-height-collapsed)); - padding: 10px; } } @@ -172,8 +175,8 @@ h4 { position: relative; background-color: white; transition: padding-left .2s ease-out; - max-width: 1200px; - margin: 0 auto; + margin-top: var(--header-height-collapsed); + margin-left: 0; > .container { margin: 20px 0; @@ -192,48 +195,45 @@ h4 { } } -.logged-in { - .main__content { - margin: 0; - max-width: none; - } -} - -@media (max-width: 768px) { - .logged-in:not(.modal) { +@media (min-width: 426px) { + :not(.modal) { .main__content { - padding-left: 60px; - } - } -} - -@media (max-width: 425px) { - .logged-in:not(.modal) { - .main__content { - padding-left: 0; + margin-left: var(--asidenav-width-md, 50px); } } } @media (min-width: 769px) { - .logged-in:not(.modal) { + :not(.modal) { .main__content { - padding-left: calc(24% + 30px); + margin-left: var(--asidenav-width-lg, 20%); + margin-top: var(--header-height); } } } @media (min-width: 1200px) { - .logged-in:not(.modal) { + :not(.modal) { .main__content { - padding-left: 320px; + margin-left: var(--asidenav-width-xl, 250px); } } } -/* sepcial case for breadcrumbs */ -.breadcrumbs__container + .main__content-body { - padding-top: 0; +.main__content-body { + padding: 13px; +} + +@media (min-width: 426px) { + .main__content-body { + padding: 13px 20px; + } +} + +@media (min-width: 769px) { + .main__content-body { + padding: 20px 40px; + } } .pseudo-focus { @@ -450,7 +450,7 @@ input[type="button"].btn-info:hover, } ul.list--inline { - + display: inline-block; margin-left: 0; diff --git a/templates/widgets/asidenav.hamlet b/templates/widgets/asidenav.hamlet index fe8a7e8f5..ac8a1de6b 100644 --- a/templates/widgets/asidenav.hamlet +++ b/templates/widgets/asidenav.hamlet @@ -1,5 +1,10 @@ $newline never