feat(course-visibility): add visibleFrom,visibleTo
add visibleFrom and visibleTo to model, add fields (CEditR), add info (CShowR)
This commit is contained in:
parent
908b1fc234
commit
222d566bda
@ -53,6 +53,9 @@ RegisterTo: Anmeldungen bis
|
|||||||
DeRegUntil: Abmeldungen bis
|
DeRegUntil: Abmeldungen bis
|
||||||
RegisterRetry: Sie wurden noch nicht angemeldet. Drücken Sie dazu den Knopf "Anmelden"
|
RegisterRetry: Sie wurden noch nicht angemeldet. Drücken Sie dazu den Knopf "Anmelden"
|
||||||
|
|
||||||
|
CourseVisibleFrom: Sichtbar ab
|
||||||
|
CourseVisibleTo: Sichtbar bis
|
||||||
|
|
||||||
CourseRegistrationInterval: Anmeldung
|
CourseRegistrationInterval: Anmeldung
|
||||||
CourseDirectRegistrationInterval: Direkte Anmeldung
|
CourseDirectRegistrationInterval: Direkte Anmeldung
|
||||||
CourseDeregisterUntil time@Text: Abmeldung nur bis #{time}
|
CourseDeregisterUntil time@Text: Abmeldung nur bis #{time}
|
||||||
@ -112,6 +115,8 @@ CourseNoCapacity: In diesem Kurs sind keine Plätze mehr frei.
|
|||||||
TutorialNoCapacity: In dieser Übung sind keine Plätze mehr frei.
|
TutorialNoCapacity: In dieser Übung sind keine Plätze mehr frei.
|
||||||
ExamOccurrenceNoCapacity: Zu diesem Termin/Raum sind keine Plätze mehr frei.
|
ExamOccurrenceNoCapacity: Zu diesem Termin/Raum sind keine Plätze mehr frei.
|
||||||
CourseNotEmpty: In diesem Kurs sind momentan Teilnehmer angemeldet.
|
CourseNotEmpty: In diesem Kurs sind momentan Teilnehmer angemeldet.
|
||||||
|
CourseVisibility: Sichtbarkeit
|
||||||
|
CourseInvisible: Dieser Kurs ist momentan nicht sichtbar. TODO
|
||||||
CourseRegistration: Kursanmeldung
|
CourseRegistration: Kursanmeldung
|
||||||
CourseRegisterOpen: Anmeldung möglich
|
CourseRegisterOpen: Anmeldung möglich
|
||||||
CourseRegisterOk: Erfolgreich zum Kurs angemeldet
|
CourseRegisterOk: Erfolgreich zum Kurs angemeldet
|
||||||
@ -158,6 +163,8 @@ CourseSchoolShort: Institut
|
|||||||
CourseSchoolMultipleTip: Es stehen für Sie mehrere Institute zur Auswahl. Stellen Sie bitte sicher, dass Sie das für den Kurs korrekte Institut wählen.
|
CourseSchoolMultipleTip: Es stehen für Sie mehrere Institute zur Auswahl. Stellen Sie bitte sicher, dass Sie das für den Kurs korrekte Institut wählen.
|
||||||
CourseSecretTip: Anmeldung zum Kurs erfordert Eingabe des Passworts, sofern gesetzt
|
CourseSecretTip: Anmeldung zum Kurs erfordert Eingabe des Passworts, sofern gesetzt
|
||||||
CourseSecretFormat: beliebige Zeichenkette
|
CourseSecretFormat: beliebige Zeichenkette
|
||||||
|
CourseVisibleFromTip: Ab diesem Zeitpunkt können andere Nutzer (außer Verwalter dieses Kurses) den Kurs sehen. Ohne Datum ist der Kurs nie für andere Nutzer sichtbar.
|
||||||
|
CourseVisibleToTip: Der Kurs ist ab "Sichtbar ab" bis zu diesem Zeitpunkt für andere Nutzer sichtbar. Ohne Datum bleibt ein sichtbarer Kurs unbegrenzt sichtbar.
|
||||||
CourseRegisterFromTip: Ohne Datum ist keine eigenständige Anmeldung von Studierenden erlaubt.
|
CourseRegisterFromTip: Ohne Datum ist keine eigenständige Anmeldung von Studierenden erlaubt.
|
||||||
CourseRegisterToTip: Darf auch unbegrenzt offen bleiben
|
CourseRegisterToTip: Darf auch unbegrenzt offen bleiben
|
||||||
CourseDeregisterUntilTip: Abmeldung ist ab "Anmeldungen von" bis zu diesem Zeitpunkt erlaubt. Die Abmeldung darf auch unbegrenzt erlaubt bleiben.
|
CourseDeregisterUntilTip: Abmeldung ist ab "Anmeldungen von" bis zu diesem Zeitpunkt erlaubt. Die Abmeldung darf auch unbegrenzt erlaubt bleiben.
|
||||||
@ -2664,4 +2671,4 @@ SubmissionDoneNever: Nie
|
|||||||
SubmissionDoneByFile: Je nach Bewertungsdatei
|
SubmissionDoneByFile: Je nach Bewertungsdatei
|
||||||
SubmissionDoneAlways: Immer
|
SubmissionDoneAlways: Immer
|
||||||
CorrUploadSubmissionDoneMode: Bewertung abgeschlossen
|
CorrUploadSubmissionDoneMode: Bewertung abgeschlossen
|
||||||
CorrUploadSubmissionDoneModeTip: Sollen hochgeladene Korrekturen als abgeschlossen markiert werden? Bewertungen sind erst für Studierende sichtbar und zählen gegen Examboni, wenn sie abgeschlossen sind.
|
CorrUploadSubmissionDoneModeTip: Sollen hochgeladene Korrekturen als abgeschlossen markiert werden? Bewertungen sind erst für Studierende sichtbar und zählen gegen Examboni, wenn sie abgeschlossen sind.
|
||||||
|
|||||||
@ -53,6 +53,9 @@ RegisterTo: Enrolment ends
|
|||||||
DeRegUntil: Deregistration until
|
DeRegUntil: Deregistration until
|
||||||
RegisterRetry: You haven't been enrolled. Press "Enrol for course" to enrol
|
RegisterRetry: You haven't been enrolled. Press "Enrol for course" to enrol
|
||||||
|
|
||||||
|
CourseVisibleFrom: Visible from
|
||||||
|
CourseVisibleTo: Visible to
|
||||||
|
|
||||||
CourseRegistrationInterval: Enrolment
|
CourseRegistrationInterval: Enrolment
|
||||||
CourseDirectRegistrationInterval: Direct enrolment
|
CourseDirectRegistrationInterval: Direct enrolment
|
||||||
CourseDeregisterUntil time: Deregistration only until #{time}
|
CourseDeregisterUntil time: Deregistration only until #{time}
|
||||||
@ -112,6 +115,8 @@ CourseNoCapacity: Course has reached maximum capacity
|
|||||||
TutorialNoCapacity: Tutorial has reached maximum capacity
|
TutorialNoCapacity: Tutorial has reached maximum capacity
|
||||||
ExamOccurrenceNoCapacity: Occurrence/Room has reached maximum capacity
|
ExamOccurrenceNoCapacity: Occurrence/Room has reached maximum capacity
|
||||||
CourseNotEmpty: There are currently no participants enrolled for this course.
|
CourseNotEmpty: There are currently no participants enrolled for this course.
|
||||||
|
CourseVisibility: Visibility
|
||||||
|
CourseInvisible: This course is currently invisible. TODO
|
||||||
CourseRegistration: Enrolment
|
CourseRegistration: Enrolment
|
||||||
CourseRegisterOpen: Enrolment is allowed
|
CourseRegisterOpen: Enrolment is allowed
|
||||||
CourseRegisterOk: Successfully enrolled for course
|
CourseRegisterOk: Successfully enrolled for course
|
||||||
@ -158,6 +163,8 @@ CourseSchoolShort: Department
|
|||||||
CourseSchoolMultipleTip: You may select from among multiple departments. Please ensure that you select the appropriate department for your course.
|
CourseSchoolMultipleTip: You may select from among multiple departments. Please ensure that you select the appropriate department for your course.
|
||||||
CourseSecretTip: Enrollment for this course will require the password, if set
|
CourseSecretTip: Enrollment for this course will require the password, if set
|
||||||
CourseSecretFormat: Arbitrary string
|
CourseSecretFormat: Arbitrary string
|
||||||
|
CourseVisibleFromTip: Other users will only be able to see the course from this date onward. When left empty nobody except administrators of this course will be able to see the course.
|
||||||
|
CourseVisibleToTip: Other users will be able to see the course from "Visible From" up to this date. When left empty visible courses will remain visible indefinitely.
|
||||||
CourseRegisterFromTip: When left empty students will not be able to enrol themselves
|
CourseRegisterFromTip: When left empty students will not be able to enrol themselves
|
||||||
CourseRegisterToTip: May be left empty to allow enrolment indefinitely
|
CourseRegisterToTip: May be left empty to allow enrolment indefinitely
|
||||||
CourseDeregisterUntilTip: Participants may deregister from immediately after registration starts up to this time. May be left empty to allow deregistration indefinitely.
|
CourseDeregisterUntilTip: Participants may deregister from immediately after registration starts up to this time. May be left empty to allow deregistration indefinitely.
|
||||||
|
|||||||
@ -12,6 +12,8 @@ Course -- Information about a single course; contained info is always visible
|
|||||||
school SchoolId
|
school SchoolId
|
||||||
capacity Int Maybe -- number of allowed enrolements, if restricted
|
capacity Int Maybe -- number of allowed enrolements, if restricted
|
||||||
-- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo
|
-- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo
|
||||||
|
visibleFrom UTCTime Maybe default=now() -- course may be visible from a given day onwards or always hidden
|
||||||
|
visibleTo UTCTime Maybe -- course may be hidden from a given date onwards
|
||||||
registerFrom UTCTime Maybe -- enrolement allowed from a given day onwwards or prohibited
|
registerFrom UTCTime Maybe -- enrolement allowed from a given day onwwards or prohibited
|
||||||
registerTo UTCTime Maybe -- enrolement may be prohibited from a given date onwards
|
registerTo UTCTime Maybe -- enrolement may be prohibited from a given date onwards
|
||||||
deregisterUntil UTCTime Maybe -- unenrolement may be prohibited from a given date onwards
|
deregisterUntil UTCTime Maybe -- unenrolement may be prohibited from a given date onwards
|
||||||
|
|||||||
3
package-lock.json
generated
3
package-lock.json
generated
@ -10943,8 +10943,7 @@
|
|||||||
"lodash.debounce": {
|
"lodash.debounce": {
|
||||||
"version": "4.0.8",
|
"version": "4.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
||||||
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
|
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"lodash.defaults": {
|
"lodash.defaults": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
|
|||||||
@ -46,6 +46,8 @@ data CourseForm = CourseForm
|
|||||||
, cfAppRatingsVisible :: Bool
|
, cfAppRatingsVisible :: Bool
|
||||||
, cfCapacity :: Maybe Int
|
, cfCapacity :: Maybe Int
|
||||||
, cfSecret :: Maybe Text
|
, cfSecret :: Maybe Text
|
||||||
|
, cfVisFrom :: Maybe UTCTime
|
||||||
|
, cfVisTo :: Maybe UTCTime
|
||||||
, cfRegFrom :: Maybe UTCTime
|
, cfRegFrom :: Maybe UTCTime
|
||||||
, cfRegTo :: Maybe UTCTime
|
, cfRegTo :: Maybe UTCTime
|
||||||
, cfDeRegUntil :: Maybe UTCTime
|
, cfDeRegUntil :: Maybe UTCTime
|
||||||
@ -77,6 +79,8 @@ courseToForm cEnt@(Entity cid Course{..}) lecs lecInvites alloc = CourseForm
|
|||||||
, cfAppText = courseApplicationsText
|
, cfAppText = courseApplicationsText
|
||||||
, cfAppFiles = courseApplicationsFiles
|
, cfAppFiles = courseApplicationsFiles
|
||||||
, cfAppRatingsVisible = courseApplicationsRatingsVisible
|
, cfAppRatingsVisible = courseApplicationsRatingsVisible
|
||||||
|
, cfVisFrom = courseVisibleFrom
|
||||||
|
, cfVisTo = courseVisibleTo
|
||||||
, cfRegFrom = courseRegisterFrom
|
, cfRegFrom = courseRegisterFrom
|
||||||
, cfRegTo = courseRegisterTo
|
, cfRegTo = courseRegisterTo
|
||||||
, cfDeRegUntil = courseDeregisterUntil
|
, cfDeRegUntil = courseDeregisterUntil
|
||||||
@ -286,6 +290,10 @@ makeCourseForm miButtonAction template = identifyForm FIDcourse . validateFormDB
|
|||||||
& setTooltip MsgCourseCapacityTip) (cfCapacity <$> template)
|
& setTooltip MsgCourseCapacityTip) (cfCapacity <$> template)
|
||||||
<*> aopt (textField & cfStrip) (fslpI MsgCourseSecret (mr MsgCourseSecretFormat)
|
<*> aopt (textField & cfStrip) (fslpI MsgCourseSecret (mr MsgCourseSecretFormat)
|
||||||
& setTooltip MsgCourseSecretTip) (cfSecret <$> template)
|
& setTooltip MsgCourseSecretTip) (cfSecret <$> template)
|
||||||
|
<*> aopt utcTimeField (fslpI MsgCourseVisibleFrom (mr MsgDate)
|
||||||
|
& setTooltip MsgCourseVisibleFromTip) (cfVisFrom <$> template)
|
||||||
|
<*> aopt utcTimeField (fslpI MsgCourseVisibleTo (mr MsgDate)
|
||||||
|
& setTooltip MsgCourseVisibleToTip) (cfVisTo <$> template)
|
||||||
<*> aopt utcTimeField (fslpI MsgRegisterFrom (mr MsgDate)
|
<*> aopt utcTimeField (fslpI MsgRegisterFrom (mr MsgDate)
|
||||||
& setTooltip MsgCourseRegisterFromTip) (deepAlt (cfRegFrom <$> template) newRegFrom)
|
& setTooltip MsgCourseRegisterFromTip) (deepAlt (cfRegFrom <$> template) newRegFrom)
|
||||||
<*> aopt utcTimeField (fslpI MsgRegisterTo (mr MsgDate)
|
<*> aopt utcTimeField (fslpI MsgRegisterTo (mr MsgDate)
|
||||||
@ -456,6 +464,8 @@ courseEditHandler miButtonAction mbCourseForm = do
|
|||||||
, courseApplicationsText = cfAppText
|
, courseApplicationsText = cfAppText
|
||||||
, courseApplicationsFiles = cfAppFiles
|
, courseApplicationsFiles = cfAppFiles
|
||||||
, courseApplicationsRatingsVisible = cfAppRatingsVisible
|
, courseApplicationsRatingsVisible = cfAppRatingsVisible
|
||||||
|
, courseVisibleFrom = cfVisFrom
|
||||||
|
, courseVisibleTo = cfVisTo
|
||||||
, courseRegisterFrom = cfRegFrom
|
, courseRegisterFrom = cfRegFrom
|
||||||
, courseRegisterTo = cfRegTo
|
, courseRegisterTo = cfRegTo
|
||||||
, courseDeregisterUntil = cfDeRegUntil
|
, courseDeregisterUntil = cfDeRegUntil
|
||||||
@ -504,6 +514,8 @@ courseEditHandler miButtonAction mbCourseForm = do
|
|||||||
, courseApplicationsText = cfAppText
|
, courseApplicationsText = cfAppText
|
||||||
, courseApplicationsFiles = cfAppFiles
|
, courseApplicationsFiles = cfAppFiles
|
||||||
, courseApplicationsRatingsVisible = cfAppRatingsVisible
|
, courseApplicationsRatingsVisible = cfAppRatingsVisible
|
||||||
|
, courseVisibleFrom = cfVisFrom
|
||||||
|
, courseVisibleTo = cfVisTo
|
||||||
, courseRegisterFrom = cfRegFrom
|
, courseRegisterFrom = cfRegFrom
|
||||||
, courseRegisterTo = cfRegTo
|
, courseRegisterTo = cfRegTo
|
||||||
, courseDeregisterUntil = cfDeRegUntil
|
, courseDeregisterUntil = cfDeRegUntil
|
||||||
|
|||||||
@ -219,6 +219,7 @@ getCShowR tid ssh csh = do
|
|||||||
hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events
|
hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events
|
||||||
mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR
|
mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR
|
||||||
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
|
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
|
||||||
|
mayEditCourse <- hasWriteAccessTo $ CourseR tid ssh csh CEditR
|
||||||
|
|
||||||
siteLayout (toWgt $ courseName course) $ do
|
siteLayout (toWgt $ courseName course) $ do
|
||||||
setTitleI $ prependCourseTitle tid ssh csh (""::Text)
|
setTitleI $ prependCourseTitle tid ssh csh (""::Text)
|
||||||
|
|||||||
@ -116,6 +116,7 @@ $# #{summary}
|
|||||||
<a href=#{link} target="_blank" rel="noopener" title="_{MsgCourseHomepageExternal}">
|
<a href=#{link} target="_blank" rel="noopener" title="_{MsgCourseHomepageExternal}">
|
||||||
#{iconLink}
|
#{iconLink}
|
||||||
\ #{link}
|
\ #{link}
|
||||||
|
|
||||||
$# $if NTop (Just 0) < NTop (courseCapacity course)
|
$# $if NTop (Just 0) < NTop (courseCapacity course)
|
||||||
<dt .deflist__dt>_{MsgCourseParticipantsHeading}
|
<dt .deflist__dt>_{MsgCourseParticipantsHeading}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
@ -123,6 +124,20 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
|||||||
_{MsgCourseParticipantsCountOf participants capacity}
|
_{MsgCourseParticipantsCountOf participants capacity}
|
||||||
$nothing
|
$nothing
|
||||||
_{MsgCourseParticipantsCount participants}
|
_{MsgCourseParticipantsCount participants}
|
||||||
|
|
||||||
|
$if mayEditCourse
|
||||||
|
<dt .deflist__dt>
|
||||||
|
$if isJust (courseVisibleTo course)
|
||||||
|
_{MsgCourseVisibility}
|
||||||
|
$else
|
||||||
|
_{MsgCourseVisibleFrom}
|
||||||
|
<dd .deflist__dd>
|
||||||
|
$maybe visFrom <- courseVisibleFrom course
|
||||||
|
<p>
|
||||||
|
^{formatTimeRangeW SelFormatDateTime visFrom (courseVisibleTo course)}
|
||||||
|
$nothing
|
||||||
|
_{MsgCourseInvisible}
|
||||||
|
|
||||||
$maybe (Allocation{allocationName, allocationRegisterByCourse}, url) <- mAllocation'
|
$maybe (Allocation{allocationName, allocationRegisterByCourse}, url) <- mAllocation'
|
||||||
<dt .deflist__dt>_{MsgCourseAllocation}
|
<dt .deflist__dt>_{MsgCourseAllocation}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
@ -148,6 +163,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
|||||||
$maybe dereg <- mDereg
|
$maybe dereg <- mDereg
|
||||||
<p .emph>
|
<p .emph>
|
||||||
_{MsgCourseDeregisterUntil dereg}
|
_{MsgCourseDeregisterUntil dereg}
|
||||||
|
|
||||||
$maybe aInst <- courseApplicationsInstructions course
|
$maybe aInst <- courseApplicationsInstructions course
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
$if courseApplicationsRequired course
|
$if courseApplicationsRequired course
|
||||||
@ -189,6 +205,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
|||||||
$nothing
|
$nothing
|
||||||
<i>
|
<i>
|
||||||
_{MsgNoSubmissionGroup}
|
_{MsgNoSubmissionGroup}
|
||||||
|
|
||||||
$if registrationOpen || isJust registration
|
$if registrationOpen || isJust registration
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgCourseRegistration}
|
_{MsgCourseRegistration}
|
||||||
@ -210,6 +227,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
|||||||
$if isJust registration
|
$if isJust registration
|
||||||
<p>
|
<p>
|
||||||
_{MsgCourseRegistrationDeleteToEdit}
|
_{MsgCourseRegistrationDeleteToEdit}
|
||||||
|
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgCourseMaterial}
|
_{MsgCourseMaterial}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
@ -217,6 +235,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
|||||||
_{MsgCourseMaterialFree}
|
_{MsgCourseMaterialFree}
|
||||||
$else
|
$else
|
||||||
_{MsgCourseMaterialNotFree}
|
_{MsgCourseMaterialNotFree}
|
||||||
|
|
||||||
$if hasExams
|
$if hasExams
|
||||||
<dt .deflist__dt>_{MsgCourseExams}
|
<dt .deflist__dt>_{MsgCourseExams}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
|
|||||||
Reference in New Issue
Block a user