From 98f202b797f7cc3322f9b22893bc38a77d8951ff Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 17 May 2020 18:14:54 +0200 Subject: [PATCH] More ui tweaks to item list --- .../webapp/src/main/elm/Comp/ItemCardList.elm | 22 +++++++++++++++---- .../webapp/src/main/elm/Data/Direction.elm | 8 +++++++ .../webapp/src/main/elm/Page/Home/View.elm | 3 +++ modules/webapp/src/main/webjar/docspell.css | 4 ++-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/modules/webapp/src/main/elm/Comp/ItemCardList.elm b/modules/webapp/src/main/elm/Comp/ItemCardList.elm index 1f6f4b32..6ac01407 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCardList.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCardList.elm @@ -109,23 +109,37 @@ viewItem item = dueDate = Maybe.map Util.Time.formatDateShort item.dueDate |> Maybe.withDefault "" + + isConfirmed = + item.state /= "created" + + newColor = + "blue" in div [ class "column item-list" ] [ a - [ class "ui fluid card" + [ classList + [ ( "ui fluid card", True ) + , ( newColor, not isConfirmed ) + ] , href "#" , onClick (SelectItem item) ] [ div [ class "content" ] - [ div [ class "header" ] + [ div + [ class "header" + , Data.Direction.labelFromMaybe item.direction + |> title + ] [ dirIcon , Util.String.ellipsis 45 item.name |> text ] , span [ class "meta" ] [ div [ classList - [ ( "ui blue ribbon label", True ) - , ( "invisible", item.state /= "created" ) + [ ( "ui ribbon label", True ) + , ( newColor, True ) + , ( "invisible", isConfirmed ) ] ] [ i [ class "exclamation icon" ] [] diff --git a/modules/webapp/src/main/elm/Data/Direction.elm b/modules/webapp/src/main/elm/Data/Direction.elm index 85e6f10c..a6ad123f 100644 --- a/modules/webapp/src/main/elm/Data/Direction.elm +++ b/modules/webapp/src/main/elm/Data/Direction.elm @@ -5,6 +5,7 @@ module Data.Direction exposing , icon , iconFromMaybe , iconFromString + , labelFromMaybe , toString ) @@ -70,3 +71,10 @@ iconFromMaybe : Maybe String -> String iconFromMaybe ms = Maybe.map iconFromString ms |> Maybe.withDefault unknownIcon + + +labelFromMaybe : Maybe String -> String +labelFromMaybe ms = + Maybe.andThen fromString ms + |> Maybe.map toString + |> Maybe.withDefault "Direction" diff --git a/modules/webapp/src/main/elm/Page/Home/View.elm b/modules/webapp/src/main/elm/Page/Home/View.elm index f2a804e0..07d393bb 100644 --- a/modules/webapp/src/main/elm/Page/Home/View.elm +++ b/modules/webapp/src/main/elm/Page/Home/View.elm @@ -25,6 +25,7 @@ view model = [ class "item" , href "#" , onClick ToggleSearchMenu + , title "Hide menu" ] [ i [ class "ui angle down icon" ] [] , text "Search" @@ -33,6 +34,7 @@ view model = [ a [ class "icon item" , onClick ResetSearch + , title "Reset form" , href "#" ] [ i [ class "undo icon" ] [] @@ -40,6 +42,7 @@ view model = , a [ class "icon item" , onClick DoSearch + , title "Run search query" , href "" ] [ i [ class "ui search icon" ] [] diff --git a/modules/webapp/src/main/webjar/docspell.css b/modules/webapp/src/main/webjar/docspell.css index 2cf107bb..9453556b 100644 --- a/modules/webapp/src/main/webjar/docspell.css +++ b/modules/webapp/src/main/webjar/docspell.css @@ -133,8 +133,8 @@ textarea.markdown-editor { } .default-layout .ui.grid > .column.item-list:not(.row) { - padding-top: 0.3em; - padding-bottom: 0.6em; + padding-top: 0.8em; + padding-bottom: 0; } .default-layout .ui.grid > .column.item-list:not(.row):last-child { padding-bottom: 1.5rem;