mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 19:08:26 +00:00
Remove old ui code in frontend
This commit is contained in:
@ -3,7 +3,6 @@ module Comp.PersonTable exposing
|
||||
, Msg(..)
|
||||
, emptyModel
|
||||
, update
|
||||
, view
|
||||
, view2
|
||||
)
|
||||
|
||||
@ -13,11 +12,8 @@ import Data.Flags exposing (Flags)
|
||||
import Data.PersonUse
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Styles as S
|
||||
import Util.Address
|
||||
import Util.Contact
|
||||
import Util.Html
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -52,62 +48,6 @@ update _ msg model =
|
||||
( { model | selected = Nothing }, Cmd.none )
|
||||
|
||||
|
||||
view : Model -> Html Msg
|
||||
view model =
|
||||
table [ class "ui very basic aligned table" ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [ class "collapsing" ] []
|
||||
, th [ class "collapsing center aligned" ] [ text "Use" ]
|
||||
, th [] [ text "Name" ]
|
||||
, th [] [ text "Organization" ]
|
||||
, th [] [ text "Address" ]
|
||||
, th [] [ text "Contact" ]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
(List.map (renderPersonLine model) model.equips)
|
||||
]
|
||||
|
||||
|
||||
renderPersonLine : Model -> Person -> Html Msg
|
||||
renderPersonLine model person =
|
||||
tr
|
||||
[ classList [ ( "active", model.selected == Just person ) ]
|
||||
]
|
||||
[ td [ class "collapsing" ]
|
||||
[ a
|
||||
[ href "#"
|
||||
, class "ui basic small blue label"
|
||||
, onClick (Select person)
|
||||
]
|
||||
[ i [ class "edit icon" ] []
|
||||
, text "Edit"
|
||||
]
|
||||
]
|
||||
, td [ class "center aligned" ]
|
||||
[ Data.PersonUse.fromString person.use
|
||||
|> Maybe.withDefault Data.PersonUse.Both
|
||||
|> Data.PersonUse.label
|
||||
|> text
|
||||
]
|
||||
, td []
|
||||
[ text person.name
|
||||
]
|
||||
, td []
|
||||
[ Maybe.map .name person.organization
|
||||
|> Maybe.withDefault "-"
|
||||
|> text
|
||||
]
|
||||
, td []
|
||||
[ Util.Address.toString person.address |> text
|
||||
]
|
||||
, td []
|
||||
[ Util.Contact.toString person.contacts |> text
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
Reference in New Issue
Block a user