First version of new ui based on tailwind

This drops fomantic-ui as css toolkit and introduces tailwindcss. With
tailwind there are no predefined components, but it's very easy to
create those. So customizing the look&feel is much simpler, most of
the time no additional css is needed.

This requires a complete rewrite of the markup + styles. Luckily all
logic can be kept as is. The now old ui is not removed, it is still
available by using a request header `Docspell-Ui` with a value of `1`
for the old ui and `2` for the new ui.

Another addition is "dev mode", where docspell serves assets with a
no-cache header, to disable browser caching. This makes developing a
lot easier.
This commit is contained in:
Eike Kettner
2021-01-29 20:48:27 +01:00
parent 442b76c5af
commit dd935454c9
140 changed files with 15077 additions and 214 deletions

View File

@ -1,5 +1,12 @@
module Comp.FieldListSelect exposing (..)
module Comp.FieldListSelect exposing
( Model
, Msg
, update
, view
, view2
)
import Comp.MenuBar as MB
import Data.Fields exposing (Field)
import Html exposing (..)
import Html.Attributes exposing (..)
@ -67,3 +74,31 @@ fieldCheckbox selected field =
, label [] [ text (Data.Fields.label field) ]
]
]
--- View2
view2 : String -> Model -> Html Msg
view2 classes selected =
div
[ class "flex flex-col space-y-4 md:space-y-2"
, class classes
]
(List.map (fieldCheckbox2 selected) Data.Fields.all)
fieldCheckbox2 : Model -> Field -> Html Msg
fieldCheckbox2 selected field =
let
isChecked =
List.member field selected
in
MB.viewItem <|
MB.Checkbox
{ id = "field-toggle-" ++ Data.Fields.toString field
, value = isChecked
, tagger = \_ -> Toggle field
, label = Data.Fields.label field
}