feat(allocations): add info page for allocations

detailed information about allocations added; not yet open allocations
display time until opening now
This commit is contained in:
Steffen Jost 2019-08-22 15:34:29 +02:00
parent 9bc5885dbb
commit 689b85ad08
9 changed files with 161 additions and 28 deletions

View File

@ -1018,6 +1018,7 @@ MenuExamEdit: Bearbeiten
MenuExamUsers: Teilnehmer
MenuExamAddMembers: Prüfungsteilnehmer hinzufügen
MenuLecturerInvite: Dozenten hinzufügen
MenuAllocationInfo: Hinweise zum Ablauf einer Zentralanmeldung
AuthPredsInfo: Um eigene Veranstaltungen aus Sicht der Teilnehmer anzusehen, können Veranstalter und Korrektoren hier die Prüfung ihrer erweiterten Berechtigungen temporär deaktivieren. Abgewählte Prädikate schlagen immer fehl. Abgewählte Prädikate werden also nicht geprüft um Zugriffe zu gewähren, welche andernfalls nicht erlaubt wären. Diese Einstellungen gelten nur temporär bis Ihre Sitzung abgelaufen ist, d.h. bis ihr Browser-Cookie abgelaufen ist. Durch Abwahl von Prädikaten kann man sich höchstens temporär aussperren.
AuthPredsActive: Aktive Authorisierungsprädikate
@ -1474,8 +1475,11 @@ AllocationStaffRegisterFrom: Eintragung der Kurse ab
AllocationStaffRegister: Eintragung der Kurse
AllocationRegisterFrom: Bewerbung ab
AllocationRegister: Bewerbung
AllocationRegisterClosed: Die Zentralanmeldung ist aktuell geschlossen.
AllocationRegisterOpensIn opens@Text: Die Zentralanmeldung öffnet voraussichtlich in #{opens}
AllocationStaffAllocationFrom: Bewertung der Bewerbungen ab
AllocationStaffAllocation: Bewertung der Bewerbungen
AllocationStaffAllocation: Bewerbungsbewertung
AllocationProcess: Platzvergabe
AllocationNoApplication: Keine Bewerbung
AllocationPriority: Priorität
AllocationPriorityTip: Kurse, denen Sie eine höhere Priorität zuteilen, werden bei der Platzvergabe präferiert.
@ -1489,7 +1493,7 @@ BtnAllocationRegister: Teilnahme registrieren
BtnAllocationRegistrationEdit: Teilnahme anpassen
AllocationParticipation: Teilnahme an der Zentralanmeldung
AllocationParticipationLoginFirst: Um an der Zentralanmeldung teilzunehmen, loggen Sie sich bitte zunächst ein.
AllocationCourses: Kurse
AllocationCourses: Kurse dieser Zentralanmeldung
AllocationData: Organisatorisches
AllocationCoursePriority i@Natural: #{i}. Wahl
AllocationCourseNoApplication: Keine Bewerbung

1
routes
View File

@ -61,6 +61,7 @@
/info InfoR GET !free
/info/lecturer InfoLecturerR GET !lecturer
/info/data DataProtR GET !free
/info/allocation InfoAllocationR GET !free
/impressum ImpressumR GET !free
/version VersionR GET !free

View File

