From 8a49979ecc26a54d3c2aff7056136f920abe13d8 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Mon, 22 Jul 2019 16:39:24 +0200 Subject: [PATCH] feat(course-teaser): working link to course pages --- messages/uniworx/de.msg | 4 ++++ src/Handler/Utils/Table/Pagination.hs | 4 ++-- templates/table/course/colonnade.hamlet | 2 +- templates/table/course/course-teaser.hamlet | 13 +++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index ef0003579..78a7b7d42 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -152,6 +152,8 @@ NoSuchSchool ssh@SchoolId: Institut #{ssh} gibt es nicht. NoSuchCourseShorthand csh@CourseShorthand: Kein Kurs mit Kürzel #{csh} bekannt. NoSuchCourse: Keinen passenden Kurs gefunden. +NoCourseDescription: Zu diesem Kurs ist keine Beschreibung verfügbar. + Sheet: Blatt SheetList tid@TermId ssh@SchoolId csh@CourseShorthand: #{tid}-#{ssh}-#{csh} Übersicht Übungsblätter SheetNewHeading tid@TermId ssh@SchoolId csh@CourseShorthand: #{tid}-#{ssh}-#{csh} Neues Übungsblatt anlegen @@ -507,6 +509,8 @@ ForSchools n@Int: für #{pluralDE n "Institut" "Institute"} UserListTitle: Komprehensive Benutzerliste AccessRightsSaved: Berechtigungsänderungen wurden gespeichert. +LecturersForN n@Int: #{pluralDE n "Dozent" "Dozenten"} + Date: Datum DateTimeFormat: Datums- und Uhrzeitformat DateFormat: Datumsformat diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index ba7c29687..aeb94f621 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -853,8 +853,8 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db wRows <- forM (zip [0..length rows] rows) $ \(cid, row') -> let Course{..} = row' ^. c . _entityVal - lecturers = toListOf l row' - courseLecturers = intercalate ", " $ userSurname . entityVal <$> lecturers + lecturerUsers = toListOf l row' + courseLecturers = userSurname . entityVal <$> lecturerUsers isRegistered = row' ^. r courseSchoolName = unSchoolKey courseSchool courseId = tshow cid diff --git a/templates/table/course/colonnade.hamlet b/templates/table/course/colonnade.hamlet index 91f065160..f67891d7d 100644 --- a/templates/table/course/colonnade.hamlet +++ b/templates/table/course/colonnade.hamlet @@ -9,4 +9,4 @@ $newline never $else $forall row <- wRows - ^{row} \ No newline at end of file + ^{row} \ No newline at end of file diff --git a/templates/table/course/course-teaser.hamlet b/templates/table/course/course-teaser.hamlet index 08ec2cf29..6a48d3192 100644 --- a/templates/table/course/course-teaser.hamlet +++ b/templates/table/course/course-teaser.hamlet @@ -2,10 +2,15 @@
_{courseShorthand}
- _{courseName} + _{courseName}
_{MsgRegistered} -
_{MsgLecturerFor} -
_{courseLecturers} +
+ _{MsgLecturersForN (length courseLecturers)} +
+
    + $forall lecturer <- courseLecturers +
  • + #{lecturer}
    _{MsgRegisterTo} $maybe regTo <- courseRegisterTo
    ^{formatTimeW SelFormatDateTime regTo} @@ -16,4 +21,4 @@ $maybe desc <- courseDescription #{desc} $nothing - No description available. + _{MsgNoCourseDescription}