From 6f7fdeb374533d7a392c4b7cd8ad8f66943ffc1c Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Tue, 10 Jul 2018 22:53:06 +0200 Subject: [PATCH 01/14] styled tables even if there is no content --- templates/table/colonnade.hamlet | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/table/colonnade.hamlet b/templates/table/colonnade.hamlet index f56dfaa14..828b64111 100644 --- a/templates/table/colonnade.hamlet +++ b/templates/table/colonnade.hamlet @@ -9,12 +9,12 @@ $newline never $nothing $if null wRows && (dbsEmptyStyle == DBESHeading) - - + + _{dbsEmptyMessage} $else $forall row <- wRows $forall widget <- row - $# cell/body.hamlet + $# cell/body.hamlet ^{widget} From 9ab469311cd23337232914c779daaf46dc139164 Mon Sep 17 00:00:00 2001 From: SJost Date: Wed, 11 Jul 2018 12:38:16 +0200 Subject: [PATCH 02/14] MatrikelNr display in UserList --- ChangeLog.md | 3 +++ src/Handler/Users.hs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 09b99076d..fbe1b5009 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ + * Version 10.07.2018 + Bugfixes, wählbares Format für Datum + * Version 04.07.2018 Hinweis eingefügt, dass alle Daten des Systems spätestens im Dezember 2018 diff --git a/src/Handler/Users.hs b/src/Handler/Users.hs index 9d3965c57..47a27cbaa 100644 --- a/src/Handler/Users.hs +++ b/src/Handler/Users.hs @@ -34,6 +34,12 @@ getUsersR = do , sortable (Just "display-name") (i18nCell MsgName) $ \DBRow{ dbrOutput = Entity uid User{..} } -> anchorCellM (AdminUserR <$> encrypt uid) (toWidget . display $ userDisplayName) + , sortable (Just "matriculation") (i18nCell MsgMatrikelNr) $ \DBRow{ dbrOutput = Entity uid User{..} } -> anchorCellM + (AdminUserR <$> encrypt uid) + (toWidget . display $ userMatrikelnummer) +-- , sortable (Just "last-name") (i18nCell MsgName) $ \DBRow{ dbrOutput = Entity uid User{..} } -> anchorCellM +-- (AdminUserR <$> encrypt uid) +-- (toWidget . display $ last $ impureNonNull $ words $ userDisplayName) , sortable Nothing (i18nCell MsgAdminFor) $ \DBRow{ dbrOutput = Entity uid _ } -> mempty { dbCellContents = do schools <- E.select . E.from $ \(school `E.InnerJoin` userAdmin) -> do @@ -78,6 +84,12 @@ getUsersR = do [ ( "display-name" , SortColumn $ \user -> user E.^. UserDisplayName ) + , ( "matriculation" + , SortColumn $ \user -> user E.^. UserMatrikelnummer + ) +-- , ( "last-name" +-- , SortColumn $ \user -> (last . impureNonNull . words) <$> (user E.^. UserDisplayName) +-- ) ] , dbtFilter = mempty , dbtStyle = def From b06014bc6962822c2cb284ac68cc928b4b2763a1 Mon Sep 17 00:00:00 2001 From: SJost Date: Fri, 13 Jul 2018 12:05:10 +0200 Subject: [PATCH 03/14] Minor typos in feature List --- templates/featureList.hamlet | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/featureList.hamlet b/templates/featureList.hamlet index 8b0ddc647..7b9f151c3 100644 --- a/templates/featureList.hamlet +++ b/templates/featureList.hamlet @@ -9,10 +9,12 @@
  • Studiengänge von Benutzern werden noch ignoriert
  • Übungsgruppen
  • Klausuren +
  • Zentralanmeldungen
  • neue geplante Features:
      -
    • Studenplan/Kalender +
    • Stundenplan/Kalender
    • Vollständige Vorlesungshomepages
    • Vollständige Internationalisierung deutsch/englisch/... + From 0f176694ba47e6dfa9f8b530d4e4f9832cd24cdd Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 15 Jul 2018 23:56:27 +0200 Subject: [PATCH 04/14] less top-margin for breadcrumbs --- templates/widgets/breadcrumbs.lucius | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/widgets/breadcrumbs.lucius b/templates/widgets/breadcrumbs.lucius index 9611ad068..1a2b07c6d 100644 --- a/templates/widgets/breadcrumbs.lucius +++ b/templates/widgets/breadcrumbs.lucius @@ -2,7 +2,7 @@ position: relative; color: var(--color-font); margin-left: 40px; - margin-top: 25px; + margin-top: 15px; margin-bottom: 10px; } From 3dddc186019ac1a2633de734af217f854db862a1 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 15 Jul 2018 23:57:10 +0200 Subject: [PATCH 05/14] fixed height-issues of asidenav and table-pagination --- templates/widgets/asidenav.julius | 15 --------------- templates/widgets/asidenav.lucius | 1 + 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/templates/widgets/asidenav.julius b/templates/widgets/asidenav.julius index 843f2eba9..772e1b455 100644 --- a/templates/widgets/asidenav.julius +++ b/templates/widgets/asidenav.julius @@ -19,21 +19,6 @@ document.addEventListener('DOMContentLoaded', function() { var asidenavEl = document.querySelector('.main__aside'); - var mainContentEl = document.querySelector('.main__content'); - - function adjustHeight() { - window.requestAnimationFrame(function() { - asidenavEl.style.height = mainContentEl.clientHeight + 'px'; - }); - } - - // unbeknownst to the user (below the fold), this happes slightly delayed - // because of dynamic changes to the styles inside the main__content - setTimeout(function() { - adjustHeight(); - }, 10); - - window.addEventListener('resize', adjustHeight); window.utils.aside(asidenavEl); diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index 781bd1742..a9bb88576 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -7,6 +7,7 @@ min-height: calc(100% - var(--header-height)); transition: all .2s ease-out; width: 24%; + height: 100%; } /* maximum width of 300px for wide screens */ From 5285c6c01fdf65f3a4f9352e4d0e5b7692ab4ac4 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 15 Jul 2018 23:57:39 +0200 Subject: [PATCH 06/14] alerts now float all the way to the top --- templates/default-layout.lucius | 1 + templates/standalone/alerts.lucius | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 8d24883c3..4d4e3976f 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -152,6 +152,7 @@ h4 { /* LAYOUT */ .main { + position: relative; min-height: calc(100vh - var(--header-height)); } diff --git a/templates/standalone/alerts.lucius b/templates/standalone/alerts.lucius index 356ccf723..18b4cec41 100644 --- a/templates/standalone/alerts.lucius +++ b/templates/standalone/alerts.lucius @@ -43,10 +43,7 @@ padding-left: 20px; margin-left: 20px; animation: slide-in-alert .2s ease-out forwards; - - + .alert:not(.alert--invisible) { - margin-top: 20px; - } + margin-bottom: 20px; &:hover { @@ -190,4 +187,6 @@ .alert--invisible { max-height: 0; transform: translateX(120%); + margin-bottom: 0; + overflow: hidden; } From 16315e55fbcf3697703d6942ebd2ccda12a69ea0 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 15 Jul 2018 23:58:45 +0200 Subject: [PATCH 07/14] breadcrumb for imprint and pagination-julius cleanup --- src/Foundation.hs | 4 ++-- templates/table/layout.julius | 45 ++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 0a6a3b50d..90fb562c2 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -187,7 +187,7 @@ getTimeLocale' = $(timeLocaleMap [("de", "de_DE.utf8")]) appTZ :: TZ appTZ = $(includeSystemTZ "Europe/Berlin") - + -- Access Control data AccessPredicate = APPure (Route UniWorX -> Bool -> Reader MsgRenderer AuthResult) @@ -604,7 +604,7 @@ instance YesodBreadcrumbs UniWorX where breadcrumb UsersR = return ("Benutzer", Just HomeR) breadcrumb AdminTestR = return ("Test" , Just HomeR) breadcrumb (AdminUserR _) = return ("Users" , Just UsersR) - breadcrumb VersionR = return ("Info" , Just HomeR) + breadcrumb VersionR = return ("Impressum" , Just HomeR) breadcrumb ProfileR = return ("Profile" , Just HomeR) breadcrumb ProfileDataR = return ("Data" , Just ProfileR) diff --git a/templates/table/layout.julius b/templates/table/layout.julius index a9885d599..79862009f 100644 --- a/templates/table/layout.julius +++ b/templates/table/layout.julius @@ -3,27 +3,21 @@ document.addEventListener('DOMContentLoaded', function DOMContentLoaded() { - var ASC = 'asc'; - var DESC = 'desc'; - function setupAsync(wrapper) { var table = wrapper.querySelector('#' + #{String $ dbtIdent}); var ths = Array.from(table.querySelectorAll('th.sortable')); - if (ths) { - // attach click handler to each sortable column if any - ths.forEach(function(th) { - th.addEventListener('click', clickHandler); - }); - } - var pagination = wrapper.querySelector('#' + #{String $ dbtIdent} + '-pagination'); + + ths.forEach(function(th) { + th.addEventListener('click', clickHandler); + }); + if (pagination) { - var paginationLinks = Array.from(pagination.querySelectorAll('.pagination-link')); - // attach click handler to pagination links if any - paginationLinks.forEach(function(p) { - p.addEventListener('click', clickHandler); - }); + Array.from(pagination.querySelectorAll('.pagination-link')) + .forEach(function(p) { + p.addEventListener('click', clickHandler); + }); } function clickHandler(event) { @@ -31,12 +25,20 @@ var url = new URL(window.location.origin + window.location.pathname + getClickDestination(this)); url.searchParams.set(#{String $ wIdent "table-only"}, 'yes'); updateTableFrom(url); + + + ths.forEach(function(th) { + // th.removeEventListener('click', clickHandler); + console.log('removed handler from', th); + }); } function getClickDestination(el) { - var link = el.querySelector('a'); - if (!link) { return false; } - return link.getAttribute('href'); + console.log(el); + if (!el.querySelector('a')) { + return false; + } + return el.querySelector('a').getAttribute('href'); } // fetches new sorted table from url with params and replaces contents of current table @@ -47,14 +49,19 @@ 'Accept': 'text/html' } }).then(function(response) { - var contentType = response.headers.get("content-type"); if (!response.ok) { throw ('Looks like there was a problem fetching ' + url.toString() + '. Status Code: ' + response.status); } return response.text(); }).then(function(data) { + // remove listeners + ths.forEach(function(th) { + th.removeEventListener('click', clickHandler); + }); + // replace contents of table body wrapper.innerHTML = data; + // set up async functionality again setupAsync(wrapper); table.querySelector('tbody').innerHTML = data; From 30dd84104856e20dfb29ca07eeb3720e8b8c3c02 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Mon, 16 Jul 2018 00:50:57 +0200 Subject: [PATCH 08/14] more consistent spacing for main_content and favorites only .logged-in --- templates/default-layout.lucius | 67 +++++++++++++--------------- templates/standalone/alerts.lucius | 3 +- templates/widgets/asidenav.julius | 1 + templates/widgets/asidenav.lucius | 9 ++++ templates/widgets/breadcrumbs.lucius | 17 ------- templates/widgets/navbar.lucius | 35 +++++++++++---- 6 files changed, 69 insertions(+), 63 deletions(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 4d4e3976f..a559e17f6 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -154,12 +154,14 @@ h4 { .main { position: relative; min-height: calc(100vh - var(--header-height)); + padding: 20px; } @media (max-width: 768px) { .main { min-height: calc(100vh - var(--header-height-collapsed)); + padding: 10px; } } @@ -167,7 +169,6 @@ h4 { position: relative; background-color: white; overflow: hidden; - padding-left: 24%; transition: padding-left .2s ease-out; > .container { @@ -183,42 +184,36 @@ h4 { } } +@media (max-width: 768px) { + .logged-in { + .main__content { + padding-left: 60px; + } + } +} + +@media (max-width: 425px) { + .logged-in { + .main__content { + padding-left: 0; + } + } +} + +@media (min-width: 769px) { + .logged-in { + .main__content { + padding-left: calc(24% + 30px); + } + } +} + @media (min-width: 1200px) { - .main__content { - padding-left: 300px; - } -} - -@media (max-width: 768px) { - - .main__content { - padding-left: 50px; - } -} - -@media (max-width: 425px) { - - .main__content { - padding-left: 0; - } -} - -.main__content-body { - padding: 30px 40px 60px; -} - -@media (max-width: 768px) { - - .main__content-body { - padding: 30px 20px 60px; - } -} - -@media (max-width: 425px) { - - .main__content-body { - padding: 20px 10px 60px; + .logged-in { + .main__content { + padding-left: 320px; + } } } @@ -420,7 +415,7 @@ input[type="button"].btn-info:hover, } /* LIST MODIFIERS */ -.list--inline > li { +.list--inline li { display: inline-block; } diff --git a/templates/standalone/alerts.lucius b/templates/standalone/alerts.lucius index 18b4cec41..d8118762f 100644 --- a/templates/standalone/alerts.lucius +++ b/templates/standalone/alerts.lucius @@ -97,13 +97,14 @@ font-weight: 600; justify-content: flex-end; align-items: center; + text-align: left; } @media (max-width: 768px) { .alert__content { padding: 4px 7px; - padding-left: 20px; + padding-left: 25px; } } diff --git a/templates/widgets/asidenav.julius b/templates/widgets/asidenav.julius index 772e1b455..b43b2f97c 100644 --- a/templates/widgets/asidenav.julius +++ b/templates/widgets/asidenav.julius @@ -8,6 +8,7 @@ function init() { var favoritesBtn = document.querySelector('.navbar__list-item--favorite'); favoritesBtn.addEventListener('click', function(event) { + favoritesBtn.classList.toggle('navbar__list-item--active'); asideEl.classList.toggle('main__aside--expanded'); event.preventDefault(); }, true); diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index a9bb88576..e2da210cd 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -1,8 +1,11 @@ .main__aside { position: absolute; + display: none; background-color: var(--color-dark); box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 1; + top: 0; + left: 0; flex: 0 0 300px; min-height: calc(100% - var(--header-height)); transition: all .2s ease-out; @@ -10,6 +13,12 @@ height: 100%; } +.logged-in { + .main__aside { + display: block; + } +} + /* maximum width of 300px for wide screens */ @media (min-width: 1200px) { .main__aside { diff --git a/templates/widgets/breadcrumbs.lucius b/templates/widgets/breadcrumbs.lucius index 1a2b07c6d..e0a3cd9ea 100644 --- a/templates/widgets/breadcrumbs.lucius +++ b/templates/widgets/breadcrumbs.lucius @@ -1,26 +1,9 @@ .breadcrumbs__container { position: relative; color: var(--color-font); - margin-left: 40px; - margin-top: 15px; margin-bottom: 10px; } -@media (max-width: 768px) { - - .breadcrumbs__container { - margin-left: 20px; - } -} - -@media (max-width: 425px) { - - .breadcrumbs__container { - margin-left: 10px; - margin-top: 10px; - } -} - .breadcrumbs__link { &:hover { diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 0c41669d7..368fdb271 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -115,6 +115,10 @@ color: var(--color-lightwhite); transition: height .2s cubic-bezier(0.03, 0.43, 0.58, 1); box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); + + &:hover { + color: var(--color-lightwhite); + } } .navbar__link-label { @@ -217,20 +221,33 @@ } } -/* "Favorites" list item, only visible on small screens */ -.navbar__list { - - .navbar__list-item--favorite { +/* "Favorites" list item, only visible on small screens and logged in */ +.navbar__list-item { + &.navbar__list-item--favorite { display: none; - background-color: var(--color-primary); + } +} +.navbar__list-item--favorite { + display: none; + background-color: var(--color-primary); +} + +.logged-in { + .navbar__list { + li.navbar__list-item--favorite, + .navbar__list-item--favorite { + display: inline-block; + } } } -@media (max-width: 425px) { +@media (min-width: 426px) { - .navbar__list { - .navbar__list-item--favorite { - display: inline-block; + .logged-in { + .navbar__list { + .navbar__list-item--favorite { + display: none !important; + } } } } From e28c8589c489cf9213722f48d88d11ae6581f6c2 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Mon, 16 Jul 2018 21:09:09 +0200 Subject: [PATCH 09/14] fixed bold-looking fonts on mac-browsers --- templates/default-layout.lucius | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index a559e17f6..9ec372125 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -24,6 +24,7 @@ box-sizing: border-box; padding: 0; margin: 0; + -webkit-font-smoothing: antialiased; } body { From 5f2e514cba3587cc4fbe3edc8a2290667fa80e44 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Mon, 16 Jul 2018 21:15:18 +0200 Subject: [PATCH 10/14] increased browser-compatibility for borders in navbar --- templates/widgets/navbar.lucius | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 368fdb271..532186bfc 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -56,7 +56,6 @@ min-width: 70px; height: calc(100% - 4px); padding: 0 6px 4px; - box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); } &::after { @@ -70,7 +69,14 @@ width: 100%; height: calc(100% - 4px); padding: 0 6px 4px; - box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); + } +} + +@media (min-width: 769px) { + + .navbar__logo::before, + .navbar__logo::after { + border: 1px solid var(--color-lmu-box-border); } } @@ -114,7 +120,6 @@ min-width: 90px; color: var(--color-lightwhite); transition: height .2s cubic-bezier(0.03, 0.43, 0.58, 1); - box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); &:hover { color: var(--color-lightwhite); @@ -127,6 +132,13 @@ text-transform: uppercase; } +@media (min-width: 769px) { + + .navbar__link-wrapper { + border: 1px solid var(--color-lmu-box-border); + } +} + @media (max-width: 768px) { .navbar__link-wrapper { @@ -258,7 +270,15 @@ .navbar__link-wrapper { color: var(--color-grey); - box-shadow: 0 0 0 1px inset var(--color-grey); + } +} + +@media (min-width: 769px) { + + .navbar__list-item--secondary { + .navbar__link-wrapper { + border: 1px solid var(--color-grey); + } } } From 5d53c41c37e78e67d6fc9539182c50077ce3823a Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Mon, 16 Jul 2018 22:39:52 +0200 Subject: [PATCH 11/14] fix for file_upload not getting validated in safari --- templates/standalone/inputs.julius | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/standalone/inputs.julius b/templates/standalone/inputs.julius index 0c5624444..ed129274e 100644 --- a/templates/standalone/inputs.julius +++ b/templates/standalone/inputs.julius @@ -59,6 +59,7 @@ resetFileLabel(); input.classList.add('file-input__input--hidden'); input.addEventListener('change', function() { + input.dispatchEvent(new Event('input')); if (isMulti) { renderFileList(input.files); } From 0479758e5b1ae781f990628d43b1017609c6a05b Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Wed, 18 Jul 2018 00:31:20 +0200 Subject: [PATCH 12/14] remove animation from nested lists in asidenav --- templates/widgets/asidenav.lucius | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index e2da210cd..3e0613284 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -178,7 +178,6 @@ color: var(--color-font); transform: translateX(0); opacity: 0; - transition: all .2s ease-out; width: 0; overflow: hidden; z-index: -1; From 1c78032f1e5a795d3772564c6db8f76b1b5d3c71 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Jul 2018 10:01:29 +0200 Subject: [PATCH 13/14] Additional information in rating files --- src/Handler/Utils/Rating.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Handler/Utils/Rating.hs b/src/Handler/Utils/Rating.hs index dfe7845c3..2bb15c23f 100644 --- a/src/Handler/Utils/Rating.hs +++ b/src/Handler/Utils/Rating.hs @@ -68,6 +68,8 @@ instance Pretty x => Pretty (CI x) where data Rating = Rating { ratingCourseName :: Text , ratingSheetName :: Text + , ratingCorrectorName :: Maybe Text + , ratingSheetType :: SheetType , ratingValues :: Rating' } deriving (Read, Show, Eq, Generic, Typeable) @@ -89,15 +91,18 @@ instance Exception RatingException getRating :: SubmissionId -> YesodDB UniWorX (Maybe Rating) getRating submissionId = runMaybeT $ do - let query = E.select . E.from $ \(submission `E.InnerJoin` sheet `E.InnerJoin` course) -> do + let query = E.select . E.from $ \(corrector `E.RightOuterJoin` (submission `E.InnerJoin` sheet `E.InnerJoin` course)) -> do E.on $ course E.^. CourseId E.==. sheet E.^. SheetCourse E.on $ sheet E.^. SheetId E.==. submission E.^. SubmissionSheet + E.on $ corrector E.?. UserId E.==. submission E.^. SubmissionRatingBy E.where_ $ submission E.^. SubmissionId E.==. E.val submissionId -- Yes, we can only pass a tuple through 'E.select' return ( course E.^. CourseName , sheet E.^. SheetName + , corrector E.?. UserDisplayName + , sheet E.^. SheetType , submission E.^. SubmissionRatingPoints , submission E.^. SubmissionRatingComment , submission E.^. SubmissionRatingTime @@ -105,6 +110,8 @@ getRating submissionId = runMaybeT $ do [ ( E.unValue -> ratingCourseName , E.unValue -> ratingSheetName + , E.unValue -> ratingCorrectorName + , E.unValue -> ratingSheetType , E.unValue -> ratingPoints , E.unValue -> ratingComment , E.unValue -> ratingTime @@ -117,12 +124,14 @@ formatRating cID Rating{ ratingValues = Rating'{..}, ..} = let doc = renderPretty 1 45 $ foldr (<$$>) mempty [ "= Bitte nur Bewertung und Kommentare ändern =" , "=============================================" - , "========== Uni2work Bewertungsdatei ==========" + , "========== Uni2work Bewertungsdatei =========" , "======= diese Datei ist UTF8 encodiert ======" , "Informationen zum Übungsblatt:" - , indent 2 $ foldr (<$$>) mempty - [ "Veranstaltung:" <+> pretty ratingCourseName - , "Blatt:" <+> pretty ratingSheetName + , indent 2 . foldr (<$$>) mempty . catMaybes $ + [ Just $ "Veranstaltung:" <+> pretty ratingCourseName + , Just $ "Blatt:" <+> pretty ratingSheetName + , ("Korrektor:" <+>) . pretty <$> ratingCorrectorName + , Just $ "Bewertung:" <+> pretty (display ratingSheetType) ] , "Abgabe-Id:" <+> pretty (ciphertext cID) , "=============================================" From e28a0aa851f0f35a1308d10ef05cbff4a251a7e2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Jul 2018 10:05:06 +0200 Subject: [PATCH 14/14] Set .logged-in --- src/Foundation.hs | 2 ++ templates/default-layout-wrapper.hamlet | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 90fb562c2..51062691d 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -478,6 +478,8 @@ instance Yesod UniWorX where menuTypes <- filterM (menuItemAccessCallback . menuItem) menu + isAuth <- isJust <$> maybeAuthId + -- Lookup Favourites & Theme if possible -- TODO: cache this info in a cookie?! (favourites',show -> currentTheme) <- do muid <- maybeAuthPair diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 4eb2fd2c0..d963d1431 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -39,7 +39,7 @@ $newline never } - +