sheet list icons cleaned
This commit is contained in:
parent
7cda3e9f2e
commit
e712552397
@ -194,7 +194,7 @@ getSheetListR tid ssh csh = do
|
|||||||
, sortable (Just "visible-from") (i18nCell MsgAccessibleSince)
|
, sortable (Just "visible-from") (i18nCell MsgAccessibleSince)
|
||||||
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, _)} -> foldMap (dateTimeCellVisible now) sheetVisibleFrom
|
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, _)} -> foldMap (dateTimeCellVisible now) sheetVisibleFrom
|
||||||
, sortable (toNothing "downloads") (i18nCell MsgFiles)
|
, sortable (toNothing "downloads") (i18nCell MsgFiles)
|
||||||
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, existFiles)} -> mconcat
|
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, existFiles)} -> listCell
|
||||||
[ icnCell & addIconFixedWidth
|
[ icnCell & addIconFixedWidth
|
||||||
| let existingSFTs = hasSFT existFiles
|
| let existingSFTs = hasSFT existFiles
|
||||||
, sft <- [minBound..maxBound]
|
, sft <- [minBound..maxBound]
|
||||||
@ -203,7 +203,7 @@ getSheetListR tid ssh csh = do
|
|||||||
, let icnCell = if sft `elem` existingSFTs
|
, let icnCell = if sft `elem` existingSFTs
|
||||||
then linkEmptyCell link icn
|
then linkEmptyCell link icn
|
||||||
else spacerCell
|
else spacerCell
|
||||||
]
|
] id & cellAttrs <>~ [("class","list--inline list--space-separated")]
|
||||||
, sortable (Just "submission-since") (i18nCell MsgSheetActiveFrom)
|
, sortable (Just "submission-since") (i18nCell MsgSheetActiveFrom)
|
||||||
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, _)} -> dateTimeCell sheetActiveFrom
|
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, _, _)} -> dateTimeCell sheetActiveFrom
|
||||||
, sortable (Just "submission-until") (i18nCell MsgSheetActiveTo)
|
, sortable (Just "submission-until") (i18nCell MsgSheetActiveTo)
|
||||||
|
|||||||
36
src/Utils.hs
36
src/Utils.hs
@ -123,33 +123,39 @@ type WidgetSiteless = forall site. forall m. (MonadIO m, MonadThrow m, MonadBase
|
|||||||
-- Icons --
|
-- Icons --
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
-- Create an icon from font-awesome without additional space
|
||||||
|
fontAwesomeIcon :: Text -> Markup
|
||||||
|
fontAwesomeIcon iconName =
|
||||||
|
[shamlet|$newline never
|
||||||
|
<i .fas .fa-#{iconName}>|]
|
||||||
|
|
||||||
-- We collect all used icons here for an overview.
|
-- We collect all used icons here for an overview.
|
||||||
-- For consistency, some conditional icons are also provided, e.g. `isIvisble`
|
-- For consistency, some conditional icons are also provided, e.g. `isIvisble`
|
||||||
|
|
||||||
iconQuestion :: Markup
|
iconQuestion :: Markup
|
||||||
iconQuestion = [shamlet|<i .fas .fa-question-circle>|]
|
iconQuestion = fontAwesomeIcon "question-circle"
|
||||||
|
|
||||||
iconHint :: Markup
|
iconHint :: Markup
|
||||||
iconHint = [shamlet|<i .fas .fa-life-ring>|]
|
iconHint = fontAwesomeIcon "life-ring"
|
||||||
|
|
||||||
iconSolution :: Markup
|
iconSolution :: Markup
|
||||||
iconSolution = [shamlet|<i .fas .fa-exclamation-circle>|]
|
iconSolution =fontAwesomeIcon "exclamation-circle"
|
||||||
|
|
||||||
iconMarking :: Markup
|
iconMarking :: Markup
|
||||||
iconMarking = [shamlet|<i .fas .fa-check-circle>|]
|
iconMarking = fontAwesomeIcon "check-circle"
|
||||||
|
|
||||||
fileDownload :: Markup
|
fileDownload :: Markup
|
||||||
fileDownload = [shamlet|<i .fas .fa-file-download>|]
|
fileDownload = fontAwesomeIcon "file-download"
|
||||||
|
|
||||||
zipDownload :: Markup
|
zipDownload :: Markup
|
||||||
zipDownload = [shamlet|<i .fas .fa-file-archive>|]
|
zipDownload = fontAwesomeIcon "file-archive"
|
||||||
|
|
||||||
-- Conditional icons
|
-- Conditional icons
|
||||||
|
|
||||||
isVisible :: Bool -> Markup
|
isVisible :: Bool -> Markup
|
||||||
-- ^ Display an icon that denotes that something™ is visible or invisible
|
-- ^ Display an icon that denotes that something™ is visible or invisible
|
||||||
isVisible True = [shamlet|<i .fas .fa-eye>|]
|
isVisible True = fontAwesomeIcon "eye"
|
||||||
isVisible False = [shamlet|<i .fas .fa-eye-slash>|]
|
isVisible False = fontAwesomeIcon "eye-slash"
|
||||||
--
|
--
|
||||||
-- For documentation on how to avoid these unneccessary functions
|
-- For documentation on how to avoid these unneccessary functions
|
||||||
-- we implement them here just once for the first icon:
|
-- we implement them here just once for the first icon:
|
||||||
@ -165,26 +171,26 @@ maybeIsVisibleWidget = toWidget . foldMap isVisible
|
|||||||
-- Other _frequently_ used icons:
|
-- Other _frequently_ used icons:
|
||||||
hasComment :: Bool -> Markup
|
hasComment :: Bool -> Markup
|
||||||
-- ^ Display an icon that denotes that something™ has a comment or not
|
-- ^ Display an icon that denotes that something™ has a comment or not
|
||||||
hasComment True = [shamlet|<i .fas .fa-comment-alt>|]
|
hasComment True = fontAwesomeIcon "comment-alt"
|
||||||
hasComment False = [shamlet|<i .fas .fa-comment-slash>|] -- comment-alt-slash is not available for free
|
hasComment False = fontAwesomeIcon "comment-slash" -- comment-alt-slash is not available for free
|
||||||
|
|
||||||
hasTickmark :: Bool -> Markup
|
hasTickmark :: Bool -> Markup
|
||||||
-- ^ Display an icon that denotes that something™ is okay
|
-- ^ Display an icon that denotes that something™ is okay
|
||||||
hasTickmark True = [shamlet|<i .fas .fa-check>|]
|
hasTickmark True = fontAwesomeIcon "check"
|
||||||
hasTickmark False = mempty
|
hasTickmark False = mempty
|
||||||
|
|
||||||
isBad :: Bool -> Markup
|
isBad :: Bool -> Markup
|
||||||
-- ^ Display an icon that denotes that something™ is bad
|
-- ^ Display an icon that denotes that something™ is bad
|
||||||
isBad True = [shamlet|<i .fas .fa-bolt>|] -- or times?!
|
isBad True = fontAwesomeIcon "bolt" -- or times?!
|
||||||
isBad False = mempty
|
isBad False = mempty
|
||||||
|
|
||||||
isNew :: Bool -> Markup
|
isNew :: Bool -> Markup
|
||||||
isNew True = [shamlet|<i .fas .fa-seedling>|] -- was exclamation
|
isNew True = fontAwesomeIcon "seedling" -- was exclamation
|
||||||
isNew False = mempty
|
isNew False = mempty
|
||||||
|
|
||||||
boolSymbol :: Bool -> Markup
|
boolSymbol :: Bool -> Markup
|
||||||
boolSymbol True = [shamlet|<i .fas .fa-check>|]
|
boolSymbol True = fontAwesomeIcon "check"
|
||||||
boolSymbol False = [shamlet|<i .fas .fa-times>|]
|
boolSymbol False = fontAwesomeIcon "times"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -465,6 +465,17 @@ ul.list--inline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.list--space-separated li {
|
||||||
|
&::after {
|
||||||
|
content: ' ';
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-of-type::after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* DEFINITION LIST */
|
/* DEFINITION LIST */
|
||||||
.deflist {
|
.deflist {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
$newline never
|
$newline never
|
||||||
<a href=@{route}>
|
<a href=@{route}>
|
||||||
^{widget}
|
^{widget}
|
||||||
Reference in New Issue
Block a user