mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 10:29:34 +00:00
Externalize strings in manage-data page
This commit is contained in:
parent
8f1380fcf5
commit
594818499e
@ -127,7 +127,7 @@ mainContent model =
|
||||
viewLogin texts model
|
||||
|
||||
ManageDataPage ->
|
||||
viewManageData model
|
||||
viewManageData texts model
|
||||
|
||||
UserSettingPage ->
|
||||
viewUserSettings texts model
|
||||
@ -431,12 +431,21 @@ viewLogin texts model =
|
||||
]
|
||||
|
||||
|
||||
viewManageData : Model -> List (Html Msg)
|
||||
viewManageData model =
|
||||
viewManageData : Messages -> Model -> List (Html Msg)
|
||||
viewManageData texts model =
|
||||
[ Html.map ManageDataMsg
|
||||
(ManageData.viewSidebar model.sidebarVisible model.flags model.uiSettings model.manageDataModel)
|
||||
(ManageData.viewSidebar texts.manageData
|
||||
model.sidebarVisible
|
||||
model.flags
|
||||
model.uiSettings
|
||||
model.manageDataModel
|
||||
)
|
||||
, Html.map ManageDataMsg
|
||||
(ManageData.viewContent model.flags model.uiSettings model.manageDataModel)
|
||||
(ManageData.viewContent texts.manageData
|
||||
model.flags
|
||||
model.uiSettings
|
||||
model.manageDataModel
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@ import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Messages.AddressFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.List
|
||||
|
||||
@ -110,12 +111,12 @@ update msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : UiSettings -> Model -> Html Msg
|
||||
view2 settings model =
|
||||
view2 : Texts -> UiSettings -> Model -> Html Msg
|
||||
view2 texts settings model =
|
||||
let
|
||||
countryCfg =
|
||||
{ makeOption = \c -> { text = c.label, additional = "" }
|
||||
, placeholder = "Select Country"
|
||||
, placeholder = texts.selectCountry
|
||||
, labelColor = \_ -> \_ -> ""
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
@ -128,12 +129,12 @@ view2 settings model =
|
||||
[ for "street"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Street"
|
||||
[ text texts.street
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetStreet
|
||||
, placeholder "Street"
|
||||
, placeholder texts.street
|
||||
, value model.street
|
||||
, name "street"
|
||||
, class S.textInput
|
||||
@ -147,12 +148,12 @@ view2 settings model =
|
||||
[ for "zip"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Zip Code"
|
||||
[ text texts.zipCode
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetZip
|
||||
, placeholder "Zip"
|
||||
, placeholder texts.zipCode
|
||||
, value model.zip
|
||||
, name "zip"
|
||||
, class S.textInput
|
||||
@ -166,12 +167,12 @@ view2 settings model =
|
||||
[ for "city"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "City"
|
||||
[ text texts.city
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetCity
|
||||
, placeholder "City"
|
||||
, placeholder texts.city
|
||||
, value model.city
|
||||
, name "city"
|
||||
, class S.textInput
|
||||
@ -180,7 +181,7 @@ view2 settings model =
|
||||
]
|
||||
, div [ class "" ]
|
||||
[ label [ class S.inputLabel ]
|
||||
[ text "Country"
|
||||
[ text texts.country
|
||||
]
|
||||
, Html.map CountryMsg
|
||||
(Comp.Dropdown.view2
|
||||
|
@ -1,6 +1,7 @@
|
||||
module Comp.ContactField exposing
|
||||
( Model
|
||||
, Msg(..)
|
||||
, ViewSettings
|
||||
, emptyModel
|
||||
, getContacts
|
||||
, update
|
||||
@ -115,11 +116,17 @@ update msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 mobile _ model =
|
||||
type alias ViewSettings =
|
||||
{ contactTypeLabel : ContactType -> String
|
||||
, mobile : Bool
|
||||
}
|
||||
|
||||
|
||||
view2 : ViewSettings -> UiSettings -> Model -> Html Msg
|
||||
view2 cfg _ model =
|
||||
let
|
||||
kindCfg =
|
||||
{ display = Data.ContactType.toString
|
||||
{ display = cfg.contactTypeLabel
|
||||
, icon = \_ -> Nothing
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
@ -127,10 +134,10 @@ view2 mobile _ model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ div
|
||||
[ class "flex flex-col space-y-2"
|
||||
, classList [ ( " md:flex-row md:space-y-0 md:space-x-2", not mobile ) ]
|
||||
, classList [ ( " md:flex-row md:space-y-0 md:space-x-2", not cfg.mobile ) ]
|
||||
]
|
||||
[ div
|
||||
[ classList [ ( "flex-none md:w-1/6", not mobile ) ]
|
||||
[ classList [ ( "flex-none md:w-1/6", not cfg.mobile ) ]
|
||||
]
|
||||
[ Html.map TypeMsg
|
||||
(Comp.FixedDropdown.viewStyled2
|
||||
@ -163,7 +170,7 @@ view2 mobile _ model =
|
||||
]
|
||||
, class "flex flex-col space-y-2 mt-2 px-2 border-0 border-l dark:border-bluegray-600 "
|
||||
]
|
||||
(List.map (renderItem2 mobile) model.items)
|
||||
(List.map (renderItem2 cfg.mobile) model.items)
|
||||
]
|
||||
|
||||
|
||||
|
@ -23,8 +23,9 @@ import Data.Flags exposing (Flags)
|
||||
import Data.Validated exposing (Validated)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput)
|
||||
import Html.Events exposing (onInput)
|
||||
import Http
|
||||
import Messages.CustomFieldFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -196,20 +197,20 @@ type alias ViewSettings =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : ViewSettings -> Model -> List (Html Msg)
|
||||
view2 viewSettings model =
|
||||
view2 : Texts -> ViewSettings -> Model -> List (Html Msg)
|
||||
view2 texts viewSettings model =
|
||||
let
|
||||
dimmerSettings =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this custom field?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteField
|
||||
|
||||
ftypeCfg =
|
||||
{ display = Data.CustomFieldType.label
|
||||
{ display = texts.fieldTypeLabel
|
||||
, icon = \_ -> Nothing
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
in
|
||||
(if viewSettings.showControls then
|
||||
[ viewButtons2 model ]
|
||||
[ viewButtons2 texts model ]
|
||||
|
||||
else
|
||||
[]
|
||||
@ -238,20 +239,19 @@ view2 viewSettings model =
|
||||
]
|
||||
, if model.field.id == "" then
|
||||
div [ class "py-2 text-lg opacity-75" ]
|
||||
[ text "Create a new custom field."
|
||||
[ text texts.createCustomField
|
||||
]
|
||||
|
||||
else
|
||||
div [ class "py-2 text-lg opacity-75" ]
|
||||
[ text "Note that changing the format may "
|
||||
, text "result in invisible values in the ui, if they don't comply to the new format!"
|
||||
[ text texts.modifyTypeWarning
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
, for "fieldname"
|
||||
]
|
||||
[ text "Name"
|
||||
[ text texts.name
|
||||
, B.inputRequired
|
||||
]
|
||||
, input
|
||||
@ -268,15 +268,14 @@ view2 viewSettings model =
|
||||
]
|
||||
[]
|
||||
, div [ class "opacity-75 text-sm" ]
|
||||
[ text "The name uniquely identifies this field. It must be a valid "
|
||||
, text "identifier, not contain spaces or weird characters."
|
||||
[ text texts.nameInfo
|
||||
]
|
||||
]
|
||||
, div
|
||||
[ class "mb-4"
|
||||
]
|
||||
[ label [ class S.inputLabel ]
|
||||
[ text "Field Format"
|
||||
[ text texts.fieldFormat
|
||||
, B.inputRequired
|
||||
]
|
||||
, Html.map FTypeMsg
|
||||
@ -287,8 +286,7 @@ view2 viewSettings model =
|
||||
model.ftypeModel
|
||||
)
|
||||
, div [ class "opacity-75 text-sm" ]
|
||||
[ text "A field must have a format. Values are validated "
|
||||
, text "according to this format."
|
||||
[ text texts.fieldFormatInfo
|
||||
]
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
@ -296,7 +294,7 @@ view2 viewSettings model =
|
||||
[ class S.inputLabel
|
||||
, for "fieldlabel"
|
||||
]
|
||||
[ text "Label" ]
|
||||
[ text texts.label ]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetLabel
|
||||
@ -308,38 +306,37 @@ view2 viewSettings model =
|
||||
]
|
||||
[]
|
||||
, div [ class "opacity-75 text-sm" ]
|
||||
[ text "The user defined label for this field. This is used to represent "
|
||||
, text "this field in the ui. If not present, the name is used."
|
||||
[ text texts.labelInfo
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
viewButtons2 : Model -> Html Msg
|
||||
viewButtons2 model =
|
||||
viewButtons2 : Texts -> Model -> Html Msg
|
||||
viewButtons2 texts model =
|
||||
MB.view
|
||||
{ start =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = SubmitForm
|
||||
, title = "Submit this form"
|
||||
, title = texts.basics.submitThisForm
|
||||
, icon = Just "fa fa-save"
|
||||
, label = "Submit"
|
||||
, label = texts.basics.submit
|
||||
}
|
||||
, MB.SecondaryButton
|
||||
{ tagger = GoBack
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, label = "Cancel"
|
||||
, label = texts.basics.cancel
|
||||
}
|
||||
]
|
||||
, end =
|
||||
if model.field.id /= "" then
|
||||
[ MB.DeleteButton
|
||||
{ tagger = RequestDelete
|
||||
, title = "Delete this field"
|
||||
, title = texts.deleteThisField
|
||||
, icon = Just "fa fa-trash"
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -17,8 +17,8 @@ import Comp.MenuBar as MB
|
||||
import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput)
|
||||
import Http
|
||||
import Messages.CustomFieldManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.CustomField
|
||||
|
||||
@ -135,18 +135,18 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Flags -> Model -> Html Msg
|
||||
view2 flags model =
|
||||
view2 : Texts -> Flags -> Model -> Html Msg
|
||||
view2 texts flags model =
|
||||
case model.detailModel of
|
||||
Just dm ->
|
||||
viewDetail2 flags dm
|
||||
viewDetail2 texts flags dm
|
||||
|
||||
Nothing ->
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
|
||||
viewDetail2 : Flags -> Comp.CustomFieldForm.Model -> Html Msg
|
||||
viewDetail2 _ detailModel =
|
||||
viewDetail2 : Texts -> Flags -> Comp.CustomFieldForm.Model -> Html Msg
|
||||
viewDetail2 texts _ detailModel =
|
||||
let
|
||||
viewSettings =
|
||||
{ showControls = True
|
||||
@ -156,44 +156,52 @@ viewDetail2 _ detailModel =
|
||||
div []
|
||||
((if detailModel.field.id == "" then
|
||||
h3 [ class S.header2 ]
|
||||
[ text "Create new custom field"
|
||||
[ text texts.newCustomField
|
||||
]
|
||||
|
||||
else
|
||||
h3 [ class S.header2 ]
|
||||
[ Util.CustomField.nameOrLabel detailModel.field |> text
|
||||
, div [ class "opacity-50 text-sm" ]
|
||||
[ text "Id: "
|
||||
[ text (texts.basics.id ++ ": ")
|
||||
, text detailModel.field.id
|
||||
]
|
||||
]
|
||||
)
|
||||
:: List.map (Html.map DetailMsg) (Comp.CustomFieldForm.view2 viewSettings detailModel)
|
||||
:: List.map (Html.map DetailMsg)
|
||||
(Comp.CustomFieldForm.view2 texts.fieldForm
|
||||
viewSettings
|
||||
detailModel
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col md:relative" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewCustomField
|
||||
, title = "Add a new custom field"
|
||||
, title = texts.addCustomField
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New custom field"
|
||||
, label = texts.newCustomField
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.CustomFieldTable.view2 model.tableModel model.fields)
|
||||
, Html.map TableMsg
|
||||
(Comp.CustomFieldTable.view2 texts.fieldTable
|
||||
model.tableModel
|
||||
model.fields
|
||||
)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -11,7 +11,7 @@ import Api.Model.CustomField exposing (CustomField)
|
||||
import Comp.Basic as B
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Messages.CustomFieldTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Time
|
||||
|
||||
@ -45,17 +45,17 @@ update msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> List CustomField -> Html Msg
|
||||
view2 _ items =
|
||||
view2 : Texts -> Model -> List CustomField -> Html Msg
|
||||
view2 texts _ items =
|
||||
div []
|
||||
[ table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [] []
|
||||
, th [ class "text-left" ] [ text "Name/Label" ]
|
||||
, th [ class "text-left" ] [ text "Format" ]
|
||||
, th [ class "text-center hidden sm:table-cell" ] [ text "#Usage" ]
|
||||
, th [ class "text-center hidden sm:table-cell" ] [ text "Created" ]
|
||||
, th [ class "text-left" ] [ text texts.nameLabel ]
|
||||
, th [ class "text-left" ] [ text texts.format ]
|
||||
, th [ class "text-center hidden sm:table-cell" ] [ text texts.usageCount ]
|
||||
, th [ class "text-center hidden sm:table-cell" ] [ text texts.basics.created ]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
|
@ -47,6 +47,11 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Http
|
||||
import Messages.CustomFieldFormComp
|
||||
import Messages.EquipmentFormComp
|
||||
import Messages.OrgFormComp
|
||||
import Messages.PersonFormComp
|
||||
import Messages.TagFormComp
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
|
||||
@ -766,24 +771,25 @@ viewIntern2 settings withButtons model =
|
||||
]
|
||||
, case model.form of
|
||||
TM tm ->
|
||||
Html.map TagMsg (Comp.TagForm.view2 tm)
|
||||
Html.map TagMsg (Comp.TagForm.view2 Messages.TagFormComp.gb tm)
|
||||
|
||||
PMR pm ->
|
||||
Html.map PersonMsg (Comp.PersonForm.view2 True settings pm)
|
||||
Html.map PersonMsg (Comp.PersonForm.view2 Messages.PersonFormComp.gb True settings pm)
|
||||
|
||||
PMC pm ->
|
||||
Html.map PersonMsg (Comp.PersonForm.view2 True settings pm)
|
||||
Html.map PersonMsg (Comp.PersonForm.view2 Messages.PersonFormComp.gb True settings pm)
|
||||
|
||||
OM om ->
|
||||
Html.map OrgMsg (Comp.OrgForm.view2 True settings om)
|
||||
Html.map OrgMsg (Comp.OrgForm.view2 Messages.OrgFormComp.gb True settings om)
|
||||
|
||||
EM em ->
|
||||
Html.map EquipMsg (Comp.EquipmentForm.view2 em)
|
||||
Html.map EquipMsg (Comp.EquipmentForm.view2 Messages.EquipmentFormComp.gb em)
|
||||
|
||||
CFM fm ->
|
||||
div []
|
||||
(List.map (Html.map CustomFieldMsg)
|
||||
(Comp.CustomFieldForm.view2
|
||||
Messages.CustomFieldFormComp.gb
|
||||
{ classes = ""
|
||||
, showControls = False
|
||||
}
|
||||
|
@ -410,11 +410,11 @@ type alias ViewSettings a =
|
||||
}
|
||||
|
||||
|
||||
orgFormViewSettings : DS.DropdownStyle -> ViewSettings IdName
|
||||
orgFormViewSettings ds =
|
||||
orgFormViewSettings : String -> DS.DropdownStyle -> ViewSettings IdName
|
||||
orgFormViewSettings placeholder ds =
|
||||
{ makeOption = \e -> { text = e.name, additional = "" }
|
||||
, labelColor = \_ -> \_ -> ""
|
||||
, placeholder = "Choose an organization"
|
||||
, placeholder = placeholder
|
||||
, style = ds
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Messages.EquipmentFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Maybe
|
||||
|
||||
@ -99,11 +100,11 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
let
|
||||
equipUseCfg =
|
||||
{ display = Data.EquipmentUse.label
|
||||
{ display = texts.equipmentUseLabel
|
||||
, icon = \_ -> Nothing
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onSubmit)
|
||||
import Http
|
||||
import Messages.EquipmentManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -204,38 +205,41 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
if model.viewMode == Table then
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
else
|
||||
viewForm2 model
|
||||
viewForm2 texts model
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewEquipment
|
||||
, title = "Create a new equipment"
|
||||
, title = texts.createNewEquipment
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New Equipment"
|
||||
, label = texts.newEquipment
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.EquipmentTable.view2 model.tableModel)
|
||||
, Html.map TableMsg
|
||||
(Comp.EquipmentTable.view2 texts.equipmentTable
|
||||
model.tableModel
|
||||
)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "ui dimmer", True )
|
||||
@ -247,14 +251,14 @@ viewTable2 model =
|
||||
]
|
||||
|
||||
|
||||
viewForm2 : Model -> Html Msg
|
||||
viewForm2 model =
|
||||
viewForm2 : Texts -> Model -> Html Msg
|
||||
viewForm2 texts model =
|
||||
let
|
||||
newEquipment =
|
||||
model.formModel.equipment.id == ""
|
||||
|
||||
dimmerSettings2 =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this equipment?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteEquipment
|
||||
in
|
||||
Html.form
|
||||
[ class "relative flex flex-col"
|
||||
@ -268,14 +272,14 @@ viewForm2 model =
|
||||
)
|
||||
, if newEquipment then
|
||||
h1 [ class S.header2 ]
|
||||
[ text "Create new equipment"
|
||||
[ text texts.createNewEquipment
|
||||
]
|
||||
|
||||
else
|
||||
h1 [ class S.header2 ]
|
||||
[ text model.formModel.equipment.name
|
||||
, div [ class "opacity-50 text-sm" ]
|
||||
[ text "Id: "
|
||||
[ text (texts.basics.id ++ ": ")
|
||||
, text model.formModel.equipment.id
|
||||
]
|
||||
]
|
||||
@ -283,24 +287,24 @@ viewForm2 model =
|
||||
{ start =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = Submit
|
||||
, title = "Submit this form"
|
||||
, title = texts.basics.submitThisForm
|
||||
, icon = Just "fa fa-save"
|
||||
, label = "Submit"
|
||||
, label = texts.basics.submit
|
||||
}
|
||||
, MB.SecondaryButton
|
||||
{ tagger = SetViewMode Table
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, label = "Cancel"
|
||||
, label = texts.basics.cancel
|
||||
}
|
||||
]
|
||||
, end =
|
||||
if not newEquipment then
|
||||
[ MB.DeleteButton
|
||||
{ tagger = RequestDelete
|
||||
, title = "Delete this equipment"
|
||||
, title = texts.deleteThisEquipment
|
||||
, icon = Just "fa fa-trash"
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
}
|
||||
]
|
||||
|
||||
@ -317,6 +321,6 @@ viewForm2 model =
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.EquipmentForm.view2 model.formModel)
|
||||
, Html.map FormMsg (Comp.EquipmentForm.view2 texts.equipmentForm model.formModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -12,7 +12,7 @@ import Data.EquipmentUse
|
||||
import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Messages.EquipmentTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
|
||||
|
||||
@ -52,25 +52,25 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [ class "" ] []
|
||||
, th [ class "text-left pr-1 md:px-2 w-20" ]
|
||||
[ text "Use"
|
||||
[ text texts.use
|
||||
]
|
||||
, th [ class "text-left" ] [ text "Name" ]
|
||||
, th [ class "text-left" ] [ text texts.name ]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
(List.map (renderEquipmentLine2 model) model.equips)
|
||||
(List.map (renderEquipmentLine2 texts model) model.equips)
|
||||
]
|
||||
|
||||
|
||||
renderEquipmentLine2 : Model -> Equipment -> Html Msg
|
||||
renderEquipmentLine2 model equip =
|
||||
renderEquipmentLine2 : Texts -> Model -> Equipment -> Html Msg
|
||||
renderEquipmentLine2 texts model equip =
|
||||
tr
|
||||
[ classList [ ( "active", model.selected == Just equip ) ]
|
||||
, class S.tableRow
|
||||
@ -80,7 +80,7 @@ renderEquipmentLine2 model equip =
|
||||
[ div [ class "label inline-flex text-sm" ]
|
||||
[ Data.EquipmentUse.fromString equip.use
|
||||
|> Maybe.withDefault Data.EquipmentUse.Concerning
|
||||
|> Data.EquipmentUse.label
|
||||
|> texts.equipmentUseLabel
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
@ -24,6 +24,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput)
|
||||
import Http
|
||||
import Messages.FolderDetailComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -275,8 +276,8 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Flags -> Model -> Html Msg
|
||||
view2 flags model =
|
||||
view2 : Texts -> Flags -> Model -> Html Msg
|
||||
view2 texts flags model =
|
||||
let
|
||||
isOwner =
|
||||
Maybe.map .user flags.account
|
||||
@ -285,10 +286,10 @@ view2 flags model =
|
||||
|
||||
dimmerSettings : Comp.YesNoDimmer.Settings
|
||||
dimmerSettings =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this folder?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteThisFolder
|
||||
in
|
||||
div [ class "flex flex-col md:relative" ]
|
||||
(viewButtons2 model
|
||||
(viewButtons2 texts model
|
||||
:: [ Html.map DeleteMsg
|
||||
(Comp.YesNoDimmer.viewN
|
||||
True
|
||||
@ -299,26 +300,26 @@ view2 flags model =
|
||||
[ class "py-2 text-lg opacity-75"
|
||||
, classList [ ( "hidden", model.folder.id /= "" ) ]
|
||||
]
|
||||
[ text "You are automatically set as owner of this new folder."
|
||||
[ text texts.autoOwnerInfo
|
||||
]
|
||||
, div
|
||||
[ class "py-2 text-lg opacity-75"
|
||||
, classList [ ( "hidden", model.folder.id == "" ) ]
|
||||
]
|
||||
[ text "Modify this folder by changing the name or add/remove members."
|
||||
[ text texts.modifyInfo
|
||||
]
|
||||
, div
|
||||
[ class S.message
|
||||
, classList [ ( "hidden", model.folder.id == "" || isOwner ) ]
|
||||
]
|
||||
[ text "You are not the owner of this folder and therefore are not allowed to edit it."
|
||||
[ text texts.notOwnerInfo
|
||||
]
|
||||
, div [ class "mb-4 flex flex-col" ]
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
, for "folder-name"
|
||||
]
|
||||
[ text "Name"
|
||||
[ text texts.name
|
||||
, B.inputRequired
|
||||
]
|
||||
, div [ class "flex flex-row space-x-2" ]
|
||||
@ -340,7 +341,7 @@ view2 flags model =
|
||||
]
|
||||
[ i [ class "fa fa-save" ] []
|
||||
, span [ class "ml-2 hidden sm:inline" ]
|
||||
[ text "Save"
|
||||
[ text texts.basics.submit
|
||||
]
|
||||
]
|
||||
]
|
||||
@ -358,12 +359,12 @@ view2 flags model =
|
||||
|> text
|
||||
]
|
||||
]
|
||||
++ viewMembers2 model
|
||||
++ viewMembers2 texts model
|
||||
)
|
||||
|
||||
|
||||
viewMembers2 : Model -> List (Html Msg)
|
||||
viewMembers2 model =
|
||||
viewMembers2 : Texts -> Model -> List (Html Msg)
|
||||
viewMembers2 texts model =
|
||||
let
|
||||
folderCfg =
|
||||
{ display = .name
|
||||
@ -379,7 +380,7 @@ viewMembers2 model =
|
||||
[ class S.header3
|
||||
, class "mt-4"
|
||||
]
|
||||
[ text "Members"
|
||||
[ text texts.members
|
||||
]
|
||||
, div [ class "flex flex-col space-y-2" ]
|
||||
[ div [ class "flex flex-row space-x-2" ]
|
||||
@ -393,7 +394,7 @@ viewMembers2 model =
|
||||
)
|
||||
]
|
||||
, a
|
||||
[ title "Add a new member"
|
||||
[ title texts.addMember
|
||||
, onClick AddMember
|
||||
, class S.primaryButton
|
||||
, href "#"
|
||||
@ -401,7 +402,7 @@ viewMembers2 model =
|
||||
]
|
||||
[ i [ class "fa fa-plus" ] []
|
||||
, span [ class "ml-2 hidden sm:inline" ]
|
||||
[ text "Add"
|
||||
[ text texts.add
|
||||
]
|
||||
]
|
||||
]
|
||||
@ -410,19 +411,19 @@ viewMembers2 model =
|
||||
[ class "flex flex-col space-y-4 md:space-y-2 mt-2"
|
||||
, class "px-2 border-0 border-l dark:border-bluegray-600"
|
||||
]
|
||||
(List.map viewMember2 model.members)
|
||||
(List.map (viewMember2 texts) model.members)
|
||||
]
|
||||
|
||||
|
||||
viewMember2 : IdName -> Html Msg
|
||||
viewMember2 member =
|
||||
viewMember2 : Texts -> IdName -> Html Msg
|
||||
viewMember2 texts member =
|
||||
div
|
||||
[ class "flex flex-row space-x-2 items-center"
|
||||
]
|
||||
[ a
|
||||
[ class S.deleteLabel
|
||||
, href "#"
|
||||
, title "Remove this member"
|
||||
, title texts.removeMember
|
||||
, onClick (RemoveMember member)
|
||||
]
|
||||
[ i [ class "fa fa-trash " ] []
|
||||
@ -433,23 +434,23 @@ viewMember2 member =
|
||||
]
|
||||
|
||||
|
||||
viewButtons2 : Model -> Html Msg
|
||||
viewButtons2 model =
|
||||
viewButtons2 : Texts -> Model -> Html Msg
|
||||
viewButtons2 texts model =
|
||||
MB.view
|
||||
{ start =
|
||||
[ MB.SecondaryButton
|
||||
{ tagger = GoBack
|
||||
, label = "Back"
|
||||
, label = texts.basics.cancel
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.CustomButton
|
||||
{ tagger = RequestDelete
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
, icon = Just "fa fa-trash"
|
||||
, title = "Delete this folder"
|
||||
, title = texts.deleteThisFolder
|
||||
, inputClass =
|
||||
[ ( S.deleteButton, True )
|
||||
, ( "hidden", model.folder.id == "" )
|
||||
|
@ -20,6 +20,7 @@ import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Http
|
||||
import Messages.FolderManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
|
||||
|
||||
@ -168,50 +169,54 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Flags -> Model -> Html Msg
|
||||
view2 flags model =
|
||||
view2 : Texts -> Flags -> Model -> Html Msg
|
||||
view2 texts flags model =
|
||||
case model.detailModel of
|
||||
Just dm ->
|
||||
viewDetail2 flags dm
|
||||
viewDetail2 texts flags dm
|
||||
|
||||
Nothing ->
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
|
||||
viewDetail2 : Flags -> Comp.FolderDetail.Model -> Html Msg
|
||||
viewDetail2 flags model =
|
||||
viewDetail2 : Texts -> Flags -> Comp.FolderDetail.Model -> Html Msg
|
||||
viewDetail2 texts flags model =
|
||||
div []
|
||||
[ if model.folder.id == "" then
|
||||
h3 [ class S.header2 ]
|
||||
[ text "Create new Folder"
|
||||
[ text texts.createNewFolder
|
||||
]
|
||||
|
||||
else
|
||||
h3 [ class S.header2 ]
|
||||
[ text model.folder.name
|
||||
, div [ class "opacity-50 text-sm" ]
|
||||
[ text "Id: "
|
||||
[ text (texts.basics.id ++ ": ")
|
||||
, text model.folder.id
|
||||
]
|
||||
]
|
||||
, Html.map DetailMsg (Comp.FolderDetail.view2 flags model)
|
||||
, Html.map DetailMsg
|
||||
(Comp.FolderDetail.view2 texts.folderDetail
|
||||
flags
|
||||
model
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
, MB.Checkbox
|
||||
{ tagger = \_ -> ToggleOwningOnly
|
||||
, label = "Show owning folders only"
|
||||
, label = texts.showOwningFoldersOnly
|
||||
, value = model.owningOnly
|
||||
, id = "folder-toggle-owner"
|
||||
}
|
||||
@ -219,14 +224,19 @@ viewTable2 model =
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewFolder
|
||||
, title = "Create a new folder"
|
||||
, title = texts.createNewFolder
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New Folder"
|
||||
, label = texts.newFolder
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.FolderTable.view2 model.tableModel model.folders)
|
||||
, Html.map TableMsg
|
||||
(Comp.FolderTable.view2
|
||||
texts.folderTable
|
||||
model.tableModel
|
||||
model.folders
|
||||
)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "ui dimmer", True )
|
||||
|
@ -11,6 +11,7 @@ import Api.Model.FolderItem exposing (FolderItem)
|
||||
import Comp.Basic as B
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Messages.FolderTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Time
|
||||
|
||||
@ -44,23 +45,27 @@ update msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> List FolderItem -> Html Msg
|
||||
view2 _ items =
|
||||
view2 : Texts -> Model -> List FolderItem -> Html Msg
|
||||
view2 texts _ items =
|
||||
table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [ class "w-px whitespace-nowrap pr-1 md:pr-3" ] []
|
||||
, th [ class "text-left" ] [ text "Name" ]
|
||||
, th [ class "text-left" ]
|
||||
[ text texts.name
|
||||
]
|
||||
, th [ class "text-left hidden sm:table-cell" ] [ text "Owner" ]
|
||||
, th [ class "text-center" ]
|
||||
[ span [ class "hidden sm:inline" ]
|
||||
[ text "#Member"
|
||||
[ text texts.memberCount
|
||||
]
|
||||
, span [ class "sm:hidden" ]
|
||||
[ text "#"
|
||||
]
|
||||
]
|
||||
, th [ class "text-center" ] [ text "Created" ]
|
||||
, th [ class "text-center" ]
|
||||
[ text texts.basics.created
|
||||
]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
|
@ -296,7 +296,7 @@ item visible. This message will disappear then.
|
||||
]
|
||||
, Html.map OrgDropdownMsg
|
||||
(Comp.Dropdown.view2
|
||||
(Comp.Dropdown.orgFormViewSettings dds)
|
||||
(Comp.Dropdown.orgFormViewSettings "Choose an organization" dds)
|
||||
settings
|
||||
model.corrOrgModel
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Messages.OrgFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Maybe
|
||||
|
||||
@ -146,14 +147,19 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 mobile settings model =
|
||||
view2 : Texts -> Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 texts mobile settings model =
|
||||
let
|
||||
orgUseCfg =
|
||||
{ display = Data.OrgUse.label
|
||||
{ display = texts.orgUseLabel
|
||||
, icon = \_ -> Nothing
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
|
||||
contactTypeCfg =
|
||||
{ mobile = mobile
|
||||
, contactTypeLabel = texts.contactTypeLabel
|
||||
}
|
||||
in
|
||||
div [ class "flex flex-col" ]
|
||||
[ div
|
||||
@ -162,13 +168,13 @@ view2 mobile settings model =
|
||||
[ for "orgname"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Name"
|
||||
[ text texts.name
|
||||
, B.inputRequired
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetName
|
||||
, placeholder "Name"
|
||||
, placeholder texts.name
|
||||
, value model.name
|
||||
, name "orgname"
|
||||
, class S.textInput
|
||||
@ -184,12 +190,12 @@ view2 mobile settings model =
|
||||
[ for "org-short-name"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Short Name"
|
||||
[ text texts.shortName
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetShortName
|
||||
, placeholder "Abbreviation"
|
||||
, placeholder texts.shortName
|
||||
, Maybe.withDefault "" model.shortName
|
||||
|> value
|
||||
, name "org-short-name"
|
||||
@ -201,7 +207,8 @@ view2 mobile settings model =
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
]
|
||||
[ text "Use" ]
|
||||
[ text texts.use
|
||||
]
|
||||
, Html.map UseDropdownMsg
|
||||
(Comp.FixedDropdown.viewStyled2 orgUseCfg
|
||||
False
|
||||
@ -211,29 +218,29 @@ view2 mobile settings model =
|
||||
, span [ class "opacity-50 text-sm" ]
|
||||
[ case model.use of
|
||||
Data.OrgUse.Correspondent ->
|
||||
text "Use as correspondent"
|
||||
text texts.useAsCorrespondent
|
||||
|
||||
Data.OrgUse.Disabled ->
|
||||
text "Do not use for suggestions."
|
||||
text texts.dontUseForSuggestions
|
||||
]
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Address"
|
||||
[ text texts.address
|
||||
]
|
||||
, Html.map AddressMsg
|
||||
(Comp.AddressForm.view2 settings model.addressModel)
|
||||
(Comp.AddressForm.view2 texts.addressForm settings model.addressModel)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Contacts"
|
||||
[ text texts.contacts
|
||||
]
|
||||
, Html.map ContactMsg
|
||||
(Comp.ContactField.view2 mobile settings model.contactModel)
|
||||
(Comp.ContactField.view2 contactTypeCfg settings model.contactModel)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Notes"
|
||||
[ text texts.notes
|
||||
]
|
||||
, div [ class "" ]
|
||||
[ textarea
|
||||
|
@ -21,6 +21,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onSubmit)
|
||||
import Http
|
||||
import Messages.OrgManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -205,50 +206,50 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : UiSettings -> Model -> Html Msg
|
||||
view2 settings model =
|
||||
view2 : Texts -> UiSettings -> Model -> Html Msg
|
||||
view2 texts settings model =
|
||||
if model.viewMode == Table then
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
else
|
||||
viewForm2 settings model
|
||||
viewForm2 texts settings model
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col relative" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewOrg
|
||||
, title = "Create a new organization"
|
||||
, title = texts.createNewOrganization
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New Organization"
|
||||
, label = texts.newOrganization
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.OrgTable.view2 model.tableModel)
|
||||
, Html.map TableMsg (Comp.OrgTable.view2 texts.orgTable model.tableModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
||||
|
||||
viewForm2 : UiSettings -> Model -> Html Msg
|
||||
viewForm2 settings model =
|
||||
viewForm2 : Texts -> UiSettings -> Model -> Html Msg
|
||||
viewForm2 texts settings model =
|
||||
let
|
||||
newOrg =
|
||||
model.formModel.org.id == ""
|
||||
|
||||
dimmerSettings2 =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this organization?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteOrg
|
||||
in
|
||||
Html.form
|
||||
[ class "md:relative flex flex-col"
|
||||
@ -262,14 +263,14 @@ viewForm2 settings model =
|
||||
)
|
||||
, if newOrg then
|
||||
h3 [ class S.header2 ]
|
||||
[ text "Create new organization"
|
||||
[ text texts.createNewOrganization
|
||||
]
|
||||
|
||||
else
|
||||
h3 [ class S.header2 ]
|
||||
[ text model.formModel.org.name
|
||||
, div [ class "opacity-50 text-sm" ]
|
||||
[ text "Id: "
|
||||
[ text (texts.basics.id ++ ": ")
|
||||
, text model.formModel.org.id
|
||||
]
|
||||
]
|
||||
@ -277,24 +278,24 @@ viewForm2 settings model =
|
||||
{ start =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = Submit
|
||||
, title = "Submit this form"
|
||||
, title = texts.basics.submitThisForm
|
||||
, icon = Just "fa fa-save"
|
||||
, label = "Submit"
|
||||
, label = texts.basics.submit
|
||||
}
|
||||
, MB.SecondaryButton
|
||||
{ tagger = SetViewMode Table
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, label = "Cancel"
|
||||
, label = texts.basics.cancel
|
||||
}
|
||||
]
|
||||
, end =
|
||||
if not newOrg then
|
||||
[ MB.DeleteButton
|
||||
{ tagger = RequestDelete
|
||||
, title = "Delete this organization"
|
||||
, title = texts.deleteThisOrg
|
||||
, icon = Just "fa fa-trash"
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
}
|
||||
]
|
||||
|
||||
@ -311,6 +312,12 @@ viewForm2 settings model =
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.OrgForm.view2 False settings model.formModel)
|
||||
, Html.map FormMsg
|
||||
(Comp.OrgForm.view2
|
||||
texts.orgForm
|
||||
False
|
||||
settings
|
||||
model.formModel
|
||||
)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -12,6 +12,7 @@ import Data.Flags exposing (Flags)
|
||||
import Data.OrgUse
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Messages.OrgTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Address
|
||||
import Util.Contact
|
||||
@ -53,8 +54,8 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
@ -62,18 +63,24 @@ view2 model =
|
||||
, th [ class "text-left pr-1 md:px-2" ]
|
||||
[ text "Use"
|
||||
]
|
||||
, th [ class "text-left" ] [ text "Name" ]
|
||||
, th [ class "text-left hidden md:table-cell" ] [ text "Address" ]
|
||||
, th [ class "text-left hidden sm:table-cell" ] [ text "Contact" ]
|
||||
, th [ class "text-left" ]
|
||||
[ text texts.name
|
||||
]
|
||||
, th [ class "text-left hidden md:table-cell" ]
|
||||
[ text texts.address
|
||||
]
|
||||
, th [ class "text-left hidden sm:table-cell" ]
|
||||
[ text texts.contact
|
||||
]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
(List.map (renderOrgLine2 model) model.orgs)
|
||||
(List.map (renderOrgLine2 texts model) model.orgs)
|
||||
]
|
||||
|
||||
|
||||
renderOrgLine2 : Model -> Organization -> Html Msg
|
||||
renderOrgLine2 model org =
|
||||
renderOrgLine2 : Texts -> Model -> Organization -> Html Msg
|
||||
renderOrgLine2 texts model org =
|
||||
tr
|
||||
[ classList [ ( "active", model.selected == Just org ) ]
|
||||
, class S.tableRow
|
||||
@ -83,7 +90,7 @@ renderOrgLine2 model org =
|
||||
[ div [ class "label inline-flex text-sm" ]
|
||||
[ Data.OrgUse.fromString org.use
|
||||
|> Maybe.withDefault Data.OrgUse.Correspondent
|
||||
|> Data.OrgUse.label
|
||||
|> texts.orgUseLabel
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
@ -22,6 +22,7 @@ import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Messages.PersonFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
|
||||
|
||||
@ -178,14 +179,19 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 mobile settings model =
|
||||
view2 : Texts -> Bool -> UiSettings -> Model -> Html Msg
|
||||
view2 texts mobile settings model =
|
||||
let
|
||||
personUseCfg =
|
||||
{ display = Data.PersonUse.label
|
||||
{ display = texts.personUseLabel
|
||||
, icon = \_ -> Nothing
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
|
||||
contactCfg =
|
||||
{ mobile = mobile
|
||||
, contactTypeLabel = texts.contactTypeLabel
|
||||
}
|
||||
in
|
||||
div [ class "flex flex-col" ]
|
||||
[ div
|
||||
@ -195,13 +201,13 @@ view2 mobile settings model =
|
||||
[ class S.inputLabel
|
||||
, for "personname"
|
||||
]
|
||||
[ text "Name"
|
||||
[ text texts.name
|
||||
, B.inputRequired
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetName
|
||||
, placeholder "Name"
|
||||
, placeholder texts.name
|
||||
, value model.name
|
||||
, class S.textInput
|
||||
, classList
|
||||
@ -215,53 +221,58 @@ view2 mobile settings model =
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
]
|
||||
[ text "Use of this person" ]
|
||||
[ text texts.useOfPerson
|
||||
]
|
||||
, Html.map UseDropdownMsg
|
||||
(Comp.FixedDropdown.viewStyled2 personUseCfg False (Just model.use) model.useModel)
|
||||
, span [ class "opacity-50 text-sm" ]
|
||||
[ case model.use of
|
||||
Data.PersonUse.Concerning ->
|
||||
text "Use as concerning person only"
|
||||
text texts.useAsConcerningOnly
|
||||
|
||||
Data.PersonUse.Correspondent ->
|
||||
text "Use as correspondent person only"
|
||||
text texts.useAsCorrespondentOnly
|
||||
|
||||
Data.PersonUse.Both ->
|
||||
text "Use as both concerning or correspondent person"
|
||||
text texts.useAsBoth
|
||||
|
||||
Data.PersonUse.Disabled ->
|
||||
text "Do not use for suggestions."
|
||||
text texts.dontUseForSuggestions
|
||||
]
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
]
|
||||
[ text "Organization"
|
||||
[ text texts.organization
|
||||
]
|
||||
, Html.map OrgDropdownMsg
|
||||
(Comp.Dropdown.view2
|
||||
(Comp.Dropdown.orgFormViewSettings DS.mainStyle)
|
||||
(Comp.Dropdown.orgFormViewSettings texts.chooseAnOrg DS.mainStyle)
|
||||
settings
|
||||
model.orgModel
|
||||
)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class "ui dividing header" ]
|
||||
[ text "Address"
|
||||
[ text texts.address
|
||||
]
|
||||
, Html.map AddressMsg (Comp.AddressForm.view2 settings model.addressModel)
|
||||
, Html.map AddressMsg
|
||||
(Comp.AddressForm.view2 texts.addressForm
|
||||
settings
|
||||
model.addressModel
|
||||
)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Contacts"
|
||||
[ text texts.contacts
|
||||
]
|
||||
, Html.map ContactMsg
|
||||
(Comp.ContactField.view2 mobile settings model.contactModel)
|
||||
(Comp.ContactField.view2 contactCfg settings model.contactModel)
|
||||
]
|
||||
, div [ class "mb-4" ]
|
||||
[ h3 [ class S.header3 ]
|
||||
[ text "Notes"
|
||||
[ text texts.notes
|
||||
]
|
||||
, div [ class "" ]
|
||||
[ textarea
|
||||
|
@ -22,6 +22,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onSubmit)
|
||||
import Http
|
||||
import Messages.PersonManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -242,50 +243,50 @@ isLoading model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : UiSettings -> Model -> Html Msg
|
||||
view2 settings model =
|
||||
view2 : Texts -> UiSettings -> Model -> Html Msg
|
||||
view2 texts settings model =
|
||||
if model.viewMode == Table then
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
else
|
||||
viewForm2 settings model
|
||||
viewForm2 texts settings model
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewPerson
|
||||
, title = "Create a new person"
|
||||
, title = texts.createNewPerson
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New Person"
|
||||
, label = texts.newPerson
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.PersonTable.view2 model.tableModel)
|
||||
, Html.map TableMsg (Comp.PersonTable.view2 texts.personTable model.tableModel)
|
||||
, B.loadingDimmer (isLoading model)
|
||||
]
|
||||
|
||||
|
||||
viewForm2 : UiSettings -> Model -> Html Msg
|
||||
viewForm2 settings model =
|
||||
viewForm2 : Texts -> UiSettings -> Model -> Html Msg
|
||||
viewForm2 texts settings model =
|
||||
let
|
||||
newPerson =
|
||||
model.formModel.person.id == ""
|
||||
|
||||
dimmerSettings2 =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this person?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeletePerson
|
||||
in
|
||||
Html.form
|
||||
[ class "md:relative flex flex-col"
|
||||
@ -299,14 +300,14 @@ viewForm2 settings model =
|
||||
)
|
||||
, if newPerson then
|
||||
h3 [ class S.header2 ]
|
||||
[ text "Create new person"
|
||||
[ text texts.createNewPerson
|
||||
]
|
||||
|
||||
else
|
||||
h3 [ class S.header2 ]
|
||||
[ text model.formModel.person.name
|
||||
, div [ class "opacity-50 text-sm" ]
|
||||
[ text "Id: "
|
||||
[ text (texts.basics.id ++ ": ")
|
||||
, text model.formModel.person.id
|
||||
]
|
||||
]
|
||||
@ -314,24 +315,24 @@ viewForm2 settings model =
|
||||
{ start =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = Submit
|
||||
, title = "Submit this form"
|
||||
, title = texts.basics.submitThisForm
|
||||
, icon = Just "fa fa-save"
|
||||
, label = "Submit"
|
||||
, label = texts.basics.submit
|
||||
}
|
||||
, MB.SecondaryButton
|
||||
{ tagger = SetViewMode Table
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, label = "Cancel"
|
||||
, label = texts.basics.cancel
|
||||
}
|
||||
]
|
||||
, end =
|
||||
if not newPerson then
|
||||
[ MB.DeleteButton
|
||||
{ tagger = RequestDelete
|
||||
, title = "Delete this person"
|
||||
, title = texts.deleteThisPerson
|
||||
, icon = Just "fa fa-trash"
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
}
|
||||
]
|
||||
|
||||
@ -348,6 +349,11 @@ viewForm2 settings model =
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.PersonForm.view2 False settings model.formModel)
|
||||
, Html.map FormMsg
|
||||
(Comp.PersonForm.view2 texts.personForm
|
||||
False
|
||||
settings
|
||||
model.formModel
|
||||
)
|
||||
, B.loadingDimmer (isLoading model)
|
||||
]
|
||||
|
@ -12,6 +12,7 @@ import Data.Flags exposing (Flags)
|
||||
import Data.PersonUse
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Messages.PersonTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Contact
|
||||
|
||||
@ -52,8 +53,8 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
@ -67,12 +68,12 @@ view2 model =
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
(List.map (renderPersonLine2 model) model.equips)
|
||||
(List.map (renderPersonLine2 texts model) model.equips)
|
||||
]
|
||||
|
||||
|
||||
renderPersonLine2 : Model -> Person -> Html Msg
|
||||
renderPersonLine2 model person =
|
||||
renderPersonLine2 : Texts -> Model -> Person -> Html Msg
|
||||
renderPersonLine2 texts model person =
|
||||
tr
|
||||
[ classList [ ( "active", model.selected == Just person ) ]
|
||||
, class S.tableRow
|
||||
@ -82,7 +83,7 @@ renderPersonLine2 model person =
|
||||
[ div [ class "label inline-flex text-sm" ]
|
||||
[ Data.PersonUse.fromString person.use
|
||||
|> Maybe.withDefault Data.PersonUse.Both
|
||||
|> Data.PersonUse.label
|
||||
|> texts.personUseLabel
|
||||
|> text
|
||||
]
|
||||
]
|
||||
|
@ -1138,7 +1138,7 @@ searchTabs ddd flags settings model =
|
||||
[ text "Organization" ]
|
||||
, Html.map OrgMsg
|
||||
(Comp.Dropdown.view2
|
||||
(Comp.Dropdown.orgFormViewSettings DS.sidebarStyle)
|
||||
(Comp.Dropdown.orgFormViewSettings "Choose an organization" DS.sidebarStyle)
|
||||
settings
|
||||
model.orgModel
|
||||
)
|
||||
|
@ -16,6 +16,7 @@ import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Messages.TagFormComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Maybe
|
||||
|
||||
@ -118,12 +119,12 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
let
|
||||
categoryCfg =
|
||||
{ makeOption = \s -> Comp.Dropdown.mkOption s
|
||||
, placeholder = "Select or define category..."
|
||||
, placeholder = texts.selectDefineCategory
|
||||
, labelColor = \_ -> \_ -> ""
|
||||
, style = DS.mainStyle
|
||||
}
|
||||
@ -135,13 +136,13 @@ view2 model =
|
||||
[ for "tagname"
|
||||
, class S.inputLabel
|
||||
]
|
||||
[ text "Name"
|
||||
[ text texts.name
|
||||
, B.inputRequired
|
||||
]
|
||||
, input
|
||||
[ type_ "text"
|
||||
, onInput SetName
|
||||
, placeholder "Name"
|
||||
, placeholder texts.name
|
||||
, value model.name
|
||||
, id "tagname"
|
||||
, class S.textInput
|
||||
@ -157,7 +158,7 @@ view2 model =
|
||||
[ label
|
||||
[ class S.inputLabel
|
||||
]
|
||||
[ text "Category"
|
||||
[ text texts.category
|
||||
]
|
||||
, Html.map CatMsg
|
||||
(Comp.Dropdown.viewSingle2
|
||||
|
@ -20,6 +20,7 @@ import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onSubmit)
|
||||
import Http
|
||||
import Messages.TagManageComp exposing (Texts)
|
||||
import Styles as S
|
||||
import Util.Http
|
||||
import Util.Maybe
|
||||
@ -213,38 +214,38 @@ update flags msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
if model.viewMode == Table then
|
||||
viewTable2 model
|
||||
viewTable2 texts model
|
||||
|
||||
else
|
||||
viewForm2 model
|
||||
viewForm2 texts model
|
||||
|
||||
|
||||
viewTable2 : Model -> Html Msg
|
||||
viewTable2 model =
|
||||
viewTable2 : Texts -> Model -> Html Msg
|
||||
viewTable2 texts model =
|
||||
div [ class "flex flex-col" ]
|
||||
[ MB.view
|
||||
{ start =
|
||||
[ MB.TextInput
|
||||
{ tagger = SetQuery
|
||||
, value = model.query
|
||||
, placeholder = "Search…"
|
||||
, placeholder = texts.basics.searchPlaceholder
|
||||
, icon = Just "fa fa-search"
|
||||
}
|
||||
]
|
||||
, end =
|
||||
[ MB.PrimaryButton
|
||||
{ tagger = InitNewTag
|
||||
, title = "Create a new tag"
|
||||
, title = texts.createNewTag
|
||||
, icon = Just "fa fa-plus"
|
||||
, label = "New Tag"
|
||||
, label = texts.newTag
|
||||
}
|
||||
]
|
||||
, rootClasses = "mb-4"
|
||||
}
|
||||
, Html.map TableMsg (Comp.TagTable.view2 model.tagTableModel)
|
||||
, Html.map TableMsg (Comp.TagTable.view2 texts.tagTable model.tagTableModel)
|
||||
, div
|
||||
[ classList
|
||||
[ ( "ui dimmer", True )
|
||||
@ -256,14 +257,14 @@ viewTable2 model =
|
||||
]
|
||||
|
||||
|
||||
viewForm2 : Model -> Html Msg
|
||||
viewForm2 model =
|
||||
viewForm2 : Texts -> Model -> Html Msg
|
||||
viewForm2 texts model =
|
||||
let
|
||||
newTag =
|
||||
model.tagFormModel.tag.id == ""
|
||||
|
||||
dimmerSettings2 =
|
||||
Comp.YesNoDimmer.defaultSettings2 "Really delete this tag?"
|
||||
Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTag
|
||||
in
|
||||
Html.form
|
||||
[ class "relative flex flex-col"
|
||||
@ -277,7 +278,7 @@ viewForm2 model =
|
||||
)
|
||||
, if newTag then
|
||||
h1 [ class S.header2 ]
|
||||
[ text "Create new tag"
|
||||
[ text texts.createNewTag
|
||||
]
|
||||
|
||||
else
|
||||
@ -294,22 +295,22 @@ viewForm2 model =
|
||||
{ tagger = Submit
|
||||
, title = "Submit this form"
|
||||
, icon = Just "fa fa-save"
|
||||
, label = "Submit"
|
||||
, label = texts.basics.submit
|
||||
}
|
||||
, MB.SecondaryButton
|
||||
{ tagger = SetViewMode Table
|
||||
, title = "Back to list"
|
||||
, title = texts.basics.backToList
|
||||
, icon = Just "fa fa-arrow-left"
|
||||
, label = "Cancel"
|
||||
, label = texts.basics.cancel
|
||||
}
|
||||
]
|
||||
, end =
|
||||
if not newTag then
|
||||
[ MB.DeleteButton
|
||||
{ tagger = RequestDelete
|
||||
, title = "Delete this tag"
|
||||
, title = texts.deleteThisTag
|
||||
, icon = Just "fa fa-trash"
|
||||
, label = "Delete"
|
||||
, label = texts.basics.delete
|
||||
}
|
||||
]
|
||||
|
||||
@ -326,6 +327,6 @@ viewForm2 model =
|
||||
]
|
||||
[ Maybe.withDefault "" model.formError |> text
|
||||
]
|
||||
, Html.map FormMsg (Comp.TagForm.view2 model.tagFormModel)
|
||||
, Html.map FormMsg (Comp.TagForm.view2 texts.tagForm model.tagFormModel)
|
||||
, B.loadingDimmer model.loading
|
||||
]
|
||||
|
@ -11,6 +11,7 @@ import Comp.Basic as B
|
||||
import Data.Flags exposing (Flags)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Messages.TagTableComp exposing (Texts)
|
||||
import Styles as S
|
||||
|
||||
|
||||
@ -50,14 +51,14 @@ update _ msg model =
|
||||
--- View2
|
||||
|
||||
|
||||
view2 : Model -> Html Msg
|
||||
view2 model =
|
||||
view2 : Texts -> Model -> Html Msg
|
||||
view2 texts model =
|
||||
table [ class S.tableMain ]
|
||||
[ thead []
|
||||
[ tr []
|
||||
[ th [ class "" ] []
|
||||
, th [ class "text-left" ] [ text "Name" ]
|
||||
, th [ class "text-left" ] [ text "Category" ]
|
||||
, th [ class "text-left" ] [ text texts.name ]
|
||||
, th [ class "text-left" ] [ text texts.category ]
|
||||
]
|
||||
]
|
||||
, tbody []
|
||||
|
@ -3,7 +3,6 @@ module Data.CustomFieldType exposing
|
||||
, all
|
||||
, asString
|
||||
, fromString
|
||||
, label
|
||||
)
|
||||
|
||||
|
||||
@ -39,25 +38,6 @@ asString ft =
|
||||
"money"
|
||||
|
||||
|
||||
label : CustomFieldType -> String
|
||||
label ft =
|
||||
case ft of
|
||||
Text ->
|
||||
"Text"
|
||||
|
||||
Numeric ->
|
||||
"Numeric"
|
||||
|
||||
Date ->
|
||||
"Date"
|
||||
|
||||
Boolean ->
|
||||
"Boolean"
|
||||
|
||||
Money ->
|
||||
"Money"
|
||||
|
||||
|
||||
fromString : String -> Maybe CustomFieldType
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
|
@ -3,7 +3,6 @@ module Data.EquipmentUse exposing
|
||||
, all
|
||||
, asString
|
||||
, fromString
|
||||
, label
|
||||
)
|
||||
|
||||
import Api.Model.Equipment exposing (Equipment)
|
||||
@ -37,16 +36,6 @@ asString pu =
|
||||
"disabled"
|
||||
|
||||
|
||||
label : EquipmentUse -> String
|
||||
label pu =
|
||||
case pu of
|
||||
Concerning ->
|
||||
"Concerning"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
||||
|
||||
|
||||
all : List EquipmentUse
|
||||
all =
|
||||
[ Concerning, Disabled ]
|
||||
|
@ -3,7 +3,6 @@ module Data.OrgUse exposing
|
||||
, all
|
||||
, asString
|
||||
, fromString
|
||||
, label
|
||||
)
|
||||
|
||||
|
||||
@ -35,16 +34,6 @@ asString pu =
|
||||
"disabled"
|
||||
|
||||
|
||||
label : OrgUse -> String
|
||||
label pu =
|
||||
case pu of
|
||||
Correspondent ->
|
||||
"Correspondent"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
||||
|
||||
|
||||
all : List OrgUse
|
||||
all =
|
||||
[ Correspondent, Disabled ]
|
||||
|
@ -3,7 +3,6 @@ module Data.PersonUse exposing
|
||||
, all
|
||||
, asString
|
||||
, fromString
|
||||
, label
|
||||
, spanPersonList
|
||||
)
|
||||
|
||||
@ -52,22 +51,6 @@ asString pu =
|
||||
"disabled"
|
||||
|
||||
|
||||
label : PersonUse -> String
|
||||
label pu =
|
||||
case pu of
|
||||
Correspondent ->
|
||||
"Correspondent"
|
||||
|
||||
Concerning ->
|
||||
"Concerning"
|
||||
|
||||
Both ->
|
||||
"Both"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
||||
|
||||
|
||||
all : List PersonUse
|
||||
all =
|
||||
[ Correspondent, Concerning, Both, Disabled ]
|
||||
|
@ -9,6 +9,7 @@ import Messages.App
|
||||
import Messages.CollectiveSettingsPage
|
||||
import Messages.ItemDetailPage
|
||||
import Messages.LoginPage
|
||||
import Messages.ManageDataPage
|
||||
import Messages.NewInvitePage
|
||||
import Messages.QueuePage
|
||||
import Messages.RegisterPage
|
||||
@ -33,6 +34,7 @@ type alias Messages =
|
||||
, itemDetail : Messages.ItemDetailPage.Texts
|
||||
, queue : Messages.QueuePage.Texts
|
||||
, userSettings : Messages.UserSettingsPage.Texts
|
||||
, manageData : Messages.ManageDataPage.Texts
|
||||
}
|
||||
|
||||
|
||||
@ -94,6 +96,7 @@ gb =
|
||||
, itemDetail = Messages.ItemDetailPage.gb
|
||||
, queue = Messages.QueuePage.gb
|
||||
, userSettings = Messages.UserSettingsPage.gb
|
||||
, manageData = Messages.ManageDataPage.gb
|
||||
}
|
||||
|
||||
|
||||
@ -112,4 +115,5 @@ de =
|
||||
, itemDetail = Messages.ItemDetailPage.de
|
||||
, queue = Messages.QueuePage.de
|
||||
, userSettings = Messages.UserSettingsPage.de
|
||||
, manageData = Messages.ManageDataPage.de
|
||||
}
|
||||
|
20
modules/webapp/src/main/elm/Messages/AddressFormComp.elm
Normal file
20
modules/webapp/src/main/elm/Messages/AddressFormComp.elm
Normal file
@ -0,0 +1,20 @@
|
||||
module Messages.AddressFormComp exposing (..)
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ selectCountry : String
|
||||
, street : String
|
||||
, zipCode : String
|
||||
, city : String
|
||||
, country : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ selectCountry = "Select Country"
|
||||
, street = "Street"
|
||||
, zipCode = "Zip Code"
|
||||
, city = "City"
|
||||
, country = "Country"
|
||||
}
|
@ -14,6 +14,8 @@ type alias Texts =
|
||||
, edit : String
|
||||
, back : String
|
||||
, backToList : String
|
||||
, searchPlaceholder : String
|
||||
, id : String
|
||||
}
|
||||
|
||||
|
||||
@ -31,6 +33,8 @@ gb =
|
||||
, edit = "Edit"
|
||||
, back = "Back"
|
||||
, backToList = "Back to list"
|
||||
, searchPlaceholder = "Search…"
|
||||
, id = "Id"
|
||||
}
|
||||
|
||||
|
||||
|
25
modules/webapp/src/main/elm/Messages/ContactTypeData.elm
Normal file
25
modules/webapp/src/main/elm/Messages/ContactTypeData.elm
Normal file
@ -0,0 +1,25 @@
|
||||
module Messages.ContactTypeData exposing (..)
|
||||
|
||||
import Data.ContactType exposing (ContactType(..))
|
||||
|
||||
|
||||
gb : ContactType -> String
|
||||
gb ct =
|
||||
case ct of
|
||||
Phone ->
|
||||
"Phone"
|
||||
|
||||
Mobile ->
|
||||
"Mobile"
|
||||
|
||||
Fax ->
|
||||
"Fax"
|
||||
|
||||
Email ->
|
||||
"Email"
|
||||
|
||||
Docspell ->
|
||||
"Docspell"
|
||||
|
||||
Website ->
|
||||
"Website"
|
46
modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm
Normal file
46
modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm
Normal file
@ -0,0 +1,46 @@
|
||||
module Messages.CustomFieldFormComp exposing (..)
|
||||
|
||||
import Data.CustomFieldType exposing (CustomFieldType)
|
||||
import Messages.Basics
|
||||
import Messages.CustomFieldTypeData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, reallyDeleteField : String
|
||||
, fieldTypeLabel : CustomFieldType -> String
|
||||
, createCustomField : String
|
||||
, modifyTypeWarning : String
|
||||
, name : String
|
||||
, nameInfo : String
|
||||
, fieldFormat : String
|
||||
, fieldFormatInfo : String
|
||||
, label : String
|
||||
, labelInfo : String
|
||||
, deleteThisField : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, reallyDeleteField = "Really delete this custom field?"
|
||||
, fieldTypeLabel = Messages.CustomFieldTypeData.gb
|
||||
, createCustomField = "Create a new custom field."
|
||||
, modifyTypeWarning =
|
||||
"Note that changing the format may "
|
||||
++ "result in invisible values in the ui, if they don't comply to the new format!"
|
||||
, name = "Name"
|
||||
, nameInfo =
|
||||
"The name uniquely identifies this field. It must be a valid "
|
||||
++ "identifier, not contain spaces or weird characters."
|
||||
, fieldFormat = "Field Format"
|
||||
, fieldFormatInfo =
|
||||
"A field must have a format. Values are validated "
|
||||
++ "according to this format."
|
||||
, label = "Label"
|
||||
, labelInfo =
|
||||
"The user defined label for this field. This is used to represent "
|
||||
++ "this field in the ui. If not present, the name is used."
|
||||
, deleteThisField = "Delete this field"
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
module Messages.CustomFieldManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.CustomFieldFormComp
|
||||
import Messages.CustomFieldTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, fieldForm : Messages.CustomFieldFormComp.Texts
|
||||
, fieldTable : Messages.CustomFieldTableComp.Texts
|
||||
, addCustomField : String
|
||||
, newCustomField : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, fieldForm = Messages.CustomFieldFormComp.gb
|
||||
, fieldTable = Messages.CustomFieldTableComp.gb
|
||||
, addCustomField = "Add a new custom field"
|
||||
, newCustomField = "New custom field"
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
module Messages.CustomFieldTableComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, nameLabel : String
|
||||
, format : String
|
||||
, usageCount : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, nameLabel = "Name/Label"
|
||||
, format = "Format"
|
||||
, usageCount = "#Usage"
|
||||
}
|
22
modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm
Normal file
22
modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm
Normal file
@ -0,0 +1,22 @@
|
||||
module Messages.CustomFieldTypeData exposing (..)
|
||||
|
||||
import Data.CustomFieldType exposing (CustomFieldType(..))
|
||||
|
||||
|
||||
gb : CustomFieldType -> String
|
||||
gb ft =
|
||||
case ft of
|
||||
Text ->
|
||||
"Text"
|
||||
|
||||
Numeric ->
|
||||
"Numeric"
|
||||
|
||||
Date ->
|
||||
"Date"
|
||||
|
||||
Boolean ->
|
||||
"Boolean"
|
||||
|
||||
Money ->
|
||||
"Money"
|
15
modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm
Normal file
15
modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm
Normal file
@ -0,0 +1,15 @@
|
||||
module Messages.EquipmentFormComp exposing (..)
|
||||
|
||||
import Data.EquipmentUse exposing (EquipmentUse)
|
||||
import Messages.EquipmentUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ equipmentUseLabel : EquipmentUse -> String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ equipmentUseLabel = Messages.EquipmentUseData.gb
|
||||
}
|
28
modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm
Normal file
28
modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm
Normal file
@ -0,0 +1,28 @@
|
||||
module Messages.EquipmentManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.EquipmentFormComp
|
||||
import Messages.EquipmentTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, equipmentTable : Messages.EquipmentTableComp.Texts
|
||||
, equipmentForm : Messages.EquipmentFormComp.Texts
|
||||
, createNewEquipment : String
|
||||
, newEquipment : String
|
||||
, reallyDeleteEquipment : String
|
||||
, deleteThisEquipment : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, equipmentTable = Messages.EquipmentTableComp.gb
|
||||
, equipmentForm = Messages.EquipmentFormComp.gb
|
||||
, createNewEquipment = "Create a new equipment"
|
||||
, newEquipment = "New Equipment"
|
||||
, reallyDeleteEquipment = "Really delete this equipment?"
|
||||
, deleteThisEquipment = "Delete this equipment"
|
||||
}
|
19
modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm
Normal file
19
modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm
Normal file
@ -0,0 +1,19 @@
|
||||
module Messages.EquipmentTableComp exposing (..)
|
||||
|
||||
import Data.EquipmentUse exposing (EquipmentUse)
|
||||
import Messages.EquipmentUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ name : String
|
||||
, use : String
|
||||
, equipmentUseLabel : EquipmentUse -> String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ name = "Name"
|
||||
, use = "Use"
|
||||
, equipmentUseLabel = Messages.EquipmentUseData.gb
|
||||
}
|
13
modules/webapp/src/main/elm/Messages/EquipmentUseData.elm
Normal file
13
modules/webapp/src/main/elm/Messages/EquipmentUseData.elm
Normal file
@ -0,0 +1,13 @@
|
||||
module Messages.EquipmentUseData exposing (..)
|
||||
|
||||
import Data.EquipmentUse exposing (EquipmentUse(..))
|
||||
|
||||
|
||||
gb : EquipmentUse -> String
|
||||
gb pu =
|
||||
case pu of
|
||||
Concerning ->
|
||||
"Concerning"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
34
modules/webapp/src/main/elm/Messages/FolderDetailComp.elm
Normal file
34
modules/webapp/src/main/elm/Messages/FolderDetailComp.elm
Normal file
@ -0,0 +1,34 @@
|
||||
module Messages.FolderDetailComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, reallyDeleteThisFolder : String
|
||||
, autoOwnerInfo : String
|
||||
, modifyInfo : String
|
||||
, notOwnerInfo : String
|
||||
, name : String
|
||||
, members : String
|
||||
, addMember : String
|
||||
, add : String
|
||||
, removeMember : String
|
||||
, deleteThisFolder : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, reallyDeleteThisFolder = "Really delete this folder?"
|
||||
, autoOwnerInfo = "You are automatically set as owner of this new folder."
|
||||
, modifyInfo = "Modify this folder by changing the name or add/remove members."
|
||||
, notOwnerInfo = "You are not the owner of this folder and therefore are not allowed to edit it."
|
||||
, name = "Name"
|
||||
, members = "Members"
|
||||
, addMember = "Add a new member"
|
||||
, add = "Add"
|
||||
, removeMember = "Remove this member"
|
||||
, deleteThisFolder = "Delete this folder"
|
||||
}
|
26
modules/webapp/src/main/elm/Messages/FolderManageComp.elm
Normal file
26
modules/webapp/src/main/elm/Messages/FolderManageComp.elm
Normal file
@ -0,0 +1,26 @@
|
||||
module Messages.FolderManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.FolderDetailComp
|
||||
import Messages.FolderTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, folderDetail : Messages.FolderDetailComp.Texts
|
||||
, folderTable : Messages.FolderTableComp.Texts
|
||||
, showOwningFoldersOnly : String
|
||||
, createNewFolder : String
|
||||
, newFolder : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, folderDetail = Messages.FolderDetailComp.gb
|
||||
, folderTable = Messages.FolderTableComp.gb
|
||||
, showOwningFoldersOnly = "Show owning folders only"
|
||||
, createNewFolder = "Create a new folder"
|
||||
, newFolder = "New Folder"
|
||||
}
|
18
modules/webapp/src/main/elm/Messages/FolderTableComp.elm
Normal file
18
modules/webapp/src/main/elm/Messages/FolderTableComp.elm
Normal file
@ -0,0 +1,18 @@
|
||||
module Messages.FolderTableComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, name : String
|
||||
, memberCount : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, name = "Name"
|
||||
, memberCount = "#Member"
|
||||
}
|
49
modules/webapp/src/main/elm/Messages/ManageDataPage.elm
Normal file
49
modules/webapp/src/main/elm/Messages/ManageDataPage.elm
Normal file
@ -0,0 +1,49 @@
|
||||
module Messages.ManageDataPage exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.CustomFieldManageComp
|
||||
import Messages.EquipmentManageComp
|
||||
import Messages.FolderManageComp
|
||||
import Messages.OrgManageComp
|
||||
import Messages.PersonManageComp
|
||||
import Messages.TagManageComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, tagManage : Messages.TagManageComp.Texts
|
||||
, equipmentManage : Messages.EquipmentManageComp.Texts
|
||||
, orgManage : Messages.OrgManageComp.Texts
|
||||
, personManage : Messages.PersonManageComp.Texts
|
||||
, folderManage : Messages.FolderManageComp.Texts
|
||||
, customFieldManage : Messages.CustomFieldManageComp.Texts
|
||||
, manageData : String
|
||||
, equipment : String
|
||||
, organization : String
|
||||
, person : String
|
||||
, folder : String
|
||||
, customFields : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, tagManage = Messages.TagManageComp.gb
|
||||
, equipmentManage = Messages.EquipmentManageComp.gb
|
||||
, orgManage = Messages.OrgManageComp.gb
|
||||
, personManage = Messages.PersonManageComp.gb
|
||||
, folderManage = Messages.FolderManageComp.gb
|
||||
, customFieldManage = Messages.CustomFieldManageComp.gb
|
||||
, manageData = "Manage Data"
|
||||
, equipment = "Equipment"
|
||||
, organization = "Organization"
|
||||
, person = "Person"
|
||||
, folder = "Folder"
|
||||
, customFields = "Custom Fields"
|
||||
}
|
||||
|
||||
|
||||
de : Texts
|
||||
de =
|
||||
gb
|
38
modules/webapp/src/main/elm/Messages/OrgFormComp.elm
Normal file
38
modules/webapp/src/main/elm/Messages/OrgFormComp.elm
Normal file
@ -0,0 +1,38 @@
|
||||
module Messages.OrgFormComp exposing (..)
|
||||
|
||||
import Data.ContactType exposing (ContactType)
|
||||
import Data.OrgUse exposing (OrgUse)
|
||||
import Messages.AddressFormComp
|
||||
import Messages.ContactTypeData
|
||||
import Messages.OrgUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ addressForm : Messages.AddressFormComp.Texts
|
||||
, orgUseLabel : OrgUse -> String
|
||||
, name : String
|
||||
, shortName : String
|
||||
, use : String
|
||||
, useAsCorrespondent : String
|
||||
, dontUseForSuggestions : String
|
||||
, address : String
|
||||
, contacts : String
|
||||
, contactTypeLabel : ContactType -> String
|
||||
, notes : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ addressForm = Messages.AddressFormComp.gb
|
||||
, orgUseLabel = Messages.OrgUseData.gb
|
||||
, name = "Name"
|
||||
, shortName = "Short Name"
|
||||
, use = "Use"
|
||||
, useAsCorrespondent = "Use as correspondent"
|
||||
, dontUseForSuggestions = "Do not use for suggestions."
|
||||
, address = "Address"
|
||||
, contacts = "Contacts"
|
||||
, contactTypeLabel = Messages.ContactTypeData.gb
|
||||
, notes = "Notes"
|
||||
}
|
28
modules/webapp/src/main/elm/Messages/OrgManageComp.elm
Normal file
28
modules/webapp/src/main/elm/Messages/OrgManageComp.elm
Normal file
@ -0,0 +1,28 @@
|
||||
module Messages.OrgManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.OrgFormComp
|
||||
import Messages.OrgTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, orgForm : Messages.OrgFormComp.Texts
|
||||
, orgTable : Messages.OrgTableComp.Texts
|
||||
, newOrganization : String
|
||||
, createNewOrganization : String
|
||||
, reallyDeleteOrg : String
|
||||
, deleteThisOrg : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, orgForm = Messages.OrgFormComp.gb
|
||||
, orgTable = Messages.OrgTableComp.gb
|
||||
, newOrganization = "New Organization"
|
||||
, createNewOrganization = "Create a new organization"
|
||||
, reallyDeleteOrg = "Really delete this organization?"
|
||||
, deleteThisOrg = "Delete this organization"
|
||||
}
|
24
modules/webapp/src/main/elm/Messages/OrgTableComp.elm
Normal file
24
modules/webapp/src/main/elm/Messages/OrgTableComp.elm
Normal file
@ -0,0 +1,24 @@
|
||||
module Messages.OrgTableComp exposing (..)
|
||||
|
||||
import Data.OrgUse exposing (OrgUse)
|
||||
import Messages.Basics
|
||||
import Messages.OrgUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, name : String
|
||||
, address : String
|
||||
, contact : String
|
||||
, orgUseLabel : OrgUse -> String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, name = "Name"
|
||||
, address = "Address"
|
||||
, contact = "Contact"
|
||||
, orgUseLabel = Messages.OrgUseData.gb
|
||||
}
|
13
modules/webapp/src/main/elm/Messages/OrgUseData.elm
Normal file
13
modules/webapp/src/main/elm/Messages/OrgUseData.elm
Normal file
@ -0,0 +1,13 @@
|
||||
module Messages.OrgUseData exposing (..)
|
||||
|
||||
import Data.OrgUse exposing (OrgUse(..))
|
||||
|
||||
|
||||
gb : OrgUse -> String
|
||||
gb pu =
|
||||
case pu of
|
||||
Correspondent ->
|
||||
"Correspondent"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
44
modules/webapp/src/main/elm/Messages/PersonFormComp.elm
Normal file
44
modules/webapp/src/main/elm/Messages/PersonFormComp.elm
Normal file
@ -0,0 +1,44 @@
|
||||
module Messages.PersonFormComp exposing (..)
|
||||
|
||||
import Data.ContactType exposing (ContactType)
|
||||
import Data.PersonUse exposing (PersonUse)
|
||||
import Messages.AddressFormComp
|
||||
import Messages.ContactTypeData
|
||||
import Messages.PersonUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ addressForm : Messages.AddressFormComp.Texts
|
||||
, personUseLabel : PersonUse -> String
|
||||
, name : String
|
||||
, useOfPerson : String
|
||||
, useAsConcerningOnly : String
|
||||
, useAsCorrespondentOnly : String
|
||||
, useAsBoth : String
|
||||
, dontUseForSuggestions : String
|
||||
, organization : String
|
||||
, chooseAnOrg : String
|
||||
, address : String
|
||||
, contacts : String
|
||||
, contactTypeLabel : ContactType -> String
|
||||
, notes : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ addressForm = Messages.AddressFormComp.gb
|
||||
, personUseLabel = Messages.PersonUseData.gb
|
||||
, name = "Name"
|
||||
, useOfPerson = "Use of this person"
|
||||
, useAsConcerningOnly = "Use as concerning person only"
|
||||
, useAsCorrespondentOnly = "Use as correspondent person only"
|
||||
, useAsBoth = "Use as both concerning or correspondent person"
|
||||
, dontUseForSuggestions = "Do not use for suggestions."
|
||||
, organization = "Organization"
|
||||
, chooseAnOrg = "Choose an organization"
|
||||
, address = "Address"
|
||||
, contacts = "Contacts"
|
||||
, contactTypeLabel = Messages.ContactTypeData.gb
|
||||
, notes = "Notes"
|
||||
}
|
28
modules/webapp/src/main/elm/Messages/PersonManageComp.elm
Normal file
28
modules/webapp/src/main/elm/Messages/PersonManageComp.elm
Normal file
@ -0,0 +1,28 @@
|
||||
module Messages.PersonManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.PersonFormComp
|
||||
import Messages.PersonTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, personForm : Messages.PersonFormComp.Texts
|
||||
, personTable : Messages.PersonTableComp.Texts
|
||||
, newPerson : String
|
||||
, createNewPerson : String
|
||||
, reallyDeletePerson : String
|
||||
, deleteThisPerson : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, personForm = Messages.PersonFormComp.gb
|
||||
, personTable = Messages.PersonTableComp.gb
|
||||
, newPerson = "New Person"
|
||||
, createNewPerson = "Create a new person"
|
||||
, reallyDeletePerson = "Really delete this person?"
|
||||
, deleteThisPerson = "Delete this person"
|
||||
}
|
24
modules/webapp/src/main/elm/Messages/PersonTableComp.elm
Normal file
24
modules/webapp/src/main/elm/Messages/PersonTableComp.elm
Normal file
@ -0,0 +1,24 @@
|
||||
module Messages.PersonTableComp exposing (..)
|
||||
|
||||
import Data.PersonUse exposing (PersonUse)
|
||||
import Messages.Basics
|
||||
import Messages.PersonUseData
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, name : String
|
||||
, address : String
|
||||
, contact : String
|
||||
, personUseLabel : PersonUse -> String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, name = "Name"
|
||||
, address = "Address"
|
||||
, contact = "Contact"
|
||||
, personUseLabel = Messages.PersonUseData.gb
|
||||
}
|
19
modules/webapp/src/main/elm/Messages/PersonUseData.elm
Normal file
19
modules/webapp/src/main/elm/Messages/PersonUseData.elm
Normal file
@ -0,0 +1,19 @@
|
||||
module Messages.PersonUseData exposing (..)
|
||||
|
||||
import Data.PersonUse exposing (PersonUse(..))
|
||||
|
||||
|
||||
gb : PersonUse -> String
|
||||
gb pu =
|
||||
case pu of
|
||||
Correspondent ->
|
||||
"Correspondent"
|
||||
|
||||
Concerning ->
|
||||
"Concerning"
|
||||
|
||||
Both ->
|
||||
"Both"
|
||||
|
||||
Disabled ->
|
||||
"Disabled"
|
16
modules/webapp/src/main/elm/Messages/TagFormComp.elm
Normal file
16
modules/webapp/src/main/elm/Messages/TagFormComp.elm
Normal file
@ -0,0 +1,16 @@
|
||||
module Messages.TagFormComp exposing (..)
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ selectDefineCategory : String
|
||||
, name : String
|
||||
, category : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ selectDefineCategory = "Select or define category..."
|
||||
, name = "Name"
|
||||
, category = "Category"
|
||||
}
|
28
modules/webapp/src/main/elm/Messages/TagManageComp.elm
Normal file
28
modules/webapp/src/main/elm/Messages/TagManageComp.elm
Normal file
@ -0,0 +1,28 @@
|
||||
module Messages.TagManageComp exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
import Messages.TagFormComp
|
||||
import Messages.TagTableComp
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, tagTable : Messages.TagTableComp.Texts
|
||||
, tagForm : Messages.TagFormComp.Texts
|
||||
, createNewTag : String
|
||||
, newTag : String
|
||||
, reallyDeleteTag : String
|
||||
, deleteThisTag : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, tagTable = Messages.TagTableComp.gb
|
||||
, tagForm = Messages.TagFormComp.gb
|
||||
, createNewTag = "Create a new tag"
|
||||
, newTag = "New Tag"
|
||||
, reallyDeleteTag = "Really delete this tag?"
|
||||
, deleteThisTag = "Delete this tag"
|
||||
}
|
14
modules/webapp/src/main/elm/Messages/TagTableComp.elm
Normal file
14
modules/webapp/src/main/elm/Messages/TagTableComp.elm
Normal file
@ -0,0 +1,14 @@
|
||||
module Messages.TagTableComp exposing (..)
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ name : String
|
||||
, category : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ name = "Name"
|
||||
, category = "Category"
|
||||
}
|
@ -13,12 +13,13 @@ import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Messages.ManageDataPage exposing (Texts)
|
||||
import Page.ManageData.Data exposing (..)
|
||||
import Styles as S
|
||||
|
||||
|
||||
viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewSidebar visible _ settings model =
|
||||
viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewSidebar texts visible _ settings model =
|
||||
div
|
||||
[ id "sidebar"
|
||||
, class S.sidebar
|
||||
@ -27,7 +28,7 @@ viewSidebar visible _ settings model =
|
||||
]
|
||||
[ div [ class "" ]
|
||||
[ h1 [ class S.header1 ]
|
||||
[ text "Manage Data"
|
||||
[ text texts.manageData
|
||||
]
|
||||
]
|
||||
, div [ class "flex flex-col my-2" ]
|
||||
@ -40,7 +41,8 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.tagIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Tags" ]
|
||||
[ text texts.basics.tags
|
||||
]
|
||||
]
|
||||
, a
|
||||
[ href "#"
|
||||
@ -51,7 +53,8 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.equipmentIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Equipment" ]
|
||||
[ text texts.equipment
|
||||
]
|
||||
]
|
||||
, a
|
||||
[ href "#"
|
||||
@ -62,7 +65,8 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.organizationIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Organization" ]
|
||||
[ text texts.organization
|
||||
]
|
||||
]
|
||||
, a
|
||||
[ href "#"
|
||||
@ -73,7 +77,8 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.personIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Person" ]
|
||||
[ text texts.person
|
||||
]
|
||||
]
|
||||
, a
|
||||
[ href "#"
|
||||
@ -89,7 +94,8 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.folderIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Folder" ]
|
||||
[ text texts.folder
|
||||
]
|
||||
]
|
||||
, a
|
||||
[ href "#"
|
||||
@ -105,36 +111,37 @@ viewSidebar visible _ settings model =
|
||||
[ Icons.customFieldIcon2 ""
|
||||
, span
|
||||
[ class "ml-3" ]
|
||||
[ text "Custom Fields" ]
|
||||
[ text texts.customFields
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
viewContent : Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent flags settings model =
|
||||
viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent texts flags settings model =
|
||||
div
|
||||
[ id "content"
|
||||
, class S.content
|
||||
]
|
||||
(case model.currentTab of
|
||||
Just TagTab ->
|
||||
viewTags model
|
||||
viewTags texts model
|
||||
|
||||
Just EquipTab ->
|
||||
viewEquip model
|
||||
viewEquip texts model
|
||||
|
||||
Just OrgTab ->
|
||||
viewOrg settings model
|
||||
viewOrg texts settings model
|
||||
|
||||
Just PersonTab ->
|
||||
viewPerson settings model
|
||||
viewPerson texts settings model
|
||||
|
||||
Just FolderTab ->
|
||||
viewFolder flags settings model
|
||||
viewFolder texts flags settings model
|
||||
|
||||
Just CustomFieldTab ->
|
||||
viewCustomFields flags settings model
|
||||
viewCustomFields texts flags settings model
|
||||
|
||||
Nothing ->
|
||||
[]
|
||||
@ -150,38 +157,45 @@ menuEntryActive model tab =
|
||||
class ""
|
||||
|
||||
|
||||
viewTags : Model -> List (Html Msg)
|
||||
viewTags model =
|
||||
viewTags : Texts -> Model -> List (Html Msg)
|
||||
viewTags texts model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
]
|
||||
[ Icons.tagIcon2 ""
|
||||
, div [ class "ml-2" ]
|
||||
[ text "Tags"
|
||||
[ text texts.basics.tags
|
||||
]
|
||||
]
|
||||
, Html.map TagManageMsg (Comp.TagManage.view2 model.tagManageModel)
|
||||
, Html.map TagManageMsg
|
||||
(Comp.TagManage.view2
|
||||
texts.tagManage
|
||||
model.tagManageModel
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
viewEquip : Model -> List (Html Msg)
|
||||
viewEquip model =
|
||||
viewEquip : Texts -> Model -> List (Html Msg)
|
||||
viewEquip texts model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
]
|
||||
[ Icons.equipmentIcon2 ""
|
||||
, div [ class "ml-2" ]
|
||||
[ text "Equipment"
|
||||
[ text texts.equipment
|
||||
]
|
||||
]
|
||||
, Html.map EquipManageMsg (Comp.EquipmentManage.view2 model.equipManageModel)
|
||||
, Html.map EquipManageMsg
|
||||
(Comp.EquipmentManage.view2 texts.equipmentManage
|
||||
model.equipManageModel
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
viewOrg : UiSettings -> Model -> List (Html Msg)
|
||||
viewOrg settings model =
|
||||
viewOrg : Texts -> UiSettings -> Model -> List (Html Msg)
|
||||
viewOrg texts settings model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
@ -191,12 +205,16 @@ viewOrg settings model =
|
||||
[ text "Organizations"
|
||||
]
|
||||
]
|
||||
, Html.map OrgManageMsg (Comp.OrgManage.view2 settings model.orgManageModel)
|
||||
, Html.map OrgManageMsg
|
||||
(Comp.OrgManage.view2 texts.orgManage
|
||||
settings
|
||||
model.orgManageModel
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
viewPerson : UiSettings -> Model -> List (Html Msg)
|
||||
viewPerson settings model =
|
||||
viewPerson : Texts -> UiSettings -> Model -> List (Html Msg)
|
||||
viewPerson texts settings model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
@ -207,12 +225,15 @@ viewPerson settings model =
|
||||
]
|
||||
]
|
||||
, Html.map PersonManageMsg
|
||||
(Comp.PersonManage.view2 settings model.personManageModel)
|
||||
(Comp.PersonManage.view2 texts.personManage
|
||||
settings
|
||||
model.personManageModel
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
viewFolder : Flags -> UiSettings -> Model -> List (Html Msg)
|
||||
viewFolder flags _ model =
|
||||
viewFolder : Texts -> Flags -> UiSettings -> Model -> List (Html Msg)
|
||||
viewFolder texts flags _ model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
@ -221,25 +242,28 @@ viewFolder flags _ model =
|
||||
, div
|
||||
[ class "ml-2"
|
||||
]
|
||||
[ text "Folder"
|
||||
[ text texts.folder
|
||||
]
|
||||
]
|
||||
, Html.map FolderMsg
|
||||
(Comp.FolderManage.view2 flags model.folderManageModel)
|
||||
(Comp.FolderManage.view2 texts.folderManage flags model.folderManageModel)
|
||||
]
|
||||
|
||||
|
||||
viewCustomFields : Flags -> UiSettings -> Model -> List (Html Msg)
|
||||
viewCustomFields flags _ model =
|
||||
viewCustomFields : Texts -> Flags -> UiSettings -> Model -> List (Html Msg)
|
||||
viewCustomFields texts flags _ model =
|
||||
[ h2
|
||||
[ class S.header1
|
||||
, class "inline-flex items-center"
|
||||
]
|
||||
[ Icons.customFieldIcon2 ""
|
||||
, div [ class "ml-2" ]
|
||||
[ text "Custom Fields"
|
||||
[ text texts.customFields
|
||||
]
|
||||
]
|
||||
, Html.map CustomFieldMsg
|
||||
(Comp.CustomFieldManage.view2 flags model.fieldManageModel)
|
||||
(Comp.CustomFieldManage.view2 texts.customFieldManage
|
||||
flags
|
||||
model.fieldManageModel
|
||||
)
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user