diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index cd834709b..8722255db 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -809,7 +809,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences return (user, Just occId) -deregisterExamUsersCount :: (MonadIO m, HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m Int64 +deregisterExamUsersCount :: (HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m Int64 deregisterExamUsersCount eId uids = do partResults <- E.select . E.from $ \(examPart `E.InnerJoin` examPartResult) -> do E.on $ examPart E.^. ExamPartId E.==. examPartResult E.^. ExamPartResultExamPart @@ -836,7 +836,7 @@ deregisterExamUsersCount eId uids = do audit $ TransactionExamDeregister examRegistrationExam examRegistrationUser return 1 -deregisterExamUsers :: (MonadIO m, HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m () +deregisterExamUsers :: (HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m () deregisterExamUsers eId uids = void $ deregisterExamUsersCount eId uids diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index f992e76d8..fccac61b2 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -172,6 +172,8 @@ data ButtonSubmitDelete = BtnSubmit' | BtnDelete' instance Universe ButtonSubmitDelete instance Finite ButtonSubmitDelete +nullaryPathPiece ''ButtonSubmitDelete $ camelToPathPiece' 1 . dropSuffix "'" + embedRenderMessage ''UniWorX ''ButtonSubmitDelete $ dropSuffix "'" instance Button UniWorX ButtonSubmitDelete where btnClasses BtnSubmit' = [BCIsButton, BCPrimary] @@ -180,8 +182,6 @@ instance Button UniWorX ButtonSubmitDelete where btnValidate _ BtnSubmit' = True btnValidate _ BtnDelete' = False -nullaryPathPiece ''ButtonSubmitDelete $ camelToPathPiece' 1 . dropSuffix "'" - -- | Looks like a button, but is just a link (e.g. for create course, etc.) linkButton :: Widget -- ^ Widget to display if unauthorized diff --git a/src/Handler/Utils/Form/MassInput.hs b/src/Handler/Utils/Form/MassInput.hs index 7e5d5e7dd..2f409142f 100644 --- a/src/Handler/Utils/Form/MassInput.hs +++ b/src/Handler/Utils/Form/MassInput.hs @@ -127,11 +127,11 @@ newtype BoundedPosition coord = BoundedPosition { unBoundedPosition :: coord } deriving (Eq, Ord, Generic, Read, Show) makeWrapped ''BoundedPosition -instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord, Ord coord) => IsBoxCoord (BoundedPosition coord) where +instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord) => IsBoxCoord (BoundedPosition coord) where boxDimensions = [BoxDimension _Wrapped] boxOrigin = minBound' -instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord, Ord coord) => Liveliness (BoundedLiveliness coord) where +instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord) => Liveliness (BoundedLiveliness coord) where type BoxCoord (BoundedLiveliness coord) = BoundedPosition coord liveCoords = iso (Set.mapMonotonic $ view _Wrapped) (Set.mapMonotonic $ view _Unwrapped) . _Unwrapped diff --git a/src/Handler/Utils/Invitations.hs b/src/Handler/Utils/Invitations.hs index c7f567fe3..adcda4cb9 100644 --- a/src/Handler/Utils/Invitations.hs +++ b/src/Handler/Utils/Invitations.hs @@ -45,6 +45,7 @@ class ( PersistRecordBackend junction (YesodPersistBackend UniWorX) , Eq (InvitationDBData junction) , PersistRecordBackend (InvitationFor junction) (YesodPersistBackend UniWorX) , Typeable junction + , SafeToInsert junction ) => IsInvitableJunction junction where -- | One side of the junction is always `User`; `InvitationFor junction` is the other type InvitationFor junction :: Type