Files
docspell/modules/webapp/src/main/elm/Comp/ItemColumnView.elm
eikek b664b5771d Fixes in dashboard table view
- The first tag was rendered with slightly higher height than the rest
- Columns between first and last are hidden on small screens
- Use `break-all` to break all words if necessary without trying to
  keep whole words
2022-02-23 23:26:22 +01:00

44 lines
1.1 KiB
Elm

{-
Copyright 2020 Eike K. & Contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-}
module Comp.ItemColumnView exposing (..)
import Api.Model.ItemLight exposing (ItemLight)
import Data.ItemColumn exposing (ItemColumn(..))
import Data.ItemTemplate exposing (TemplateContext)
import Data.UiSettings exposing (UiSettings)
import Html exposing (Attribute, Html, div, text)
import Html.Attributes exposing (class)
renderDiv :
TemplateContext
-> UiSettings
-> ItemColumn
-> List (Attribute msg)
-> ItemLight
-> Html msg
renderDiv ctx settings col attr item =
case col of
Tags ->
div attr
(List.map
(\t ->
div
[ class "label text-sm mt-1"
, class <| Data.UiSettings.tagColorString2 t settings
]
[ text t.name ]
)
item.tags
)
_ ->
div attr
[ text (Data.ItemColumn.renderString ctx col item)
]