chore(lms): minor fix reset tries conditions
This commit is contained in:
parent
1b668c7b28
commit
da26901f8b
@ -726,8 +726,9 @@ postLmsR sid qsh = do
|
||||
forM_ shortUsers $ upsertQualificationUser qid nowaday cutoff Nothing
|
||||
|
||||
fromIntegral <$> (if isReset
|
||||
then updateWhereCount [LmsUserQualification ==. qid, LmsUserUser <-. usersList] [LmsUserResetTries =. True]
|
||||
else deleteWhereCount [LmsUserQualification ==. qid, LmsUserUser <-. usersList]
|
||||
then updateWhereCount ([LmsUserQualification ==. qid, LmsUserUser <-. usersList, LmsUserResetTries ==. False, LmsUserLocked ==. True]
|
||||
++ ([LmsUserStatus ==. Just LmsBlocked] ||. [LmsUserStatus ==. Just LmsExpired])) [LmsUserResetTries =. True]
|
||||
else deleteWhereCount [LmsUserQualification ==. qid, LmsUserUser <-. usersList]
|
||||
)
|
||||
|
||||
unless isReset $
|
||||
|
||||
@ -249,27 +249,27 @@ lmsUserStatusWidget isAdmin luser
|
||||
lmsUserStatusWidgetAux _ LmsUser{lmsUserStatus=Just lStat, lmsUserStatusDay=Just aday} =
|
||||
[whamlet|$newline never
|
||||
^{formatTimeW SelFormatDate aday}
|
||||
\ ^{icon (lmsStatusIcon lStat)}
|
||||
\ ^{iconFixed (lmsStatusIcon lStat)}
|
||||
|]
|
||||
-- previously: IconWaitingForUser for lmsUserStatus==Nothing
|
||||
lmsUserStatusWidgetAux _ LmsUser{lmsUserNotified=Just d} =
|
||||
[whamlet|$newline never
|
||||
^{formatTimeW SelFormatDate d}
|
||||
\ ^{icon IconNotificationSent}
|
||||
\ ^{iconFixed IconNotificationSent}
|
||||
|]
|
||||
lmsUserStatusWidgetAux True LmsUser{lmsUserStarted} = -- E-Learning started, but not yet notified; only intended for Admins
|
||||
[whamlet|$newline never
|
||||
^{formatTimeW SelFormatDate lmsUserStarted}
|
||||
\ ^{icon IconPlanned}
|
||||
\ ^{iconFixed IconPlanned}
|
||||
|]
|
||||
lmsUserStatusWidgetAux _ _ = mempty
|
||||
|
||||
lockIcon
|
||||
| lmsUserLocked luser == lmsUserToLock luser = mempty
|
||||
| lmsUserLocked luser = icon IconLocked
|
||||
| otherwise = icon IconUnlocked
|
||||
| lmsUserLocked luser = iconFixed IconLocked
|
||||
| otherwise = iconFixed IconUnlocked
|
||||
|
||||
resetIcon
|
||||
| lmsUserResetTries luser = icon IconUndo
|
||||
| lmsUserResetTries luser = iconFixed IconUndo
|
||||
| otherwise = mempty
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user