chore: use star icons

This commit is contained in:
Wolfgang Witt 2021-04-06 16:41:33 +02:00 committed by Gregor Kleen
parent ebe676d39d
commit ad6671ed10
2 changed files with 12 additions and 5 deletions

View File

@ -40,7 +40,14 @@ nullaryPathPiece ''CourseFavouriteToggleButton $ camelToPathPiece' 4
instance Button UniWorX CourseFavouriteToggleButton where instance Button UniWorX CourseFavouriteToggleButton where
btnLabel BtnCourseFavouriteToggleManual = toWidget iconCourseFavouriteManual btnLabel BtnCourseFavouriteToggleManual = toWidget iconCourseFavouriteManual
btnLabel BtnCourseFavouriteToggleAutomatic = toWidget iconCourseFavouriteAutomatic btnLabel BtnCourseFavouriteToggleAutomatic = toWidget iconCourseFavouriteAutomatic
btnLabel BtnCourseFavouriteToggleOff = toWidget iconCourseFavouriteOff btnLabel BtnCourseFavouriteToggleOff = [whamlet|
$newline never
<span .fa-stack .fa-xs>
<i .fa-stack-1x>
^{iconCourseFavouriteManual}
<i .fa-stack-2x>
^{iconCourseFavouriteOff}
|]
btnClasses _ = [BCIsButton] btnClasses _ = [BCIsButton]
@ -80,7 +87,6 @@ storedFavouriteReason tid ssh csh muid = fmap unValueFirst . E.select . E.from $
-- `over each E.unValue` doesn't work here, since E.unValue is monomorphised -- `over each E.unValue` doesn't work here, since E.unValue is monomorphised
unValueFirst = fmap (over _1 E.unValue . over _2 E.unValue) . listToMaybe unValueFirst = fmap (over _1 E.unValue . over _2 E.unValue) . listToMaybe
-- TODO add toggle Manual favorite Icon here
getCShowR :: TermId -> SchoolId -> CourseShorthand -> Handler Html getCShowR :: TermId -> SchoolId -> CourseShorthand -> Handler Html
getCShowR tid ssh csh = do getCShowR tid ssh csh = do
mbAid <- maybeAuthId mbAid <- maybeAuthId
@ -318,6 +324,7 @@ getCShowR tid ssh csh = do
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
mayEdit <- hasWriteAccessTo $ CourseR tid ssh csh CEditR mayEdit <- hasWriteAccessTo $ CourseR tid ssh csh CEditR
-- TODO use different style for button (neutral background?)
let favouriteReason = case favouriteReason' of let favouriteReason = case favouriteReason' of
-- (reason, blacklist) -- (reason, blacklist)
(Just (_reason, True)) -> Nothing (Just (_reason, True)) -> Nothing

View File

@ -112,9 +112,9 @@ iconText = \case
IconInvisible -> "eye-slash" IconInvisible -> "eye-slash"
IconCourse -> "graduation-cap" IconCourse -> "graduation-cap"
-- TODO find better Icons: https://fontawesome.com/icons?d=gallery&p=2&s=solid -- TODO find better Icons: https://fontawesome.com/icons?d=gallery&p=2&s=solid
IconCourseFavouriteManual -> "battery-full" IconCourseFavouriteManual -> "star"
IconCourseFavouriteAutomatic -> "battery-half" IconCourseFavouriteAutomatic -> "star-half-alt"
IconCourseFavouriteOff -> "battery-slash" IconCourseFavouriteOff -> "slash"
IconEnrolTrue -> "user-plus" IconEnrolTrue -> "user-plus"
IconEnrolFalse -> "user-slash" IconEnrolFalse -> "user-slash"
IconPlanned -> "cog" IconPlanned -> "cog"