mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Remove old ui code in frontend
This commit is contained in:
@ -3,7 +3,6 @@ module Comp.AttachmentMeta exposing
|
||||
, Msg
|
||||
, init
|
||||
, update
|
||||
, view
|
||||
, view2
|
||||
)
|
||||
|
||||
@ -62,161 +61,6 @@ update msg model =
|
||||
|
||||
|
||||
|
||||
--- View
|
||||
|
||||
|
||||
view : Model -> Html Msg
|
||||
view model =
|
||||
div []
|
||||
[ h3 [ class "ui header" ]
|
||||
[ text "Extracted Meta Data"
|
||||
]
|
||||
, case model.meta of
|
||||
NotAvailable ->
|
||||
div [ class "ui active dimmer" ]
|
||||
[ div [ class "ui loader" ]
|
||||
[]
|
||||
]
|
||||
|
||||
Failure msg ->
|
||||
div [ class "ui error message" ]
|
||||
[ text msg
|
||||
]
|
||||
|
||||
Success data ->
|
||||
viewData data
|
||||
]
|
||||
|
||||
|
||||
viewData : AttachmentMeta -> Html Msg
|
||||
viewData meta =
|
||||
div []
|
||||
[ div [ class "ui dividing header" ]
|
||||
[ text "Content"
|
||||
]
|
||||
, div [ class "extracted-text" ]
|
||||
[ text meta.content
|
||||
]
|
||||
, div [ class "ui dividing header" ]
|
||||
[ text "Labels"
|
||||
]
|
||||
, div []
|
||||
[ div [ class "ui horizontal list" ]
|
||||
(List.map renderLabelItem meta.labels)
|
||||
]
|
||||
, div [ class "ui dividing header" ]
|
||||
[ text "Proposals"
|
||||
]
|
||||
, viewProposals meta.proposals
|
||||
]
|
||||
|
||||
|
||||
viewProposals : ItemProposals -> Html Msg
|
||||
viewProposals props =
|
||||
let
|
||||
mkItem n lbl =
|
||||
div [ class "item" ]
|
||||
[ div [ class "ui label" ]
|
||||
[ text lbl.name
|
||||
, div [ class "detail" ]
|
||||
[ (String.fromInt (n + 1) ++ ".")
|
||||
|> text
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
mkTimeItem ms =
|
||||
div [ class "item" ]
|
||||
[ div [ class "ui label" ]
|
||||
[ Util.Time.formatDateShort ms |> text
|
||||
]
|
||||
]
|
||||
in
|
||||
div []
|
||||
[ div [ class "ui small header" ]
|
||||
[ text "Correspondent Organization"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.indexedMap mkItem props.corrOrg)
|
||||
, div [ class "ui small header" ]
|
||||
[ text "Correspondent Person"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.indexedMap mkItem props.corrPerson)
|
||||
, div [ class "ui small header" ]
|
||||
[ text "Concerning Person"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.indexedMap mkItem props.concPerson)
|
||||
, div [ class "ui small header" ]
|
||||
[ text "Concerning Equipment"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.indexedMap mkItem props.concEquipment)
|
||||
, div [ class "ui small header" ]
|
||||
[ text "Item Date"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.map mkTimeItem props.itemDate)
|
||||
, div [ class "ui small header" ]
|
||||
[ text "Item Due Date"
|
||||
]
|
||||
, div [ class "ui horizontal list" ]
|
||||
(List.map mkTimeItem props.dueDate)
|
||||
]
|
||||
|
||||
|
||||
renderLabelItem : Label -> Html Msg
|
||||
renderLabelItem label =
|
||||
div [ class "item" ]
|
||||
[ renderLabel label
|
||||
]
|
||||
|
||||
|
||||
renderLabel : Label -> Html Msg
|
||||
renderLabel label =
|
||||
let
|
||||
icon =
|
||||
case label.labelType of
|
||||
"organization" ->
|
||||
"factory icon"
|
||||
|
||||
"person" ->
|
||||
"user icon"
|
||||
|
||||
"location" ->
|
||||
"map marker icon"
|
||||
|
||||
"date" ->
|
||||
"calendar alternate icon"
|
||||
|
||||
"misc" ->
|
||||
"help icon"
|
||||
|
||||
"email" ->
|
||||
"at icon"
|
||||
|
||||
"website" ->
|
||||
"external alternate icon"
|
||||
|
||||
_ ->
|
||||
"tag icon"
|
||||
in
|
||||
div
|
||||
[ class "ui basic label"
|
||||
, title label.labelType
|
||||
]
|
||||
[ i [ class icon ] []
|
||||
, text label.label
|
||||
, div [ class "detail" ]
|
||||
[ String.fromInt label.beginPos |> text
|
||||
, text "-"
|
||||
, String.fromInt label.endPos |> text
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user