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

@ -5,12 +5,15 @@ module Comp.ScanMailboxList exposing
, init
, update
, view
, view2
)
import Api.Model.ScanMailboxSettings exposing (ScanMailboxSettings)
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 ScanMailboxSettings -> Html Msg
view _ items =
div []
@ -104,3 +111,65 @@ viewItem item =
[ Util.Html.checkbox item.deleteMail
]
]
--- View2
view2 : Model -> List ScanMailboxSettings -> Html Msg
view2 _ items =
div []
[ table [ class S.tableMain ]
[ thead []
[ tr []
[ th [ class "" ] []
, th [ class "" ]
[ i [ class "fa fa-check" ] []
]
, th [ class "text-left mr-2 hidden md:table-cell" ] [ text "Schedule" ]
, th [ class "text-left mr-2" ] [ text "Connection" ]
, th [ class "text-left mr-2" ] [ text "Folders" ]
, th [ class "text-left mr-2 hidden md:table-cell" ] [ text "Received Since" ]
, th [ class "text-left mr-2 hidden md:table-cell" ] [ text "Target" ]
, th [ class "hidden md:table-cell" ] [ text "Delete" ]
]
]
, tbody []
(List.map viewItem2 items)
]
]
viewItem2 : ScanMailboxSettings -> Html Msg
viewItem2 item =
tr [ class S.tableRow ]
[ B.editLinkTableCell (EditSettings item)
, td [ class "w-px px-2" ]
[ Util.Html.checkbox2 item.enabled
]
, td [ class "mr-2 hidden md:table-cell" ]
[ code [ class "font-mono text-sm" ]
[ text item.schedule
]
]
, td [ class "text-left mr-2" ]
[ text item.imapConnection
]
, td [ class "text-left mr-2" ]
[ String.join ", " item.folders |> text
]
, td [ class "text-left mr-2 hidden md:table-cell" ]
[ Maybe.map String.fromInt item.receivedSinceHours
|> Maybe.withDefault "-"
|> text
, text " h"
]
, td [ class "text-left mr-2 hidden md:table-cell" ]
[ Maybe.withDefault "-" item.targetFolder
|> text
]
, td [ class "w-px px-2 hidden md:table-cell" ]
[ Util.Html.checkbox2 item.deleteMail
]
]