mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48:26 +00:00
Introduce fomantic-ui, replacing semantic-ui
Replaced semantic-ui with the drop-in replacement fomantic-ui [0] which is a maintained fork. The fomantic-ui used here is a custom build [1] of the less-version _without_ google-fonts (css-only). The javascript part of fomantic-ui is not used, and also jquery could be dropped now. [0] https://fomantic-ui.com [1] https://github.com/eikek/fomantic-slim-default Issue: #349
This commit is contained in:
63
modules/webapp/src/main/elm/Comp/Progress.elm
Normal file
63
modules/webapp/src/main/elm/Comp/Progress.elm
Normal file
@ -0,0 +1,63 @@
|
||||
module Comp.Progress exposing
|
||||
( smallIndicating
|
||||
, topAttachedIndicating
|
||||
)
|
||||
|
||||
import Html exposing (Html, div, text)
|
||||
import Html.Attributes exposing (attribute, class, style)
|
||||
|
||||
|
||||
smallIndicating : Int -> Html msg
|
||||
smallIndicating percent =
|
||||
progress "small indicating active" percent Nothing Nothing
|
||||
|
||||
|
||||
topAttachedIndicating : Int -> Html msg
|
||||
topAttachedIndicating percent =
|
||||
progress "top attached indicating active" percent Nothing Nothing
|
||||
|
||||
|
||||
progress : String -> Int -> Maybe String -> Maybe String -> Html msg
|
||||
progress classes percent label barText =
|
||||
if percent <= 0 then
|
||||
div
|
||||
[ class ("ui progress " ++ classes)
|
||||
]
|
||||
(div [ class "bar" ] (barDiv barText) :: labelDiv label)
|
||||
|
||||
else
|
||||
div
|
||||
[ class ("ui progress " ++ classes)
|
||||
, attribute "data-percent" (String.fromInt percent)
|
||||
]
|
||||
(div
|
||||
[ class "bar"
|
||||
, style "transition-duration" "300ms"
|
||||
, style "display" "block"
|
||||
, style "width" (String.fromInt percent ++ "%")
|
||||
]
|
||||
(barDiv barText)
|
||||
:: labelDiv label
|
||||
)
|
||||
|
||||
|
||||
labelDiv : Maybe String -> List (Html msg)
|
||||
labelDiv label =
|
||||
case label of
|
||||
Just l ->
|
||||
[ div [ class "label" ] [ text l ]
|
||||
]
|
||||
|
||||
Nothing ->
|
||||
[]
|
||||
|
||||
|
||||
barDiv : Maybe String -> List (Html msg)
|
||||
barDiv barText =
|
||||
case barText of
|
||||
Just t ->
|
||||
[ div [ class "progress" ] [ text t ]
|
||||
]
|
||||
|
||||
Nothing ->
|
||||
[]
|
Reference in New Issue
Block a user