chore: display unrestricted rooms as "-"
This commit is contained in:
parent
7e425754fc
commit
1c24b8e5e2
@ -113,7 +113,7 @@ postEAutoOccurrenceR tid ssh csh examn = do
|
|||||||
let participants' = Map.fromList $ do
|
let participants' = Map.fromList $ do
|
||||||
(Entity uid userRec, Entity _ ExamRegistration{..}) <- participants
|
(Entity uid userRec, Entity _ ExamRegistration{..}) <- participants
|
||||||
return (uid, (userRec, examRegistrationOccurrence))
|
return (uid, (userRec, examRegistrationOccurrence))
|
||||||
occurrences' = Map.fromList $ map (\(Entity eoId ExamOccurrence{..}) -> (eoId, fromIntegral examOccurrenceCapacity)) occurrences
|
occurrences' = Map.fromList $ map (\(Entity eoId ExamOccurrence{..}) -> (eoId, view (from _examOccurrenceCapacityIso) $ fromIntegral <$> examOccurrenceCapacity)) occurrences
|
||||||
autoOccurrenceResult = examAutoOccurrence eId examOccurrenceRule eaofConfig occurrences' participants'
|
autoOccurrenceResult = examAutoOccurrence eId examOccurrenceRule eaofConfig occurrences' participants'
|
||||||
(eaofMapping, eaofAssignment) <- case autoOccurrenceResult of
|
(eaofMapping, eaofAssignment) <- case autoOccurrenceResult of
|
||||||
(Left e) -> do
|
(Left e) -> do
|
||||||
@ -165,8 +165,10 @@ postEAutoOccurrenceR tid ssh csh examn = do
|
|||||||
occMappingRule = examOccurrenceMappingRule eaofMapping
|
occMappingRule = examOccurrenceMappingRule eaofMapping
|
||||||
|
|
||||||
loadProp curr max'
|
loadProp curr max'
|
||||||
| max' /= 0 = MsgProportion (toMessage curr) (toMessage max') (toRational curr / toRational max')
|
| Just max'' <- max', max'' /= 0
|
||||||
| otherwise = MsgProportionNoRatio (toMessage curr) (toMessage max')
|
= MsgProportion (toMessage curr) (toMessage max'') (toRational curr / toRational max'')
|
||||||
|
| otherwise
|
||||||
|
= MsgProportionNoRatio (toMessage curr) $ maybe "-" toMessage max'
|
||||||
|
|
||||||
occMapping occId = examOccurrenceMappingDescriptionWidget occMappingRule <$> Map.lookup occId (examOccurrenceMappingMapping eaofMapping)
|
occMapping occId = examOccurrenceMappingDescriptionWidget occMappingRule <$> Map.lookup occId (examOccurrenceMappingMapping eaofMapping)
|
||||||
in $(widgetFile "widgets/exam-occurrence-mapping")
|
in $(widgetFile "widgets/exam-occurrence-mapping")
|
||||||
|
|||||||
Reference in New Issue
Block a user