Allow to change use enum for org/equipment

This commit is contained in:
Eike Kettner
2021-03-10 23:54:04 +01:00
parent 0229a867af
commit 274e433d9d
10 changed files with 252 additions and 7 deletions

View File

@ -8,6 +8,7 @@ module Comp.EquipmentTable exposing
import Api.Model.Equipment exposing (Equipment)
import Comp.Basic as B
import Data.EquipmentUse
import Data.Flags exposing (Flags)
import Html exposing (..)
import Html.Attributes exposing (..)
@ -57,6 +58,9 @@ view2 model =
[ thead []
[ tr []
[ th [ class "" ] []
, th [ class "text-left pr-1 md:px-2 w-20" ]
[ text "Use"
]
, th [ class "text-left" ] [ text "Name" ]
]
]
@ -72,6 +76,14 @@ renderEquipmentLine2 model equip =
, class S.tableRow
]
[ B.editLinkTableCell (Select equip)
, td [ class "text-left pr-1 md:px-2" ]
[ div [ class "label inline-flex text-sm" ]
[ Data.EquipmentUse.fromString equip.use
|> Maybe.withDefault Data.EquipmentUse.Concerning
|> Data.EquipmentUse.label
|> text
]
]
, td [ class "text-left" ]
[ text equip.name
]