From ada41e21645d8524a21e3c2c54590071d10dfb89 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 5 Sep 2019 18:05:39 +0200 Subject: [PATCH] style(allocation): improve structure of allocation-page --- messages/uniworx/de.msg | 1 + src/Handler/Allocation/Show.hs | 2 ++ templates/allocation/show.hamlet | 3 +++ templates/allocation/show.lucius | 24 +++++++++++++++++------- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index 7228f0612..d79a825ca 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -1523,6 +1523,7 @@ AllocationActive: Aktiv AllocationName: Name AllocationAvailableCourses: Kurse AllocationAppliedCourses: Bewerbungen +AllocationNumCoursesAvailableApplied available@Int applied@Int: Sie haben sich bisher für #{applied}/#{available} #{pluralDE applied "Kurs" "Kursen"} beworben AllocationTitle termText@Text ssh'@SchoolShorthand allocation@AllocationName: #{termText} - #{ssh'}: #{allocation} AllocationShortTitle termText@Text ssh'@SchoolShorthand ash@AllocationShorthand: #{termText} - #{ssh'} - #{ash} AllocationDescription: Beschreibung diff --git a/src/Handler/Allocation/Show.hs b/src/Handler/Allocation/Show.hs index bb6410ef0..0029581b7 100644 --- a/src/Handler/Allocation/Show.hs +++ b/src/Handler/Allocation/Show.hs @@ -96,4 +96,6 @@ getAShowR tid ssh ash = do |] let daysToRegistrationStart = assertM (>0) $ (`diffUTCTime` now) <$> allocationRegisterFrom allocationInfoModal = modal [whamlet|_{MsgMenuAllocationInfo}|] $ Left $ SomeRoute InfoAllocationR + numCourses = length courses + numAppliedCourses = lengthOf (folded . _2 . _Just) courses $(widgetFile "allocation/show") diff --git a/templates/allocation/show.hamlet b/templates/allocation/show.hamlet index 5d5462da4..3f0e97fe1 100644 --- a/templates/allocation/show.hamlet +++ b/templates/allocation/show.hamlet @@ -78,6 +78,9 @@ $if not (null courseWidgets)

_{MsgAllocationPriorityTip}

_{MsgAllocationPriorityRelative}

_{MsgApplicationEditTip} + $if is _Just muid +

+ _{MsgAllocationNumCoursesAvailableApplied numCourses numAppliedCourses}

$forall courseWgt <- courseWidgets ^{courseWgt} diff --git a/templates/allocation/show.lucius b/templates/allocation/show.lucius index ebbaab266..7cf292a62 100644 --- a/templates/allocation/show.lucius +++ b/templates/allocation/show.lucius @@ -3,8 +3,14 @@ font-style: italic; } +.allocation__state { + color: var(--color-font); + font-weight: 600; + font-style: normal; +} + .allocation__courses { - margin-top: 20px; + margin: 20px 0 0 40px; } .allocation-course { @@ -19,15 +25,19 @@ grid-gap: 5px 7px; padding: 12px 10px; - &:last-child { - padding: 12px 10px 0 10px; - } + /* &:last-child { + * padding: 12px 10px 0 10px; + * } + * + * & + .allocation-course { + * border-top: 1px solid var(--color-grey); + * } + */ - & + .allocation-course { - border-top: 1px solid var(--color-grey); + &:nth-child(2n) { + background-color: rgba(0, 0, 0, 0.03); } - .allocation-course__priority { grid-area: prio; }