Default sorting for TermListR added

This commit is contained in:
SJost 2019-02-22 13:00:13 +01:00
parent d90093bed4
commit d1c0b67627

View File

@ -68,7 +68,7 @@ getTermShowR = do
provideRep $ toJSON . map fst <$> runDB (E.select $ E.from termData)
provideRep $ do
let colonnadeTerms = widgetColonnade $ mconcat
[ sortable (Just "termid") "Kürzel" $ \(Entity tid _, _) -> anchorCell
[ sortable (Just "term-id") "Kürzel" $ \(Entity tid _, _) -> anchorCell
(TermCourseListR tid)
[whamlet|#{toPathPiece tid}|]
, sortable (Just "lecture-start") (i18nCell MsgLectureStart) $ \(Entity _ Term{..},_) ->
@ -104,7 +104,7 @@ getTermShowR = do
-- #{termToText termName}
-- |]
-- ]
let validator = def
let validator = def & defaultSorting [SortDescBy "term-id"]
table <- runDB $ dbTableWidget' validator DBTable
{ dbtSQLQuery = termData
, dbtRowKey = (E.^. TermId)
@ -123,7 +123,7 @@ getTermShowR = do
, ( "lecture-end"
, SortColumn $ \term -> term E.^. TermLectureEnd
)
, ( "termid"
, ( "term-id"
, SortColumn $ \term -> term E.^. TermId
)
]