This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/templates/schedule/week.hamlet

78 lines
4.6 KiB
Plaintext

$newline never
<div .schedule uw-hide-columns="schedule-week">
<table .table .table--striped .table--hover .schedule>
<thead>
<tr .table__row .table__row--head>
<th .table__th uw-hide-column-header="time">
_{MsgScheduleTableHeadTime}
$forall day <- week
$if is _Just (Map.lookup day events)
<th .table__th :isToday day:.schedule-current uw-hide-column-header=#{dayTableHeadIdent day}>
^{formatTimeW SelFormatDate day}
$if elem day holidays
\ (_{MsgScheduleWeekHoliday})
<tbody>
$forall slot <- allTimeSlots
$if Set.member slot timeSlotsDefaultDisplay || not (timeSlotIsEmpty slot)
<tr .table__row>
<th .table__th uw-hide-columns--no-hide :any isToday week && isCurrentSlot slot:.schedule-current>
^{formatTimeSlotW slot}
$forall day <- week
$maybe dayEvents <- Map.lookup day events
$maybe slotEvents <- Map.lookup slot dayEvents
<td .table__td>
<div .table__td-content>
$forall (scheduleEntry, slotAssociation) <- slotEvents
<a href=@{scheduleEntryToHref scheduleEntry} .schedule--entry-link>
<div .schedule--entry .schedule--entry__#{toPathPiece slotAssociation} :slotAssocIsCont slotAssociation:.schedule--entry__continuation :isCurrentScheduleEntry day slot scheduleEntry:.schedule-current>
$case scheduleEntry
$of ScheduleCourseEvent{sceCourse=Entity _ Course{courseName},sceType,sceRoom,sceShowRoom,sceOccurrence}
#{CI.original courseName}: #{CI.original sceType} #
$if slotAssocIsCont slotAssociation
(_{MsgScheduleWeekSlotIsCont})
<br>
$if sceShowRoom
$maybe room <- sceRoom
_{MsgScheduleRoom}: ^{roomReferenceWidget room}
<br>
^{formatEitherOccurrenceW sceOccurrence}
$of ScheduleTutorial{stCourse=Entity _ Course{courseName},stName,stType,stRoom,stShowRoom,stOccurrence}
#{CI.original courseName}: #{stName} #
(
#{CI.original stType}
$if slotAssocIsCont slotAssociation
, _{MsgScheduleWeekSlotIsCont}
)
<br>
$if stShowRoom
$maybe room <- stRoom
_{MsgScheduleRoom}: ^{roomReferenceWidget room}
<br>
^{formatEitherOccurrenceW stOccurrence}
$of ScheduleExamOccurrence{seoCourse=Entity _ Course{courseName},seoExamName,seoRooms,seoStart,seoEnd}
#{CI.original courseName}: #{seoExamName} #
$if slotAssocIsCont slotAssociation
(_{MsgScheduleWeekSlotIsCont})
<br>
$case Set.toList seoRooms
$of []
$of [(mRoom, showRoom)]
$if showRoom
$maybe room <- mRoom
_{MsgScheduleRoom}: ^{roomReferenceWidget room}
<br>
$of more
_{MsgScheduleRooms}: #
$forall (idx,(mRoom,showRoom)) <- indexedList more
$if showRoom
$maybe room <- mRoom
^{roomReferenceWidget room}
$if idx < pred (length more)
; #
<br>
_{MsgScheduleOccur}: #
$if Just (utctDay seoStart) == fmap utctDay seoEnd
^{formatTimeRangeW SelFormatTime seoStart seoEnd}
$else
^{formatTimeRangeW SelFormatDateTime seoStart seoEnd}