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
btnLabel BtnCourseFavouriteToggleManual = toWidget iconCourseFavouriteManual
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]
@ -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
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 tid ssh csh = do
mbAid <- maybeAuthId
@ -318,6 +324,7 @@ getCShowR tid ssh csh = do
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
mayEdit <- hasWriteAccessTo $ CourseR tid ssh csh CEditR
-- TODO use different style for button (neutral background?)
let favouriteReason = case favouriteReason' of
-- (reason, blacklist)
(Just (_reason, True)) -> Nothing

View File

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