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}