Bugfix: Weekdays correct now; Homepage edited.
This commit is contained in:
parent
85cc86e37f
commit
21e0c5b4dc
@ -62,10 +62,6 @@ homeAnonymous = do
|
|||||||
E.&&. ((E.isNothing $ course E.^. CourseRegisterTo)
|
E.&&. ((E.isNothing $ course E.^. CourseRegisterTo)
|
||||||
E.||. (course E.^. CourseRegisterTo E.>=. E.val (Just cTime)))
|
E.||. (course E.^. CourseRegisterTo E.>=. E.val (Just cTime)))
|
||||||
E.limit nrSheetDeadlines
|
E.limit nrSheetDeadlines
|
||||||
E.orderBy [ E.asc $ course E.^. CourseRegisterTo
|
|
||||||
, E.desc $ course E.^. CourseShorthand
|
|
||||||
]
|
|
||||||
E.limit nrSheetDeadlines
|
|
||||||
return course
|
return course
|
||||||
|
|
||||||
colonnade :: Colonnade Sortable (DBRow (Entity Course)) (DBCell (WidgetT UniWorX IO) ())
|
colonnade :: Colonnade Sortable (DBRow (Entity Course)) (DBCell (WidgetT UniWorX IO) ())
|
||||||
@ -75,7 +71,9 @@ homeAnonymous = do
|
|||||||
let tid = courseTerm course
|
let tid = courseTerm course
|
||||||
csh = courseShorthand course
|
csh = courseShorthand course
|
||||||
cell [whamlet|<a href=@{CourseR tid csh CShowR}>#{display csh}|]
|
cell [whamlet|<a href=@{CourseR tid csh CShowR}>#{display csh}|]
|
||||||
, sortable (Just "deadline") (i18nCell MsgRegisterTo) $ \DBRow{ dbrOutput=(Entity {entityVal = course}) } ->
|
, sortable (Just "term") (textCell MsgTerm) $ \DBRow{ dbrOutput=(Entity {entityVal = course}) } ->
|
||||||
|
textCell $ display $ courseTerm course
|
||||||
|
, sortable (Just "deadline") (textCell MsgRegisterTo) $ \DBRow{ dbrOutput=(Entity {entityVal = course}) } ->
|
||||||
textCell $ display $ courseRegisterTo course
|
textCell $ display $ courseRegisterTo course
|
||||||
]
|
]
|
||||||
courseTable <- dbTable def $ DBTable
|
courseTable <- dbTable def $ DBTable
|
||||||
@ -88,7 +86,9 @@ homeAnonymous = do
|
|||||||
, ( "course"
|
, ( "course"
|
||||||
, SortColumn $ \(course) -> course E.^. CourseShorthand
|
, SortColumn $ \(course) -> course E.^. CourseShorthand
|
||||||
)
|
)
|
||||||
-- TODO
|
, ( "deadline"
|
||||||
|
, SortColumn $ \(course) -> course E.^. CourseRegisterTo
|
||||||
|
)
|
||||||
]
|
]
|
||||||
, dbtFilter = mempty {- [ ( "term"
|
, dbtFilter = mempty {- [ ( "term"
|
||||||
, FilterColumn $ \(course `E.InnerJoin` _ `E.InnerJoin` _ ) tids -> if
|
, FilterColumn $ \(course `E.InnerJoin` _ `E.InnerJoin` _ ) tids -> if
|
||||||
@ -122,10 +122,6 @@ homeUser uid = do
|
|||||||
E.where_ $ participant E.^. CourseParticipantUser E.==. E.val uid
|
E.where_ $ participant E.^. CourseParticipantUser E.==. E.val uid
|
||||||
E.&&. sheet E.^. SheetActiveTo E.<=. E.val fTime
|
E.&&. sheet E.^. SheetActiveTo E.<=. E.val fTime
|
||||||
E.&&. sheet E.^. SheetActiveTo E.>=. E.val cTime
|
E.&&. sheet E.^. SheetActiveTo E.>=. E.val cTime
|
||||||
E.orderBy [ E.asc $ sheet E.^. SheetActiveTo
|
|
||||||
, E.desc $ sheet E.^. SheetName
|
|
||||||
, E.desc $ course E.^. CourseShorthand
|
|
||||||
]
|
|
||||||
E.limit nrSheetDeadlines
|
E.limit nrSheetDeadlines
|
||||||
return
|
return
|
||||||
( course E.^. CourseTerm
|
( course E.^. CourseTerm
|
||||||
@ -139,6 +135,8 @@ homeUser uid = do
|
|||||||
[ -- dbRow
|
[ -- dbRow
|
||||||
sortable (Just "course") (textCell MsgCourse) $ \DBRow{ dbrOutput=(E.Value tid, E.Value csh, _, _) } ->
|
sortable (Just "course") (textCell MsgCourse) $ \DBRow{ dbrOutput=(E.Value tid, E.Value csh, _, _) } ->
|
||||||
cell [whamlet|<a href=@{CourseR tid csh CShowR}>#{display csh}|]
|
cell [whamlet|<a href=@{CourseR tid csh CShowR}>#{display csh}|]
|
||||||
|
, sortable (Just "term") (textCell MsgTerm) $ \DBRow{ dbrOutput=(E.Value tid, _,_,_) } ->
|
||||||
|
textCell $ display tid
|
||||||
, sortable (Just "sheet") (textCell MsgSheet) $ \DBRow{ dbrOutput=(E.Value tid, E.Value csh, E.Value shn, _) } ->
|
, sortable (Just "sheet") (textCell MsgSheet) $ \DBRow{ dbrOutput=(E.Value tid, E.Value csh, E.Value shn, _) } ->
|
||||||
cell [whamlet|<a href=@{CSheetR tid csh shn SShowR}>#{display shn}|]
|
cell [whamlet|<a href=@{CSheetR tid csh shn SShowR}>#{display shn}|]
|
||||||
, sortable (Just "deadline") (textCell MsgDeadline) $ \DBRow{ dbrOutput=(_, _, _, E.Value deadline) } ->
|
, sortable (Just "deadline") (textCell MsgDeadline) $ \DBRow{ dbrOutput=(_, _, _, E.Value deadline) } ->
|
||||||
@ -156,7 +154,15 @@ homeUser uid = do
|
|||||||
, ( "course"
|
, ( "course"
|
||||||
, SortColumn $ \(_ `E.InnerJoin` course `E.InnerJoin` _ ) -> course E.^. CourseShorthand
|
, SortColumn $ \(_ `E.InnerJoin` course `E.InnerJoin` _ ) -> course E.^. CourseShorthand
|
||||||
)
|
)
|
||||||
-- TODO
|
, ( "sheet"
|
||||||
|
, SortColumn $ \(_ `E.InnerJoin` _ `E.InnerJoin` sheet ) -> sheet E.^. SheetName
|
||||||
|
)
|
||||||
|
, ( "deadline"
|
||||||
|
, SortColumn $ \(_ `E.InnerJoin` _ `E.InnerJoin` sheet ) -> sheet E.^. SheetActiveTo
|
||||||
|
)
|
||||||
|
, ( "done"
|
||||||
|
, SortColumn $ \(_ `E.InnerJoin` _ `E.InnerJoin` sheet ) -> sheet E.^. SheetActiveTo
|
||||||
|
)
|
||||||
]
|
]
|
||||||
, dbtFilter = mempty {- [ ( "term"
|
, dbtFilter = mempty {- [ ( "term"
|
||||||
, FilterColumn $ \(course `E.InnerJoin` _ `E.InnerJoin` _ ) tids -> if
|
, FilterColumn $ \(course `E.InnerJoin` _ `E.InnerJoin` _ ) tids -> if
|
||||||
|
|||||||
@ -165,7 +165,7 @@ getSheetList courseEnt = do
|
|||||||
let colBase = mconcat
|
let colBase = mconcat
|
||||||
[ headed "Blatt" $ \(sid,sheet,_) -> simpleLink (toWgt $ sheetName sheet) $ CSheetR tid csh (sheetName sheet) SShowR
|
[ headed "Blatt" $ \(sid,sheet,_) -> simpleLink (toWgt $ sheetName sheet) $ CSheetR tid csh (sheetName sheet) SShowR
|
||||||
, headed "Abgabe ab" $ toWgt . formatTimeGerWD . sheetActiveFrom . snd3
|
, headed "Abgabe ab" $ toWgt . formatTimeGerWD . sheetActiveFrom . snd3
|
||||||
, headed "Abgabe lbis" $ toWgt . formatTimeGerWD . sheetActiveTo . snd3
|
, headed "Abgabe bis" $ toWgt . formatTimeGerWD . sheetActiveTo . snd3
|
||||||
, headed "Bewertung" $ toWgt . display . sheetType . snd3
|
, headed "Bewertung" $ toWgt . display . sheetType . snd3
|
||||||
]
|
]
|
||||||
let colAdmin = mconcat -- only show edit button for allowed course assistants
|
let colAdmin = mconcat -- only show edit button for allowed course assistants
|
||||||
|
|||||||
@ -42,25 +42,17 @@ getTermShowR = do
|
|||||||
provideRep $ toJSON . map fst <$> runDB (E.select $ E.from termData)
|
provideRep $ toJSON . map fst <$> runDB (E.select $ E.from termData)
|
||||||
provideRep $ do
|
provideRep $ do
|
||||||
let colonnadeTerms = widgetColonnade $ mconcat
|
let colonnadeTerms = widgetColonnade $ mconcat
|
||||||
[ sortable Nothing "Kürzel" $ \(Entity tid Term{..},_) -> cell $ do
|
[ sortable Nothing "Kürzel" $
|
||||||
-- Scrap this if to slow, create term edit page instead
|
anchorCell (\(Entity tid _, _) -> TermCourseListR tid)
|
||||||
adminLink <- handlerToWidget $ isAuthorized (TermEditExistR tid) False
|
(\(Entity tid _, _) -> [whamlet|#{display tid}|])
|
||||||
[whamlet|
|
|
||||||
$if adminLink == Authorized
|
|
||||||
<a href=@{TermEditExistR tid}>
|
|
||||||
#{termToText termName}
|
|
||||||
$else
|
|
||||||
#{termToText termName}
|
|
||||||
|]
|
|
||||||
, sortable (Just "lecture-start") (i18nCell MsgLectureStart) $ \(Entity _ Term{..},_) ->
|
, sortable (Just "lecture-start") (i18nCell MsgLectureStart) $ \(Entity _ Term{..},_) ->
|
||||||
stringCell $ formatTimeGerWD termLectureStart
|
stringCell $ formatTimeGerWD termLectureStart
|
||||||
, sortable (Just "lecture-end") "Ende Vorlesungen" $ \(Entity _ Term{..},_) ->
|
, sortable (Just "lecture-end") "Ende Vorlesungen" $ \(Entity _ Term{..},_) ->
|
||||||
stringCell $ formatTimeGerWD termLectureEnd
|
stringCell $ formatTimeGerWD termLectureEnd
|
||||||
, sortable Nothing "Aktiv" $ \(Entity _ Term{..},_) ->
|
, sortable Nothing "Aktiv" $ \(Entity _ Term{..},_) ->
|
||||||
textCell $ (bool "" tickmark termActive :: Text)
|
textCell $ (bool "" tickmark termActive :: Text)
|
||||||
, sortable Nothing "Kursliste" $ anchorCell
|
, sortable Nothing "Kurse" $ \(_, E.Value numCourses) ->
|
||||||
(\(Entity tid _, _) -> TermCourseListR tid)
|
cell [whamlet|_{MsgNumCourses numCourses}|]
|
||||||
(\(_, E.Value numCourses) -> [whamlet|_{MsgNumCourses numCourses}|])
|
|
||||||
, sortable (Just "start") "Semesteranfang" $ \(Entity _ Term{..},_) ->
|
, sortable (Just "start") "Semesteranfang" $ \(Entity _ Term{..},_) ->
|
||||||
stringCell $ formatTimeGerWD termStart
|
stringCell $ formatTimeGerWD termStart
|
||||||
, sortable (Just "end") "Semesterende" $ \(Entity _ Term{..},_) ->
|
, sortable (Just "end") "Semesterende" $ \(Entity _ Term{..},_) ->
|
||||||
@ -68,6 +60,18 @@ getTermShowR = do
|
|||||||
, sortable Nothing "Feiertage im Semester" $ \(Entity _ Term{..},_) ->
|
, sortable Nothing "Feiertage im Semester" $ \(Entity _ Term{..},_) ->
|
||||||
stringCell $ (intercalate ", ") $ map formatTimeGerWD termHolidays
|
stringCell $ (intercalate ", ") $ map formatTimeGerWD termHolidays
|
||||||
]
|
]
|
||||||
|
-- let adminColonnade =
|
||||||
|
-- [ sortable Nothing "Edit" $ \(Entity tid Term{..},_) -> cell $ do
|
||||||
|
-- -- Scrap this if to slow, create term edit page instead
|
||||||
|
-- adminLink <- handlerToWidget $ isAuthorized (TermEditExistR tid) False
|
||||||
|
-- [whamlet|
|
||||||
|
-- $if adminLink == Authorized
|
||||||
|
-- <a href=@{TermEditExistR tid}>
|
||||||
|
-- #{termToText termName}
|
||||||
|
-- $else
|
||||||
|
-- #{termToText termName}
|
||||||
|
-- |]
|
||||||
|
-- ]
|
||||||
table <- dbTable def $ DBTable
|
table <- dbTable def $ DBTable
|
||||||
{ dbtSQLQuery = termData
|
{ dbtSQLQuery = termData
|
||||||
, dbtColonnade = colonnadeTerms
|
, dbtColonnade = colonnadeTerms
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import Data.Time
|
|||||||
|
|
||||||
germanTimeLocale :: TimeLocale
|
germanTimeLocale :: TimeLocale
|
||||||
germanTimeLocale = TimeLocale
|
germanTimeLocale = TimeLocale
|
||||||
{ wDays = [("Montag" ,"Mo")
|
{ wDays = [("Sonntag" ,"So")
|
||||||
|
,("Montag" ,"Mo")
|
||||||
,("Dienstag" ,"Di")
|
,("Dienstag" ,"Di")
|
||||||
,("Mittwoch" ,"Mi")
|
,("Mittwoch" ,"Mi")
|
||||||
,("Donnerstag" ,"Do")
|
,("Donnerstag" ,"Do")
|
||||||
,("Freitag" ,"Fr")
|
,("Freitag" ,"Fr")
|
||||||
,("Samstag" ,"Sa")
|
,("Samstag" ,"Sa")
|
||||||
,("Sonntag" ,"So")
|
|
||||||
]
|
]
|
||||||
, months = [("Januar" ,"Jan")
|
, months = [("Januar" ,"Jan")
|
||||||
,("Februar" ,"Feb")
|
,("Februar" ,"Feb")
|
||||||
@ -46,8 +46,9 @@ formatTimeGerWDT = formatTimeGer $ dateTimeFmt germanTimeLocale
|
|||||||
formatTimeGerDT :: FormatTime t => t -> String -- 0.00.00 0:00
|
formatTimeGerDT :: FormatTime t => t -> String -- 0.00.00 0:00
|
||||||
formatTimeGerDT = formatTimeGer "%e.%m.%y %k:%M" -- leading spaces at start, otherwise 0 padding
|
formatTimeGerDT = formatTimeGer "%e.%m.%y %k:%M" -- leading spaces at start, otherwise 0 padding
|
||||||
|
|
||||||
formatTimeGerDT2 :: FormatTime t => t -> String -- 00.00.00 00:00
|
-- the following is used by DisplayAble's display:
|
||||||
formatTimeGerDT2 = formatTimeGer "%d.%m.%y %H:%M" -- always padding with 0
|
formatTimeGerDT2 :: FormatTime t => t -> String -- Day 00.00.00 00:00
|
||||||
|
formatTimeGerDT2 = formatTimeGer "%a %d.%m.%y %H:%M" -- always padding with 0
|
||||||
|
|
||||||
formatTimeGerWD :: FormatTime t => t -> String
|
formatTimeGerWD :: FormatTime t => t -> String
|
||||||
formatTimeGerWD = formatTimeGer "%a %e.%m.%y"
|
formatTimeGerWD = formatTimeGer "%a %e.%m.%y"
|
||||||
|
|||||||
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
Kurse mit offener Registrierung
|
Kurse mit offener Registrierung
|
||||||
<div .container>
|
<div .container>
|
||||||
^{courseTable}
|
^{courseTable}
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
Re-Implementierung von <a href="https://uniworx.ifi.lmu.de/">UniWorX</a>
|
Re-Implementierung von <a href="https://uniworx.ifi.lmu.de/">UniWorX</a>
|
||||||
|
|||||||
@ -9,9 +9,10 @@
|
|||||||
Die Implementierung von
|
Die Implementierung von
|
||||||
Uni2work ist noch nicht abgeschlossen.
|
Uni2work ist noch nicht abgeschlossen.
|
||||||
|
|
||||||
<h1>Anstehende Übungsblätter
|
<h1>
|
||||||
<div .container>
|
Anstehende Übungsblätter
|
||||||
^{sheetTable}
|
<div .container>
|
||||||
|
^{sheetTable}
|
||||||
|
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user