@ -1724,6 +1724,7 @@ instance YesodBreadcrumbs UniWorX where
breadcrumb InfoR = return ("Information" , Nothing)
breadcrumb InfoLecturerR = return ("Veranstalter" , Just InfoR)
breadcrumb DataProtR = return ("Datenschutz" , Just InfoR)
breadcrumb InfoAllocationR = return ("Zentralanmeldungen", Just InfoR)
breadcrumb ImpressumR = return ("Impressum" , Just InfoR)
breadcrumb VersionR = return ("Versionsgeschichte", Just InfoR)
@ -2173,7 +2174,7 @@ pageActions (TermCourseListR tid) =
]
pageActions (TermSchoolCourseListR _tid _ssh) =
[ MenuItem
{ menuItemType = PageActionPrime
{ menuItemType = PageActionPrime
, menuItemLabel = MsgMenuCourseNew
, menuItemIcon = Just "book"
, menuItemRoute = SomeRoute CourseNewR
@ -2181,6 +2182,16 @@ pageActions (TermSchoolCourseListR _tid _ssh) =
, menuItemAccessCallback' = return True
}
]
pageActions (AllocationR _tid _ssh _ash AShowR) =
[ MenuItem
{ menuItemType = PageActionPrime
, menuItemLabel = MsgMenuAllocationInfo
, menuItemIcon = Nothing
, menuItemRoute = SomeRoute InfoAllocationR
, menuItemModal = True
, menuItemAccessCallback' = return True
}
]
pageActions (CourseListR) =
[ MenuItem
{ menuItemType = PageActionPrime

View File

@ -2,6 +2,7 @@ module Handler.Allocation
( module Handler.Allocation
) where
import Handler.Allocation.Info as Handler.Allocation
import Handler.Allocation.Show as Handler.Allocation
import Handler.Allocation.Application as Handler.Allocation
import Handler.Allocation.Register as Handler.Allocation

View File

@ -0,0 +1,13 @@
module Handler.Allocation.Info
( getInfoAllocationR
) where
import Import
import Handler.Utils
getInfoAllocationR :: Handler Html
getInfoAllocationR = do
siteLayoutMsg MsgMenuAllocationInfo $ do
setTitleI MsgMenuAllocationInfo
$(i18nWidgetFile "allocation-info")

View File

@ -10,18 +10,19 @@ import Handler.Allocation.Register
import Handler.Allocation.Application
import qualified Database.Esqueleto as E
getAShowR :: TermId -> SchoolId -> AllocationShorthand -> Handler Html
getAShowR tid ssh ash = do
muid <- maybeAuthId
now <- liftIO getCurrentTime
let
resultCourse :: Simple Field1 a (Entity Course) => Lens' a (Entity Course)
resultCourse = _1
resultCourseApplication :: Simple Field2 a (Maybe (Entity CourseApplication)) => Traversal' a (Entity CourseApplication)
resultCourseApplication = _2 . _Just
resultHasTemplate :: Simple Field3 a (E.Value Bool) => Lens' a Bool
resultHasTemplate :: Simple Field3 a (E.Value Bool) => Lens' a Bool
resultHasTemplate = _3 . _Value
(Entity aId Allocation{..}, courses, registration) <- runDB $ do
@ -92,5 +93,6 @@ getAShowR tid ssh ash = do
<div .allocation-course ##{toPathPiece cID}>
^{wdgt}
|]
let daysToRegistrationStart = assertM (>0) $ (`diffUTCTime` now) <$> allocationRegisterFrom
allocationInfoModal = modal [whamlet|_{MsgMenuAllocationInfo}|] $ Left $ SomeRoute InfoAllocationR
$(widgetFile "allocation/show")

View File

@ -34,26 +34,42 @@ $newline never
<dd .deflist__dd>
^{formatTimeRangeW SelFormatDateTime fromT allocationStaffAllocationTo}
$if is _Just muid
$if mayRegister || is _Just registration
<section id=allocation-participation>
<h2>
_{MsgAllocationParticipation}
$if mayRegister
^{registerForm'}
$else
$maybe Entity _ AllocationUser{allocationUserTotalCourses} <- registration
<dl .deflist>
<dt .deflist__dt>
_{MsgAllocationTotalCourses}
<dd .deflist__dd>
#{allocationUserTotalCourses}
$else
<section id=allocation-participation>
<h2>
_{MsgAllocationParticipation}
$# TODO show datetime of automatic allocation
$#
$# <dt .deflist__dt>
$# _{MsgAllocationProcess}
$# <dd .deflist__dd>
$# ^{formatTimeRangeW SelFormatDateTime fromT allocationProcess}
$#
<section id=allocation-participation>
<h2>
_{MsgAllocationParticipation}
$if is _Nothing muid
<p>
_{MsgAllocationParticipationLoginFirst}
_{MsgAllocationParticipationLoginFirst}
$elseif mayRegister
$# existing registrations may also be edited in this case
^{registerForm'}
$elseif is _Just registration
$# show existing registration even if it cannot be changed now
$maybe Entity _ AllocationUser{allocationUserTotalCourses} <- registration
<dl .deflist>
<dt .deflist__dt>
_{MsgAllocationTotalCourses}
<dd .deflist__dd>
#{allocationUserTotalCourses}
$else
$# Provide helpful information for confused students who cannot register now
$maybe daysToOpen <- daysToRegistrationStart
<p>
_{MsgAllocationRegisterOpensIn (formatDiffDays daysToOpen)}
$nothing
<p>
_{MsgAllocationRegisterClosed}
<p>
$# This redundant links prevents useless help requests from frantic users
^{allocationInfoModal}
$if not (null courseWidgets)
<section .allocation>

View File

@ -184,10 +184,10 @@ h4 {
&:last-child {
margin: 0.5rem 0 0;
}
&:first-of-type {
margin: 0;
&:first-of-type {
margin: 0;
}
}
}
}

View File

@ -0,0 +1,85 @@
$newline text
<section>
<p>
Jede Zentralanmeldung durchläuft
der Reihe nach folgende Phasen:
<dl .deflist>
<dt .deflist__dt>
_{MsgAllocationStaffRegister}
<dd .deflist__dd>
<p>
Veranstalter können nur in diesem Zeitraum ihre Veranstaltungen
zur Zentralanmeldung hinzufügen oder entfernen.
<p>
Pro Veranstaltung wird einzeln festgelegt,
ob Studierende einen Bewerbungstext und/oder Bewerbungsdateien
einreichen sollen.
Veranstalter stellen auch Anweisungen zur Bewerbung ein,
z.B. welchen Inhalt abzugebende Bewerbungsdateien enthalten sollen.
<p>
Zur Zentralanmeldung eingetragene Kurse
erlauben während dem gesamten Ablauf
der Zentralanmeldung keine anderweitigen Kursanmeldung mehr,
auch nicht durch den Veranstalter selbst.
<dt .deflist__dt>
_{MsgAllocationRegister}
<dd .deflist__dd>
<p>
Studierende können sich nur in diesem Zeitraum
auf Plätze in Kursen einer Zentralanmeldung bewerben.
<p>
Bewerber können jedem Kurs der Zentralanmeldung eine Priorität
zuweisen, zwischen "dieser Kurs wäre meine erste Wahl"
und "diesen Kurs besuche ich auf keinen Fall".
Es kann auch mehreren Kursen die gleiche Priorität eingeräumt werden.
<p>
Studierende können auch mehr als einen Platz
in verschiedenen Kursen einer Zentralanmeldung anfordern,
falls die Kurskapazitäten und/oder Dringlichkeit ausreichend sind.
<p>
Bewerbungstexte und/oder Bewerbungsdateien
sind pro Kurs anzugeben, falls vom Veranstalter gefordert.
<dt .deflist__dt>
_{MsgAllocationStaffAllocation}
<dd .deflist__dd>
<p>
Veranstalter können nur in diesem Zeitraum die
Bewerbungen einsehen und bewerten.
$# <p>
$# Nur in manchen Zentralanmeldungen dürfen Veranstalter
$# Bewerber jetzt direkt ablehnen und/oder übernehmen.
$# <p>
$# Veranstalter haben noch eine letzte Möglichkeit,
$# die Kurskapazität anzupassen.
<dt .deflist__dt>
_{MsgAllocationProcess}
<dd .deflist__dd>
<p>
Die Plätze werden gemäß Studienfortschritt, Dringlichkeit
und der Bewertung durch den Veranstalter auf die Bewerber verteilt.
<p>
Die Bewerber werden diekt in den jeweiligen Kursen angemeldet.
Eine Abmeldung durch Studierende ist nicht erlaubt.
Übernommene Bewerber, welche einen zugeteilten Platz
ohne Angabe eines triftigen Grundes nicht antreten,
werden in zukünftigen Zentralanmeldungen
unter Umständen benachteiligt.
<p>
Veranstalter können frühestens nach der erfolgten Zuteilung
Teilnehmer selbst an-/abmelden
und ggf. Nachrücker für freigewordene Plätze anfordern.
<p>
Der Ablauf einer Zentralanmeldung kann unter Umständen noch variieren.
<em>
Insbesondere: #
Fehlt in der Übersichtsseite einer Zentralanmeldung
die Angabe einer dieser Phasen, dann wurde der entsprechende Zeitraum
leider noch nicht festgelegt!
<p>
Mehrere Zentralanmeldungen werden völlig unabhängig voneinander
abgewickelt.