mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48: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:
@ -5,12 +5,15 @@ module Comp.NotificationList exposing
|
||||
, init
|
||||
, update
|
||||
, view
|
||||
, view2
|
||||
)
|
||||
|
||||
import Api.Model.NotificationSettings exposing (NotificationSettings)
|
||||
import Comp.Basic as B
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Styles as S
|
||||
import Util.Html
|
||||
|
||||
|
||||
@ -39,6 +42,10 @@ update msg model =
|
||||
( model, EditAction settings )
|
||||
|
||||
|
||||
|
||||
--- View
|
||||
|
||||
|
||||
view : Model -> List NotificationSettings -> Html Msg
|
||||
view _ items =
|
||||
div []
|
||||
@ -93,3 +100,57 @@ viewItem item =
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> List NotificationSettings -> Html Msg
|
||||
view2 _ items =
|
||||
div []
|
||||
[ table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [ class "" ] []
|
||||
, th [ class "text-center mr-2" ]
|
||||
[ i [ class "fa fa-check" ] []
|
||||
]
|
||||
, th [ class "text-left hidden sm:table-cell mr-2" ]
|
||||
[ text "Schedule" ]
|
||||
, th [ class "text-left mr-2" ]
|
||||
[ text "Connection" ]
|
||||
, th [ class "text-left hidden sm:table-cell mr-2" ]
|
||||
[ text "Recipients" ]
|
||||
, th [ class "text-center " ] [ text "Remind Days" ]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
(List.map viewItem2 items)
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
viewItem2 : NotificationSettings -> Html Msg
|
||||
viewItem2 item =
|
||||
tr []
|
||||
[ B.editLinkTableCell (EditSettings item)
|
||||
, td [ class "w-px whitespace-nowrap px-2 text-center" ]
|
||||
[ Util.Html.checkbox2 item.enabled
|
||||
]
|
||||
, td [ class "text-left hidden sm:table-cell mr-2" ]
|
||||
[ code [ class "font-mono text-sm" ]
|
||||
[ text item.schedule
|
||||
]
|
||||
]
|
||||
, td [ class "text-left mr-2" ]
|
||||
[ text item.smtpConnection
|
||||
]
|
||||
, td [ class "text-left hidden sm:table-cell mr-2" ]
|
||||
[ String.join ", " item.recipients |> text
|
||||
]
|
||||
, td [ class "text-center" ]
|
||||
[ String.fromInt item.remindDays
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
Reference in New Issue
Block a user