mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 19:08: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:
@ -7,16 +7,19 @@ module Comp.OrgForm exposing
|
||||
, update
|
||||
, view
|
||||
, view1
|
||||
, view2
|
||||
)
|
||||
|
||||
import Api.Model.Organization exposing (Organization)
|
||||
import Comp.AddressForm
|
||||
import Comp.Basic as B
|
||||
import Comp.ContactField
|
||||
import Data.Flags exposing (Flags)
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Styles as S
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -150,3 +153,62 @@ view1 settings compact model =
|
||||
[]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 mobile settings model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ div
|
||||
[ class "mb-4" ]
|
||||
[ label
|
||||
[ for "orgname"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Name"
|
||||
, B.inputRequired
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetName
|
||||
, placeholder "Name"
|
||||
, value model.name
|
||||
, name "orgname"
|
||||
, class S.textInput
|
||||
, classList
|
||||
[ ( S.inputErrorBorder, not (isValid model) )
|
||||
]
|
||||
]
|
||||
[]
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Address"
|
||||
]
|
||||
, Html.map AddressMsg
|
||||
(Comp.AddressForm.view2 settings model.addressModel)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Contacts"
|
||||
]
|
||||
, Html.map ContactMsg
|
||||
(Comp.ContactField.view2 mobile settings model.contactModel)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Notes"
|
||||
]
|
||||
, div [ class "" ]
|
||||
[ textarea
|
||||
[ onInput SetNotes
|
||||
, Maybe.withDefault "" model.notes |> value
|
||||
, class S.textAreaInput
|
||||
]
|
||||
[]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
Reference in New Issue
Block a user