mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-24 03:18: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:
63
modules/webapp/src/main/elm/Page/ItemDetail/View2.elm
Normal file
63
modules/webapp/src/main/elm/Page/ItemDetail/View2.elm
Normal file
@ -0,0 +1,63 @@
|
||||
module Page.ItemDetail.View2 exposing (viewContent, viewSidebar)
|
||||
|
||||
import Comp.Basic as B
|
||||
import Comp.ItemDetail
|
||||
import Comp.ItemDetail.EditForm
|
||||
import Comp.ItemDetail.Model
|
||||
import Comp.MenuBar as MB
|
||||
import Data.Flags exposing (Flags)
|
||||
import Data.ItemNav exposing (ItemNav)
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Page.ItemDetail.Data exposing (..)
|
||||
import Styles as S
|
||||
|
||||
|
||||
viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewSidebar visible _ settings model =
|
||||
div
|
||||
[ id "sidebar"
|
||||
, class S.sidebar
|
||||
, class S.sidebarBg
|
||||
, classList [ ( "hidden", not visible ) ]
|
||||
]
|
||||
[ div
|
||||
[ class S.header2
|
||||
, class "font-bold mt-2"
|
||||
]
|
||||
[ i [ class "fa fa-pencil-alt mr-2" ] []
|
||||
, text "Edit Metadata"
|
||||
]
|
||||
, MB.viewSide
|
||||
{ start =
|
||||
[ MB.CustomElement <|
|
||||
B.secondaryBasicButton
|
||||
{ label = ""
|
||||
, icon = "fa fa-expand-alt"
|
||||
, disabled = model.detail.item.state == "created"
|
||||
, handler = onClick (ItemDetailMsg Comp.ItemDetail.Model.ToggleOpenAllAkkordionTabs)
|
||||
, attrs =
|
||||
[ title "Collapse/Expand"
|
||||
, href "#"
|
||||
]
|
||||
}
|
||||
]
|
||||
, end = []
|
||||
, rootClasses = "text-sm mb-3 "
|
||||
}
|
||||
, Html.map ItemDetailMsg
|
||||
(Comp.ItemDetail.EditForm.view2 settings model.detail)
|
||||
]
|
||||
|
||||
|
||||
viewContent : ItemNav -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent inav _ settings model =
|
||||
div
|
||||
[ id "content"
|
||||
, class S.content
|
||||
]
|
||||
[ Html.map ItemDetailMsg
|
||||
(Comp.ItemDetail.view2 inav settings model.detail)
|
||||
]
|
Reference in New Issue
Block a user