Use a placeholder string for all dropdowns

This commit is contained in:
Eike Kettner 2021-04-11 20:37:16 +02:00
parent bbda4e84d7
commit 7b1cbe6435
31 changed files with 66 additions and 32 deletions

View File

@ -192,6 +192,7 @@ view2 texts settings model =
{ display = Data.ListType.label
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div []

View File

@ -203,7 +203,7 @@ view2 flags texts settings model =
{ text = texts.languageLabel l
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -93,6 +93,7 @@ type alias ViewOpts =
, colorLabel : Color -> String
, label : String
, description : Maybe String
, selectPlaceholder : String
}
@ -103,6 +104,7 @@ view2 data opts model =
{ display = identity
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = opts.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -119,6 +119,7 @@ update msg model =
type alias ViewSettings =
{ contactTypeLabel : ContactType -> String
, mobile : Bool
, selectPlaceholder : String
}
@ -129,6 +130,7 @@ view2 cfg _ model =
{ display = cfg.contactTypeLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = cfg.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -209,6 +209,7 @@ view2 texts viewSettings model =
{ display = texts.fieldTypeLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
(if viewSettings.showControls then

View File

@ -316,6 +316,7 @@ type alias ViewSettings =
, fieldIcon : CustomField -> Maybe String
, style : DS.DropdownStyle
, createCustomFieldTitle : String
, selectPlaceholder : String
}
@ -340,6 +341,7 @@ viewMenuBar2 viewSettings model =
{ display = \f -> Maybe.withDefault f.name f.label
, icon = \_ -> Nothing
, style = { ddstyle | root = ddstyle.root ++ " flex-grow" }
, selectPlaceholder = viewSettings.selectPlaceholder
}
in
div

View File

@ -155,7 +155,7 @@ view2 texts model =
, lineColor = "bg-gray-300 dark:bg-bluegray-600"
}
, B.primaryBasicButton
{ label = texts.select
{ label = texts.basics.selectPlaceholder
, icon = "fa fa-folder-open font-thin"
, handler = onClick PickFiles
, attrs = [ href "#" ]

View File

@ -180,7 +180,7 @@ view2 texts settings model =
{ text = texts.sslTypeLabel s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -107,6 +107,7 @@ view2 texts model =
{ display = texts.equipmentUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -152,6 +152,7 @@ update msg model =
type alias ViewSettings a =
{ display : a -> String
, icon : a -> Maybe String
, selectPlaceholder : String
, style : DS.DropdownStyle
}
@ -204,7 +205,7 @@ viewStyled2 cfg error sel model =
]
[ selIcon
, Maybe.map cfg.display sel
|> Maybe.withDefault "Select"
|> Maybe.withDefault cfg.selectPlaceholder
|> text
]
, div

View File

@ -372,6 +372,7 @@ viewMembers2 texts model =
{ display = .name
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
if model.folder.id == "" then

View File

@ -172,7 +172,7 @@ view2 texts settings model =
{ text = texts.sslTypeLabel s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}

View File

@ -102,6 +102,7 @@ formTabs texts flags settings model =
, fieldIcon = \f -> Dict.get f.id model.customFieldSavingIcon
, style = dds
, createCustomFieldTitle = texts.createNewCustomField
, selectPlaceholder = texts.basics.selectPlaceholder
}
optional fields html =
@ -127,7 +128,7 @@ formTabs texts flags settings model =
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = dds
}
@ -135,14 +136,14 @@ formTabs texts flags settings model =
idNameCfg =
{ makeOption = \e -> { text = e.name, additional = "" }
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}
personCfg =
{ makeOption = \p -> Util.Person.mkPersonOption p model.allPersons
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}
in

View File

@ -662,6 +662,7 @@ renderEditForm2 texts flags cfg settings model =
, fieldIcon = customFieldIcon
, style = dds
, createCustomFieldTitle = ""
, selectPlaceholder = texts.basics.selectPlaceholder
}
dds =
@ -672,7 +673,7 @@ renderEditForm2 texts flags cfg settings model =
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = dds
}
@ -680,7 +681,7 @@ renderEditForm2 texts flags cfg settings model =
idNameCfg =
{ makeOption = \e -> { text = e.name, additional = "" }
, labelColor = \_ -> \_ -> ""
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, style = dds
}

View File

@ -154,11 +154,13 @@ view2 texts mobile settings model =
{ display = texts.orgUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
contactTypeCfg =
{ mobile = mobile
, contactTypeLabel = texts.contactTypeLabel
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -186,11 +186,13 @@ view2 texts mobile settings model =
{ display = texts.personUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
contactCfg =
{ mobile = mobile
, contactTypeLabel = texts.contactTypeLabel
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -1034,7 +1034,7 @@ viewMetadata2 texts flags settings model =
let
folderCfg =
{ makeOption = Util.Folder.mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -1043,6 +1043,7 @@ viewMetadata2 texts flags settings model =
{ display = Messages.Data.Language.gb
, icon = \_ -> Nothing
, style = DS.mainStyleWith "flex-grow mr-2"
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
[ div [ class "mb-4" ]

View File

@ -1317,6 +1317,7 @@ searchTabs texts ddd flags settings model =
, fieldIcon = \_ -> Nothing
, style = DS.sidebarStyle
, createCustomFieldTitle = texts.createCustomFieldTitle
, selectPlaceholder = texts.basics.selectPlaceholder
}
model.customFieldModel
)

View File

@ -316,7 +316,7 @@ view2 flags texts settings model =
let
folderCfg =
{ makeOption = mkFolderOption flags model.allFolders
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -330,7 +330,7 @@ view2 flags texts settings model =
{ text = texts.languageLabel a
, additional = ""
}
, placeholder = texts.selectPlaceholder
, placeholder = texts.basics.selectPlaceholder
, labelColor = \_ -> \_ -> ""
, style = DS.mainStyle
}
@ -339,6 +339,7 @@ view2 flags texts settings model =
{ display = Data.Priority.toName
, icon = \_ -> Nothing
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "flex flex-col" ]

View File

@ -469,6 +469,7 @@ tagColorViewOpts2 texts =
, colorLabel = texts.colorLabel
, label = texts.chooseTagColorLabel
, description = Just texts.tagColorDescription
, selectPlaceholder = texts.basics.selectPlaceholder
}
@ -497,6 +498,7 @@ settingFormTabs texts flags _ model =
{ display = \lang -> Messages.get lang |> .label
, icon = \lang -> Just (Messages.get lang |> .flagIcon)
, style = DS.mainStyle
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
[ { name = "general"

View File

@ -162,7 +162,7 @@ view2 texts settings model =
{ text = Data.UserState.toString s
, additional = ""
}
, placeholder = ""
, placeholder = texts.basics.selectPlaceholder
, style = DS.mainStyle
, labelColor = \_ -> \_ -> ""
}

View File

@ -15,6 +15,7 @@ type alias Texts =
, back : String
, backToList : String
, searchPlaceholder : String
, selectPlaceholder : String
, id : String
, ok : String
, yes : String
@ -49,6 +50,7 @@ gb =
, back = "Back"
, backToList = "Back to list"
, searchPlaceholder = "Search"
, selectPlaceholder = "Select"
, id = "Id"
, ok = "Ok"
, yes = "Yes"

View File

@ -1,10 +1,12 @@
module Messages.Comp.ClassifierSettingsForm exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CalEventInput
type alias Texts =
{ calEventInput : Messages.Comp.CalEventInput.Texts
{ basics : Messages.Basics.Texts
, calEventInput : Messages.Comp.CalEventInput.Texts
, autoTaggingText : String
, blacklistOrWhitelist : String
, whitelistLabel : String
@ -17,7 +19,8 @@ type alias Texts =
gb : Texts
gb =
{ calEventInput = Messages.Comp.CalEventInput.gb
{ basics = Messages.Basics.gb
, calEventInput = Messages.Comp.CalEventInput.gb
, autoTaggingText =
"""

View File

@ -1,12 +1,14 @@
module Messages.Comp.CollectiveSettingsForm exposing (Texts, gb)
import Data.Language exposing (Language)
import Messages.Basics
import Messages.Comp.ClassifierSettingsForm
import Messages.Data.Language
type alias Texts =
{ classifierSettingsForm : Messages.Comp.ClassifierSettingsForm.Texts
{ basics : Messages.Basics.Texts
, classifierSettingsForm : Messages.Comp.ClassifierSettingsForm.Texts
, save : String
, saveSettings : String
, documentLanguage : String
@ -25,7 +27,8 @@ type alias Texts =
gb : Texts
gb =
{ classifierSettingsForm = Messages.Comp.ClassifierSettingsForm.gb
{ basics = Messages.Basics.gb
, classifierSettingsForm = Messages.Comp.ClassifierSettingsForm.gb
, save = "Save"
, saveSettings = "Save Settings"
, documentLanguage = "Document Language"

View File

@ -1,19 +1,21 @@
module Messages.Comp.Dropzone exposing (Texts, gb)
import Messages.Basics
type alias Texts =
{ dropFilesHere : String
{ basics : Messages.Basics.Texts
, dropFilesHere : String
, or : String
, select : String
, selectInfo : String
}
gb : Texts
gb =
{ dropFilesHere = "Drop files here"
{ basics = Messages.Basics.gb
, dropFilesHere = "Drop files here"
, or = "Or"
, select = "Select ..."
, selectInfo =
"Choose document files (pdf, docx, txt, html, ). "
++ "Archives (zip and eml) are extracted."

View File

@ -9,7 +9,6 @@ type alias Texts =
, customFieldInput : Messages.Comp.CustomFieldMultiInput.Texts
, createNewCustomField : String
, chooseDirection : String
, selectPlaceholder : String
, folderNotOwnerWarning : String
, dueDateTab : String
, addNewOrg : String
@ -31,7 +30,6 @@ gb =
, customFieldInput = Messages.Comp.CustomFieldMultiInput.gb
, createNewCustomField = "Create new custom field"
, chooseDirection = "Choose a direction"
, selectPlaceholder = "Select"
, folderNotOwnerWarning =
"""
You are **not a member** of this folder. This item will be **hidden**

View File

@ -10,7 +10,6 @@ type alias Texts =
, tagModeAddInfo : String
, tagModeRemoveInfo : String
, tagModeReplaceInfo : String
, selectPlaceholder : String
, chooseDirection : String
, confirmUnconfirm : String
, confirm : String
@ -28,7 +27,6 @@ gb =
, tagModeAddInfo = "Tags chosen here are *added* to all selected items."
, tagModeRemoveInfo = "Tags chosen here are *removed* from all selected items."
, tagModeReplaceInfo = "Tags chosen here *replace* those on selected items."
, selectPlaceholder = "Select"
, chooseDirection = "Choose a direction"
, confirmUnconfirm = "Confirm/Unconfirm item metadata"
, confirm = "Confirm"

View File

@ -21,7 +21,6 @@ type alias Texts =
, language : String
, languageInfo : String
, languageLabel : Language -> String
, selectPlaceholder : String
}
@ -59,5 +58,4 @@ Specify a file glob to filter files when uploading archives
"Used for text extraction and analysis. The collective's "
++ "default language is used if not specified here."
, languageLabel = Messages.Data.Language.gb
, selectPlaceholder = "Select"
}

View File

@ -2,12 +2,14 @@ module Messages.Comp.UiSettingsForm exposing (Texts, gb)
import Data.Color exposing (Color)
import Data.Fields exposing (Field)
import Messages.Basics
import Messages.Data.Color
import Messages.Data.Fields
type alias Texts =
{ general : String
{ basics : Messages.Basics.Texts
, general : String
, showSideMenuByDefault : String
, uiLanguage : String
, itemSearch : String
@ -45,7 +47,8 @@ type alias Texts =
gb : Texts
gb =
{ general = "General"
{ basics = Messages.Basics.gb
, general = "General"
, showSideMenuByDefault = "Show side menu by default"
, uiLanguage = "UI Language"
, itemSearch = "Item Search"

View File

@ -1,8 +1,11 @@
module Messages.Comp.UserForm exposing (Texts, gb)
import Messages.Basics
type alias Texts =
{ login : String
{ basics : Messages.Basics.Texts
, login : String
, state : String
, email : String
, password : String
@ -11,7 +14,8 @@ type alias Texts =
gb : Texts
gb =
{ login = "Login"
{ basics = Messages.Basics.gb
, login = "Login"
, state = "State"
, email = "E-Mail"
, password = "Password"

View File

@ -76,6 +76,7 @@ renderForm texts model =
{ display = texts.languageLabel
, icon = \_ -> Nothing
, style = DS.mainStyleWith "w-40"
, selectPlaceholder = texts.basics.selectPlaceholder
}
in
div [ class "row" ]