diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index e6b8afeae..2c0a74755 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -270,54 +270,14 @@ getTermCurrentR = do case fromNullable termIds of Nothing -> notFound (Just (maximum -> tid)) -> - redirect $ TermCourseListR tid -- redirect avoids problematic breadcrumbs, headings, etc. + redirect $ (CourseListR, [("courses-term", toPathPiece tid)]) -- redirect avoids problematic breadcrumbs, headings, etc. getTermSchoolCourseListR :: TermId -> SchoolId -> Handler Html -getTermSchoolCourseListR tid ssh = do - void . runDB $ get404 tid -- Just ensure the term exists - School{schoolName=school} <- runDB $ get404 ssh -- Just ensure the term exists - muid <- maybeAuthId - let colonnade = widgetColonnade $ mconcat - [ dbRow - , colCShort - , colDescription - , colRegFrom - , colRegTo - , colMembers - , maybe mempty (const colRegistered) muid - ] - whereClause (course, _, _) = - course E.^. CourseTerm E.==. E.val tid - E.&&. course E.^. CourseSchool E.==. E.val ssh - validator = def - & defaultSorting [SortAscBy "cshort"] - coursesTable <- runDB $ makeCourseTable whereClause colonnade validator - defaultLayout $ do - setTitleI $ MsgTermSchoolCourseListTitle tid school - $(widgetFile "courses") +getTermSchoolCourseListR tid ssh = redirect $ (CourseListR, [("courses-term", toPathPiece tid), ("courses-schoolshort", toPathPiece ssh)]) getTermCourseListR :: TermId -> Handler Html -getTermCourseListR tid = do - void . runDB $ get404 tid -- Just ensure the term exists - muid <- maybeAuthId - let colonnade = widgetColonnade $ mconcat - [ dbRow - , colCShort - , colDescription - , colSchoolShort - , colRegFrom - , colRegTo - , colMembers - , maybe mempty (const colRegistered) muid - ] - whereClause (course, _, _) = course E.^. CourseTerm E.==. E.val tid - validator = def - & defaultSorting [SortAscBy "cshort"] - coursesTable <- runDB $ makeCourseTable whereClause colonnade validator - defaultLayout $ do - setTitleI . MsgTermCourseListTitle $ tid - $(widgetFile "courses") +getTermCourseListR tid = redirect $ (CourseListR, [("courses-term", toPathPiece tid)]) getCShowR :: TermId -> SchoolId -> CourseShorthand -> Handler Html getCShowR tid ssh csh = do