mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Dashboard updates
This commit is contained in:
@ -107,7 +107,7 @@ update flags msg model =
|
||||
Comp.ItemColumnDropdown.update lm model.columnModel
|
||||
|
||||
selection =
|
||||
Comp.ItemColumnDropdown.getSelected model.columnModel
|
||||
Comp.ItemColumnDropdown.getSelected cm
|
||||
|
||||
data =
|
||||
model.data
|
||||
|
@ -107,19 +107,23 @@ viewItems texts settings meta list =
|
||||
items =
|
||||
Data.Items.flatten list
|
||||
in
|
||||
table [ class "w-full divide-y dark:divide-slate-500" ]
|
||||
(viewItemHead texts meta ++ [ tbody [] <| List.map (viewItemRow texts settings meta) items ])
|
||||
table [ class "w-full divide-y divide-y-2 dark:divide-slate-500" ]
|
||||
(viewItemHead texts meta ++ [ tbody [ class "divide-y divide-dotted dark:divide-slate-500" ] <| List.map (viewItemRow texts settings meta) items ])
|
||||
|
||||
|
||||
viewItemHead : Texts -> QueryData -> List (Html Msg)
|
||||
viewItemHead texts meta =
|
||||
if not meta.showHeaders || meta.columns == [] then
|
||||
let
|
||||
( col1, cols ) =
|
||||
getColumns meta
|
||||
in
|
||||
if not meta.showHeaders then
|
||||
[]
|
||||
|
||||
else
|
||||
[ thead []
|
||||
[ tr []
|
||||
(List.map texts.itemColumn.header meta.columns
|
||||
(List.map texts.itemColumn.header (col1 :: cols)
|
||||
|> List.map (\n -> th [ class "text-left text-sm" ] [ text n ])
|
||||
)
|
||||
]
|
||||
|
@ -128,10 +128,10 @@ viewGeneral texts stats =
|
||||
List.length stats.concEquipStats
|
||||
|
||||
mklabel name =
|
||||
div [ class "py-1 text-lg" ] [ text name ]
|
||||
div [ class "py-0.5 text-lg" ] [ text name ]
|
||||
|
||||
value num =
|
||||
div [ class "py-1 font-mono text-lg" ] [ text <| String.fromInt num ]
|
||||
div [ class "py-0.5 font-mono text-lg" ] [ text <| String.fromInt num ]
|
||||
in
|
||||
div [ class "opacity-90" ]
|
||||
[ div [ class "flex flex-row" ]
|
||||
|
@ -17,6 +17,7 @@ import Html.Events exposing (onCheck, onClick, onInput)
|
||||
import Html5.DragDrop as DD
|
||||
import Messages.Comp.DashboardEdit exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Maybe
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -145,7 +146,12 @@ update flags msg model =
|
||||
db_ =
|
||||
{ db | columns = Maybe.withDefault db.columns value }
|
||||
in
|
||||
unit { model | columnsValue = value, columnsModel = cm, dashboard = db_ }
|
||||
unit
|
||||
{ model
|
||||
| columnsValue = Util.Maybe.or [ value, model.columnsValue ]
|
||||
, columnsModel = cm
|
||||
, dashboard = db_
|
||||
}
|
||||
|
||||
GapMsg lm ->
|
||||
let
|
||||
@ -158,7 +164,12 @@ update flags msg model =
|
||||
db_ =
|
||||
{ db | gap = Maybe.withDefault db.gap value }
|
||||
in
|
||||
unit { model | gapModel = gm, gapValue = value, dashboard = db_ }
|
||||
unit
|
||||
{ model
|
||||
| gapModel = gm
|
||||
, gapValue = Util.Maybe.or [ value, model.gapValue ]
|
||||
, dashboard = db_
|
||||
}
|
||||
|
||||
ToggleNewBoxMenu ->
|
||||
unit { model | newBoxMenuOpen = not model.newBoxMenuOpen }
|
||||
|
Reference in New Issue
Block a user