mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
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:
@ -4,9 +4,11 @@ module Comp.UiSettingsManage exposing
|
||||
, init
|
||||
, update
|
||||
, view
|
||||
, view2
|
||||
)
|
||||
|
||||
import Api.Model.BasicResult exposing (BasicResult)
|
||||
import Comp.MenuBar as MB
|
||||
import Comp.UiSettingsForm
|
||||
import Data.Flags exposing (Flags)
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
@ -14,6 +16,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Ports
|
||||
import Styles as S
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -147,3 +150,42 @@ view flags settings classes model =
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Flags -> UiSettings -> String -> Model -> Html Msg
|
||||
view2 flags settings classes model =
|
||||
div [ class classes ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = Submit
|
||||
, label = "Submit"
|
||||
, title = "Save settings"
|
||||
, icon = Just "fa fa-save"
|
||||
}
|
||||
]
|
||||
, end = []
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, div
|
||||
[ classList
|
||||
[ ( S.successMessage, isSuccess model )
|
||||
, ( S.errorMessage, isError model )
|
||||
, ( "hidden", model.message == Nothing )
|
||||
]
|
||||
]
|
||||
[ Maybe.map .message model.message
|
||||
|> Maybe.withDefault ""
|
||||
|> text
|
||||
]
|
||||
, Html.map UiSettingsFormMsg
|
||||
(Comp.UiSettingsForm.view2
|
||||
flags
|
||||
settings
|
||||
model.formModel
|
||||
)
|
||||
]
|
||||
|
Reference in New Issue
Block a user