From 43ae91ad3b127a8d2b46191aca6694e500baa174 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 21:47:19 +0200 Subject: [PATCH 01/23] added styling for fieldsets --- templates/widgets/form.lucius | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/widgets/form.lucius b/templates/widgets/form.lucius index f4d336fdf..d7ea14684 100644 --- a/templates/widgets/form.lucius +++ b/templates/widgets/form.lucius @@ -1,3 +1,13 @@ .hidden { display: none; } + + +fieldset { + border: 0; + margin: 20px 0 30px; + + legend { + display: none; + } +} From 0b7725949995ffac340d0e4195a059dfb8075e3f Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 21:54:41 +0200 Subject: [PATCH 02/23] fix line-break for now missing empty fieldsets --- templates/widgets/form.lucius | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/widgets/form.lucius b/templates/widgets/form.lucius index d7ea14684..094758416 100644 --- a/templates/widgets/form.lucius +++ b/templates/widgets/form.lucius @@ -1,5 +1,7 @@ .hidden { - display: none; + visibility: hidden; + height: 0; + opacity: 0; } From eb7f971d10660c097bed8e1788acd480246e5c53 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 22:23:29 +0200 Subject: [PATCH 03/23] fix for async modals --- templates/default-layout.lucius | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 251cdc9ba..b78d81b29 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -159,7 +159,6 @@ h4 { .main__content { position: relative; background-color: white; - z-index: 0; overflow: hidden; > .container { From 62b708438cb7cc62aa54d5d2271f482e5f587dbd Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 23:05:34 +0200 Subject: [PATCH 04/23] JS respects formnorequired --- templates/standalone/alerts.lucius | 1 + templates/widgets/form.julius | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/standalone/alerts.lucius b/templates/standalone/alerts.lucius index 8856a9b61..4d080cc8d 100644 --- a/templates/standalone/alerts.lucius +++ b/templates/standalone/alerts.lucius @@ -13,6 +13,7 @@ .alerts { top: 150px; + bottom: auto; } } diff --git a/templates/widgets/form.julius b/templates/widgets/form.julius index 2c6100e7d..b36ea327b 100644 --- a/templates/widgets/form.julius +++ b/templates/widgets/form.julius @@ -10,6 +10,12 @@ if (requireds.length == 0) { return false; } + if (typeof button.dataset.formnorequired !== 'undefined' && button.dataset.formnorequired !== null) { + button.addEventListener('click', function() { + form.submit(); + }); + return false; + } updateButtonState(); requireds.forEach(function(el) { @@ -66,10 +72,10 @@ document.addEventListener('DOMContentLoaded', function() { var forms = document.querySelectorAll('form'); Array.from(forms).forEach(function(form) { // auto reactiveButton submit-buttons with required fields - var submitBtn = form.querySelector('[type=submit]'); - if (submitBtn) { + var submitBtns = Array.from(form.querySelectorAll('[type=submit]')); + submitBtns.forEach(function(submitBtn) { window.utils.reactiveButton(form, submitBtn, validateForm); - } + }); // auto conditonal fieldsets var fieldSets = Array.from(form.querySelectorAll('fieldset[data-conditional-id][data-conditional-value]')); From 842aa81f33b8d007319d42cb092eac2bbe37aba6 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 30 Jun 2018 23:48:34 +0200 Subject: [PATCH 05/23] less obtrusive asidenav-hover-effects --- templates/widgets/asidenav.lucius | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index 789752f71..8cad43d54 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -48,9 +48,15 @@ justify-content: flex-start; align-items: center; + &:not(.asidenav__list-item--active):hover { + background-color: var(--color-darker); + + > .asidenav__link-wrapper { + color: var(--color-lightwhite); + } + } + &:hover { - color: var(--color-link); - background-color: var(--color-lightwhite); .asidenav__link-shorthand { transform: scale(1.05, 1.0); @@ -58,10 +64,6 @@ text-shadow: none; } - > .asidenav__link-wrapper { - color: var(--color-link); - } - .asidenav__nested-list { transform: translateX(100%); opacity: 1; @@ -109,7 +111,6 @@ width: 50px; } - .glyphicon + .asidenav__link-label { padding-left: 0; } @@ -143,15 +144,10 @@ background-color: var(--color-dark); &:hover { - color: var(--color-link); - background-color: var(--color-lightwhite); - - .asidenav__link-wrapper { - background-color: white; - color: var(--color-link); - } + background-color: var(--color-darker); } - .asidenav__link-wrapper { + + .asidenav__link-wrapper { padding-left: 13px; padding-right: 13px; border-left: 20px solid white; From db0076a628b5895a3a960ab29ba0ed7b27303e02 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 01:32:36 +0200 Subject: [PATCH 06/23] navbar now with lmu-boxes --- src/Foundation.hs | 2 +- templates/default-layout.lucius | 11 +++ templates/widgets/navbar.hamlet | 2 +- templates/widgets/navbar.lucius | 116 +++++++++++++++++++++++++------- 4 files changed, 103 insertions(+), 28 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index c70a713c0..cf10ff20d 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -725,7 +725,7 @@ pageActions (HomeR) = -- , NavbarAside $ MenuItem { menuItemLabel = "AdminDemo" - , menuItemIcon = Nothing + , menuItemIcon = Just "book" , menuItemRoute = AdminTestR , menuItemAccessCallback' = return True } diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index b78d81b29..2219e7edd 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -46,7 +46,18 @@ body { --color-darker: #274a65; --color-link: var(--color-dark); --color-link-hover: var(--color-darker); + --color-lmu-box-border: transparent; + /* WIP LMU THEME */ + &.theme--lmu { + --color-lmu-box-border: var(--color-lightwhite); + --color-primary: #0a9342; + --color-dark: #087536; + --color-darker: #075728; + --color-link: var(--color-font); + --color-link-hover: var(--color-font); + --header-height: 100px; + } &.theme--neutral-blue { --color-primary: #3E606F; diff --git a/templates/widgets/navbar.hamlet b/templates/widgets/navbar.hamlet index 7329fd2db..9a67a13fe 100644 --- a/templates/widgets/navbar.hamlet +++ b/templates/widgets/navbar.hamlet @@ -4,7 +4,7 @@ $newline never -
    +
      $forall menuType <- menuTypes $case menuType $of NavbarAside (MenuItem label mIcon route _) diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 0c29ca920..9e4a244c3 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -3,11 +3,10 @@ display: flex; flex-direction: row; align-items: center; - justify-content: space-between; + justify-content: flex-start; width: 100%; height: var(--header-height); padding-right: 2vw; - padding-left: calc(24% + 40px); background: var(--color-darker); /* Old browsers */ background: -moz-linear-gradient(bottom, var(--color-dark) 0%, var(--color-darker) 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(bottom, var(--color-dark) 0%,var(--color-darker) 100%); /* Chrome10-25,Safari5.1-6 */ @@ -21,13 +20,6 @@ transition: all .2s cubic-bezier(0.03, 0.43, 0.58, 1); } -@media (min-width: 1200px) { - - .navbar { - padding-left: 340px; - } -} - @media (max-width: 768px) { .navbar { @@ -36,31 +28,67 @@ } .navbar__logo { - position: absolute; - top: 15px; + top: 10px; left: 20px; - transition: all .2s ease; - transform-origin: left; - width: 0px; + height: 80px; + padding: 0 20px; + display: flex; + flex-basis: 300px; + font-size: 16px; + align-items: center; color: var(--color-lightwhite); + transform-origin: left; + transition: all .2s ease; &:hover { color: var(--color-lightwhite); } &::before { - content: 'Uni2work'; + content: 'LMU'; font-family: var(--font-logo); - font-size: 42px; font-weight: bold; letter-spacing: 2px; + display: flex; + align-items: flex-end; + font-size: 30px; + min-width: 70px; + height: calc(100% - 4px); + padding: 0 6px 4px; + box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); + } + + &::after { + content: 'Uni2work'; + margin-left: 12px; + font-weight: normal; + letter-spacing: 2px; + display: flex; + align-items: flex-end; + text-transform: uppercase; + width: 100%; + height: calc(100% - 4px); + padding: 0 6px 4px; + box-shadow: 0 0 0 1px inset var(--color-lmu-box-border); + } +} + +@media (max-width: 1200px) { + + .navbar__logo { + flex-basis: 24%; + font-size: 16px; } } @media (max-width: 1024px) { .navbar__logo { - transform: scale(0.7); + font-size: 14px; + + &::before { + content: none; + } } } @@ -75,21 +103,30 @@ .navbar__link-wrapper { display: flex; flex-direction: column; - justify-content: center; - align-items: center; - height: var(--header-height); + justify-content: flex-end; + align-items: flex-start; + height: 80px; + 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); } .navbar__link-label { transition: opacity .2s ease; - padding: 0 13px; + padding: 4px 6px; text-transform: uppercase; } @media (max-width: 768px) { + .navbar__link-wrapper { + box-shadow: none; + min-width: 0; + align-items: center; + justify-content: center; + } + .navbar__link-label { padding: 0 7px; } @@ -112,6 +149,10 @@ position: relative; transition: background-color .1s ease; + + .navbar__list-item { + margin-left: 12px; + } + .glyphicon { position: relative; width: 20px; @@ -120,10 +161,22 @@ .glyphicon::before { height: 20px; + margin-left: 6px; } .fas { height: 20px; + margin-left: 8px; + } +} + +@media (max-width: 768px) { + + .navbar__list-item { + + .fas { + margin-left: 0; + } } } @@ -134,15 +187,29 @@ } } +.navbar__list-left { + flex: 5; + padding-left: 40px; +} + .navbar__list-item--secondary { margin-left: 20px; color: var(--color-grey); + + .navbar__link-wrapper { + color: var(--color-grey); + box-shadow: 0 0 0 1px inset var(--color-grey); + } } @media (max-width: 768px) { .navbar__list-item--secondary { margin-left: 0; + + .navbar__link-wrapper { + box-shadow: none; + } } } @@ -169,10 +236,6 @@ color: var(--color-lightwhite); } -.navbar__list-item--secondary .navbar__link-wrapper { - color: var(--color-grey); -} - /* sticky state */ .navbar--sticky { height: var(--header-height-collapsed); @@ -209,7 +272,7 @@ } } -@media (max-height: 768px) { +@media (max-height: 500px) { .navbar, .navbar__pushdown { @@ -222,5 +285,6 @@ .navbar__logo { top: 5px; + height: var(--header-height-collapsed); } } From dc047b02c28a158286b33efebc3ee70c41c3ab68 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 01:32:44 +0200 Subject: [PATCH 07/23] table-fix on profile-page --- templates/profile.hamlet | 60 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/templates/profile.hamlet b/templates/profile.hamlet index f102192b2..fe40d2e3d 100644 --- a/templates/profile.hamlet +++ b/templates/profile.hamlet @@ -3,71 +3,71 @@
      -
      _{MsgName} - #{display userDisplayName} + _{MsgName} + #{display userDisplayName} - _{MsgMatrikelNr} - #{display userMatrikelnummer} + _{MsgMatrikelNr} + #{display userMatrikelnummer} - _{MsgEMail} - #{display userEmail} + _{MsgEMail} + #{display userEmail} - _{MsgIdent} - #{display userIdent} + _{MsgIdent} + #{display userIdent} - _{MsgPlugin} - #{display userPlugin} + _{MsgPlugin} + #{display userPlugin} $if not $ null admin_rights - Administrator - + Administrator +
        $forall institute <- admin_rights
      • #{display institute} $if not $ null lecturer_rights -
      Lehrberechtigt - + Lehrberechtigt +
        $forall institute <- lecturer_rights
      • #{display institute} $if not $ null lecture_owner -
      Eigene Kurse - + Eigene Kurse + Korrektor - + Korrektor + Studiengänge - + Studiengänge + - - - + +
      Abschluss - Studiengang - Studienart - Semester + Abschluss + Studiengang + Studienart + Semester $forall (degree,field,fieldtype,semester) <- studies - #{display degree} - #{display field} - #{display fieldtype} - #{display semester} + #{display degree} + #{display field} + #{display fieldtype} + #{display semester} $if not $ null participant - Teilnehmer - + Teilnehmer +
        $forall (E.Value csh, E.Value tid, regSince) <- participant
      • From 3c414cf29f03098fa266c57f10ad6cfb05af526f Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 01:36:07 +0200 Subject: [PATCH 08/23] make lmu-theme default theme --- templates/default-layout.lucius | 35 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 2219e7edd..10a5c5f0c 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -16,7 +16,7 @@ --font-logo: "Roboto", var(--font-base); /* DIMENSIONS */ - --header-height: 80px; + --header-height: 100px; --header-height-collapsed: 50px; } @@ -38,25 +38,22 @@ body { /* THEMES */ body { - /* DEFAULT THEME */ - --color-primary: #4C7A9C; - --color-light: #598EB5; - --color-lighter: #5F98C2; - --color-dark: #425d79; - --color-darker: #274a65; - --color-link: var(--color-dark); - --color-link-hover: var(--color-darker); - --color-lmu-box-border: transparent; + /* DEFAULT LMU THEME */ + --color-primary: #0a9342; + --color-dark: #087536; + --color-darker: #075728; + --color-link: var(--color-font); + --color-link-hover: var(--color-font); + --color-lmu-box-border: var(--color-lightwhite); - /* WIP LMU THEME */ - &.theme--lmu { - --color-lmu-box-border: var(--color-lightwhite); - --color-primary: #0a9342; - --color-dark: #087536; - --color-darker: #075728; - --color-link: var(--color-font); - --color-link-hover: var(--color-font); - --header-height: 100px; + &.theme--lavender { + --color-primary: #4C7A9C; + --color-light: #598EB5; + --color-lighter: #5F98C2; + --color-dark: #425d79; + --color-darker: #274a65; + --color-link: var(--color-dark); + --color-link-hover: var(--color-darker); } &.theme--neutral-blue { From 1e70ba5ffa81ce0bf3b5f7affbddf94f5b20c6da Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 01:42:33 +0200 Subject: [PATCH 09/23] add light and lighter color to lmu-theme closes #75 --- templates/default-layout.lucius | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 10a5c5f0c..9ac59764f 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -40,6 +40,8 @@ body { body { /* DEFAULT LMU THEME */ --color-primary: #0a9342; + --color-light: #31cc72; + --color-lighter: #35db7a; --color-dark: #087536; --color-darker: #075728; --color-link: var(--color-font); From f1806ffed2f10731e8c1d7abcd4cc8fcb4ffb64d Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 09:43:44 +0200 Subject: [PATCH 10/23] live-preview of selected theme on profile-page --- src/Handler/Profile.hs | 4 ++-- src/Model/Types.hs | 19 +++++++++---------- templates/profile.julius | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 templates/profile.julius diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index c21527b77..b6639a11d 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -31,7 +31,7 @@ makeSettingForm template = identForm FIDsettings $ \html -> do <$> areq (natFieldI $ MsgNatField "Favoriten") -- TODO: natFieldI not working here (fslpI MsgFavoriten "Anzahl Favoriten") (stgMaxFavourties <$> template) <*> areq (selectFieldList themeList) - (fslI MsgTheme ) (stgTheme <$> template) + (fslpI MsgTheme "theme-select" ) (stgTheme <$> template) -- TODO: pass theme-select as id-attribute or similar. <* submitButton return (result, widget) -- no validation required here @@ -70,7 +70,7 @@ getProfileR = do E.where_ $ adright ^. UserAdminUser E.==. E.val uid E.on $ adright ^. UserAdminSchool E.==. school ^. SchoolId return (school ^. SchoolShorthand) - ) + ) <*> (E.select $ E.from $ \(lecright `E.InnerJoin` school) -> do E.where_ $ lecright ^. UserLecturerUser E.==. E.val uid diff --git a/src/Model/Types.hs b/src/Model/Types.hs index efa329e4a..5b5c6735a 100644 --- a/src/Model/Types.hs +++ b/src/Model/Types.hs @@ -185,7 +185,7 @@ termFromRational n = TermIdentifier{..} season | remainder == 0 = Summer | otherwise = Winter - + instance PersistField TermIdentifier where toPersistValue = PersistRational . termToRational fromPersistValue (PersistRational t) = Right $ termFromRational t @@ -209,20 +209,20 @@ instance ToJSON TermIdentifier where instance FromJSON TermIdentifier where parseJSON = withText "Term" $ either (fail . Text.unpack) return . termFromText - + {- Must be defined in a later module: termField :: Field (HandlerT UniWorX IO) TermIdentifier termField = checkMMap (return . termFromText) termToText textField - -- TODO: this is too simple and inconvenient, use selector and year picker --} + -- TODO: this is too simple and inconvenient, use selector and year picker +-} withinTerm :: Day -> TermIdentifier -> Bool time `withinTerm` term = timeYear `mod` 100 == termYear `mod` 100 - where - timeYear = fst3 $ toGregorian time - termYear = year term - + where + timeYear = fst3 $ toGregorian time + termYear = year term + data StudyFieldType = FieldPrimary | FieldSecondary deriving (Eq, Ord, Enum, Show, Read, Bounded) @@ -232,6 +232,7 @@ derivePersistField "StudyFieldType" -- Skins / Themes data Theme --Simply add Themes to this type only. CamelCase will be converted to "-lower" = Default + | Lavender | NeutralBlue | AberdeenReds | MintGreen @@ -258,5 +259,3 @@ instance Default Theme where -} derivePersistField "Theme" - - diff --git a/templates/profile.julius b/templates/profile.julius new file mode 100644 index 000000000..9883c9957 --- /dev/null +++ b/templates/profile.julius @@ -0,0 +1,17 @@ +document.addEventListener('DOMContentLoaded', function () { + + var themeSelector = document.querySelector('[placeholder="theme-select"]'); + themeSelector.addEventListener('change', function() { + // get rid of old themes on body + var options = Array.from(themeSelector.options) + .forEach(function (option) { + document.body.classList.remove(optionToTheme(option)); + }); + // add newly selected theme + document.body.classList.add(optionToTheme(themeSelector.options[themeSelector.value - 1])); + }); + + function optionToTheme(option) { + return optionValue = 'theme--' + option.innerText.toLowerCase().trim().replace(/\s/g, '-'); + } +}); From 244fd2b3d19c039d172a51449f29ac7d4bd56416 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 1 Jul 2018 11:53:51 +0200 Subject: [PATCH 11/23] refine course.hamlet --- templates/course.hamlet | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/templates/course.hamlet b/templates/course.hamlet index 4f53eba07..f739626e4 100644 --- a/templates/course.hamlet +++ b/templates/course.hamlet @@ -22,18 +22,17 @@ #{participants} $maybe capacity <- courseCapacity course \ von #{capacity} -
      Anmeldezeitraum - - $maybe regFrom <- courseRegisterFrom course - #{formatTimeGerWD regFrom} - $maybe regTo <- courseRegisterTo course - \ bis #{formatTimeGerWD regTo} - -
      - - $if registrationOpen + $maybe regFrom <- courseRegisterFrom course +
      Anmeldezeitraum + + Ab #{formatTimeGerWD regFrom} + $maybe regTo <- courseRegisterTo course + \ bis #{formatTimeGerWD regTo} + $if registrationOpen +
      +
      $# regWidget is defined through templates/widgets/registerForm From 583025135c608e55fc34a15ecffba0939b9ba6b4 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 12:31:37 +0200 Subject: [PATCH 12/23] mint-green is now moss-green and resonsive-fixes --- src/Model/Types.hs | 2 +- templates/course.hamlet | 2 +- templates/default-layout.lucius | 2 +- templates/widgets/navbar.lucius | 11 +++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Model/Types.hs b/src/Model/Types.hs index 5b5c6735a..918880fe4 100644 --- a/src/Model/Types.hs +++ b/src/Model/Types.hs @@ -235,7 +235,7 @@ data Theme --Simply add Themes to this type only. CamelCase will be conver | Lavender | NeutralBlue | AberdeenReds - | MintGreen + | MossGreen | SkyLove deriving (Eq,Ord,Bounded,Enum) diff --git a/templates/course.hamlet b/templates/course.hamlet index f739626e4..869172518 100644 --- a/templates/course.hamlet +++ b/templates/course.hamlet @@ -1,4 +1,4 @@ -0
      +
      $maybe school <- schoolMB diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 9ac59764f..075f7ae20 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -74,7 +74,7 @@ body { --color-darker: #2E112D; } - &.theme--mint-green { + &.theme--moss-green { --color-primary: #5C996B; --color-light: #7ACC8F; --color-lighter: #99FFB2; diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 9e4a244c3..1b6f685bd 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -142,6 +142,10 @@ /* navbar list */ .navbar__list { white-space: nowrap; + + + .navbar__list { + margin-left: 12px; + } } /* list item */ @@ -192,6 +196,13 @@ padding-left: 40px; } +@media (max-width: 768px) { + + .navbar__list-left { + padding-left: 0; + } +} + .navbar__list-item--secondary { margin-left: 20px; color: var(--color-grey); From 4ca7ebd6f17c9d83059ead2887a7fe9547c1281e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 1 Jul 2018 12:32:26 +0200 Subject: [PATCH 13/23] =?UTF-8?q?Logik=20f=C3=BCr=20Abgabe=20ansehen/anleg?= =?UTF-8?q?en?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #78 --- src/Foundation.hs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index cf10ff20d..cdd887b07 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -613,6 +613,19 @@ instance YesodBreadcrumbs UniWorX where -- Others breadcrumb _ = return ("Uni2work", Nothing) -- Default is no breadcrumb at all +submissionList :: TermId -> Text -> Text -> UserId -> DB [E.Value SubmissionId] +submissionList tid csh shn uid = E.select . E.from $ \(course `E.InnerJoin` sheet `E.InnerJoin` submission `E.InnerJoin` submissionUser) -> do + E.on $ submissionUser E.^. SubmissionUserSubmission E.==. submission E.^. SubmissionId + E.on $ submission E.^. SubmissionSheet E.==. sheet E.^. SheetId + E.on $ sheet E.^. SheetCourse E.==. course E.^. CourseId + + E.where_ $ submissionUser E.^. SubmissionUserUser E.==. E.val uid + E.&&. sheet E.^. SheetName E.==. E.val shn + E.&&. course E.^. CourseShorthand E.==. E.val csh + E.&&. course E.^. CourseTerm E.==. E.val tid + + return $ submission E.^. SubmissionId + pageActions :: Route UniWorX -> [MenuTypes] pageActions (CourseR tid csh CShowR) = [ PageActionPrime $ MenuItem @@ -663,13 +676,21 @@ pageActions (CSheetR tid csh shn SShowR) = { menuItemLabel = "Abgabe anlegen" , menuItemIcon = Nothing , menuItemRoute = CSheetR tid csh shn SubmissionNewR - , menuItemAccessCallback' = return True -- TODO: check that no submission already exists + , menuItemAccessCallback' = runDB . maybeT (return False) $ do + uid <- MaybeT $ liftHandlerT maybeAuthId + submissions <- lift $ submissionList tid csh shn uid + guard $ null submissions + return True } , PageActionPrime $ MenuItem { menuItemLabel = "Abgabe ansehen" , menuItemIcon = Nothing , menuItemRoute = CSheetR tid csh shn SubmissionOwnR - , menuItemAccessCallback' = return True -- TODO: check that a submission already exists + , menuItemAccessCallback' = runDB . maybeT (return False) $ do + uid <- MaybeT $ liftHandlerT maybeAuthId + submissions <- lift $ submissionList tid csh shn uid + guard . not $ null submissions + return True } , PageActionPrime $ MenuItem { menuItemLabel = "Korrektoren" From ba813dd5ac8050148d0e1aec82e9ec6dafefad8a Mon Sep 17 00:00:00 2001 From: SJost Date: Sun, 1 Jul 2018 13:53:33 +0200 Subject: [PATCH 14/23] Minor message cleaning. --- messages/de.msg | 54 +++++++++++++++++++++---------------------- src/Handler/Course.hs | 12 ++++------ src/Handler/Term.hs | 5 ++-- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/messages/de.msg b/messages/de.msg index f6baedfea..f89a8728c 100644 --- a/messages/de.msg +++ b/messages/de.msg @@ -7,16 +7,16 @@ BtnDeregister: Abmelden RegisterFrom: Anmeldungen von RegisterTo: Anmeldungen bis -SummerTerm year@Integer: Sommersemester #{tshow year} -WinterTerm year@Integer: Wintersemester #{tshow year}/#{tshow $ succ year} +SummerTerm year@Integer: Sommersemester #{display year} +WinterTerm year@Integer: Wintersemester #{display year}/#{display $ succ year} PSLimitNonPositive: “pagesize” muss größer als null sein -Page n@Int64: #{tshow n} +Page n@Int64: #{display n} TermsHeading: Semesterübersicht TermCurrent: Aktuelles Semester TermEditHeading: Semester editieren/anlegen -TermEditTid tk@TermId: Semester #{display tk} editieren -TermEdited tid@TermIdentifier: Semester #{display tid} erfolgreich editiert. +TermEditTid tid@TermId: Semester #{display tid} editieren +TermEdited tid@TermId: Semester #{display tid} erfolgreich editiert. TermNewTitle: Semester editieren/anlegen. InvalidInput: Eingaben bitte korrigieren. Term: Semester @@ -24,29 +24,29 @@ TermPlaceholder: W/S + vierstellige Jahreszahl Course: Kurs CourseSecret: Zugangspasswort -CourseNewOk tid@TermIdentifier courseShortHand@Text: Kurs #{termToText tid}-#{courseShortHand} wurde erfolgreich erstellt. -CourseEditOk tid@TermIdentifier courseShortHand@Text: Kurs #{termToText tid}-#{courseShortHand} wurde erfolgreich geändert. -CourseNewDupShort tid@TermIdentifier courseShortHand@Text: Kurs #{termToText tid}-#{courseShortHand} konnte nicht erstellt werden: Es gibt bereits einen anderen Kurs mit dem Kürzel #{courseShortHand} in diesem Semester. -CourseEditDupShort tid@TermIdentifier courseShortHand@Text: Kurs #{termToText tid}-#{courseShortHand} konnte nicht geändert werden: Es gibt bereits einen anderen Kurs mit dem Kürzel #{courseShortHand} in diesem Semester. +CourseNewOk tid@TermId courseShortHand@Text: Kurs #{display tid}-#{courseShortHand} wurde erfolgreich erstellt. +CourseEditOk tid@TermId courseShortHand@Text: Kurs #{display tid}-#{courseShortHand} wurde erfolgreich geändert. +CourseNewDupShort tid@TermId courseShortHand@Text: Kurs #{display tid}-#{courseShortHand} konnte nicht erstellt werden: Es gibt bereits einen anderen Kurs mit dem Kürzel #{courseShortHand} in diesem Semester. +CourseEditDupShort tid@TermId courseShortHand@Text: Kurs #{display tid}-#{courseShortHand} konnte nicht geändert werden: Es gibt bereits einen anderen Kurs mit dem Kürzel #{courseShortHand} in diesem Semester. FFSheetName: Name -TermCourseListHeading tk@TermId: Kursübersicht #{display tk} -TermCourseListTitle tk@TermId: Kurse #{display tk} +TermCourseListHeading tid@TermId: Kursübersicht #{display tid} +TermCourseListTitle tid@TermId: Kurse #{display tid} CourseNewHeading: Neuen Kurs anlegen -CourseEditHeading tk@TermId courseShortHand@Text: Kurs #{display tk}-#{courseShortHand} editieren +CourseEditHeading tid@TermId courseShortHand@Text: Kurs #{display tid}-#{courseShortHand} editieren CourseEditTitle: Kurs editieren/anlegen Sheet: Blatt -SheetList tk@TermId courseShortHand@Text: #{display tk}-#{courseShortHand} Übersicht Übungsblätter -SheetNewHeading tk@TermId courseShortHand@Text: #{display tk}-#{courseShortHand} Neues Übungsblatt anlegen -SheetNewOk tk@TermId courseShortHand@Text sheetName@Text: Neues Übungsblatt #{sheetName} wurde im Kurs #{display tk}-#{courseShortHand} erfolgreich erstellt. -SheetTitle tk@TermId courseShortHand@Text sheetName@Text: #{display tk}-#{courseShortHand} #{sheetName} -SheetTitleNew tk@TermId courseShortHand@Text : #{display tk}-#{courseShortHand}: Neues Übungsblatt -SheetEditHead tk@TermId courseShortHand@Text sheetName@Text: #{display tk}-#{courseShortHand} #{sheetName} editieren -SheetEditOk tk@TermId courseShortHand@Text sheetName@Text: Übungsblatt #{sheetName} aus Kurs #{display tk}-#{courseShortHand} wurde gespeichert. -SheetNameDup tk@TermId courseShortHand@Text sheetName@Text: Es gibt bereits ein Übungsblatt #{sheetName} in diesem Kurs #{display tk}-#{courseShortHand}. -SheetDelHead tk@TermId courseShortHand@Text sheetName@Text: Übungsblatt #{sheetName} wirklich aus Kurs #{display tk}-#{courseShortHand} herauslöschen? -SheetDelText submissionNo@Int: Dies kann nicht mehr rückgängig gemacht werden! Alle Einreichungen gehen ebenfalls verloren! Es gibt #{show submissionNo} Abgaben. -SheetDelOk tk@TermId courseShortHand@Text sheetName@Text: #{display tk}-#{courseShortHand}: Übungsblatt #{sheetName} gelöscht. +SheetList tid@TermId courseShortHand@Text: #{display tid}-#{courseShortHand} Übersicht Übungsblätter +SheetNewHeading tid@TermId courseShortHand@Text: #{display tid}-#{courseShortHand} Neues Übungsblatt anlegen +SheetNewOk tid@TermId courseShortHand@Text sheetName@Text: Neues Übungsblatt #{sheetName} wurde im Kurs #{display tid}-#{courseShortHand} erfolgreich erstellt. +SheetTitle tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName} +SheetTitleNew tid@TermId courseShortHand@Text : #{display tid}-#{courseShortHand}: Neues Übungsblatt +SheetEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName} editieren +SheetEditOk tid@TermId courseShortHand@Text sheetName@Text: Übungsblatt #{sheetName} aus Kurs #{display tid}-#{courseShortHand} wurde gespeichert. +SheetNameDup tid@TermId courseShortHand@Text sheetName@Text: Es gibt bereits ein Übungsblatt #{sheetName} in diesem Kurs #{display tid}-#{courseShortHand}. +SheetDelHead tid@TermId courseShortHand@Text sheetName@Text: Übungsblatt #{sheetName} wirklich aus Kurs #{display tid}-#{courseShortHand} herauslöschen? +SheetDelText submissionNo@Int: Dies kann nicht mehr rückgängig gemacht werden! Alle Einreichungen gehen ebenfalls verloren! Es gibt #{display submissionNo} Abgaben. +SheetDelOk tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand}: Übungsblatt #{sheetName} gelöscht. Deadline: Abgabe Done: Eingereicht @@ -73,8 +73,8 @@ UnauthorizedWrite: Sie haben hierfür keine Schreibberechtigung SubmissionWrongSheet: Abgabenummer gehört nicht zum angegebenen Übungsblatt. SubmissionAlreadyExists: Sie haben bereits eine Abgabe zu diesem Übungsblatt. -SubmissionEditHead tk@TermId courseShortHand@Text sheetName@Text: #{display tk}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen -SubmissionMember g@Int: Mitabgebende(r) ##{tshow g} +SubmissionEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen +SubmissionMember g@Int: Mitabgebende(r) ##{display g} SubmissionArchive: Zip-Archiv der Abgabedatei(en) SubmissionFile: Datei zur Abgabe SubmissionAlreadyExistsFor user@Text: #{user} hat bereits eine Abgabe zu diesem bÜbungsblatt. @@ -82,14 +82,14 @@ SubmissionAlreadyExistsFor user@Text: #{user} hat bereits eine Abgabe zu diesem EMail: E-Mail EMailUnknown email@Text: E-Mail #{email} gehört zu keinem bekannten Benutzer. -NotAParticipant user@Text tk@TermId csh@Text: #{user} ist nicht im Kurs #{display tk}-#{csh} angemeldet. +NotAParticipant user@Text tid@TermId csh@Text: #{user} ist nicht im Kurs #{display tid}-#{csh} angemeldet. Users: Benutzer HomeHeading: Aktuelle Termine ProfileHeading: Benutzerprofil und Einstellungen ProfileDataHeading: Gespeicherte Benutzerdaten -NumCourses n@Int64: #{tshow n} Kurse +NumCourses n@Int64: #{display n} Kurse CloseAlert: Schliessen Name: Name diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 51b6c8a82..3ecf90e58 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -174,7 +174,6 @@ courseEditHandler isGet course = do , cfShort = csh , cfTerm = tid })) -> do -- create new course - let tident = unTermKey tid now <- liftIO getCurrentTime insertOkay <- runDB $ insertUnique $ Course { courseName = cfName res @@ -195,17 +194,16 @@ courseEditHandler isGet course = do runDB $ do insert_ $ CourseEdit aid now cid insert_ $ Lecturer aid cid - addMessageI "info" $ MsgCourseNewOk tident csh + addMessageI "info" $ MsgCourseNewOk tid csh redirect $ TermCourseListR tid Nothing -> - addMessageI "danger" $ MsgCourseNewDupShort tident csh + addMessageI "danger" $ MsgCourseNewDupShort tid csh (FormSuccess res@( CourseForm { cfCourseId = Just cid , cfShort = csh , cfTerm = tid })) -> do -- edit existing course - let tident = unTermKey tid now <- liftIO getCurrentTime -- addMessage "debug" [shamlet| #{show res}|] runDB $ do @@ -215,7 +213,7 @@ courseEditHandler isGet course = do (Just oldCourse) -> do -- existing <- getBy $ CourseTermShort tid csh -- if ((entityKey <$> existing) /= Just cid) - -- then addMessageI "danger" $ MsgCourseEditDupShort tident csh + -- then addMessageI "danger" $ MsgCourseEditDupShort tid csh -- else do -- addMessage "debug" $ fromMaybe [shamlet|No description given.|] $ cfDesc res -- update cid @@ -249,9 +247,9 @@ courseEditHandler isGet course = do insert_ $ CourseEdit aid now cid -- if (isNothing updOkay) -- then do - addMessageI "success" $ MsgCourseEditOk tident csh + addMessageI "success" $ MsgCourseEditOk tid csh -- redirect $ TermCourseListR tid --- else addMessageI "danger" $ MsgCourseEditDupShort tident csh +-- else addMessageI "danger" $ MsgCourseEditDupShort tid csh (FormFailure _) -> addMessageI "warning" MsgInvalidInput (FormMissing) | isGet -> return () diff --git a/src/Handler/Term.hs b/src/Handler/Term.hs index 59c103e28..3ffe638e7 100644 --- a/src/Handler/Term.hs +++ b/src/Handler/Term.hs @@ -121,14 +121,15 @@ termEditHandler term = do ((result, formWidget), formEnctype) <- runFormPost $ newTermForm term case result of (FormSuccess res) -> do + let tid = TermKey $ termName res -- term <- runDB $ get $ TermKey termName - runDB $ repsert (TermKey $ termName res) res + runDB $ repsert tid res -- VOR INTERNATIONALISIERUNG: -- let tid = termToText $ termName res -- let msg = "Semester " `T.append` tid `T.append` " erfolgreich editiert." -- addMessage "success" [shamlet| #{msg} |] -- MIT INTERNATIONALISIERUNG: - addMessageI "success" $ MsgTermEdited $ termName res + addMessageI "success" $ MsgTermEdited tid redirect TermShowR (FormMissing ) -> return () (FormFailure _) -> addMessageI "warning" MsgInvalidInput From 12e52becbdce550943d008748c457d7e8025873f Mon Sep 17 00:00:00 2001 From: SJost Date: Sun, 1 Jul 2018 14:14:15 +0200 Subject: [PATCH 15/23] Minor fixes. --- fill-db.hs | 2 +- messages/de.msg | 39 +++++++++++++++++++-------------------- src/Handler/Sheet.hs | 6 +++--- src/Model/Types.hs | 2 +- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/fill-db.hs b/fill-db.hs index cc3dbe804..81a805011 100755 --- a/fill-db.hs +++ b/fill-db.hs @@ -43,7 +43,7 @@ main = db $ do , userEmail = "jost@tcs.ifi.lmu.de" , userDisplayName = "Steffen Jost" , userMaxFavourites = 14 - , userTheme = MintGreen + , userTheme = MossGreen } void . insert $ Term { termName = summer2017 diff --git a/messages/de.msg b/messages/de.msg index 895b319c4..59f144e96 100644 --- a/messages/de.msg +++ b/messages/de.msg @@ -50,9 +50,26 @@ SheetDelHead tid@TermId courseShortHand@Text sheetName@Text: Übungsblatt SheetDelText submissionNo@Int: Dies kann nicht mehr rückgängig gemacht werden! Alle Einreichungen gehen ebenfalls verloren! Es gibt #{display submissionNo} Abgaben. SheetDelOk tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand}: Übungsblatt #{sheetName} gelöscht. +SheetExercise: Aufgabenstellung +SheetHint: Hinweise +SheetSolution: Lösung +SheetMarking: Korrekturhinweise + Deadline: Abgabe Done: Eingereicht +Submission: Abgabenummer +SubmissionWrongSheet: Abgabenummer gehört nicht zum angegebenen Übungsblatt. +SubmissionAlreadyExists: Sie haben bereits eine Abgabe zu diesem Übungsblatt. +SubmissionEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen +SubmissionMember g@Int: Mitabgebende(r) ##{display g} +SubmissionArchive: Zip-Archiv der Abgabedatei(en) +SubmissionFile: Datei zur Abgabe +SubmissionAlreadyExistsFor user@Text: #{user} hat bereits eine Abgabe zu diesem bÜbungsblatt. + +CorrectionsTitle: Zugewiesene Korrekturen +CourseCorrectionsTitle: Korrekturen für diesen Kurs + Unauthorized: Sie haben hierfür keine explizite Berechtigung. UnauthorizedAnd l@Text r@Text: #{l} UND #{r} UnauthorizedOr l@Text r@Text: #{l} ODER #{r} @@ -72,26 +89,13 @@ DeprecatedRoute: Diese Ansicht ist obsolet und könnte in Zukunft entfallen. UnfreeMaterials: Die Materialien für diese Veranstaltung sind nicht allgemein freigegeben. UnauthorizedWrite: Sie haben hierfür keine Schreibberechtigung -Submission: Abgabenummer - -SubmissionWrongSheet: Abgabenummer gehört nicht zum angegebenen Übungsblatt. -SubmissionAlreadyExists: Sie haben bereits eine Abgabe zu diesem Übungsblatt. -SubmissionEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen -SubmissionMember g@Int: Mitabgebende(r) ##{display g} -SubmissionArchive: Zip-Archiv der Abgabedatei(en) -SubmissionFile: Datei zur Abgabe -SubmissionAlreadyExistsFor user@Text: #{user} hat bereits eine Abgabe zu diesem bÜbungsblatt. - -CorrectionsTitle: Zugewiesene Korrekturen -CourseCorrectionsTitle: Korrekturen für diesen Kurs - EMail: E-Mail EMailUnknown email@Text: E-Mail #{email} gehört zu keinem bekannten Benutzer. NotAParticipant user@Text tid@TermId csh@Text: #{user} ist nicht im Kurs #{display tid}-#{csh} angemeldet. AddCorrector: Zusätzlicher Korrektor CorrectorExists user@Text: #{user} ist bereits als Korrektor eingetragen -SheetCorrectorsTitle tid@TermIdentifier courseShortHand@Text sheetName@Text: Korrektoren für #{termToText tid}-#{courseShortHand} #{sheetName} +SheetCorrectorsTitle tid@TermId courseShortHand@Text sheetName@Text: Korrektoren für #{display tid}-#{courseShortHand} #{sheetName} CountTutProp: Tutorien zählen gegen Proportion Corrector: Korrektor Correctors: Korrektoren @@ -120,11 +124,6 @@ Ident: Identifizierung Settings: Individuelle Benutzereinstellungen SettingsUpdate: Einstellungen wurden gespeichert. -SheetExercise: Aufgabenstellung -SheetHint: Hinweise -SheetSolution: Lösung -SheetMarking: Korrekturhinweise - MultiFileUploadInfo: (Mehrere Dateien mit Shift oder Strg auswählen) NrColumn: Nr @@ -142,4 +141,4 @@ UpdatedAssignedCorrectorSingle num@Int64: #{display num} Abgaben wurden dem neue NoCorrector: Kein Korrektor RemovedCorrections num@Int64: Korrektur-Daten wurden von #{display num} Abgaben entfernt. UpdatedAssignedCorrectorsAuto num@Int64: #{display num} Abgaben wurden unter den Korrektoren aufgeteilt. -CouldNotAssignCorrectorsAuto num@Int64: #{display num} Abgaben konnten nicht automatisch zugewiesen werden: \ No newline at end of file +CouldNotAssignCorrectorsAuto num@Int64: #{display num} Abgaben konnten nicht automatisch zugewiesen werden: diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index ddf39d970..3da6d34e7 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -592,7 +592,7 @@ getSCorrR, postSCorrR :: TermId -> Text -- ^ Sheet name -> Handler Html postSCorrR = getSCorrR -getSCorrR tid@(unTermKey -> tident) csh shn = do +getSCorrR tid csh shn = do Entity shid Sheet{..} <- runDB $ fetchSheet tid csh shn ((res,formWidget), formEnctype) <- runFormPost . identForm FIDcorrectors . renderAForm FormStandard $ formToAForm (correctorForm shid) <* submitButton @@ -606,10 +606,10 @@ getSCorrR tid@(unTermKey -> tident) csh shn = do FormMissing -> return () let - formTitle = MsgSheetCorrectorsTitle tident csh shn + formTitle = MsgSheetCorrectorsTitle tid csh shn formText = Nothing :: Maybe (SomeMessage UniWorX) actionUrl = CSheetR tid csh shn SCorrR -- actionUrl = CSheetR tid csh shn SShowR defaultLayout $ do - setTitleI $ MsgSheetCorrectorsTitle tident csh shn + setTitleI $ MsgSheetCorrectorsTitle tid csh shn $(widgetFile "formPageI18n") diff --git a/src/Model/Types.hs b/src/Model/Types.hs index 918880fe4..acf717b67 100644 --- a/src/Model/Types.hs +++ b/src/Model/Types.hs @@ -234,7 +234,7 @@ data Theme --Simply add Themes to this type only. CamelCase will be conver = Default | Lavender | NeutralBlue - | AberdeenReds + | AberdeenReds -- e.g. turned into "theme--aberdeen-reds" | MossGreen | SkyLove deriving (Eq,Ord,Bounded,Enum) From dc90f2718a9e7f08cacf916f6c1b789acf978708 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 15:03:45 +0200 Subject: [PATCH 16/23] add test-user max@campus.lmu.de to fill-db.hs --- fill-db.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fill-db.hs b/fill-db.hs index 81a805011..812b8fa7c 100755 --- a/fill-db.hs +++ b/fill-db.hs @@ -45,6 +45,15 @@ main = db $ do , userMaxFavourites = 14 , userTheme = MossGreen } + void . insert $ User + { userPlugin = "LDAP" + , userIdent = "max@campus.lmu.de" + , userMatrikelnummer = Nothing + , userEmail = "max@campus.lmu.de" + , userDisplayName = "Max Musterstudent" + , userMaxFavourites = 7 + , userTheme = AberdeenReds + } void . insert $ Term { termName = summer2017 , termStart = fromGregorian 2017 04 09 From ccceee9be5f41dd8280c2d8258e8a5627573e3af Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 15:28:43 +0200 Subject: [PATCH 17/23] responsive-fix for navbar --- templates/widgets/navbar.lucius | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 1b6f685bd..6e3d69798 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -6,7 +6,6 @@ justify-content: flex-start; width: 100%; height: var(--header-height); - padding-right: 2vw; background: var(--color-darker); /* Old browsers */ background: -moz-linear-gradient(bottom, var(--color-dark) 0%, var(--color-darker) 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(bottom, var(--color-dark) 0%,var(--color-darker) 100%); /* Chrome10-25,Safari5.1-6 */ @@ -38,7 +37,7 @@ align-items: center; color: var(--color-lightwhite); transform-origin: left; - transition: all .2s ease; + transition: all .2s ease-out; &:hover { color: var(--color-lightwhite); @@ -73,7 +72,7 @@ } } -@media (max-width: 1200px) { +@media (max-width: 1199px) { .navbar__logo { flex-basis: 24%; @@ -148,6 +147,13 @@ } } +@media (min-width: 768px) { + + .navbar__list:last-of-type { + margin-right: 20px; + } +} + /* list item */ .navbar__list-item { position: relative; From 1ed4670f549c0ecc40569a0fd65b04eb4d0791ef Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 15:31:45 +0200 Subject: [PATCH 18/23] style update for list of previously uploaded files --- templates/multiFileField.hamlet | 6 +++--- templates/multiFileField.lucius | 31 ++++++++++++++++++++++++++++++ templates/standalone/inputs.julius | 11 ++--------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/templates/multiFileField.hamlet b/templates/multiFileField.hamlet index e12a1864f..62123a11e 100644 --- a/templates/multiFileField.hamlet +++ b/templates/multiFileField.hamlet @@ -1,9 +1,9 @@ $newline never $forall FileUploadInfo{..} <- fileInfos -
      -
      $maybe school <- schoolMB - - - - - -
      Fakultät/Institut - - #{schoolName school} + Fakultät/Institut + + + #{schoolName school} $maybe descr <- courseDescription course
      Beschreibung - - #{descr} + Beschreibung + + + #{descr} $maybe link <- courseLinkExternal course
      Website - - #{link} + Website + + + #{link}
      Teilnehmer - - #{participants} - $maybe capacity <- courseCapacity course - \ von #{capacity} + Teilnehmer + + + #{participants} + $maybe capacity <- courseCapacity course + \ von #{capacity} $maybe regFrom <- courseRegisterFrom course
      Anmeldezeitraum - - Ab #{formatTimeGerWD regFrom} - $maybe regTo <- courseRegisterTo course - \ bis #{formatTimeGerWD regTo} + Anmeldezeitraum + + + Ab #{formatTimeGerWD regFrom} + $maybe regTo <- courseRegisterTo course + \ bis #{formatTimeGerWD regTo} $if registrationOpen
      - -
      +
      + +
      $# regWidget is defined through templates/widgets/registerForm ^{regWidget} From 1d63e9a068b49c2c33aa1f41608531c885f94bb8 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 15:39:27 +0200 Subject: [PATCH 20/23] consistent font-familes across input-fields --- templates/standalone/inputs.lucius | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/standalone/inputs.lucius b/templates/standalone/inputs.lucius index 0233e8956..19c0988a7 100644 --- a/templates/standalone/inputs.lucius +++ b/templates/standalone/inputs.lucius @@ -68,6 +68,7 @@ input[type*="time"] { border: 1px solid transparent; border-radius: 4px; font-size: 1rem; + font-family: var(--font-base); line-height: 1.5; padding: 4px 13px; } @@ -104,11 +105,12 @@ textarea { width: 100%; height: 170px; max-width: 600px; - font-size: 1rem; line-height: 1.5; color: #363636; background-color: #f3f3f3; padding: 4px 13px; + font-size: 1rem; + font-family: var(--font-base); -webkit-appearance: none; appearance: none; border: 1px solid #dbdbdb; From c541a40468db1308962bdffaab0d3205e3a8f240 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 15:42:39 +0200 Subject: [PATCH 21/23] uppercase course-shorthands in fill-db. No auto-uppercasing --- fill-db.hs | 12 ++++++------ templates/widgets/asidenav.lucius | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fill-db.hs b/fill-db.hs index 812b8fa7c..0465dc665 100755 --- a/fill-db.hs +++ b/fill-db.hs @@ -100,7 +100,7 @@ main = db $ do { courseName = "Fortgeschrittene Funktionale Programmierung" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "ffp" + , courseShorthand = "FFP" , courseTerm = TermKey summer2018 , courseSchool = ifi , courseCapacity = Just 20 @@ -126,7 +126,7 @@ main = db $ do { courseName = "Einführung in die Programmierung" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "eip" + , courseShorthand = "EIP" , courseTerm = TermKey summer2017 , courseSchool = ifi , courseCapacity = Just 20 @@ -144,7 +144,7 @@ main = db $ do { courseName = "Interaction Design (User Experience Design I & II)" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "ixd" + , courseShorthand = "IXD" , courseTerm = TermKey summer2018 , courseSchool = ifi , courseCapacity = Just 20 @@ -162,7 +162,7 @@ main = db $ do { courseName = "Concept Development (User Experience Design III)" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "ux3" + , courseShorthand = "UX3" , courseTerm = TermKey winter2017 , courseSchool = ifi , courseCapacity = Just 30 @@ -180,7 +180,7 @@ main = db $ do { courseName = "Programmierung und Modellierung" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "pmo" + , courseShorthand = "ProMo" , courseTerm = TermKey summer2017 , courseSchool = ifi , courseCapacity = Just 50 @@ -198,7 +198,7 @@ main = db $ do { courseName = "Datenbanksysteme" , courseDescription = Nothing , courseLinkExternal = Nothing - , courseShorthand = "dbs" + , courseShorthand = "DBS" , courseTerm = TermKey summer2018 , courseSchool = ifi , courseCapacity = Just 50 diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index 8cad43d54..35e052df6 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -190,7 +190,6 @@ flex-shrink: 0; padding: 1px; outline: 1px solid white; - text-transform: uppercase; word-break: break-all; align-items: center; justify-content: center; From 0cc36eeef1344e63a74d0bb3ed82a76a8c75c541 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 16:47:49 +0200 Subject: [PATCH 22/23] small fixes for font-family and clickable area in asidenav --- templates/default-layout.lucius | 2 +- templates/widgets/asidenav.lucius | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index 075f7ae20..6cd69859b 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -12,7 +12,7 @@ /* FONTS */ - --font-base: "Source Sans Pro", Helvetica, sans-serif; + --font-base: "Source Sans Pro", "Trebuchet MS", sans-serif; --font-logo: "Roboto", var(--font-base); /* DIMENSIONS */ diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index 35e052df6..6d79460dd 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -105,6 +105,7 @@ padding: 7px 10px; justify-content: flex-start; color: var(--color-lightwhite); + width: 100%; z-index: 1; .glyphicon { From 31935c0182dfab23273d8896583b491a46cd9007 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 1 Jul 2018 18:23:20 +0200 Subject: [PATCH 23/23] responsive-fixes for asidenav and navbar --- templates/widgets/asidenav.lucius | 4 ++-- templates/widgets/navbar.lucius | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/widgets/asidenav.lucius b/templates/widgets/asidenav.lucius index 6d79460dd..8dce6117c 100644 --- a/templates/widgets/asidenav.lucius +++ b/templates/widgets/asidenav.lucius @@ -4,7 +4,7 @@ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 1; flex: 0 0 300px; - min-height: calc(100% - 80px); + min-height: calc(100% - var(--header-height)); transition: all .2s ease-out; width: 24%; @@ -164,7 +164,7 @@ width: 50px; flex-basis: 50px; overflow: hidden; - min-height: calc(100% - 50px); + min-height: calc(100% - var(--header-height-collapsed)); ~ .main__content { padding-left: 50px; diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 6e3d69798..08c44c5fa 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -88,6 +88,10 @@ &::before { content: none; } + + &::after { + margin-left: 0; + } } }