From f7fb3c12198e29b653f93e9d9ef2f6fce23b1b85 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 9 Aug 2019 16:35:03 +0200 Subject: [PATCH] feat(course-teaser): hide lecturer entry if empty --- src/Handler/Course/List.hs | 2 +- templates/table/course/course-teaser.hamlet | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Handler/Course/List.hs b/src/Handler/Course/List.hs index c3d110a8a..19aac2caf 100644 --- a/src/Handler/Course/List.hs +++ b/src/Handler/Course/List.hs @@ -158,7 +158,7 @@ makeCourseTable whereClause colChoices psValidator = do , Just $ prismAForm (singletonFilter "schoolshort" . maybePrism (_PathPiece . from _SchoolId)) mPrev $ aopt (hoistField lift schoolField) (fslI MsgCourseSchool) , Just $ prismAForm (singletonFilter "lecturer") mPrev $ aopt textField (fslI MsgCourseLecturer) , Just $ prismAForm (singletonFilter "search") mPrev $ aopt textField (fslI MsgCourseFilterSearch) - , Just $ prismAForm (singletonFilter "openregistration" . maybePrism _PathPiece) mPrev $ aopt boolField (fslI MsgCourseRegisterOpen) + , Just $ prismAForm (singletonFilter "openregistration" . maybePrism _PathPiece) mPrev $ aopt boolField (fslI MsgCourseRegisterOpen) -- TODO: checkbox instead of boolField , muid $> prismAForm (singletonFilter "registered" . maybePrism _PathPiece) mPrev (aopt boolField (fslI MsgCourseFilterRegistered)) ] , dbtStyle = def diff --git a/templates/table/course/course-teaser.hamlet b/templates/table/course/course-teaser.hamlet index 4ef13ef08..8ba66493f 100644 --- a/templates/table/course/course-teaser.hamlet +++ b/templates/table/course/course-teaser.hamlet @@ -9,13 +9,14 @@ _{courseName} $if isRegistered
_{MsgRegistered} -
- _{MsgLecturersForN (length courseLecturers)} -
-
    - $forall lecturer <- courseLecturers -
  • - #{lecturer} + $if not $ null courseLecturers +
    + _{MsgLecturersForN (length courseLecturers)} +
    +
      + $forall lecturer <- courseLecturers +
    • + #{lecturer} $maybe regTo <- courseRegisterTo
      _{MsgRegisterTo}
      ^{formatTimeW SelFormatDateTime regTo}