mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-05 10:59:33 +00:00
commit
57224e03b1
@ -220,9 +220,9 @@ renderLabel label =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
div []
|
||||
view2 : List (Attribute Msg) -> Model -> Html Msg
|
||||
view2 attrs model =
|
||||
div attrs
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Extracted Meta Data"
|
||||
]
|
||||
@ -252,7 +252,7 @@ viewData2 meta =
|
||||
, div [ class "text-lg font-bold mt-2" ]
|
||||
[ text "Labels"
|
||||
]
|
||||
, div [ class "flex fex-row flex-wrap space-x-2" ]
|
||||
, div [ class "flex fex-row flex-wrap" ]
|
||||
(List.map renderLabelItem2 meta.labels)
|
||||
, div [ class "text-lg font-bold mt-2" ]
|
||||
[ text "Proposals"
|
||||
@ -354,14 +354,14 @@ renderLabel2 label =
|
||||
in
|
||||
div
|
||||
[ class S.basicLabel
|
||||
, class "mt-1 text-sm"
|
||||
, class "mt-1 mr-2 text-sm"
|
||||
, title label.labelType
|
||||
]
|
||||
[ i [ class icon ] []
|
||||
, span [ class "ml-2" ]
|
||||
[ text label.label
|
||||
]
|
||||
, div [ class "opacity-75 ml-3" ]
|
||||
, div [ class "opacity-75 ml-3 font-mono" ]
|
||||
[ String.fromInt label.beginPos |> text
|
||||
, text "-"
|
||||
, String.fromInt label.endPos |> text
|
||||
|
@ -340,6 +340,18 @@ view2 viewSettings model =
|
||||
dimmerSettings
|
||||
model.deleteDimmer
|
||||
)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", model.result == Nothing )
|
||||
, ( S.errorMessage, Maybe.map .success model.result == Just False )
|
||||
, ( S.successMessage, Maybe.map .success model.result == Just True )
|
||||
]
|
||||
, class "my-2"
|
||||
]
|
||||
[ Maybe.map .message model.result
|
||||
|> Maybe.withDefault ""
|
||||
|> text
|
||||
]
|
||||
, if model.field.id == "" then
|
||||
div [ class "py-2 text-lg opacity-75" ]
|
||||
[ text "Create a new custom field."
|
||||
@ -416,18 +428,6 @@ view2 viewSettings model =
|
||||
, text "this field in the ui. If not present, the name is used."
|
||||
]
|
||||
]
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", model.result == Nothing )
|
||||
, ( S.errorMessage, Maybe.map .success model.result == Just False )
|
||||
, ( S.successMessage, Maybe.map .success model.result == Just True )
|
||||
]
|
||||
, class "mb-4"
|
||||
]
|
||||
[ Maybe.map .message model.result
|
||||
|> Maybe.withDefault ""
|
||||
|> text
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
@ -755,7 +755,7 @@ viewMultiple2 style settings model =
|
||||
renderSelectMultiple item =
|
||||
a
|
||||
[ class (model.labelColor item.value settings)
|
||||
, class "label font-medium inline-flex relative items-center hover:shadow-md mt-1"
|
||||
, class "label font-medium inline-flex relative items-center hover:shadow-md mt-1 mr-1"
|
||||
, onClick (RemoveItem item)
|
||||
, href "#"
|
||||
]
|
||||
@ -776,7 +776,7 @@ viewMultiple2 style settings model =
|
||||
, class "flex inline-flex flex-wrap items-center"
|
||||
]
|
||||
[ div
|
||||
[ class "flex flex-row flex-wrap space-x-1 items-center mr-2 -mt-1"
|
||||
[ class "flex flex-row flex-wrap items-center mr-2 -mt-1"
|
||||
, classList [ ( "hidden", List.isEmpty model.selected ) ]
|
||||
]
|
||||
(List.map renderSelectMultiple model.selected)
|
||||
|
@ -373,16 +373,17 @@ viewForm2 settings model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map FormMsg
|
||||
(Comp.EmailSettingsForm.view2 settings model.formModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", model.formError == Nothing )
|
||||
]
|
||||
, class "my-2"
|
||||
, class S.errorMessage
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg
|
||||
(Comp.EmailSettingsForm.view2 settings model.formModel)
|
||||
, Html.map YesNoMsg
|
||||
(Comp.YesNoDimmer.viewN
|
||||
True
|
||||
|
@ -414,14 +414,15 @@ viewForm2 model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map FormMsg (Comp.EquipmentForm.view2 model.formModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", Util.Maybe.isEmpty model.formError )
|
||||
]
|
||||
, class S.errorMessage
|
||||
, class "my-2"
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.EquipmentForm.view2 model.formModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -477,6 +477,7 @@ view2 flags model =
|
||||
, onInput SetName
|
||||
, Maybe.withDefault "" model.name
|
||||
|> value
|
||||
, classList [ ( S.inputErrorBorder, model.name == Nothing ) ]
|
||||
, class S.textInput
|
||||
, id "folder-name"
|
||||
]
|
||||
@ -585,11 +586,15 @@ viewButtons2 model =
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.DeleteButton
|
||||
[ MB.CustomButton
|
||||
{ tagger = RequestDelete
|
||||
, label = "Delete"
|
||||
, icon = Just "fa fa-trash"
|
||||
, title = "Delete this folder"
|
||||
, inputClass =
|
||||
[ ( S.deleteButton, True )
|
||||
, ( "hidden", model.folder.id == "" )
|
||||
]
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
|
@ -376,19 +376,20 @@ viewForm2 settings model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", model.formError == Nothing )
|
||||
]
|
||||
, class "my-2"
|
||||
, class S.errorMessage
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg
|
||||
(Comp.ImapSettingsForm.view2
|
||||
settings
|
||||
model.formModel
|
||||
)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", model.formError == Nothing )
|
||||
]
|
||||
, class S.errorMessage
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map YesNoMsg
|
||||
(Comp.YesNoDimmer.viewN
|
||||
True
|
||||
|
@ -55,7 +55,10 @@ view settings model pos attach =
|
||||
case Dict.get attach.id model.attachMeta of
|
||||
Just am ->
|
||||
Html.map (AttachMetaMsg attach.id)
|
||||
(Comp.AttachmentMeta.view2 am)
|
||||
(Comp.AttachmentMeta.view2
|
||||
[ class "border-r border-l dark:border-bluegray-600 px-2" ]
|
||||
am
|
||||
)
|
||||
|
||||
Nothing ->
|
||||
span [ class "hidden" ] []
|
||||
|
@ -408,14 +408,15 @@ viewForm2 settings model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map FormMsg (Comp.OrgForm.view2 False settings model.formModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", Util.Maybe.isEmpty model.formError )
|
||||
]
|
||||
, class S.errorMessage
|
||||
, class "my-2"
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.OrgForm.view2 False settings model.formModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -456,14 +456,15 @@ viewForm2 settings model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map FormMsg (Comp.PersonForm.view2 False settings model.formModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", Util.Maybe.isEmpty model.formError )
|
||||
]
|
||||
, class S.errorMessage
|
||||
, class "my-2"
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.PersonForm.view2 False settings model.formModel)
|
||||
, B.loadingDimmer (isLoading model)
|
||||
]
|
||||
|
@ -424,14 +424,15 @@ viewForm2 model =
|
||||
[]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map FormMsg (Comp.TagForm.view2 model.tagFormModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "hidden", Util.Maybe.isEmpty model.formError )
|
||||
]
|
||||
, class "my-2"
|
||||
, class S.errorMessage
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.TagForm.view2 model.tagFormModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -287,18 +287,19 @@ itemCardList flags settings model =
|
||||
in
|
||||
[ Html.map ItemCardListMsg
|
||||
(Comp.ItemCardList.view2 itemViewCfg settings model.itemListModel)
|
||||
, loadMore model
|
||||
, loadMore settings model
|
||||
]
|
||||
|
||||
|
||||
loadMore : Model -> Html Msg
|
||||
loadMore model =
|
||||
loadMore : UiSettings -> Model -> Html Msg
|
||||
loadMore settings model =
|
||||
let
|
||||
inactive =
|
||||
not model.moreAvailable || model.moreInProgress || model.searchInProgress
|
||||
in
|
||||
div
|
||||
[ class "h-40 flex flex-col items-center justify-center w-full"
|
||||
, classList [ ( "hidden", resultsBelowLimit settings model ) ]
|
||||
]
|
||||
[ B.secondaryBasicButton
|
||||
{ label =
|
||||
|
Loading…
x
Reference in New Issue
Block a user