From b89b19098e600961af2f5155b81b00ed28e78504 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 26 Mar 2021 20:30:28 +0100 Subject: [PATCH 01/25] Update tailwind, fontawesome --- package-lock.json | 104 ++++++++++++++++++++++++++++++++-------------- package.json | 8 ++-- 2 files changed, 76 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4bb4daf1..f89bc676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,9 +28,9 @@ } }, "@fortawesome/fontawesome-free": { - "version": "5.15.2", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.2.tgz", - "integrity": "sha512-7l/AX41m609L/EXI9EKH3Vs3v0iA8tKlIOGtw+kgcoanI7p+e4I4GYLqW3UXWiTnjSFymKSmTTPKYrivzbxxqA==" + "version": "5.15.3", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.3.tgz", + "integrity": "sha512-rFnSUN/QOtnOAgqFRooTA3H57JLDm0QEG/jPdk+tLQNL/eWd+Aok8g3qCI+Q1xuDPWpGW/i9JySpJVsq8Q0s9w==" }, "@fullhuman/postcss-purgecss": { "version": "3.1.3", @@ -147,16 +147,40 @@ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, "autoprefixer": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.4.tgz", - "integrity": "sha512-DCCdUQiMD+P/as8m3XkeTUkUKuuRqLGcwD0nll7wevhqoJfMRpJlkFd1+MQh1pvupjiQuip42lc/VFvfUTMSKw==", + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.5.tgz", + "integrity": "sha512-7H4AJZXvSsn62SqZyJCP+1AWwOuoYpUfK6ot9vm0e87XD6mT8lDywc9D9OTJPMULyGcvmIxzTAMeG2Cc+YX+fA==", "requires": { - "browserslist": "^4.16.1", - "caniuse-lite": "^1.0.30001181", - "colorette": "^1.2.1", + "browserslist": "^4.16.3", + "caniuse-lite": "^1.0.30001196", + "colorette": "^1.2.2", "fraction.js": "^4.0.13", "normalize-range": "^0.1.2", "postcss-value-parser": "^4.1.0" + }, + "dependencies": { + "browserslist": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.3.tgz", + "integrity": "sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==", + "requires": { + "caniuse-lite": "^1.0.30001181", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.649", + "escalade": "^3.1.1", + "node-releases": "^1.1.70" + } + }, + "caniuse-lite": { + "version": "1.0.30001204", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz", + "integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==" + }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + } } }, "balanced-match": { @@ -1090,9 +1114,9 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.difference": { "version": "4.5.0", @@ -1185,9 +1209,9 @@ "integrity": "sha512-1lM+BMLGuDfsdwf3rsgBSrxJwAZHFIrQ8YR61xIqdHo0uNKI9M52wNpHSrliZATJp51On6JD0AfRxd4YGSU0lw==" }, "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==" + "version": "3.1.22", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", + "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==" }, "node-emoji": { "version": "1.10.0", @@ -1335,13 +1359,20 @@ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" }, "postcss": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.4.tgz", - "integrity": "sha512-kRFftRoExRVXZlwUuay9iC824qmXPcQQVzAjbCCgjpXnkdMCJYBu2gTwAaFBzv8ewND6O8xFb3aELmEkh9zTzg==", + "version": "8.2.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.8.tgz", + "integrity": "sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==", "requires": { - "colorette": "^1.2.1", + "colorette": "^1.2.2", "nanoid": "^3.1.20", "source-map": "^0.6.1" + }, + "dependencies": { + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + } } }, "postcss-calc": { @@ -1849,9 +1880,9 @@ } }, "postcss-nested": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-5.0.3.tgz", - "integrity": "sha512-R2LHPw+u5hFfDgJG748KpGbJyTv7Yr33/2tIMWxquYuHTd9EXu27PYnKi7BxMXLtzKC0a0WVsqHtd7qIluQu/g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-5.0.5.tgz", + "integrity": "sha512-GSRXYz5bccobpTzLQZXOnSOfKl6TwVr5CyAQJUPub4nuRJSOECK5AqurxVgmtxP48p0Kc/ndY/YyS1yqldX0Ew==", "requires": { "postcss-selector-parser": "^6.0.4" } @@ -2480,30 +2511,30 @@ } }, "tailwindcss": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.0.2.tgz", - "integrity": "sha512-nO9JRE1pO7SF9RnYAl6g7uzeHdrmKAFqNjT9NtZUfxqimJZAOOLOEyIEUiMq12+xIc7mC2Ey3Vf90XjHpWKfbw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.0.4.tgz", + "integrity": "sha512-WhgR0oiBxGOZ9jY0yVfaJCHnckR7U74Fs/BMsYxGdwGJQ5Hd/HlaKD26bEJFZOvYScJo0QcUj2ImldzedsG7Bw==", "requires": { - "@fullhuman/postcss-purgecss": "^3.0.0", + "@fullhuman/postcss-purgecss": "^3.1.3", "bytes": "^3.0.0", "chalk": "^4.1.0", "color": "^3.1.3", "detective": "^5.2.0", "didyoumean": "^1.2.1", - "fs-extra": "^9.0.1", + "fs-extra": "^9.1.0", "html-tags": "^3.1.0", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "modern-normalize": "^1.0.0", "node-emoji": "^1.8.1", - "object-hash": "^2.0.3", + "object-hash": "^2.1.1", "postcss-functions": "^3", "postcss-js": "^3.0.3", - "postcss-nested": "^5.0.1", + "postcss-nested": "^5.0.5", "postcss-selector-parser": "^6.0.4", "postcss-value-parser": "^4.1.0", "pretty-hrtime": "^1.0.3", - "reduce-css-calc": "^2.1.6", - "resolve": "^1.19.0" + "reduce-css-calc": "^2.1.8", + "resolve": "^1.20.0" }, "dependencies": { "ansi-styles": { @@ -2541,6 +2572,15 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/package.json b/package.json index 33a7d4e0..74ff9aee 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "1.0.0", "private": true, "dependencies": { - "@fortawesome/fontawesome-free": "^5.15.2", + "@fortawesome/fontawesome-free": "^5.15.3", "@tailwindcss/forms": "^0.2.1", - "autoprefixer": "^10.2.4", + "autoprefixer": "^10.2.5", "cssnano": "^4.1.10", - "postcss": "^8.2.4", + "postcss": "^8.2.8", "postcss-cli": "^8.3.1", "postcss-import": "^14.0.0", - "tailwindcss": "^2.0.2" + "tailwindcss": "^2.0.4" } } From 589e136883c7b42b0ce1c4ef719f32844db8d856 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 26 Mar 2021 22:16:10 +0100 Subject: [PATCH 02/25] Add flag icons --- modules/webapp/src/main/styles/index.css | 1 + package-lock.json | 5 +++++ package.json | 1 + project/StylesPlugin.scala | 20 +++++++++++++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/modules/webapp/src/main/styles/index.css b/modules/webapp/src/main/styles/index.css index 0639a27c..274ad20a 100644 --- a/modules/webapp/src/main/styles/index.css +++ b/modules/webapp/src/main/styles/index.css @@ -1,4 +1,5 @@ @import "@fortawesome/fontawesome-free/css/all"; +@import "flag-icon-css/css/flag-icon.min"; /* all @import must be above this line */ diff --git a/package-lock.json b/package-lock.json index f89bc676..770872b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -769,6 +769,11 @@ "to-regex-range": "^5.0.1" } }, + "flag-icon-css": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/flag-icon-css/-/flag-icon-css-3.5.0.tgz", + "integrity": "sha512-pgJnJLrtb0tcDgU1fzGaQXmR8h++nXvILJ+r5SmOXaaL/2pocunQo2a8TAXhjQnBpRLPtZ1KCz/TYpqeNuE2ew==" + }, "fraction.js": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz", diff --git a/package.json b/package.json index 74ff9aee..2a30eba9 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@tailwindcss/forms": "^0.2.1", "autoprefixer": "^10.2.5", "cssnano": "^4.1.10", + "flag-icon-css": "^3.5.0", "postcss": "^8.2.8", "postcss-cli": "^8.3.1", "postcss-import": "^14.0.0", diff --git a/project/StylesPlugin.scala b/project/StylesPlugin.scala index ce6f1d1e..e41af9c8 100644 --- a/project/StylesPlugin.scala +++ b/project/StylesPlugin.scala @@ -54,7 +54,8 @@ object StylesPlugin extends AutoPlugin { val mode = stylesMode.value npmInstall(npm, wd, logger) val files = postCss(npx, inDir, outDir, wd, mode, logger) ++ - copyWebfonts(wd, outDir, logger) + copyWebfonts(wd, outDir, logger) ++ + copyFlags(wd, outDir, logger) logger.info("Styles built") files }, @@ -63,6 +64,7 @@ object StylesPlugin extends AutoPlugin { val npm = stylesNpmCommand.value val wd = (LocalRootProject / baseDirectory).value npmInstall(npm, wd, logger) + } ) @@ -118,4 +120,20 @@ object StylesPlugin extends AutoPlugin { IO.copy(fontDir.listFiles().map(f => f -> targetDir / f.name).toSeq) IO.listFiles(targetDir).toSeq } + + def copyFlags(baseDir: File, outDir: File, logger: Logger): Seq[File] = { + val flagDir = + baseDir / "node_modules" / "flag-icon-css" / "flags" + val targetDir = outDir / "flags" + IO.createDirectory(targetDir) + + val files = (flagDir ** "*") + .filter(_.isFile) + .get + .pair(Path.relativeTo(flagDir)) + .map(t => (t._1, targetDir / t._2)) + + IO.copy(files) + (targetDir ** "*.svg").get() + } } From 9fcab84267257771b7a186ed7ac6760aec23b191 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 27 Mar 2021 18:30:32 +0100 Subject: [PATCH 03/25] Add icon to fixed dropdown --- .../main/elm/Comp/ClassifierSettingsForm.elm | 1 + .../webapp/src/main/elm/Comp/ColorTagger.elm | 2 +- .../webapp/src/main/elm/Comp/ContactField.elm | 1 + .../src/main/elm/Comp/CustomFieldForm.elm | 2 +- .../main/elm/Comp/CustomFieldMultiInput.elm | 2 +- .../src/main/elm/Comp/EquipmentForm.elm | 2 +- .../src/main/elm/Comp/FixedDropdown.elm | 25 +++++++++++++++---- .../webapp/src/main/elm/Comp/FolderDetail.elm | 2 +- modules/webapp/src/main/elm/Comp/OrgForm.elm | 2 +- .../webapp/src/main/elm/Comp/PersonForm.elm | 2 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 2 +- .../webapp/src/main/elm/Comp/SourceForm.elm | 1 + .../webapp/src/main/elm/Page/Upload/Data.elm | 2 +- 13 files changed, 32 insertions(+), 14 deletions(-) diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index 3850dab2..e95dbd6e 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -190,6 +190,7 @@ view2 settings model = Comp.FixedDropdown.Item model.categoryListType (Data.ListType.label model.categoryListType) + Nothing in div [] [ Markdown.toHtml [ class "px-2 py-2 opacity-75" ] diff --git a/modules/webapp/src/main/elm/Comp/ColorTagger.elm b/modules/webapp/src/main/elm/Comp/ColorTagger.elm index a606b337..a65ddba2 100644 --- a/modules/webapp/src/main/elm/Comp/ColorTagger.elm +++ b/modules/webapp/src/main/elm/Comp/ColorTagger.elm @@ -101,7 +101,7 @@ view2 data opts model = [ text opts.label ] , Html.map LeftMsg (Comp.FixedDropdown.view2 - (Maybe.map (\s -> Comp.FixedDropdown.Item s s) model.leftSelect) + (Maybe.map (\s -> Comp.FixedDropdown.Item s s Nothing) model.leftSelect) model.leftDropdown ) , div [ class "field" ] diff --git a/modules/webapp/src/main/elm/Comp/ContactField.elm b/modules/webapp/src/main/elm/Comp/ContactField.elm index 986d94de..d27646f1 100644 --- a/modules/webapp/src/main/elm/Comp/ContactField.elm +++ b/modules/webapp/src/main/elm/Comp/ContactField.elm @@ -45,6 +45,7 @@ makeDropdownItem : ContactType -> Comp.FixedDropdown.Item ContactType makeDropdownItem ct = { id = ct , display = Data.ContactType.toString ct + , icon = Nothing } diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index 2881a4dc..b1d54aa9 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -201,7 +201,7 @@ view2 : ViewSettings -> Model -> List (Html Msg) view2 viewSettings model = let mkItem cft = - Comp.FixedDropdown.Item cft (Data.CustomFieldType.label cft) + Comp.FixedDropdown.Item cft (Data.CustomFieldType.label cft) Nothing dimmerSettings = Comp.YesNoDimmer.defaultSettings2 "Really delete this custom field?" diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index 73c8981a..459d8138 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -147,7 +147,7 @@ type alias UpdateResult = mkItem : CustomField -> Comp.FixedDropdown.Item CustomField mkItem f = - Comp.FixedDropdown.Item f (Maybe.withDefault f.name f.label) + Comp.FixedDropdown.Item f (Maybe.withDefault f.name f.label) Nothing update : Flags -> Msg -> Model -> UpdateResult diff --git a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm index 2968db76..695c64ef 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm @@ -161,4 +161,4 @@ view2 model = makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item EquipmentUse) makeUseItem model = Just <| - Comp.FixedDropdown.Item model.use (Data.EquipmentUse.label model.use) + Comp.FixedDropdown.Item model.use (Data.EquipmentUse.label model.use) Nothing diff --git a/modules/webapp/src/main/elm/Comp/FixedDropdown.elm b/modules/webapp/src/main/elm/Comp/FixedDropdown.elm index 5d94d369..6679b06f 100644 --- a/modules/webapp/src/main/elm/Comp/FixedDropdown.elm +++ b/modules/webapp/src/main/elm/Comp/FixedDropdown.elm @@ -23,6 +23,7 @@ import Util.List type alias Item a = { id : a , display : String + , icon : Maybe String } @@ -49,19 +50,19 @@ init options = initString : List String -> Model String initString strings = - init <| List.map (\s -> Item s s) strings + init <| List.map (\s -> Item s s Nothing) strings initMap : (a -> String) -> List a -> Model a initMap elToString els = - init <| List.map (\a -> Item a (elToString a)) els + init <| List.map (\a -> Item a (elToString a) Nothing) els initTuple : List ( String, a ) -> Model a initTuple tuples = let mkItem ( txt, id ) = - Item id txt + Item id txt Nothing in init <| List.map mkItem tuples @@ -170,6 +171,14 @@ update msg model = viewStyled2 : DS.DropdownStyle -> Bool -> Maybe (Item a) -> Model a -> Html (Msg a) viewStyled2 style error sel model = let + iconItem item = + span + [ classList [ ( "hidden", item.icon == Nothing ) ] + , class (Maybe.withDefault "" item.icon) + , class "mr-2" + ] + [] + renderItem item = a [ href "#" @@ -180,8 +189,13 @@ viewStyled2 style error sel model = ] , onClick (SelectItem2 item) ] - [ text item.display + [ iconItem item + , text item.display ] + + selIcon = + Maybe.map iconItem sel + |> Maybe.withDefault (span [ class "hidden" ] []) in div [ class ("relative " ++ style.root) @@ -200,7 +214,8 @@ viewStyled2 style error sel model = [ ( "opacity-50", sel == Nothing ) ] ] - [ Maybe.map .display sel + [ selIcon + , Maybe.map .display sel |> Maybe.withDefault "Select…" |> text ] diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index 5e4a38af..a86a12eb 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -277,7 +277,7 @@ update flags msg model = makeItem : IdName -> Comp.FixedDropdown.Item IdName makeItem idn = - Comp.FixedDropdown.Item idn idn.name + Comp.FixedDropdown.Item idn idn.name Nothing view2 : Flags -> Model -> Html Msg diff --git a/modules/webapp/src/main/elm/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Comp/OrgForm.elm index 5f2584fe..f7305923 100644 --- a/modules/webapp/src/main/elm/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Comp/OrgForm.elm @@ -150,7 +150,7 @@ update flags msg model = makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item OrgUse) makeUseItem model = Just <| - Comp.FixedDropdown.Item model.use (Data.OrgUse.label model.use) + Comp.FixedDropdown.Item model.use (Data.OrgUse.label model.use) Nothing view2 : Bool -> UiSettings -> Model -> Html Msg diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index e9b35c79..0c875fe0 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -179,7 +179,7 @@ update flags msg model = makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item PersonUse) makeUseItem model = Just <| - Comp.FixedDropdown.Item model.use (Data.PersonUse.label model.use) + Comp.FixedDropdown.Item model.use (Data.PersonUse.label model.use) Nothing diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 3e23a981..926c0267 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -237,7 +237,7 @@ init flags = mkLanguageItem : Language -> Comp.FixedDropdown.Item Language mkLanguageItem lang = - Comp.FixedDropdown.Item lang (Data.Language.toName lang) + Comp.FixedDropdown.Item lang (Data.Language.toName lang) Nothing diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index bca6a32e..e762d9a3 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -336,6 +336,7 @@ view2 _ settings model = Comp.FixedDropdown.Item model.priority (Data.Priority.toName model.priority) + Nothing in div [ class "flex flex-col" ] [ div [ class "mb-4" ] diff --git a/modules/webapp/src/main/elm/Page/Upload/Data.elm b/modules/webapp/src/main/elm/Page/Upload/Data.elm index 8c4632c3..40255518 100644 --- a/modules/webapp/src/main/elm/Page/Upload/Data.elm +++ b/modules/webapp/src/main/elm/Page/Upload/Data.elm @@ -40,7 +40,7 @@ type alias Model = mkLanguageItem : Language -> Comp.FixedDropdown.Item Language mkLanguageItem lang = - Comp.FixedDropdown.Item lang (Data.Language.toName lang) + Comp.FixedDropdown.Item lang (Data.Language.toName lang) Nothing emptyModel : Model From 322a3e837ccc52884dbd6c4bd0b358cea690541a Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 27 Mar 2021 22:00:50 +0100 Subject: [PATCH 04/25] Prepare for selecting languages UI language is stored in user settings for authenticated users; otherwise is only stored in the current model (not persisted). --- modules/webapp/src/main/elm/App/Data.elm | 18 ++++ modules/webapp/src/main/elm/App/Update.elm | 9 ++ modules/webapp/src/main/elm/App/View2.elm | 52 ++++++++++- .../src/main/elm/Comp/UiSettingsForm.elm | 44 ++++++++++ .../webapp/src/main/elm/Data/UiSettings.elm | 9 ++ modules/webapp/src/main/elm/Messages.elm | 87 +++++++++++++++++++ modules/webapp/src/main/elm/Messages/App.elm | 22 +++++ .../src/main/elm/Messages/FixedDropdown.elm | 22 +++++ .../src/main/elm/Messages/LoginPage.elm | 57 ++++++++++++ modules/webapp/src/main/elm/UiLanguage.elm | 16 ++++ 10 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 modules/webapp/src/main/elm/Messages.elm create mode 100644 modules/webapp/src/main/elm/Messages/App.elm create mode 100644 modules/webapp/src/main/elm/Messages/FixedDropdown.elm create mode 100644 modules/webapp/src/main/elm/Messages/LoginPage.elm create mode 100644 modules/webapp/src/main/elm/UiLanguage.elm diff --git a/modules/webapp/src/main/elm/App/Data.elm b/modules/webapp/src/main/elm/App/Data.elm index b047f250..4c3a4c6c 100644 --- a/modules/webapp/src/main/elm/App/Data.elm +++ b/modules/webapp/src/main/elm/App/Data.elm @@ -2,6 +2,7 @@ module App.Data exposing ( Model , Msg(..) , defaultPage + , getUiLanguage , init ) @@ -24,6 +25,7 @@ import Page.Queue.Data import Page.Register.Data import Page.Upload.Data import Page.UserSettings.Data +import UiLanguage exposing (UiLanguage) import Url exposing (Url) @@ -48,6 +50,8 @@ type alias Model = , uiSettings : UiSettings , sidebarVisible : Bool , anonymousTheme : UiTheme + , anonymousUiLang : UiLanguage + , langMenuOpen : Bool } @@ -97,6 +101,8 @@ init key url flags_ settings = , uiSettings = settings , sidebarVisible = settings.sideMenuVisible , anonymousTheme = Data.UiTheme.Light + , anonymousUiLang = UiLanguage.English + , langMenuOpen = False } , Cmd.batch [ Cmd.map UserSettingsMsg uc @@ -152,8 +158,20 @@ type Msg | GetUiSettings UiSettings | ToggleSidebar | ToggleDarkMode + | ToggleLangMenu + | SetLanguage UiLanguage defaultPage : Flags -> Page defaultPage flags = HomePage + + +getUiLanguage : Model -> UiLanguage +getUiLanguage model = + case model.flags.account of + Just _ -> + model.uiSettings.uiLang + + Nothing -> + model.anonymousUiLang diff --git a/modules/webapp/src/main/elm/App/Update.elm b/modules/webapp/src/main/elm/App/Update.elm index 63e3aceb..4752f4b0 100644 --- a/modules/webapp/src/main/elm/App/Update.elm +++ b/modules/webapp/src/main/elm/App/Update.elm @@ -84,6 +84,15 @@ updateWithSub msg model = , Sub.none ) + ToggleLangMenu -> + ( { model | langMenuOpen = not model.langMenuOpen } + , Cmd.none + , Sub.none + ) + + SetLanguage lang -> + ( { model | anonymousUiLang = lang, langMenuOpen = False }, Cmd.none, Sub.none ) + HomeMsg lm -> updateHome lm model diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 7c907437..fe32be78 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -7,6 +7,7 @@ import Data.Flags import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages import Page exposing (Page(..)) import Page.CollectiveSettings.View2 as CollectiveSettings import Page.Home.Data @@ -20,6 +21,7 @@ import Page.Register.View2 as Register import Page.Upload.View2 as Upload import Page.UserSettings.View2 as UserSettings import Styles as S +import UiLanguage view : Model -> List (Html Msg) @@ -64,13 +66,18 @@ topNavUser auth model = topNavAnon : Model -> Html Msg topNavAnon model = + let + texts = + Messages.get <| App.Data.getUiLanguage model + in nav [ id "top-nav" , class styleTopNav ] [ headerNavItem model , div [ class "flex flex-grow justify-end" ] - [ a + [ langMenu model + , a [ href "#" , onClick ToggleDarkMode , class dropdownLink @@ -100,6 +107,10 @@ headerNavItem model = mainContent : Model -> Html Msg mainContent model = + let + texts = + Messages.get <| App.Data.getUiLanguage model + in div [ id "main" , class styleMain @@ -151,6 +162,45 @@ styleMain = "mt-12 flex md:flex-row flex-col w-full h-screen-12 overflow-y-hidden bg-white dark:bg-bluegray-800 text-gray-800 dark:text-bluegray-300 antialiased" +langMenu : Model -> Html Msg +langMenu model = + let + texts = + Messages.get <| App.Data.getUiLanguage model + + langItem lang = + let + langMsg = + Messages.get lang + in + a + [ classList + [ ( dropdownItem, True ) + , ( "bg-gray-200 dark:bg-bluegray-700", lang == texts.lang ) + ] + , onClick (SetLanguage lang) + , href "#" + ] + [ i [ langMsg |> .flagIcon |> class ] [] + , span [ class "ml-2" ] [ text langMsg.label ] + ] + in + div [ class "relative" ] + [ a + [ class dropdownLink + , onClick ToggleLangMenu + , href "#" + ] + [ i [ class texts.flagIcon ] [] + ] + , div + [ class dropdownMenu + , classList [ ( "hidden", not model.langMenuOpen ) ] + ] + (List.map langItem UiLanguage.all) + ] + + dataMenu : AuthResult -> Model -> Html Msg dataMenu _ model = div [ class "relative" ] diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index c9f0a010..3f086604 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -11,11 +11,13 @@ import Api.Model.TagList exposing (TagList) import Comp.BasicSizeField import Comp.ColorTagger import Comp.FieldListSelect +import Comp.FixedDropdown import Comp.IntField import Comp.MenuBar as MB import Comp.Tabs import Data.BasicSize exposing (BasicSize) import Data.Color exposing (Color) +import Data.DropdownStyle as DS import Data.Fields exposing (Field) import Data.Flags exposing (Flags) import Data.ItemTemplate as IT exposing (ItemTemplate) @@ -26,8 +28,10 @@ import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http import Markdown +import Messages import Set exposing (Set) import Styles as S +import UiLanguage exposing (UiLanguage) import Util.Maybe import Util.Tag @@ -56,6 +60,8 @@ type alias Model = , searchStatsVisible : Bool , sideMenuVisible : Bool , powerSearchEnabled : Bool + , uiLangModel : Comp.FixedDropdown.Model UiLanguage + , uiLang : UiLanguage , openTabs : Set String } @@ -148,6 +154,10 @@ init flags settings = , searchStatsVisible = settings.searchStatsVisible , sideMenuVisible = settings.sideMenuVisible , powerSearchEnabled = settings.powerSearchEnabled + , uiLang = settings.uiLang + , uiLangModel = + List.map langItem UiLanguage.all + |> Comp.FixedDropdown.init , openTabs = Set.empty } , Api.getTags flags "" GetTagsResp @@ -174,6 +184,15 @@ type Msg | ToggleAkkordionTab String | ToggleSideMenuVisible | TogglePowerSearch + | UiLangMsg (Comp.FixedDropdown.Msg UiLanguage) + + +langItem : UiLanguage -> Comp.FixedDropdown.Item UiLanguage +langItem lang = + { id = lang + , display = Messages.get lang |> .label + , icon = Just (Messages.get lang |> .flagIcon) + } @@ -445,6 +464,22 @@ update sett msg model = , Just { sett | powerSearchEnabled = next } ) + UiLangMsg lm -> + let + ( m, sel ) = + Comp.FixedDropdown.update lm model.uiLangModel + + newLang = + Maybe.withDefault model.uiLang sel + in + ( { model | uiLangModel = m, uiLang = newLang } + , if newLang == model.uiLang then + Nothing + + else + Just { sett | uiLang = newLang } + ) + --- View2 @@ -494,6 +529,15 @@ settingFormTabs flags _ model = , value = model.sideMenuVisible } ] + , div [ class "mb-4" ] + [ label [ class S.inputLabel ] [ text "UI Language" ] + , Html.map UiLangMsg + (Comp.FixedDropdown.viewStyled2 DS.mainStyle + False + (Just <| langItem model.uiLang) + model.uiLangModel + ) + ] ] } , { title = "Item Search" diff --git a/modules/webapp/src/main/elm/Data/UiSettings.elm b/modules/webapp/src/main/elm/Data/UiSettings.elm index 988eb2d4..3bcbb0c0 100644 --- a/modules/webapp/src/main/elm/Data/UiSettings.elm +++ b/modules/webapp/src/main/elm/Data/UiSettings.elm @@ -32,6 +32,8 @@ import Data.UiTheme exposing (UiTheme) import Dict exposing (Dict) import Html exposing (Attribute) import Html.Attributes as HA +import Messages +import UiLanguage exposing (UiLanguage) {-| Settings for the web ui. All fields should be optional, since it @@ -63,6 +65,7 @@ type alias StoredUiSettings = , uiTheme : Maybe String , sideMenuVisible : Bool , powerSearchEnabled : Bool + , uiLang : Maybe String } @@ -94,6 +97,7 @@ type alias UiSettings = , uiTheme : UiTheme , sideMenuVisible : Bool , powerSearchEnabled : Bool + , uiLang : UiLanguage } @@ -165,6 +169,7 @@ defaults = , uiTheme = Data.UiTheme.Light , sideMenuVisible = True , powerSearchEnabled = False + , uiLang = UiLanguage.English } @@ -217,6 +222,9 @@ merge given fallback = |> Maybe.withDefault fallback.uiTheme , sideMenuVisible = given.sideMenuVisible , powerSearchEnabled = given.powerSearchEnabled + , uiLang = + Maybe.map Messages.fromIso2 given.uiLang + |> Maybe.withDefault UiLanguage.English } @@ -254,6 +262,7 @@ toStoredUiSettings settings = , uiTheme = Just (Data.UiTheme.toString settings.uiTheme) , sideMenuVisible = settings.sideMenuVisible , powerSearchEnabled = settings.powerSearchEnabled + , uiLang = Just <| Messages.toIso2 settings.uiLang } diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm new file mode 100644 index 00000000..0a07608e --- /dev/null +++ b/modules/webapp/src/main/elm/Messages.elm @@ -0,0 +1,87 @@ +module Messages exposing + ( Messages + , fromIso2 + , get + , toIso2 + ) + +import Messages.App +import Messages.LoginPage +import UiLanguage exposing (UiLanguage(..)) + + +{-| The messages record contains all strings used in the application. +-} +type alias Messages = + { lang : UiLanguage + , iso2 : String + , label : String + , flagIcon : String + , app : Messages.App.Texts + , login : Messages.LoginPage.Texts + } + + +get : UiLanguage -> Messages +get lang = + case lang of + English -> + gb + + German -> + de + + +{-| Get a ISO-3166-1 code of the given lanugage. +-} +toIso2 : UiLanguage -> String +toIso2 lang = + get lang |> .iso2 + + +{-| Return the UiLanguage from given iso2 code. If the iso2 code is not +known, return Nothing. +-} +readIso2 : String -> Maybe UiLanguage +readIso2 iso = + let + isIso lang = + iso == toIso2 lang + in + List.filter isIso UiLanguage.all + |> List.head + + +{-| return the language from the given iso2 code. if the iso2 code is +not known, return English as a default. +-} +fromIso2 : String -> UiLanguage +fromIso2 iso = + readIso2 iso + |> Maybe.withDefault English + + + +--- Messages Definitions + + +gb : Messages +gb = + { lang = English + , iso2 = "gb" + , label = "English" + , flagIcon = "flag-icon flag-icon-gb" + , app = Messages.App.gb + , login = Messages.LoginPage.gb + } + + +de : Messages +de = + { lang = German + , iso2 = "de" + , label = "Deutsch" + , flagIcon = "flag-icon flag-icon-de" + , app = Messages.App.de + , login = Messages.LoginPage.de + } diff --git a/modules/webapp/src/main/elm/Messages/App.elm b/modules/webapp/src/main/elm/Messages/App.elm new file mode 100644 index 00000000..1c3af83b --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/App.elm @@ -0,0 +1,22 @@ +module Messages.App exposing + ( Texts + , de + , gb + ) + + +type alias Texts = + { login : String + } + + +gb : Texts +gb = + { login = "Login" + } + + +de : Texts +de = + { login = "Anmelden" + } diff --git a/modules/webapp/src/main/elm/Messages/FixedDropdown.elm b/modules/webapp/src/main/elm/Messages/FixedDropdown.elm new file mode 100644 index 00000000..32f7e983 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/FixedDropdown.elm @@ -0,0 +1,22 @@ +module Messages.FixedDropdown exposing + ( Texts + , de + , gb + ) + + +type alias Texts = + { select : String + } + + +gb : Texts +gb = + { select = "Select…" + } + + +de : Texts +de = + { select = "Auswahl…" + } diff --git a/modules/webapp/src/main/elm/Messages/LoginPage.elm b/modules/webapp/src/main/elm/Messages/LoginPage.elm new file mode 100644 index 00000000..befd838a --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/LoginPage.elm @@ -0,0 +1,57 @@ +module Messages.LoginPage exposing + ( Texts + , de + , fr + , gb + ) + + +type alias Texts = + { username : String + , password : String + , loginPlaceholder : String + , passwordPlaceholder : String + , loginButton : String + , loginSuccessful : String + , noAccount : String + , signupLink : String + } + + +gb : Texts +gb = + { username = "Username" + , password = "Password" + , loginPlaceholder = "Login" + , passwordPlaceholder = "Password" + , loginButton = "Login" + , loginSuccessful = "Login successful" + , noAccount = "No account?" + , signupLink = "Sign up!" + } + + +de : Texts +de = + { username = "Benutzer" + , password = "Passwort" + , loginPlaceholder = "Benutzer" + , passwordPlaceholder = "Passwort" + , loginButton = "Anmelden" + , loginSuccessful = "Anmeldung erfolgreich" + , noAccount = "Kein Konto?" + , signupLink = "Hier registrieren!" + } + + +fr : Texts +fr = + { username = "Identifiant" + , password = "Mot de passe" + , loginPlaceholder = "Utilisateur" + , passwordPlaceholder = "Mot de passe" + , loginButton = "Connexion" + , loginSuccessful = "Identification réussie" + , noAccount = "Pas de compte ?" + , signupLink = "S'inscrire" + } diff --git a/modules/webapp/src/main/elm/UiLanguage.elm b/modules/webapp/src/main/elm/UiLanguage.elm new file mode 100644 index 00000000..05a46f61 --- /dev/null +++ b/modules/webapp/src/main/elm/UiLanguage.elm @@ -0,0 +1,16 @@ +module UiLanguage exposing + ( UiLanguage(..) + , all + ) + + +type UiLanguage + = English + | German + + +all : List UiLanguage +all = + [ English + , German + ] From 2b81c72d96556b1681b20e228254ed361e30bd84 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Mar 2021 10:46:21 +0200 Subject: [PATCH 05/25] Provide translations for main menu --- modules/webapp/src/main/elm/App/View2.elm | 41 ++++++++++---------- modules/webapp/src/main/elm/Messages/App.elm | 33 ++++++++++++++-- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index fe32be78..c6194302 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -8,6 +8,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Messages +import Messages.App exposing (Texts) import Page exposing (Page(..)) import Page.CollectiveSettings.View2 as CollectiveSettings import Page.Home.Data @@ -43,6 +44,10 @@ topNavbar model = topNavUser : AuthResult -> Model -> Html Msg topNavUser auth model = + let + texts = + Messages.get <| App.Data.getUiLanguage model + in nav [ id "top-nav" , class styleTopNav @@ -58,18 +63,14 @@ topNavUser auth model = } , headerNavItem model , div [ class "flex flex-grow justify-end" ] - [ userMenu auth model - , dataMenu auth model + [ userMenu texts.app auth model + , dataMenu texts.app auth model ] ] topNavAnon : Model -> Html Msg topNavAnon model = - let - texts = - Messages.get <| App.Data.getUiLanguage model - in nav [ id "top-nav" , class styleTopNav @@ -201,8 +202,8 @@ langMenu model = ] -dataMenu : AuthResult -> Model -> Html Msg -dataMenu _ model = +dataMenu : Texts -> AuthResult -> Model -> Html Msg +dataMenu texts _ model = div [ class "relative" ] [ a [ class dropdownLink @@ -224,7 +225,7 @@ dataMenu _ model = ] [] , div [ class "inline-block ml-2" ] - [ text "Items" + [ text texts.items ] ] , div [ class "py-1" ] [ hr [ class S.border ] [] ] @@ -233,7 +234,7 @@ dataMenu _ model = [] [ i [ class "fa fa-cubes w-6" ] [] , span [ class "ml-1" ] - [ text "Manage Data" + [ text texts.manageData ] ] , div [ class "divider" ] [] @@ -242,7 +243,7 @@ dataMenu _ model = [] [ i [ class "fa fa-upload w-6" ] [] , span [ class "ml-1" ] - [ text "Upload files" + [ text texts.uploadFiles ] ] , dataPageLink model @@ -250,7 +251,7 @@ dataMenu _ model = [] [ i [ class "fa fa-tachometer-alt w-6" ] [] , span [ class "ml-1" ] - [ text "Processing Queue" + [ text texts.processingQueue ] ] , div @@ -265,7 +266,7 @@ dataMenu _ model = [ ( "hidden", model.flags.config.signupMode /= "invite" ) ] [ i [ class "fa fa-key w-6" ] [] , span [ class "ml-1" ] - [ text "New Invites" + [ text texts.newInvites ] ] , div [ class "py-1" ] @@ -279,7 +280,7 @@ dataMenu _ model = , title "Opens https://docspell.org/docs" ] [ i [ class "fa fa-question-circle w-6" ] [] - , span [ class "ml-1" ] [ text "Help" ] + , span [ class "ml-1" ] [ text texts.help ] , span [ class "float-right" ] [ i [ class "fa fa-external-link-alt w-6" ] [] ] @@ -288,8 +289,8 @@ dataMenu _ model = ] -userMenu : AuthResult -> Model -> Html Msg -userMenu acc model = +userMenu : Texts -> AuthResult -> Model -> Html Msg +userMenu texts acc model = div [ class "relative" ] [ a [ class dropdownLink @@ -313,14 +314,14 @@ userMenu acc model = CollectiveSettingPage [ i [ class "fa fa-users w-6" ] [] , span [ class "ml-1" ] - [ text "Collective Profile" + [ text texts.collectiveProfile ] ] , userPageLink model UserSettingPage [ i [ class "fa fa-user-circle w-6" ] [] , span [ class "ml-1" ] - [ text "User Profile" + [ text texts.userProfile ] ] , a @@ -330,7 +331,7 @@ userMenu acc model = ] [ i [ class "fa fa-adjust w-6" ] [] , span [ class "ml-1" ] - [ text "Light/Dark" + [ text texts.lightDark ] ] , div [ class "py-1" ] [ hr [ class S.border ] [] ] @@ -341,7 +342,7 @@ userMenu acc model = ] [ i [ class "fa fa-sign-out-alt w-6" ] [] , span [ class "ml-1" ] - [ text "Logout" + [ text texts.logout ] ] ] diff --git a/modules/webapp/src/main/elm/Messages/App.elm b/modules/webapp/src/main/elm/Messages/App.elm index 1c3af83b..fc9e5011 100644 --- a/modules/webapp/src/main/elm/Messages/App.elm +++ b/modules/webapp/src/main/elm/Messages/App.elm @@ -6,17 +6,44 @@ module Messages.App exposing type alias Texts = - { login : String + { collectiveProfile : String + , userProfile : String + , lightDark : String + , logout : String + , items : String + , manageData : String + , uploadFiles : String + , processingQueue : String + , newInvites : String + , help : String } gb : Texts gb = - { login = "Login" + { collectiveProfile = "Collective Profile" + , userProfile = "User Profile" + , lightDark = "Light/Dark" + , logout = "Logout" + , items = "Items" + , manageData = "Manage Data" + , uploadFiles = "Upload Files" + , processingQueue = "Processing Queue" + , newInvites = "New Invites" + , help = "Help" } de : Texts de = - { login = "Anmelden" + { collectiveProfile = "Kollektiv-Profil" + , userProfile = "Benutzer-Profil" + , lightDark = "Hell/Dunkel" + , logout = "Abmelden" + , items = "Dokumente" + , manageData = "Daten verwalten" + , uploadFiles = "Dateien hochladen" + , processingQueue = "Verarbeitung" + , newInvites = "Neue Einladung" + , help = "Hilfe (English)" } From ec237a2eaaeb4714ff1bc99f7bab2bb159eb800a Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Mar 2021 18:23:43 +0200 Subject: [PATCH 06/25] Externalized strings --- modules/webapp/src/main/elm/App/View2.elm | 22 ++--- modules/webapp/src/main/elm/Comp/Basic.elm | 20 ++++- .../main/elm/Comp/ClassifierSettingsForm.elm | 43 +++++---- .../main/elm/Comp/CollectiveSettingsForm.elm | 38 ++++---- modules/webapp/src/main/elm/Comp/IntField.elm | 37 ++++++-- .../webapp/src/main/elm/Comp/SourceForm.elm | 60 +++++-------- .../webapp/src/main/elm/Comp/SourceManage.elm | 81 ++++++++--------- .../webapp/src/main/elm/Comp/SourceTable.elm | 23 ++--- modules/webapp/src/main/elm/Comp/UserForm.elm | 19 ++-- .../webapp/src/main/elm/Comp/UserManage.elm | 78 ++++++++++------ .../webapp/src/main/elm/Comp/UserTable.elm | 27 +++--- modules/webapp/src/main/elm/Messages.elm | 4 + .../webapp/src/main/elm/Messages/Basics.elm | 39 ++++++++ .../Messages/ClassifierSettingsFormComp.elm | 35 ++++++++ .../Messages/CollectiveSettingsFormComp.elm | 42 +++++++++ .../elm/Messages/CollectiveSettingsPage.elm | 44 +++++++++ .../src/main/elm/Messages/LoginPage.elm | 29 +++--- .../src/main/elm/Messages/SourceFormComp.elm | 61 +++++++++++++ .../main/elm/Messages/SourceManageComp.elm | 53 +++++++++++ .../src/main/elm/Messages/SourceTableComp.elm | 22 +++++ .../src/main/elm/Messages/UserFormComp.elm | 18 ++++ .../src/main/elm/Messages/UserManageComp.elm | 39 ++++++++ .../src/main/elm/Messages/UserTableComp.elm | 26 ++++++ .../elm/Page/CollectiveSettings/View2.elm | 89 +++++++++++-------- .../webapp/src/main/elm/Page/Login/View2.elm | 31 +++---- 25 files changed, 709 insertions(+), 271 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/Basics.elm create mode 100644 modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm create mode 100644 modules/webapp/src/main/elm/Messages/SourceFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SourceManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SourceTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/UserFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/UserManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/UserTableComp.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index c6194302..d6432326 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -7,7 +7,7 @@ import Data.Flags import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages +import Messages exposing (Messages) import Messages.App exposing (Texts) import Page exposing (Page(..)) import Page.CollectiveSettings.View2 as CollectiveSettings @@ -121,10 +121,10 @@ mainContent model = viewHome model CollectiveSettingPage -> - viewCollectiveSettings model + viewCollectiveSettings texts model LoginPage _ -> - viewLogin model + viewLogin texts model ManageDataPage -> viewManageData model @@ -404,28 +404,30 @@ viewHome model = ] -viewCollectiveSettings : Model -> List (Html Msg) -viewCollectiveSettings model = +viewCollectiveSettings : Messages -> Model -> List (Html Msg) +viewCollectiveSettings texts model = [ Html.map CollSettingsMsg - (CollectiveSettings.viewSidebar model.sidebarVisible + (CollectiveSettings.viewSidebar texts.collectiveSettings + model.sidebarVisible model.flags model.uiSettings model.collSettingsModel ) , Html.map CollSettingsMsg - (CollectiveSettings.viewContent model.flags + (CollectiveSettings.viewContent texts.collectiveSettings + model.flags model.uiSettings model.collSettingsModel ) ] -viewLogin : Model -> List (Html Msg) -viewLogin model = +viewLogin : Messages -> Model -> List (Html Msg) +viewLogin texts model = [ Html.map LoginMsg (Login.viewSidebar model.sidebarVisible model.flags model.uiSettings model.loginModel) , Html.map LoginMsg - (Login.viewContent model.flags model.version model.uiSettings model.loginModel) + (Login.viewContent texts.login model.flags model.version model.uiSettings model.loginModel) ] diff --git a/modules/webapp/src/main/elm/Comp/Basic.elm b/modules/webapp/src/main/elm/Comp/Basic.elm index 0686b6ea..9629e3a0 100644 --- a/modules/webapp/src/main/elm/Comp/Basic.elm +++ b/modules/webapp/src/main/elm/Comp/Basic.elm @@ -1,6 +1,7 @@ module Comp.Basic exposing ( editLinkLabel , editLinkTableCell + , editLinkTableCell2 , genericButton , horizontalDivider , inputRequired @@ -17,6 +18,7 @@ module Comp.Basic exposing import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.Basics import Styles as S @@ -192,9 +194,14 @@ loadingDimmer active = editLinkLabel : msg -> Html msg -editLinkLabel click = +editLinkLabel = + editLinkLabel2 Messages.Basics.gb + + +editLinkLabel2 : Messages.Basics.Texts -> msg -> Html msg +editLinkLabel2 texts click = linkLabel - { label = "Edit" + { label = texts.edit , icon = "fa fa-edit" , handler = click , disabled = False @@ -204,7 +211,14 @@ editLinkLabel click = editLinkTableCell : msg -> Html msg editLinkTableCell m = td [ class S.editLinkTableCellStyle ] - [ editLinkLabel m + [ editLinkLabel2 Messages.Basics.gb m + ] + + +editLinkTableCell2 : Messages.Basics.Texts -> msg -> Html msg +editLinkTableCell2 texts m = + td [ class S.editLinkTableCellStyle ] + [ editLinkLabel2 texts m ] diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index e95dbd6e..564bd4fa 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -24,6 +24,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Http import Markdown +import Messages.ClassifierSettingsFormComp exposing (Texts) import Styles as S import Util.Tag @@ -59,7 +60,7 @@ init flags sett = in ( { scheduleModel = cem , schedule = Data.Validated.Unknown newSchedule - , itemCountModel = Comp.IntField.init (Just 0) Nothing True "Item Count" + , itemCountModel = Comp.IntField.init (Just 0) Nothing True "" , itemCount = Just sett.itemCount , categoryListModel = let @@ -183,8 +184,8 @@ update flags msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = let catListTypeItem = Comp.FixedDropdown.Item @@ -194,20 +195,10 @@ view2 settings model = in div [] [ Markdown.toHtml [ class "px-2 py-2 opacity-75" ] - """ - -Auto-tagging works by learning from existing documents. The more -documents you have correctly tagged, the better. Learning is done -periodically based on a schedule. You can specify tag-groups that -should either be used (whitelist) or not used (blacklist) for -learning. - -Use an empty whitelist to disable auto tagging. - - """ + texts.autoTaggingText , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Is the following a blacklist or whitelist?" ] + [ text texts.blacklistOrWhitelist ] , Html.map CategoryListTypeMsg (Comp.FixedDropdown.view2 (Just catListTypeItem) model.categoryListTypeModel) ] @@ -215,10 +206,10 @@ Use an empty whitelist to disable auto tagging. [ label [ class S.inputLabel ] [ case model.categoryListType of Data.ListType.Whitelist -> - text "Include tag categories for learning" + text texts.whitelistLabel Data.ListType.Blacklist -> - text "Exclude tag categories from learning" + text texts.blacklistLabel ] , Html.map CategoryListMsg (Comp.Dropdown.view2 @@ -228,16 +219,22 @@ Use an empty whitelist to disable auto tagging. ) ] , Html.map ItemCountMsg - (Comp.IntField.viewWithInfo2 - "The maximum number of items to learn from, order by date newest first. Use 0 to mean all." - model.itemCount - "mb-4" + (Comp.IntField.view + { label = texts.itemCount + , info = texts.itemCountHelp + , classes = "mb-4" + , number = model.itemCount + } model.itemCountModel ) , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Schedule" ] + [ text texts.schedule ] , Html.map ScheduleMsg - (Comp.CalEventInput.view2 "" (Data.Validated.value model.schedule) model.scheduleModel) + (Comp.CalEventInput.view2 + "" + (Data.Validated.value model.schedule) + model.scheduleModel + ) ] ] diff --git a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm index 5b28bb4e..d666668d 100644 --- a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm @@ -23,6 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick, onInput) import Http +import Messages.CollectiveSettingsFormComp exposing (Texts) import Styles as S import Util.Http @@ -200,8 +201,8 @@ update flags msg model = --- View2 -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 flags settings model = +view2 : Flags -> Texts -> UiSettings -> Model -> Html Msg +view2 flags texts settings model = div [ classList [ ( "ui form error success", True ) @@ -215,10 +216,10 @@ view2 flags settings model = [ MB.CustomElement <| B.primaryButton { handler = onClick SaveSettings - , label = "Save" + , label = texts.save , icon = "fa fa-save" , attrs = - [ title "Save settings" + [ title texts.saveSettings , href "#" ] , disabled = getSettings model |> Data.Validated.isInvalid @@ -228,11 +229,11 @@ view2 flags settings model = , rootClasses = "mb-4" } , h3 [ class S.header3 ] - [ text "Document Language" + [ text texts.documentLanguage ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Document Language" + [ text texts.documentLanguage ] , Html.map LangDropdownMsg (Comp.Dropdown.view2 @@ -241,7 +242,7 @@ view2 flags settings model = model.langModel ) , span [ class "opacity-50 text-sm" ] - [ text "The language of your documents. This helps text recognition (OCR) and text analysis." + [ text texts.documentLanguageHelp ] ] , div @@ -252,7 +253,7 @@ view2 flags settings model = [ h3 [ class S.header3 ] - [ text "Integration Endpoint" + [ text texts.integrationEndpoint ] , div [ class "mb-4" ] [ label @@ -268,12 +269,11 @@ view2 flags settings model = ] [] , span [ class "ml-2" ] - [ text "Enable integration endpoint" + [ text texts.integrationEndpointHelp ] ] , div [ class "opacity-50 text-sm" ] - [ text "The integration endpoint allows (local) applications to submit files. " - , text "You can choose to disable it for your collective." + [ text texts.integrationEndpointHelp ] ] ] @@ -284,7 +284,7 @@ view2 flags settings model = ] [ h3 [ class S.header3 ] - [ text "Full-Text Search" ] + [ text texts.fulltextSearch ] , div [ class "mb-4" ] [ div [ class "flex flex-row" ] @@ -304,13 +304,12 @@ view2 flags settings model = ] [ i [ class "fa fa-sync-alt" ] [] , span [ class "ml-2 hidden sm:inline" ] - [ text "Re-Index All Data" + [ text texts.reindexAllData ] ] ] , div [ class "opacity-50 text-sm" ] - [ text "This starts a task that clears the full-text index and re-indexes all your data again." - , text "You must type OK before clicking the button to avoid accidental re-indexing." + [ text texts.reindexAllDataHelp ] , renderResultMessage2 model.fullTextReIndexResult ] @@ -322,17 +321,20 @@ view2 flags settings model = ] [ h3 [ class S.header3 ] - [ text "Auto-Tagging" + [ text texts.autoTagging ] , div [ class "mb-4" ] [ Html.map ClassifierSettingMsg - (Comp.ClassifierSettingsForm.view2 settings model.classifierModel) + (Comp.ClassifierSettingsForm.view2 texts.classifierSettingsForm + settings + model.classifierModel + ) , div [ class "flex flex-row justify-end" ] [ B.secondaryBasicButton { handler = onClick StartClassifierTask , icon = "fa fa-play" - , label = "Start now" + , label = texts.startNow , disabled = Data.Validated.isInvalid model.classifierModel.schedule , attrs = [ href "#" ] } diff --git a/modules/webapp/src/main/elm/Comp/IntField.elm b/modules/webapp/src/main/elm/Comp/IntField.elm index 986f40da..a62fe41b 100644 --- a/modules/webapp/src/main/elm/Comp/IntField.elm +++ b/modules/webapp/src/main/elm/Comp/IntField.elm @@ -1,8 +1,10 @@ module Comp.IntField exposing ( Model , Msg + , ViewSettings , init , update + , view , viewWithInfo2 ) @@ -98,20 +100,28 @@ update msg model = --- View2 -viewWithInfo2 : String -> Maybe Int -> String -> Model -> Html Msg -viewWithInfo2 info nval classes model = +type alias ViewSettings = + { label : String + , info : String + , number : Maybe Int + , classes : String + } + + +view : ViewSettings -> Model -> Html Msg +view cfg model = div [ classList - [ ( classes, True ) + [ ( cfg.classes, True ) , ( "error", model.error /= Nothing ) ] ] [ label [ class S.inputLabel ] - [ text model.label + [ text cfg.label ] , input [ type_ "text" - , Maybe.map String.fromInt nval + , Maybe.map String.fromInt cfg.number |> Maybe.withDefault model.lastInput |> value , onInput SetValue @@ -120,11 +130,11 @@ viewWithInfo2 info nval classes model = [] , span [ classList - [ ( "hidden", info == "" ) + [ ( "hidden", cfg.info == "" ) ] , class "opacity-50 text-sm" ] - [ Markdown.toHtml [] info + [ Markdown.toHtml [] cfg.info ] , div [ classList @@ -135,3 +145,16 @@ viewWithInfo2 info nval classes model = [ Maybe.withDefault "" model.error |> text ] ] + + +viewWithInfo2 : String -> Maybe Int -> String -> Model -> Html Msg +viewWithInfo2 info nval classes model = + let + cfg = + { label = model.label + , info = info + , number = nval + , classes = classes + } + in + view cfg model diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index e762d9a3..73250bb8 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -28,6 +28,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onInput) import Http import Markdown +import Messages.SourceFormComp exposing (Texts) import Styles as S import Util.Folder exposing (mkFolderOption) import Util.Maybe @@ -329,8 +330,8 @@ update flags msg model = --- View2 -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 _ settings model = +view2 : Flags -> Texts -> UiSettings -> Model -> Html Msg +view2 _ texts settings model = let priorityItem = Comp.FixedDropdown.Item @@ -344,14 +345,14 @@ view2 _ settings model = [ for "source-abbrev" , class S.inputLabel ] - [ text "Name" + [ text texts.name , B.inputRequired ] , input [ type_ "text" , id "source-abbrev" , onInput SetAbbrev - , placeholder "Name" + , placeholder texts.name , value model.abbrev , class S.textInput , classList [ ( S.inputErrorBorder, not (isValid model) ) ] @@ -363,7 +364,7 @@ view2 _ settings model = [ for "source-descr" , class S.inputLabel ] - [ text "Description" + [ text texts.description ] , textarea [ onInput SetDescr @@ -388,13 +389,13 @@ view2 _ settings model = ] [] , span [ class "ml-2" ] - [ text "Enabled" + [ text texts.enabled ] ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Priority" + [ text texts.priority ] , Html.map PrioDropdownMsg (Comp.FixedDropdown.view2 @@ -402,26 +403,24 @@ view2 _ settings model = model.priorityModel ) , div [ class "opacity-50 text-sm" ] - [ text "The priority used by the scheduler when processing uploaded files." + [ text texts.priorityInfo ] ] , div [ class S.header2 , class "mt-6" ] - [ text "Metadata" + [ text texts.metadata ] , div [ class S.message , class "mb-4" ] - [ text "Metadata specified here is automatically attached to each item uploaded " - , text "through this source, unless it is overriden in the upload request meta data. " - , text "Tags from the request are added to those defined here." + [ text texts.metadataInfoText ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Folder" + [ text texts.folder ] , Html.map FolderDropdownMsg (Comp.Dropdown.view2 @@ -430,7 +429,7 @@ view2 _ settings model = model.folderModel ) , div [ class "opacity-50 text-sm" ] - [ text "Choose a folder to automatically put items into." + [ text texts.folderInfo ] , div [ classList @@ -438,17 +437,13 @@ view2 _ settings model = ] , class S.message ] - [ Markdown.toHtml [] """ -You are **not a member** of this folder. Items created through this -link will be **hidden** from any search results. Use a folder where -you are a member of to make items visible. This message will -disappear then. - """ + [ Markdown.toHtml [] texts.folderForbiddenText ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Tags" ] + [ text texts.basics.tags + ] , Html.map TagDropdownMsg (Comp.Dropdown.view2 DS.mainStyle @@ -456,18 +451,18 @@ disappear then. model.tagModel ) , div [ class "opacity-50 text-sm" ] - [ text "Choose tags that should be applied to items." + [ text texts.tagsInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "File Filter" ] + [ text texts.fileFilter ] , input [ type_ "text" , onInput SetFileFilter - , placeholder "File Filter" + , placeholder texts.fileFilter , model.fileFilter |> Maybe.withDefault "" |> value @@ -475,20 +470,12 @@ disappear then. ] [] , div [ class "opacity-50 text-sm" ] - [ text "Specify a file glob to filter files when uploading archives " - , text "(e.g. for email and zip). For example, to only extract pdf files: " - , code [ class "font-mono" ] - [ text "*.pdf" - ] - , text ". Globs can be combined via OR, like this: " - , code [ class "font-mono" ] - [ text "*.pdf|mail.html" - ] + [ Markdown.toHtml [] texts.fileFilterInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Language:" + [ text (texts.language ++ ":") ] , Html.map LanguageMsg (Comp.Dropdown.view2 @@ -496,9 +483,8 @@ disappear then. settings model.languageModel ) - , div [ class "text-gray-400 text-xs" ] - [ text "Used for text extraction and analysis. The collective's " - , text "default language is used if not specified here." + , div [ class "opacity-50 text-sm" ] + [ text texts.languageInfo ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/SourceManage.elm b/modules/webapp/src/main/elm/Comp/SourceManage.elm index 0d8b2954..0734abc9 100644 --- a/modules/webapp/src/main/elm/Comp/SourceManage.elm +++ b/modules/webapp/src/main/elm/Comp/SourceManage.elm @@ -21,6 +21,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http +import Messages.SourceManageComp exposing (Texts) import Ports import QRCode import Styles as S @@ -211,49 +212,49 @@ update flags msg model = --- View2 -qrCodeView : String -> Html msg -qrCodeView message = +qrCodeView : Texts -> String -> Html msg +qrCodeView texts message = QRCode.encode message |> Result.map QRCode.toSvg |> Result.withDefault - (Html.text "Error generating QR-Code") + (Html.text texts.errorGeneratingQR) -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 flags settings model = +view2 : Texts -> Flags -> UiSettings -> Model -> Html Msg +view2 texts flags settings model = case model.viewMode of None -> - viewTable2 model + viewTable2 texts model Edit _ -> - div [] (viewForm2 flags settings model) + div [] (viewForm2 texts flags settings model) Display source -> - viewLinks2 flags settings source + viewLinks2 texts flags settings source -viewTable2 : Model -> Html Msg -viewTable2 model = +viewTable2 : Texts -> Model -> Html Msg +viewTable2 texts model = div [ class "relative flex flex-col" ] [ MB.view { start = [] , end = [ MB.PrimaryButton { tagger = InitNewSource - , title = "Add a source url" + , title = texts.addSourceUrl , icon = Just "fa fa-plus" - , label = "New source" + , label = texts.newSource } ] , rootClasses = "mb-4" } - , Html.map TableMsg (Comp.SourceTable.view2 model.sources) + , Html.map TableMsg (Comp.SourceTable.view2 texts.sourceTable model.sources) , B.loadingDimmer model.loading ] -viewLinks2 : Flags -> UiSettings -> SourceAndTags -> Html Msg -viewLinks2 flags _ source = +viewLinks2 : Texts -> Flags -> UiSettings -> SourceAndTags -> Html Msg +viewLinks2 texts flags _ source = let appUrl = flags.config.baseUrl ++ "/app/upload/" ++ source.source.id @@ -270,7 +271,7 @@ viewLinks2 flags _ source = div [] [ h2 [ class S.header2 ] - [ text "Public Uploads: " + [ text (texts.publicUploads ++ ": ") , text source.source.abbrev , div [ class "opacity-50 text-sm" ] [ text source.source.id @@ -279,37 +280,33 @@ viewLinks2 flags _ source = , MB.view { start = [ MB.SecondaryButton - { label = "Back" + { label = texts.basics.back , icon = Just "fa fa-arrow-left" , tagger = SetTableView - , title = "Back to list" + , title = texts.basics.backToList } ] , end = [] , rootClasses = "mb-4" } , p [ class "text-lg pt-2 opacity-75" ] - [ text "This source defines URLs that can be used by anyone to send files to " - , text "you. There is a web page that you can share or the API url can be used " - , text "with other clients." + [ text texts.sourceInfoText ] , p [ class "text-lg py-2 opacity-75" ] - [ text "There have been " - , String.fromInt source.source.counter |> text - , text " items created through this source." + [ text (texts.itemsCreatedInfo source.source.counter) ] , h3 [ class S.header3 , class "mt-2" ] - [ text "Public Upload Page" + [ text texts.publicUploadPage ] , div [ class "" ] [ div [ class "flex flex-row" ] [ a [ class S.secondaryBasicButtonPlain , class "rounded-l border text-sm px-4 py-2" - , title "Copy to clipboard" + , title texts.copyToClipboard , href "#" , Tuple.second appClipboardData |> String.dropLeft 1 @@ -323,7 +320,7 @@ viewLinks2 flags _ source = , class "px-4 py-2 border-0 border-t border-b border-r text-sm" , href appUrl , target "_blank" - , title "Open in new tab/window" + , title texts.openInNewTab ] [ i [ class "fa fa-external-link-alt" ] [] ] @@ -340,21 +337,21 @@ viewLinks2 flags _ source = [ class S.border , class styleQr ] - [ qrCodeView appUrl + [ qrCodeView texts appUrl ] ] , h3 [ class S.header3 , class "mt-4" ] - [ text "Public API Upload URL" + [ text texts.publicUploadUrl ] , div [ class "" ] [ div [ class "flex flex-row" ] [ a [ class S.secondaryBasicButtonPlain , class "px-4 py-2 rounded-l border text-sm" - , title "Copy to clipboard" + , title texts.copyToClipboard , href "#" , Tuple.second apiClipboardData |> String.dropLeft 1 @@ -376,24 +373,24 @@ viewLinks2 flags _ source = [ class S.border , class styleQr ] - [ qrCodeView apiUrl + [ qrCodeView texts apiUrl ] ] ] -viewForm2 : Flags -> UiSettings -> Model -> List (Html Msg) -viewForm2 flags settings model = +viewForm2 : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewForm2 texts flags settings model = let newSource = model.formModel.source.source.id == "" dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete this source?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteSource in [ if newSource then h3 [ class S.header2 ] - [ text "Create new source" + [ text texts.createNewSource ] else @@ -412,24 +409,24 @@ viewForm2 flags 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 = SetTableView - , title = "Back to list" + , title = texts.basics.backToList , icon = Just "fa fa-arrow-left" - , label = "Cancel" + , label = texts.basics.cancel } ] , end = if not newSource then [ MB.DeleteButton { tagger = RequestDelete - , title = "Delete this settings entry" + , title = texts.deleteThisSource , icon = Just "fa fa-trash" - , label = "Delete" + , label = texts.basics.delete } ] @@ -438,7 +435,7 @@ viewForm2 flags settings model = , rootClasses = "mb-4" } , Html.map FormMsg - (Comp.SourceForm.view2 flags settings model.formModel) + (Comp.SourceForm.view2 flags texts.sourceForm settings model.formModel) , div [ classList [ ( S.errorMessage, True ) diff --git a/modules/webapp/src/main/elm/Comp/SourceTable.elm b/modules/webapp/src/main/elm/Comp/SourceTable.elm index bd0a3466..6aa4f53c 100644 --- a/modules/webapp/src/main/elm/Comp/SourceTable.elm +++ b/modules/webapp/src/main/elm/Comp/SourceTable.elm @@ -12,6 +12,7 @@ import Data.Flags exposing (Flags) import Data.Priority import Html exposing (..) import Html.Attributes exposing (..) +import Messages.SourceTableComp exposing (Texts) import Styles as S import Util.Html @@ -54,26 +55,26 @@ update _ msg = --- View2 -view2 : List SourceAndTags -> Html Msg -view2 sources = +view2 : Texts -> List SourceAndTags -> Html Msg +view2 texts sources = table [ class S.tableMain ] [ thead [] [ tr [] [ th [ class "" ] [] - , th [ class "text-left" ] [ text "Abbrev" ] - , th [ class "px-2 text-center" ] [ text "Enabled" ] - , th [ class "hidden md:table-cell" ] [ text "Counter" ] - , th [ class "hidden md:table-cell" ] [ text "Priority" ] - , th [ class "hidden sm:table-cell" ] [ text "Id" ] + , th [ class "text-left" ] [ text texts.abbrev ] + , th [ class "px-2 text-center" ] [ text texts.enabled ] + , th [ class "hidden md:table-cell" ] [ text texts.counter ] + , th [ class "hidden md:table-cell" ] [ text texts.priority ] + , th [ class "hidden sm:table-cell" ] [ text texts.id ] ] ] , tbody [] - (List.map renderSourceLine2 sources) + (List.map (renderSourceLine2 texts) sources) ] -renderSourceLine2 : SourceAndTags -> Html Msg -renderSourceLine2 source = +renderSourceLine2 : Texts -> SourceAndTags -> Html Msg +renderSourceLine2 texts source = tr [ class S.tableRow ] [ td [ class S.editLinkTableCellStyle ] @@ -82,7 +83,7 @@ renderSourceLine2 source = ] [ B.editLinkLabel (Select source) , B.linkLabel - { label = "Show" + { label = texts.show , icon = "fa fa-eye" , handler = Show source , disabled = not source.source.enabled diff --git a/modules/webapp/src/main/elm/Comp/UserForm.elm b/modules/webapp/src/main/elm/Comp/UserForm.elm index a1b74aad..4255ca01 100644 --- a/modules/webapp/src/main/elm/Comp/UserForm.elm +++ b/modules/webapp/src/main/elm/Comp/UserForm.elm @@ -19,6 +19,7 @@ import Data.UserState exposing (UserState) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) +import Messages.UserFormComp exposing (Texts) import Styles as S import Util.Maybe @@ -166,19 +167,19 @@ update _ msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = div [ class "flex flex-col" ] [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Login" + [ text texts.login , B.inputRequired ] , input [ type_ "text" , onInput SetLogin - , placeholder "Login" + , placeholder texts.login , value model.login , class S.textInput , classList [ ( S.inputErrorBorder, model.login == "" ) ] @@ -187,20 +188,20 @@ view2 settings model = ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "E-Mail" + [ text texts.email ] , input [ onInput SetEmail , type_ "text" , model.email |> Maybe.withDefault "" |> value - , placeholder "E-Mail" + , placeholder texts.email , class S.textInput ] [] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "State" + [ text texts.state ] , Html.map StateMsg (Comp.Dropdown.view2 @@ -214,13 +215,13 @@ view2 settings model = , classList [ ( "hidden", model.user.login /= "" ) ] ] [ label [ class S.inputLabel ] - [ text "Password" + [ text texts.password , B.inputRequired ] , input [ type_ "text" , onInput SetPassword - , placeholder "Password" + , placeholder texts.password , Maybe.withDefault "" model.password |> value , class S.textInput , classList [ ( S.inputErrorBorder, Util.Maybe.isEmpty model.password ) ] diff --git a/modules/webapp/src/main/elm/Comp/UserManage.elm b/modules/webapp/src/main/elm/Comp/UserManage.elm index f1f7ff1d..5bb7fe2d 100644 --- a/modules/webapp/src/main/elm/Comp/UserManage.elm +++ b/modules/webapp/src/main/elm/Comp/UserManage.elm @@ -21,6 +21,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http +import Messages.UserManageComp exposing (Texts) import Styles as S import Util.Http import Util.Maybe @@ -30,7 +31,7 @@ type alias Model = { tableModel : Comp.UserTable.Model , formModel : Comp.UserForm.Model , viewMode : ViewMode - , formError : Maybe String + , formError : FormError , loading : Bool , deleteConfirm : Comp.YesNoDimmer.Model } @@ -41,12 +42,18 @@ type ViewMode | Form +type FormError + = FormErrorNone + | FormErrorSubmit String + | FormErrorInvalid + + emptyModel : Model emptyModel = { tableModel = Comp.UserTable.emptyModel , formModel = Comp.UserForm.emptyModel , viewMode = Table - , formError = Nothing + , formError = FormErrorNone , loading = False , deleteConfirm = Comp.YesNoDimmer.emptyModel } @@ -79,7 +86,7 @@ update flags msg model = , viewMode = Maybe.map (\_ -> Form) tm.selected |> Maybe.withDefault Table , formError = if Util.Maybe.nonEmpty tm.selected then - Nothing + FormErrorNone else model.formError @@ -132,7 +139,7 @@ update flags msg model = InitNewUser -> let nm = - { model | viewMode = Form, formError = Nothing } + { model | viewMode = Form, formError = FormErrorNone } user = Api.Model.User.empty @@ -158,7 +165,7 @@ update flags msg model = ( { model | loading = True }, cmd ) else - ( { model | formError = Just "Please correct the errors in the form." }, Cmd.none ) + ( { model | formError = FormErrorInvalid }, Cmd.none ) SubmitResp (Ok res) -> if res.success then @@ -172,10 +179,15 @@ update flags msg model = ( { m3 | loading = False }, Cmd.batch [ c2, c3 ] ) else - ( { model | formError = Just res.message, loading = False }, Cmd.none ) + ( { model | formError = FormErrorSubmit res.message, loading = False }, Cmd.none ) SubmitResp (Err err) -> - ( { model | formError = Just (Util.Http.errorToString err), loading = False }, Cmd.none ) + ( { model + | formError = FormErrorSubmit (Util.Http.errorToString err) + , loading = False + } + , Cmd.none + ) RequestDelete -> update flags (YesNoMsg Comp.YesNoDimmer.activate) model @@ -202,44 +214,44 @@ 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" ] [ MB.view { start = [] , end = [ MB.PrimaryButton { tagger = InitNewUser - , title = "Add a new user" + , title = texts.addNewUser , icon = Just "fa fa-plus" - , label = "New user" + , label = texts.newUser } ] , rootClasses = "mb-4" } - , Html.map TableMsg (Comp.UserTable.view2 model.tableModel) + , Html.map TableMsg (Comp.UserTable.view2 texts.userTable 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 newUser = Comp.UserForm.isNewUser model.formModel dimmerSettings : Comp.YesNoDimmer.Settings dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete this user?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteUser in Html.form [ class "flex flex-col md:relative" @@ -252,7 +264,7 @@ viewForm2 settings model = ) , if newUser then h3 [ class S.header2 ] - [ text "Create new user" + [ text texts.createNewUser ] else @@ -263,24 +275,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 newUser then [ MB.DeleteButton { tagger = RequestDelete - , title = "Delete this user" + , title = texts.deleteThisUser , icon = Just "fa fa-trash" - , label = "Delete" + , label = texts.basics.delete } ] @@ -288,14 +300,22 @@ viewForm2 settings model = [] , rootClasses = "mb-4" } - , Html.map FormMsg (Comp.UserForm.view2 settings model.formModel) + , Html.map FormMsg (Comp.UserForm.view2 texts.userForm settings model.formModel) , div [ classList - [ ( "hidden", Util.Maybe.isEmpty model.formError ) + [ ( "hidden", model.formError == FormErrorNone ) ] , class S.errorMessage ] - [ Maybe.withDefault "" model.formError |> text + [ case model.formError of + FormErrorNone -> + text "" + + FormErrorSubmit err -> + text err + + FormErrorInvalid -> + text texts.pleaseCorrectErrors ] , B.loadingDimmer model.loading ] diff --git a/modules/webapp/src/main/elm/Comp/UserTable.elm b/modules/webapp/src/main/elm/Comp/UserTable.elm index 8a021de3..a5209be1 100644 --- a/modules/webapp/src/main/elm/Comp/UserTable.elm +++ b/modules/webapp/src/main/elm/Comp/UserTable.elm @@ -11,6 +11,7 @@ import Comp.Basic as B import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) +import Messages.UserTableComp exposing (Texts) import Styles as S import Util.Time exposing (formatDateTime) @@ -51,32 +52,34 @@ 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 "w-px whitespace-nowrap" ] [] - , th [ class "text-left" ] [ text "Login" ] - , th [ class "text-center" ] [ text "State" ] - , th [ class "hidden md:table-cell text-left" ] [ text "Email" ] - , th [ class "hidden md:table-cell text-center" ] [ text "Logins" ] - , th [ class "hidden sm:table-cell text-center" ] [ text "Last Login" ] - , th [ class "hidden md:table-cell text-center" ] [ text "Created" ] + , th [ class "text-left" ] [ text texts.login ] + , th [ class "text-center" ] [ text texts.state ] + , th [ class "hidden md:table-cell text-left" ] [ text texts.email ] + , th [ class "hidden md:table-cell text-center" ] [ text texts.login ] + , th [ class "hidden sm:table-cell text-center" ] [ text texts.lastLogin ] + , th [ class "hidden md:table-cell text-center" ] + [ text texts.basics.created + ] ] ] , tbody [] - (List.map (renderUserLine2 model) model.users) + (List.map (renderUserLine2 texts model) model.users) ] -renderUserLine2 : Model -> User -> Html Msg -renderUserLine2 model user = +renderUserLine2 : Texts -> Model -> User -> Html Msg +renderUserLine2 texts model user = tr [ classList [ ( "active", model.selected == Just user ) ] , class S.tableRow ] - [ B.editLinkTableCell (Select user) + [ B.editLinkTableCell2 texts.basics (Select user) , td [ class "text-left" ] [ text user.login ] diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index 0a07608e..04b84168 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -6,6 +6,7 @@ module Messages exposing ) import Messages.App +import Messages.CollectiveSettingsPage import Messages.LoginPage import UiLanguage exposing (UiLanguage(..)) @@ -18,6 +19,7 @@ type alias Messages = , label : String , flagIcon : String , app : Messages.App.Texts + , collectiveSettings : Messages.CollectiveSettingsPage.Texts , login : Messages.LoginPage.Texts } @@ -72,6 +74,7 @@ gb = , label = "English" , flagIcon = "flag-icon flag-icon-gb" , app = Messages.App.gb + , collectiveSettings = Messages.CollectiveSettingsPage.gb , login = Messages.LoginPage.gb } @@ -83,5 +86,6 @@ de = , label = "Deutsch" , flagIcon = "flag-icon flag-icon-de" , app = Messages.App.de + , collectiveSettings = Messages.CollectiveSettingsPage.de , login = Messages.LoginPage.de } diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm new file mode 100644 index 00000000..089453d3 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -0,0 +1,39 @@ +module Messages.Basics exposing (..) + + +type alias Texts = + { incoming : String + , outgoing : String + , tags : String + , items : String + , submit : String + , submitThisForm : String + , cancel : String + , delete : String + , created : String + , edit : String + , back : String + , backToList : String + } + + +gb : Texts +gb = + { incoming = "Incoming" + , outgoing = "Outgoing" + , tags = "Tags" + , items = "Items" + , submit = "Submit" + , submitThisForm = "Submit this form" + , cancel = "Cancel" + , delete = "Delete" + , created = "Created" + , edit = "Edit" + , back = "Back" + , backToList = "Back to list" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm new file mode 100644 index 00000000..38a4ef45 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm @@ -0,0 +1,35 @@ +module Messages.ClassifierSettingsFormComp exposing (..) + + +type alias Texts = + { autoTaggingText : String + , blacklistOrWhitelist : String + , whitelistLabel : String + , blacklistLabel : String + , itemCount : String + , schedule : String + , itemCountHelp : String + } + + +gb : Texts +gb = + { autoTaggingText = + """ + +Auto-tagging works by learning from existing documents. The more +documents you have correctly tagged, the better. Learning is done +periodically based on a schedule. You can specify tag-groups that +should either be used (whitelist) or not used (blacklist) for +learning. + +Use an empty whitelist to disable auto tagging. + + """ + , blacklistOrWhitelist = "Is the following a blacklist or whitelist?" + , whitelistLabel = "Include tag categories for learning" + , blacklistLabel = "Exclude tag categories from learning" + , itemCount = "Item Count" + , schedule = "Schedule" + , itemCountHelp = "The maximum number of items to learn from, order by date newest first. Use 0 to mean all." + } diff --git a/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm new file mode 100644 index 00000000..eeabfe34 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm @@ -0,0 +1,42 @@ +module Messages.CollectiveSettingsFormComp exposing (..) + +import Messages.ClassifierSettingsFormComp + + +type alias Texts = + { classifierSettingsForm : Messages.ClassifierSettingsFormComp.Texts + , save : String + , saveSettings : String + , documentLanguage : String + , documentLanguageHelp : String + , integrationEndpoint : String + , integrationEndpointLabel : String + , integrationEndpointHelp : String + , fulltextSearch : String + , reindexAllData : String + , reindexAllDataHelp : String + , autoTagging : String + , startNow : String + } + + +gb : Texts +gb = + { classifierSettingsForm = Messages.ClassifierSettingsFormComp.gb + , save = "Save" + , saveSettings = "Save Settings" + , documentLanguage = "Document Language" + , documentLanguageHelp = "The language of your documents. This helps text recognition (OCR) and text analysis." + , integrationEndpoint = "Integration Endpoint" + , integrationEndpointLabel = "Enable integration endpoint" + , integrationEndpointHelp = + "The integration endpoint allows (local) applications to submit files. " + ++ "You can choose to disable it for your collective." + , fulltextSearch = "Full-Text Search" + , reindexAllData = "Re-Index All Data" + , reindexAllDataHelp = + "This starts a task that clears the full-text index and re-indexes all your data again." + ++ "You must type OK before clicking the button to avoid accidental re-indexing." + , autoTagging = "Auto-Tagging" + , startNow = "Start now" + } diff --git a/modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm b/modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm new file mode 100644 index 00000000..8d05c859 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm @@ -0,0 +1,44 @@ +module Messages.CollectiveSettingsPage exposing (..) + +import Messages.Basics +import Messages.CollectiveSettingsFormComp +import Messages.SourceManageComp +import Messages.UserManageComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , userManage : Messages.UserManageComp.Texts + , collectiveSettingsForm : Messages.CollectiveSettingsFormComp.Texts + , sourceManage : Messages.SourceManageComp.Texts + , collectiveSettings : String + , insights : String + , sources : String + , settings : String + , users : String + , user : String + , collective : String + , size : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , userManage = Messages.UserManageComp.gb + , collectiveSettingsForm = Messages.CollectiveSettingsFormComp.gb + , sourceManage = Messages.SourceManageComp.gb + , collectiveSettings = "Collective Settings" + , insights = "Insights" + , sources = "Sources" + , settings = "Settings" + , users = "Users" + , user = "User" + , collective = "Collective" + , size = "Size" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/LoginPage.elm b/modules/webapp/src/main/elm/Messages/LoginPage.elm index befd838a..94d2b2d5 100644 --- a/modules/webapp/src/main/elm/Messages/LoginPage.elm +++ b/modules/webapp/src/main/elm/Messages/LoginPage.elm @@ -1,14 +1,16 @@ module Messages.LoginPage exposing ( Texts , de - , fr , gb ) type alias Texts = - { username : String + { loginToDocspell : String + , username : String + , collectiveSlashLogin : String , password : String + , rememberMe : String , loginPlaceholder : String , passwordPlaceholder : String , loginButton : String @@ -20,8 +22,11 @@ type alias Texts = gb : Texts gb = - { username = "Username" + { loginToDocspell = "Login to Docspell" + , username = "Username" + , collectiveSlashLogin = "Collective / Login" , password = "Password" + , rememberMe = "Remember Me" , loginPlaceholder = "Login" , passwordPlaceholder = "Password" , loginButton = "Login" @@ -33,8 +38,11 @@ gb = de : Texts de = - { username = "Benutzer" + { loginToDocspell = "Docspell Anmeldung" + , username = "Benutzer" + , collectiveSlashLogin = "Kollektiv / Benutzer" , password = "Passwort" + , rememberMe = "Anmeldung speichern" , loginPlaceholder = "Benutzer" , passwordPlaceholder = "Passwort" , loginButton = "Anmelden" @@ -42,16 +50,3 @@ de = , noAccount = "Kein Konto?" , signupLink = "Hier registrieren!" } - - -fr : Texts -fr = - { username = "Identifiant" - , password = "Mot de passe" - , loginPlaceholder = "Utilisateur" - , passwordPlaceholder = "Mot de passe" - , loginButton = "Connexion" - , loginSuccessful = "Identification réussie" - , noAccount = "Pas de compte ?" - , signupLink = "S'inscrire" - } diff --git a/modules/webapp/src/main/elm/Messages/SourceFormComp.elm b/modules/webapp/src/main/elm/Messages/SourceFormComp.elm new file mode 100644 index 00000000..9269cd4f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SourceFormComp.elm @@ -0,0 +1,61 @@ +module Messages.SourceFormComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , name : String + , description : String + , enabled : String + , priority : String + , priorityInfo : String + , metadata : String + , metadataInfoText : String + , folder : String + , folderInfo : String + , folderForbiddenText : String + , tagsInfo : String + , fileFilter : String + , fileFilterInfo : String + , language : String + , languageInfo : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , name = "Name" + , description = "Description" + , enabled = "Enabled" + , priority = "Priority" + , priorityInfo = "The priority used by the scheduler when processing uploaded files." + , metadata = "Metadata" + , metadataInfoText = + "Metadata specified here is automatically attached to each item uploaded " + ++ "through this source, unless it is overriden in the upload request meta data. " + ++ "Tags from the request are added to those defined here." + , folder = "Folder" + , folderInfo = "Choose a folder to automatically put items into." + , folderForbiddenText = + """ +You are **not a member** of this folder. Items created through this +link will be **hidden** from any search results. Use a folder where +you are a member of to make items visible. This message will +disappear then. + """ + , tagsInfo = "Choose tags that should be applied to items." + , fileFilter = "File Filter" + , fileFilterInfo = """ + +Specify a file glob to filter files when uploading archives +(e.g. for email and zip). For example, to only extract pdf files: +`*.pdf`. Globs can be combined via OR, like this: `*.pdf|mail.html`. + +""" + , language = "Language" + , languageInfo = + "Used for text extraction and analysis. The collective's " + ++ "default language is used if not specified here." + } diff --git a/modules/webapp/src/main/elm/Messages/SourceManageComp.elm b/modules/webapp/src/main/elm/Messages/SourceManageComp.elm new file mode 100644 index 00000000..a6b68cf2 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SourceManageComp.elm @@ -0,0 +1,53 @@ +module Messages.SourceManageComp exposing (..) + +import Messages.Basics +import Messages.SourceFormComp +import Messages.SourceTableComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , sourceTable : Messages.SourceTableComp.Texts + , sourceForm : Messages.SourceFormComp.Texts + , addSourceUrl : String + , newSource : String + , publicUploads : String + , sourceInfoText : String + , itemsCreatedInfo : Int -> String + , publicUploadPage : String + , copyToClipboard : String + , openInNewTab : String + , publicUploadUrl : String + , reallyDeleteSource : String + , createNewSource : String + , deleteThisSource : String + , errorGeneratingQR : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , sourceTable = Messages.SourceTableComp.gb + , sourceForm = Messages.SourceFormComp.gb + , addSourceUrl = "Add a source url" + , newSource = "New source" + , publicUploads = "Public Uploads" + , sourceInfoText = + "This source defines URLs that can be used by anyone to send files to " + ++ "you. There is a web page that you can share or the API url can be used " + ++ "with other clients." + , itemsCreatedInfo = + \n -> + "There have been " + ++ String.fromInt n + ++ " items created through this source." + , publicUploadPage = "Public Upload Page" + , copyToClipboard = "Copy to clipboard" + , openInNewTab = "Open in new tab/window" + , publicUploadUrl = "Public API Upload URL" + , reallyDeleteSource = "Really delete this source?" + , createNewSource = "Create new source" + , deleteThisSource = "Delete this source" + , errorGeneratingQR = "Error generating QR Code" + } diff --git a/modules/webapp/src/main/elm/Messages/SourceTableComp.elm b/modules/webapp/src/main/elm/Messages/SourceTableComp.elm new file mode 100644 index 00000000..1b306995 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SourceTableComp.elm @@ -0,0 +1,22 @@ +module Messages.SourceTableComp exposing (..) + + +type alias Texts = + { abbrev : String + , enabled : String + , counter : String + , priority : String + , id : String + , show : String + } + + +gb : Texts +gb = + { abbrev = "Abbrev" + , enabled = "Enabled" + , counter = "Counter" + , priority = "Priority" + , id = "Id" + , show = "Show" + } diff --git a/modules/webapp/src/main/elm/Messages/UserFormComp.elm b/modules/webapp/src/main/elm/Messages/UserFormComp.elm new file mode 100644 index 00000000..4616f360 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UserFormComp.elm @@ -0,0 +1,18 @@ +module Messages.UserFormComp exposing (..) + + +type alias Texts = + { login : String + , state : String + , email : String + , password : String + } + + +gb : Texts +gb = + { login = "Login" + , state = "State" + , email = "E-Mail" + , password = "Password" + } diff --git a/modules/webapp/src/main/elm/Messages/UserManageComp.elm b/modules/webapp/src/main/elm/Messages/UserManageComp.elm new file mode 100644 index 00000000..98870683 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UserManageComp.elm @@ -0,0 +1,39 @@ +module Messages.UserManageComp exposing (..) + +import Messages.Basics +import Messages.UserFormComp +import Messages.UserTableComp + + +type alias Texts = + { userTable : Messages.UserTableComp.Texts + , userForm : Messages.UserFormComp.Texts + , users : String + , newUser : String + , addNewUser : String + , reallyDeleteUser : String + , createNewUser : String + , basics : Messages.Basics.Texts + , deleteThisUser : String + , pleaseCorrectErrors : String + } + + +gb : Texts +gb = + { userTable = Messages.UserTableComp.gb + , userForm = Messages.UserFormComp.gb + , basics = Messages.Basics.gb + , users = "Users" + , newUser = "New user" + , addNewUser = "Add new user" + , reallyDeleteUser = "Really delete this user?" + , createNewUser = "Create new user" + , deleteThisUser = "Delete this user" + , pleaseCorrectErrors = "Please correct the errors in the form." + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/UserTableComp.elm b/modules/webapp/src/main/elm/Messages/UserTableComp.elm new file mode 100644 index 00000000..30939c31 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UserTableComp.elm @@ -0,0 +1,26 @@ +module Messages.UserTableComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , login : String + , state : String + , email : String + , logins : String + , lastLogin : String + , created : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , login = "Login" + , state = "State" + , email = "E-Mail" + , logins = "Logins" + , lastLogin = "Last Login" + , created = "Created" + } diff --git a/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm b/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm index 7a7ac428..33c89996 100644 --- a/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm @@ -11,14 +11,15 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.CollectiveSettingsPage exposing (Texts) import Page.CollectiveSettings.Data exposing (..) import Styles as S import Util.Maybe import Util.Size -viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg -viewSidebar visible _ _ model = +viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg +viewSidebar texts visible _ _ model = div [ id "sidebar" , class S.sidebar @@ -27,7 +28,7 @@ viewSidebar visible _ _ model = ] [ div [ class "" ] [ h1 [ class S.header1 ] - [ text "Collective Settings" + [ text texts.collectiveSettings ] ] , div [ class "flex flex-col my-2" ] @@ -40,7 +41,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-chart-bar" ] [] , span [ class "ml-3" ] - [ text "Insights" ] + [ text texts.insights ] ] , a [ href "#" @@ -51,7 +52,7 @@ viewSidebar visible _ _ model = [ Icons.sourceIcon2 "" , span [ class "ml-3" ] - [ text "Sources" ] + [ text texts.sources ] ] , a [ href "#" @@ -62,7 +63,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-cog" ] [] , span [ class "ml-3" ] - [ text "Settings" ] + [ text texts.settings ] ] , a [ href "#" @@ -73,30 +74,30 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-user" ] [] , span [ class "ml-3" ] - [ text "Users" ] + [ text texts.users ] ] ] ] -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 UserTab -> - viewUsers settings model + viewUsers texts settings model Just SettingsTab -> - viewSettings flags settings model + viewSettings texts flags settings model Just InsightsTab -> - viewInsights flags model + viewInsights texts flags model Just SourceTab -> - viewSources flags settings model + viewSources texts flags settings model Nothing -> [] @@ -116,8 +117,8 @@ menuEntryActive model tab = class "" -viewInsights : Flags -> Model -> List (Html Msg) -viewInsights flags model = +viewInsights : Texts -> Flags -> Model -> List (Html Msg) +viewInsights texts flags model = let ( coll, user ) = Maybe.map (\a -> ( a.collective, a.user )) flags.account @@ -126,7 +127,7 @@ viewInsights flags model = [ h1 [ class S.header1 ] [ i [ class "fa fa-chart-bar font-thin" ] [] , span [ class "ml-2" ] - [ text "Insights" + [ text texts.insights ] ] , div [ class "mb-4" ] @@ -136,7 +137,7 @@ viewInsights flags model = [ div [ class "flex flex-row space-x-6" ] [ div [ class "" - , title "Collective" + , title texts.collective ] [ i [ class "fa fa-users" ] [] , span [ class "ml-2" ] @@ -145,7 +146,7 @@ viewInsights flags model = ] , div [ class "" - , title "User" + , title texts.user ] [ i [ class "fa fa-user font-thin" ] [] , span [ class "ml-2" ] @@ -161,26 +162,26 @@ viewInsights flags model = [ text "Items" ] , div [ class "flex px-4 flex-wrap" ] - [ stats (String.fromInt (model.insights.incomingCount + model.insights.outgoingCount)) "Items" - , stats (String.fromInt model.insights.incomingCount) "Incoming" - , stats (String.fromInt model.insights.outgoingCount) "Outgoing" + [ stats (String.fromInt (model.insights.incomingCount + model.insights.outgoingCount)) texts.basics.items + , stats (String.fromInt model.insights.incomingCount) texts.basics.incoming + , stats (String.fromInt model.insights.outgoingCount) texts.basics.outgoing ] ] , div [ class "py-2" ] [ h4 [ class S.header3 ] - [ text "Size" + [ text texts.size ] , div [ class "flex px-4 flex-wrap" ] - [ stats (toFloat model.insights.itemSize |> Util.Size.bytesReadable Util.Size.B) "Size" + [ stats (toFloat model.insights.itemSize |> Util.Size.bytesReadable Util.Size.B) texts.size ] ] , div [ class "py-2" ] [ h4 [ class S.header3 ] - [ text "Tags" + [ text texts.basics.tags ] , div [ class "flex px-4 flex-wrap" ] (List.map makeTagStats @@ -207,54 +208,66 @@ makeTagStats nc = stats (String.fromInt nc.count) nc.tag.name -viewSources : Flags -> UiSettings -> Model -> List (Html Msg) -viewSources flags settings model = +viewSources : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewSources texts flags settings model = [ h1 [ class S.header1 , class "inline-flex items-center" ] [ Icons.sourceIcon2 "" , div [ class "ml-3" ] - [ text "Sources" + [ text texts.sources ] ] - , Html.map SourceMsg (Comp.SourceManage.view2 flags settings model.sourceModel) + , Html.map SourceMsg (Comp.SourceManage.view2 texts.sourceManage flags settings model.sourceModel) ] -viewUsers : UiSettings -> Model -> List (Html Msg) -viewUsers settings model = +viewUsers : Texts -> UiSettings -> Model -> List (Html Msg) +viewUsers texts settings model = [ h1 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-user" ] [] , div [ class "ml-3" ] - [ text "Users" + [ text texts.users ] ] - , Html.map UserMsg (Comp.UserManage.view2 settings model.userModel) + , Html.map UserMsg (Comp.UserManage.view2 texts.userManage settings model.userModel) ] -viewSettings : Flags -> UiSettings -> Model -> List (Html Msg) -viewSettings flags settings model = +viewSettings : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewSettings texts flags settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-cog" ] [] , span [ class "ml-3" ] - [ text "Collective Settings" + [ text texts.collectiveSettings ] ] , Html.map SettingsFormMsg - (Comp.CollectiveSettingsForm.view2 flags settings model.settingsModel) + (Comp.CollectiveSettingsForm.view2 + flags + texts.collectiveSettingsForm + settings + model.settingsModel + ) , div [ classList [ ( "hidden", Util.Maybe.isEmpty model.submitResult ) - , ( S.successMessage, Maybe.map .success model.submitResult |> Maybe.withDefault False ) - , ( S.errorMessage, Maybe.map .success model.submitResult |> Maybe.map not |> Maybe.withDefault False ) + , ( S.successMessage + , Maybe.map .success model.submitResult + |> Maybe.withDefault False + ) + , ( S.errorMessage + , Maybe.map .success model.submitResult + |> Maybe.map not + |> Maybe.withDefault False + ) ] , class "mt-2" ] diff --git a/modules/webapp/src/main/elm/Page/Login/View2.elm b/modules/webapp/src/main/elm/Page/Login/View2.elm index 9f5e8695..1289132c 100644 --- a/modules/webapp/src/main/elm/Page/Login/View2.elm +++ b/modules/webapp/src/main/elm/Page/Login/View2.elm @@ -6,6 +6,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onInput, onSubmit) +import Messages.LoginPage exposing (Texts) import Page exposing (Page(..)) import Page.Login.Data exposing (..) import Styles as S @@ -20,8 +21,8 @@ viewSidebar _ _ _ _ = [] -viewContent : Flags -> VersionInfo -> UiSettings -> Model -> Html Msg -viewContent flags versionInfo _ model = +viewContent : Texts -> Flags -> VersionInfo -> UiSettings -> Model -> Html Msg +viewContent texts flags versionInfo _ model = div [ id "content" , class "h-full flex flex-col items-center justify-center w-full" @@ -36,7 +37,7 @@ viewContent flags versionInfo _ model = [] ] , div [ class "font-medium self-center text-xl sm:text-2xl" ] - [ text "Login to Docspell" + [ text texts.loginToDocspell ] , Html.form [ action "#" @@ -48,7 +49,7 @@ viewContent flags versionInfo _ model = [ for "username" , class S.inputLabel ] - [ text "Username" + [ text texts.username ] , div [ class "relative" ] [ div [ class S.inputIcon ] @@ -62,7 +63,7 @@ viewContent flags versionInfo _ model = , value model.username , autofocus True , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Collective / Login" + , placeholder texts.collectiveSlashLogin ] [] ] @@ -72,7 +73,7 @@ viewContent flags versionInfo _ model = [ for "password" , class S.inputLabel ] - [ text "Password" + [ text texts.password ] , div [ class "relative" ] [ div [ class S.inputIcon ] @@ -85,7 +86,7 @@ viewContent flags versionInfo _ model = , onInput SetPassword , value model.password , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Password" + , placeholder texts.password ] [] ] @@ -107,7 +108,7 @@ viewContent flags versionInfo _ model = , span [ class "mb-1 ml-2 text-xs sm:text-sm tracking-wide my-1" ] - [ text "Remember Me" + [ text texts.rememberMe ] ] ] @@ -116,23 +117,23 @@ viewContent flags versionInfo _ model = [ type_ "submit" , class S.primaryButton ] - [ text "Login" + [ text texts.loginButton ] ] - , resultMessage model + , resultMessage texts model , div [ class "flex justify-end text-sm pt-4" , classList [ ( "hidden", flags.config.signupMode == "closed" ) ] ] [ span [] - [ text "No account?" + [ text texts.noAccount ] , a [ Page.href RegisterPage , class ("ml-2" ++ S.link) ] [ i [ class "fa fa-user-plus mr-1" ] [] - , text "Sign up" + , text texts.signupLink ] ] ] @@ -155,13 +156,13 @@ viewContent flags versionInfo _ model = ] -resultMessage : Model -> Html Msg -resultMessage model = +resultMessage : Texts -> Model -> Html Msg +resultMessage texts model = case model.result of Just r -> if r.success then div [ class ("my-2" ++ S.successMessage) ] - [ text "Login successful." + [ text texts.loginSuccessful ] else From db6198673bbd7d4814d0f000fcc1e824b00761a1 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Tue, 30 Mar 2021 22:12:25 +0200 Subject: [PATCH 07/25] Externalize strings in register page --- modules/webapp/src/main/elm/App/View2.elm | 8 ++-- modules/webapp/src/main/elm/Messages.elm | 4 ++ .../src/main/elm/Messages/RegisterPage.elm | 41 +++++++++++++++++++ .../src/main/elm/Page/Register/View2.elm | 41 ++++++++++--------- 4 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/RegisterPage.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index d6432326..2c6c7801 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -136,7 +136,7 @@ mainContent model = viewQueue model RegisterPage -> - viewRegister model + viewRegister texts model UploadPage mid -> viewUpload mid model @@ -458,12 +458,12 @@ viewQueue model = ] -viewRegister : Model -> List (Html Msg) -viewRegister model = +viewRegister : Messages -> Model -> List (Html Msg) +viewRegister texts model = [ Html.map RegisterMsg (Register.viewSidebar model.sidebarVisible model.flags model.uiSettings model.registerModel) , Html.map RegisterMsg - (Register.viewContent model.flags model.uiSettings model.registerModel) + (Register.viewContent texts.register model.flags model.uiSettings model.registerModel) ] diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index 04b84168..c2289bcf 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -8,6 +8,7 @@ module Messages exposing import Messages.App import Messages.CollectiveSettingsPage import Messages.LoginPage +import Messages.RegisterPage import UiLanguage exposing (UiLanguage(..)) @@ -21,6 +22,7 @@ type alias Messages = , app : Messages.App.Texts , collectiveSettings : Messages.CollectiveSettingsPage.Texts , login : Messages.LoginPage.Texts + , register : Messages.RegisterPage.Texts } @@ -76,6 +78,7 @@ gb = , app = Messages.App.gb , collectiveSettings = Messages.CollectiveSettingsPage.gb , login = Messages.LoginPage.gb + , register = Messages.RegisterPage.gb } @@ -88,4 +91,5 @@ de = , app = Messages.App.de , collectiveSettings = Messages.CollectiveSettingsPage.de , login = Messages.LoginPage.de + , register = Messages.RegisterPage.de } diff --git a/modules/webapp/src/main/elm/Messages/RegisterPage.elm b/modules/webapp/src/main/elm/Messages/RegisterPage.elm new file mode 100644 index 00000000..6b0dba5f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/RegisterPage.elm @@ -0,0 +1,41 @@ +module Messages.RegisterPage exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , signupToDocspell : String + , collectiveId : String + , collective : String + , userLogin : String + , username : String + , password : String + , passwordRepeat : String + , invitationKey : String + , alreadySignedUp : String + , signIn : String + , registrationSuccessful : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , signupToDocspell = "Signup to Docspell" + , collectiveId = "Collective ID" + , collective = "Collective" + , userLogin = "User Login" + , username = "Username" + , password = "Password" + , passwordRepeat = "Password (repeat)" + , invitationKey = "Invitation Key" + , alreadySignedUp = "Already signed up?" + , signIn = "Sign in" + , registrationSuccessful = "Registration successful." + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Page/Register/View2.elm b/modules/webapp/src/main/elm/Page/Register/View2.elm index d056f69c..9da3a1c2 100644 --- a/modules/webapp/src/main/elm/Page/Register/View2.elm +++ b/modules/webapp/src/main/elm/Page/Register/View2.elm @@ -6,6 +6,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput, onSubmit) +import Messages.RegisterPage exposing (Texts) import Page exposing (Page(..)) import Page.Register.Data exposing (..) import Styles as S @@ -20,8 +21,8 @@ viewSidebar _ _ _ _ = [] -viewContent : Flags -> UiSettings -> Model -> Html Msg -viewContent flags _ model = +viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts flags _ model = div [ id "content" , class "h-full flex flex-col items-center justify-center w-full" @@ -36,7 +37,7 @@ viewContent flags _ model = [] ] , div [ class "font-medium self-center text-xl sm:text-2xl" ] - [ text "Signup to Docspell" + [ text texts.signupToDocspell ] , Html.form [ action "#" @@ -48,7 +49,7 @@ viewContent flags _ model = [ for "username" , class S.inputLabel ] - [ text "Collective ID" + [ text texts.collectiveId , B.inputRequired ] , div [ class "relative" ] @@ -63,7 +64,7 @@ viewContent flags _ model = , value model.collId , autofocus True , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Collective" + , placeholder texts.collective ] [] ] @@ -73,7 +74,7 @@ viewContent flags _ model = [ for "user" , class S.inputLabel ] - [ text "User Login" + [ text texts.userLogin , B.inputRequired ] , div [ class "relative" ] @@ -87,7 +88,7 @@ viewContent flags _ model = , onInput SetLogin , value model.login , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Username" + , placeholder texts.username ] [] ] @@ -97,7 +98,7 @@ viewContent flags _ model = [ for "passw1" , class S.inputLabel ] - [ text "Password" + [ text texts.password , B.inputRequired ] , div [ class "relative" ] @@ -124,7 +125,7 @@ viewContent flags _ model = , onInput SetPass1 , value model.pass1 , class ("pl-10 pr-10 py-2 rounded-lg" ++ S.textInput) - , placeholder "Password" + , placeholder texts.password ] [] , a @@ -141,7 +142,7 @@ viewContent flags _ model = [ for "passw2" , class S.inputLabel ] - [ text "Password (repeat)" + [ text texts.passwordRepeat , B.inputRequired ] , div [ class "relative" ] @@ -168,7 +169,7 @@ viewContent flags _ model = , onInput SetPass2 , value model.pass2 , class ("pl-10 pr-10 py-2 rounded-lg" ++ S.textInput) - , placeholder "Password (repeat)" + , placeholder texts.passwordRepeat ] [] , a @@ -188,7 +189,7 @@ viewContent flags _ model = [ for "invitekey" , class S.inputLabel ] - [ text "Invitation Key" + [ text texts.invitationKey , B.inputRequired ] , div [ class "relative" ] @@ -202,7 +203,7 @@ viewContent flags _ model = , onInput SetInvite , model.invite |> Maybe.withDefault "" |> value , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Invitation Key" + , placeholder texts.invitationKey ] [] ] @@ -212,23 +213,23 @@ viewContent flags _ model = [ type_ "submit" , class S.primaryButton ] - [ text "Submit" + [ text texts.basics.submit ] ] - , resultMessage model + , resultMessage texts model , div [ class "flex justify-end text-sm pt-4" , classList [ ( "hidden", flags.config.signupMode == "closed" ) ] ] [ span [] - [ text "Already signed up?" + [ text texts.alreadySignedUp ] , a [ Page.href (LoginPage Nothing) , class ("ml-2" ++ S.link) ] [ i [ class "fa fa-user-plus mr-1" ] [] - , text "Sign in" + , text texts.signIn ] ] ] @@ -236,13 +237,13 @@ viewContent flags _ model = ] -resultMessage : Model -> Html Msg -resultMessage model = +resultMessage : Texts -> Model -> Html Msg +resultMessage texts model = case model.result of Just r -> if r.success then div [ class S.successMessage ] - [ text "Registration successful." + [ text texts.registrationSuccessful ] else From 12cad398ac733629335de7f18eeea88efc7cefd6 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Wed, 31 Mar 2021 20:57:47 +0200 Subject: [PATCH 08/25] Externalize strings in new-invite page --- modules/webapp/src/main/elm/App/View2.elm | 8 ++-- .../src/main/elm/Messages/NewInvitePage.elm | 33 +++++++++++++ .../src/main/elm/Page/NewInvite/View2.elm | 47 +++++++------------ 3 files changed, 54 insertions(+), 34 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/NewInvitePage.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 2c6c7801..07075ccb 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -142,7 +142,7 @@ mainContent model = viewUpload mid model NewInvitePage -> - viewNewInvite model + viewNewInvite texts model ItemDetailPage id -> viewItemDetail id model @@ -467,12 +467,12 @@ viewRegister texts model = ] -viewNewInvite : Model -> List (Html Msg) -viewNewInvite model = +viewNewInvite : Messages -> Model -> List (Html Msg) +viewNewInvite texts model = [ Html.map NewInviteMsg (NewInvite.viewSidebar model.sidebarVisible model.flags model.uiSettings model.newInviteModel) , Html.map NewInviteMsg - (NewInvite.viewContent model.flags model.uiSettings model.newInviteModel) + (NewInvite.viewContent texts.newInvite model.flags model.uiSettings model.newInviteModel) ] diff --git a/modules/webapp/src/main/elm/Messages/NewInvitePage.elm b/modules/webapp/src/main/elm/Messages/NewInvitePage.elm new file mode 100644 index 00000000..4e10ec5a --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/NewInvitePage.elm @@ -0,0 +1,33 @@ +module Messages.NewInvitePage exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , createNewInvitations : String + , invitationKey : String + , password : String + , reset : String + , inviteInfo : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , createNewInvitations = "Create new invitations" + , invitationKey = "Invitation Key" + , password = "Password" + , reset = "Reset" + , inviteInfo = + """Docspell requires an invite when signing up. You can + create these invites here and send them to friends so + they can signup with docspell. + + Each invite can only be used once. You'll need to + create one key for each person you want to invite. + + Creating an invite requires providing the password + from the configuration.""" + } diff --git a/modules/webapp/src/main/elm/Page/NewInvite/View2.elm b/modules/webapp/src/main/elm/Page/NewInvite/View2.elm index 1350e0ba..f81666e9 100644 --- a/modules/webapp/src/main/elm/Page/NewInvite/View2.elm +++ b/modules/webapp/src/main/elm/Page/NewInvite/View2.elm @@ -5,6 +5,8 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput, onSubmit) +import Markdown +import Messages.NewInvitePage exposing (Texts) import Page.NewInvite.Data exposing (..) import Styles as S @@ -18,15 +20,15 @@ viewSidebar _ _ _ _ = [] -viewContent : Flags -> UiSettings -> Model -> Html Msg -viewContent flags _ model = +viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts flags _ model = div [ id "content" , class "flex flex-col md:w-3/5 px-2" , class S.content ] - [ h1 [ class S.header1 ] [ text "Create new invitations" ] - , inviteMessage flags + [ h1 [ class S.header1 ] [ text texts.createNewInvitations ] + , inviteMessage texts flags , div [ class " py-2 mt-6 rounded" ] [ Html.form [ action "#" @@ -38,7 +40,7 @@ viewContent flags _ model = [ for "invitekey" , class "mb-1 text-xs sm:text-sm tracking-wide " ] - [ text "Invitation key" + [ text texts.invitationKey ] , div [ class "relative" ] [ div [ class "inline-flex items-center justify-center absolute left-0 top-0 h-full w-10 text-gray-400 dark:text-bluegray-400 " ] @@ -53,7 +55,7 @@ viewContent flags _ model = , value model.password , autofocus True , class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput) - , placeholder "Password" + , placeholder texts.password ] [] ] @@ -64,25 +66,25 @@ viewContent flags _ model = [ type_ "submit" , class (S.primaryButton ++ "inline-flex") ] - [ text "Submit" + [ text texts.basics.submit ] , a [ class S.secondaryButton , href "#" , onClick Reset ] - [ text "Reset" + [ text texts.reset ] ] ] - , resultMessage model + , resultMessage texts model ] ] ] -resultMessage : Model -> Html Msg -resultMessage model = +resultMessage : Texts -> Model -> Html Msg +resultMessage texts model = div [ classList [ ( S.errorMessage, isFailed model.result ) @@ -98,7 +100,7 @@ resultMessage model = div [ class "" ] [ p [] [ text r.message - , text " Invitation Key:" + , text (" " ++ texts.invitationKey ++ ":") ] , pre [ class "text-center font-mono mt-4" ] [ Maybe.withDefault "" r.key |> text @@ -110,28 +112,13 @@ resultMessage model = ] -inviteMessage : Flags -> Html Msg -inviteMessage flags = +inviteMessage : Texts -> Flags -> Html Msg +inviteMessage texts flags = div [ class (S.message ++ "text-sm") , classList [ ( "hidden", flags.config.signupMode /= "invite" ) ] ] - [ p [] - [ text - """Docspell requires an invite when signing up. You can - create these invites here and send them to friends so - they can signup with docspell.""" - ] - , p [] - [ text - """Each invite can only be used once. You'll need to - create one key for each person you want to invite.""" - ] - , p [] - [ text - """Creating an invite requires providing the password - from the configuration.""" - ] + [ Markdown.toHtml [] texts.inviteInfo ] From 968c8e02b72df9fe9e89ef0509450bd5a59f47c9 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Thu, 1 Apr 2021 00:47:33 +0200 Subject: [PATCH 09/25] Externalize strings in upload page --- modules/webapp/src/main/elm/App/View2.elm | 19 ++--- modules/webapp/src/main/elm/Comp/Dropzone.elm | 14 ++-- .../webapp/src/main/elm/Comp/ItemDetail.elm | 3 +- .../main/elm/Comp/ItemDetail/AddFilesForm.elm | 10 +-- .../src/main/elm/Comp/ItemDetail/View2.elm | 19 ++--- modules/webapp/src/main/elm/Messages.elm | 12 ++++ .../src/main/elm/Messages/DropzoneComp.elm | 20 ++++++ .../elm/Messages/ItemDetail/AddFilesForm.elm | 12 ++++ .../src/main/elm/Messages/ItemDetailComp.elm | 14 ++++ .../src/main/elm/Messages/ItemDetailPage.elm | 21 ++++++ .../src/main/elm/Messages/NewInvitePage.elm | 5 ++ .../src/main/elm/Messages/UploadPage.elm | 62 ++++++++++++++++ .../src/main/elm/Page/ItemDetail/View2.elm | 13 ++-- .../webapp/src/main/elm/Page/Upload/View2.elm | 71 +++++++++---------- 14 files changed, 222 insertions(+), 73 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/DropzoneComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemDetailComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemDetailPage.elm create mode 100644 modules/webapp/src/main/elm/Messages/UploadPage.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 07075ccb..279182c0 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -139,13 +139,13 @@ mainContent model = viewRegister texts model UploadPage mid -> - viewUpload mid model + viewUpload texts mid model NewInvitePage -> viewNewInvite texts model ItemDetailPage id -> - viewItemDetail id model + viewItemDetail texts id model ) @@ -476,8 +476,8 @@ viewNewInvite texts model = ] -viewUpload : Maybe String -> Model -> List (Html Msg) -viewUpload mid model = +viewUpload : Messages -> Maybe String -> Model -> List (Html Msg) +viewUpload texts mid model = [ Html.map UploadMsg (Upload.viewSidebar mid @@ -487,7 +487,8 @@ viewUpload mid model = model.uploadModel ) , Html.map UploadMsg - (Upload.viewContent mid + (Upload.viewContent texts.upload + mid model.flags model.uiSettings model.uploadModel @@ -495,21 +496,21 @@ viewUpload mid model = ] -viewItemDetail : String -> Model -> List (Html Msg) -viewItemDetail id model = +viewItemDetail : Messages -> String -> Model -> List (Html Msg) +viewItemDetail texts id model = let inav = Page.Home.Data.itemNav id model.homeModel in [ Html.map ItemDetailMsg - (ItemDetail.viewSidebar + (ItemDetail.viewSidebar texts.itemDetail model.sidebarVisible model.flags model.uiSettings model.itemDetailModel ) , Html.map ItemDetailMsg - (ItemDetail.viewContent + (ItemDetail.viewContent texts.itemDetail inav model.flags model.uiSettings diff --git a/modules/webapp/src/main/elm/Comp/Dropzone.elm b/modules/webapp/src/main/elm/Comp/Dropzone.elm index e8a8b71a..32c96740 100644 --- a/modules/webapp/src/main/elm/Comp/Dropzone.elm +++ b/modules/webapp/src/main/elm/Comp/Dropzone.elm @@ -18,6 +18,7 @@ import File.Select import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) +import Messages.DropzoneComp exposing (Texts) import Styles as S import Util.Html exposing (onDragEnter, onDragLeave, onDragOver, onDropFiles) @@ -124,8 +125,8 @@ filterMime model files = --- View2 -view2 : Model -> Html Msg -view2 model = +view2 : Texts -> Model -> Html Msg +view2 texts model = div [ classList [ ( "bg-opacity-100 bg-blue-100 dark:bg-lightblue-800", model.state.hover ) @@ -144,24 +145,23 @@ view2 model = ] [ i [ class "fa fa-mouse-pointer" ] [] , div [ class "ml-3" ] - [ text "Drop files here" + [ text texts.dropFilesHere ] ] , B.horizontalDivider - { label = "Or" + { label = texts.or , topCss = "w-2/3 mb-4 hidden md:inline-flex" , labelCss = "px-4 bg-gray-200 bg-opacity-50" , lineColor = "bg-gray-300 dark:bg-bluegray-600" } , B.primaryBasicButton - { label = "Select ..." + { label = texts.select , icon = "fa fa-folder-open font-thin" , handler = onClick PickFiles , attrs = [ href "#" ] , disabled = not model.state.active } , div [ class "text-center opacity-75 text-sm mt-4" ] - [ text "Choose document files (pdf, docx, txt, html, …). " - , text "Archives (zip and eml) are extracted." + [ text texts.selectInfo ] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail.elm b/modules/webapp/src/main/elm/Comp/ItemDetail.elm index b295c7a9..f35f37ea 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail.elm @@ -13,6 +13,7 @@ import Data.Flags exposing (Flags) import Data.ItemNav exposing (ItemNav) import Data.UiSettings exposing (UiSettings) import Html exposing (..) +import Messages.ItemDetailComp exposing (Texts) import Page exposing (Page(..)) @@ -30,6 +31,6 @@ update = Comp.ItemDetail.Update.update -view2 : ItemNav -> UiSettings -> Model -> Html Msg +view2 : Texts -> ItemNav -> UiSettings -> Model -> Html Msg view2 = Comp.ItemDetail.View2.view diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm index bebc9622..fb3e7147 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm @@ -3,20 +3,20 @@ module Comp.ItemDetail.AddFilesForm exposing (view) import Comp.Dropzone import Comp.ItemDetail.Model exposing (..) import Comp.Progress -import Data.DropdownStyle import Dict import File exposing (File) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onCheck, onClick, onInput) +import Html.Events exposing (onClick) +import Messages.ItemDetail.AddFilesForm exposing (Texts) import Set import Styles as S import Util.File exposing (makeFileId) import Util.Size -view : Model -> Html Msg -view model = +view : Texts -> Model -> Html Msg +view texts model = div [ classList [ ( "hidden", not model.addFilesOpen ) @@ -28,7 +28,7 @@ view model = [ text "Add more files to this item" ] , Html.map AddFilesMsg - (Comp.Dropzone.view2 model.addFilesModel) + (Comp.Dropzone.view2 texts.dropzone model.addFilesModel) , div [ class "flex flex-row space-x-2 mt-2" ] [ button [ class S.primaryButton diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm index 377f0b16..af3c849e 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm @@ -23,17 +23,18 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.ItemDetailComp exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Time -view : ItemNav -> UiSettings -> Model -> Html Msg -view inav settings model = +view : Texts -> ItemNav -> UiSettings -> Model -> Html Msg +view texts inav settings model = div [ class "flex flex-col h-full" ] [ header settings model , menuBar inav settings model - , body inav settings model + , body texts inav settings model , itemModal model ] @@ -194,20 +195,20 @@ menuBar inav settings model = } -body : ItemNav -> UiSettings -> Model -> Html Msg -body inav settings model = +body : Texts -> ItemNav -> UiSettings -> Model -> Html Msg +body texts _ settings model = div [ class "grid gap-2 grid-cols-1 md:grid-cols-3 h-full" ] - [ leftArea settings model + [ leftArea texts settings model , rightArea settings model ] -leftArea : UiSettings -> Model -> Html Msg -leftArea settings model = +leftArea : Texts -> UiSettings -> Model -> Html Msg +leftArea texts settings model = div [ class "w-full md:order-first md:mr-2 flex flex-col" ] [ addDetailForm settings model , sendMailForm settings model - , Comp.ItemDetail.AddFilesForm.view model + , Comp.ItemDetail.AddFilesForm.view texts.addFilesForm model , Comp.ItemDetail.Notes.view model , div [ classList diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index c2289bcf..c325f228 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -7,8 +7,11 @@ module Messages exposing import Messages.App import Messages.CollectiveSettingsPage +import Messages.ItemDetailPage import Messages.LoginPage +import Messages.NewInvitePage import Messages.RegisterPage +import Messages.UploadPage import UiLanguage exposing (UiLanguage(..)) @@ -23,6 +26,9 @@ type alias Messages = , collectiveSettings : Messages.CollectiveSettingsPage.Texts , login : Messages.LoginPage.Texts , register : Messages.RegisterPage.Texts + , newInvite : Messages.NewInvitePage.Texts + , upload : Messages.UploadPage.Texts + , itemDetail : Messages.ItemDetailPage.Texts } @@ -79,6 +85,9 @@ gb = , collectiveSettings = Messages.CollectiveSettingsPage.gb , login = Messages.LoginPage.gb , register = Messages.RegisterPage.gb + , newInvite = Messages.NewInvitePage.gb + , upload = Messages.UploadPage.gb + , itemDetail = Messages.ItemDetailPage.gb } @@ -92,4 +101,7 @@ de = , collectiveSettings = Messages.CollectiveSettingsPage.de , login = Messages.LoginPage.de , register = Messages.RegisterPage.de + , newInvite = Messages.NewInvitePage.de + , upload = Messages.UploadPage.de + , itemDetail = Messages.ItemDetailPage.de } diff --git a/modules/webapp/src/main/elm/Messages/DropzoneComp.elm b/modules/webapp/src/main/elm/Messages/DropzoneComp.elm new file mode 100644 index 00000000..f7d1f9bd --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/DropzoneComp.elm @@ -0,0 +1,20 @@ +module Messages.DropzoneComp exposing (..) + + +type alias Texts = + { dropFilesHere : String + , or : String + , select : String + , selectInfo : String + } + + +gb : Texts +gb = + { dropFilesHere = "Drop files here" + , or = "Or" + , select = "Select ..." + , selectInfo = + "Choose document files (pdf, docx, txt, html, …). " + ++ "Archives (zip and eml) are extracted." + } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm new file mode 100644 index 00000000..ec4e0b47 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm @@ -0,0 +1,12 @@ +module Messages.ItemDetail.AddFilesForm exposing (..) + +import Messages.DropzoneComp + + +type alias Texts = + { dropzone : Messages.DropzoneComp.Texts } + + +gb : Texts +gb = + { dropzone = Messages.DropzoneComp.gb } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm new file mode 100644 index 00000000..30e17929 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm @@ -0,0 +1,14 @@ +module Messages.ItemDetailComp exposing (..) + +import Messages.ItemDetail.AddFilesForm + + +type alias Texts = + { addFilesForm : Messages.ItemDetail.AddFilesForm.Texts + } + + +gb : Texts +gb = + { addFilesForm = Messages.ItemDetail.AddFilesForm.gb + } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm b/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm new file mode 100644 index 00000000..0b8e43bd --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm @@ -0,0 +1,21 @@ +module Messages.ItemDetailPage exposing (..) + +import Messages.ItemDetailComp + + +type alias Texts = + { itemDetail : Messages.ItemDetailComp.Texts + , editMetadata : String + } + + +gb : Texts +gb = + { itemDetail = Messages.ItemDetailComp.gb + , editMetadata = "Edit Metadata" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/NewInvitePage.elm b/modules/webapp/src/main/elm/Messages/NewInvitePage.elm index 4e10ec5a..1a8e1eb0 100644 --- a/modules/webapp/src/main/elm/Messages/NewInvitePage.elm +++ b/modules/webapp/src/main/elm/Messages/NewInvitePage.elm @@ -31,3 +31,8 @@ gb = Creating an invite requires providing the password from the configuration.""" } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/UploadPage.elm b/modules/webapp/src/main/elm/Messages/UploadPage.elm new file mode 100644 index 00000000..8ca93efa --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UploadPage.elm @@ -0,0 +1,62 @@ +module Messages.UploadPage exposing (..) + +import Messages.Basics +import Messages.DropzoneComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , dropzone : Messages.DropzoneComp.Texts + , reset : String + , allFilesOneItem : String + , skipExistingFiles : String + , language : String + , languageInfo : String + , uploadErrorMessage : String + , successBox : + { allFilesUploaded : String + , line1 : String + , itemsPage : String + , line2 : String + , processingPage : String + , line3 : String + , resetLine1 : String + , reset : String + , resetLine2 : String + } + , selectedFiles : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , dropzone = Messages.DropzoneComp.gb + , reset = "Reset" + , allFilesOneItem = "All files are one single item" + , skipExistingFiles = "Skip files already present in docspell" + , language = "Language" + , languageInfo = + "Used for text extraction and analysis. The collective's " + ++ "default language is used if not specified here." + , uploadErrorMessage = "There were errors uploading some files." + , successBox = + { allFilesUploaded = "All files uploaded" + , line1 = + "Your files have been successfully uploaded. " + ++ "They are now being processed. Check the " + , itemsPage = "Items Page" + , line2 = " later where the files will arrive eventually. Or go to the " + , processingPage = "Processing Page" + , line3 = " to view the current processing state." + , resetLine1 = " Click " + , reset = "Reset" + , resetLine2 = " to upload more files." + } + , selectedFiles = "Selected Files" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm index 7ac8b9fe..7d5ac3eb 100644 --- a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm @@ -11,12 +11,13 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.ItemDetailPage exposing (Texts) import Page.ItemDetail.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 @@ -28,7 +29,7 @@ viewSidebar visible _ settings model = , class "font-bold mt-2" ] [ i [ class "fa fa-pencil-alt mr-2" ] [] - , text "Edit Metadata" + , text texts.editMetadata ] , MB.viewSide { start = @@ -52,12 +53,12 @@ viewSidebar visible _ settings model = ] -viewContent : ItemNav -> Flags -> UiSettings -> Model -> Html Msg -viewContent inav _ settings model = +viewContent : Texts -> ItemNav -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts inav _ settings model = div [ id "content" , class S.content ] [ Html.map ItemDetailMsg - (Comp.ItemDetail.view2 inav settings model.detail) + (Comp.ItemDetail.view2 texts.itemDetail inav settings model.detail) ] diff --git a/modules/webapp/src/main/elm/Page/Upload/View2.elm b/modules/webapp/src/main/elm/Page/Upload/View2.elm index a685c50b..e5dbf50f 100644 --- a/modules/webapp/src/main/elm/Page/Upload/View2.elm +++ b/modules/webapp/src/main/elm/Page/Upload/View2.elm @@ -11,6 +11,7 @@ import File exposing (File) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick) +import Messages.UploadPage exposing (Texts) import Page exposing (Page(..)) import Page.Upload.Data exposing (..) import Styles as S @@ -28,8 +29,8 @@ viewSidebar _ _ _ _ _ = [] -viewContent : Maybe String -> Flags -> UiSettings -> Model -> Html Msg -viewContent mid _ _ model = +viewContent : Texts -> Maybe String -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts mid _ _ model = div [ id "content" , class S.content @@ -37,11 +38,11 @@ viewContent mid _ _ model = [ div [ class "container mx-auto" ] [ div [ class "px-0 flex flex-col" ] [ div [ class "py-4" ] - [ renderForm model + [ renderForm texts model ] , div [ class "py-0" ] [ Html.map DropzoneMsg - (Comp.Dropzone.view2 model.dropzone) + (Comp.Dropzone.view2 texts.dropzone model.dropzone) ] , div [ class "py-4" ] [ a @@ -49,7 +50,7 @@ viewContent mid _ _ model = , href "#" , onClick SubmitUpload ] - [ text "Submit" + [ text texts.basics.submit ] , a [ class S.secondaryButton @@ -57,19 +58,19 @@ viewContent mid _ _ model = , href "#" , onClick Clear ] - [ text "Reset" + [ text texts.reset ] ] ] - , renderErrorMsg model - , renderSuccessMsg (Util.Maybe.nonEmpty mid) model - , renderUploads model + , renderErrorMsg texts model + , renderSuccessMsg texts (Util.Maybe.nonEmpty mid) model + , renderUploads texts model ] ] -renderForm : Model -> Html Msg -renderForm model = +renderForm : Texts -> Model -> Html Msg +renderForm texts model = div [ class "row" ] [ Html.form [ action "#" ] [ div [ class "flex flex-col mb-3" ] @@ -81,7 +82,7 @@ renderForm model = , class S.radioInput ] [] - , span [ class "ml-2" ] [ text "Incoming" ] + , span [ class "ml-2" ] [ text texts.basics.incoming ] ] , label [ class "inline-flex items-center" ] [ input @@ -91,7 +92,7 @@ renderForm model = , class S.radioInput ] [] - , span [ class "ml-2" ] [ text "Outgoing" ] + , span [ class "ml-2" ] [ text texts.basics.outgoing ] ] ] , div [ class "flex flex-col mb-3" ] @@ -104,7 +105,7 @@ renderForm model = ] [] , span [ class "ml-2" ] - [ text "All files are one single item" + [ text texts.allFilesOneItem ] ] ] @@ -118,13 +119,13 @@ renderForm model = ] [] , span [ class "ml-2" ] - [ text "Skip files already present in docspell" + [ text texts.skipExistingFiles ] ] ] , div [ class "flex flex-col mb-3" ] [ label [ class "inline-flex items-center mb-2" ] - [ span [ class "mr-2" ] [ text "Language:" ] + [ span [ class "mr-2" ] [ text (texts.language ++ ":") ] , Html.map LanguageMsg (Comp.FixedDropdown.viewStyled2 (DS.mainStyleWith "w-40") @@ -134,30 +135,29 @@ renderForm model = ) ] , div [ class "text-gray-400 text-xs" ] - [ text "Used for text extraction and analysis. The collective's " - , text "default language is used if not specified here." + [ text texts.languageInfo ] ] ] ] -renderErrorMsg : Model -> Html Msg -renderErrorMsg model = +renderErrorMsg : Texts -> Model -> Html Msg +renderErrorMsg texts model = div [ class "row" , classList [ ( "hidden", not (isDone model && hasErrors model) ) ] ] [ div [ class "mt-4" ] [ div [ class S.errorMessage ] - [ text "There were errors uploading some files." + [ text texts.uploadErrorMessage ] ] ] -renderSuccessMsg : Bool -> Model -> Html Msg -renderSuccessMsg public model = +renderSuccessMsg : Texts -> Bool -> Model -> Html Msg +renderSuccessMsg texts public model = div [ class "row" , classList [ ( "hidden", List.isEmpty model.files || not (isSuccessAll model) ) ] @@ -167,47 +167,46 @@ renderSuccessMsg public model = [ h3 [ class S.header2, class "text-green-800 dark:text-lime-800" ] [ i [ class "fa fa-smile font-thin" ] [] , span [ class "ml-2" ] - [ text "All files uploaded" + [ text texts.successBox.allFilesUploaded ] ] , p [ classList [ ( "hidden", public ) ] ] - [ text "Your files have been successfully uploaded. " - , text "They are now being processed. Check the " + [ text texts.successBox.line1 , a [ class S.successMessageLink , Page.href HomePage ] - [ text "Items page" + [ text texts.successBox.itemsPage ] - , text " later where the files will arrive eventually. Or go to the " + , text texts.successBox.line2 , a [ class S.successMessageLink , Page.href QueuePage ] - [ text "Processing Page" + [ text texts.successBox.processingPage ] - , text " to view the current processing state." + , text texts.successBox.line3 ] , p [] - [ text "Click " + [ text texts.successBox.resetLine1 , a [ class S.successMessageLink , href "#" , onClick Clear ] - [ text "Reset" + [ text texts.successBox.reset ] - , text " to upload more files." + , text texts.successBox.resetLine2 ] ] ] ] -renderUploads : Model -> Html Msg -renderUploads model = +renderUploads : Texts -> Model -> Html Msg +renderUploads texts model = div [ class "mt-4" , classList [ ( "hidden", List.isEmpty model.files || isSuccessAll model ) ] @@ -215,7 +214,7 @@ renderUploads model = [ div [ class "sixteen wide column" ] [ div [ class "ui basic segment" ] [ h2 [ class S.header2 ] - [ text "Selected Files" + [ text texts.selectedFiles ] , div [ class "ui items" ] <| if model.singleItem then From b9c98c6578e8bb474cf326616cfc9baf5d800e71 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Thu, 1 Apr 2021 22:00:48 +0200 Subject: [PATCH 10/25] Externalize strings in queue page --- modules/webapp/src/main/elm/App/View2.elm | 15 ++-- modules/webapp/src/main/elm/Messages.elm | 4 + .../src/main/elm/Messages/QueuePage.elm | 51 +++++++++++++ .../webapp/src/main/elm/Page/Queue/View2.elm | 73 ++++++++++--------- 4 files changed, 104 insertions(+), 39 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/QueuePage.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 279182c0..9000009e 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -133,7 +133,7 @@ mainContent model = viewUserSettings model QueuePage -> - viewQueue model + viewQueue texts model RegisterPage -> viewRegister texts model @@ -449,12 +449,17 @@ viewUserSettings model = ] -viewQueue : Model -> List (Html Msg) -viewQueue model = +viewQueue : Messages -> Model -> List (Html Msg) +viewQueue texts model = [ Html.map QueueMsg - (Queue.viewSidebar model.sidebarVisible model.flags model.uiSettings model.queueModel) + (Queue.viewSidebar texts.queue + model.sidebarVisible + model.flags + model.uiSettings + model.queueModel + ) , Html.map QueueMsg - (Queue.viewContent model.flags model.uiSettings model.queueModel) + (Queue.viewContent texts.queue model.flags model.uiSettings model.queueModel) ] diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index c325f228..69d8d155 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -10,6 +10,7 @@ import Messages.CollectiveSettingsPage import Messages.ItemDetailPage import Messages.LoginPage import Messages.NewInvitePage +import Messages.QueuePage import Messages.RegisterPage import Messages.UploadPage import UiLanguage exposing (UiLanguage(..)) @@ -29,6 +30,7 @@ type alias Messages = , newInvite : Messages.NewInvitePage.Texts , upload : Messages.UploadPage.Texts , itemDetail : Messages.ItemDetailPage.Texts + , queue : Messages.QueuePage.Texts } @@ -88,6 +90,7 @@ gb = , newInvite = Messages.NewInvitePage.gb , upload = Messages.UploadPage.gb , itemDetail = Messages.ItemDetailPage.gb + , queue = Messages.QueuePage.gb } @@ -104,4 +107,5 @@ de = , newInvite = Messages.NewInvitePage.de , upload = Messages.UploadPage.de , itemDetail = Messages.ItemDetailPage.de + , queue = Messages.QueuePage.de } diff --git a/modules/webapp/src/main/elm/Messages/QueuePage.elm b/modules/webapp/src/main/elm/Messages/QueuePage.elm new file mode 100644 index 00000000..2d43501d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/QueuePage.elm @@ -0,0 +1,51 @@ +module Messages.QueuePage exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , currentlyRunning : String + , queue : String + , waiting : String + , errored : String + , success : String + , noJobsRunning : String + , noJobsDisplay : String + , noJobsWaiting : String + , noJobsFailed : String + , noJobsSuccess : String + , deleteThisJob : String + , showLog : String + , remove : String + , retries : String + , changePriority : String + , prio : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , currentlyRunning = "Currently Running" + , queue = "Queue" + , waiting = "Waiting" + , errored = "Errored" + , success = "Success" + , noJobsRunning = "No jobs currently running." + , noJobsDisplay = "No jobs to display." + , noJobsWaiting = "No waiting jobs." + , noJobsFailed = "No failed jobs to display." + , noJobsSuccess = "No succesfull jobs to display." + , deleteThisJob = "Cancel/Delete this job?" + , showLog = "Show log" + , remove = "Remove" + , retries = "Retries" + , changePriority = "Change priority of this job" + , prio = "Prio" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Page/Queue/View2.elm b/modules/webapp/src/main/elm/Page/Queue/View2.elm index a59534b4..c137cf92 100644 --- a/modules/webapp/src/main/elm/Page/Queue/View2.elm +++ b/modules/webapp/src/main/elm/Page/Queue/View2.elm @@ -10,13 +10,14 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.QueuePage exposing (Texts) import Page.Queue.Data exposing (..) import Styles as S import Util.Time exposing (formatDateTime, formatIsoDateTime) -viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg -viewSidebar visible _ _ model = +viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg +viewSidebar texts visible _ _ model = let count v = case v of @@ -68,17 +69,17 @@ viewSidebar visible _ _ model = ] ] , div [ class "flex flex-col my-2" ] - [ tabLink "" CurrentJobs "fa fa-play-circle" "Currently Running" - , tabLink "" QueueAll "fa fa-hourglass-half" "Queue" - , tabLink "ml-8" QueueWaiting "fa fa-clock" "Waiting" - , tabLink "ml-8" QueueError "fa fa-bolt" "Errored" - , tabLink "ml-8" QueueSuccess "fa fa-check" "Success" + [ tabLink "" CurrentJobs "fa fa-play-circle" texts.currentlyRunning + , tabLink "" QueueAll "fa fa-hourglass-half" texts.queue + , tabLink "ml-8" QueueWaiting "fa fa-clock" texts.waiting + , tabLink "ml-8" QueueError "fa fa-bolt" texts.errored + , tabLink "ml-8" QueueSuccess "fa fa-check" texts.success ] ] -viewContent : Flags -> UiSettings -> Model -> Html Msg -viewContent _ _ model = +viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts _ _ model = let gridStyle = "grid gap-4 grid-cols-1 md:grid-cols-2" @@ -103,29 +104,29 @@ viewContent _ _ model = , case model.queueView of CurrentJobs -> if List.isEmpty model.state.progress then - message "No jobs currently running." + message texts.noJobsRunning else div [ class "flex flex-col space-y-2" ] - (List.map (renderProgressCard model) model.state.progress) + (List.map (renderProgressCard texts model) model.state.progress) QueueAll -> if List.isEmpty model.state.completed && List.isEmpty model.state.completed then - message "No jobs to display." + message texts.noJobsDisplay else div [ class gridStyle ] - (List.map (renderInfoCard model) + (List.map (renderInfoCard texts model) (model.state.queued ++ model.state.completed) ) QueueWaiting -> if List.isEmpty model.state.queued then - message "No waiting jobs." + message texts.noJobsWaiting else div [ class gridStyle ] - (List.map (renderInfoCard model) model.state.queued) + (List.map (renderInfoCard texts model) model.state.queued) QueueError -> let @@ -133,11 +134,11 @@ viewContent _ _ model = filterJobDetails model.state.completed "failed" in if List.isEmpty items then - message "No failed jobs to display." + message texts.noJobsFailed else div [ class gridStyle ] - (List.map (renderInfoCard model) items) + (List.map (renderInfoCard texts model) items) QueueSuccess -> let @@ -145,11 +146,11 @@ viewContent _ _ model = filterJobDetails model.state.completed "success" in if List.isEmpty items then - message "No succesfull jobs to display." + message texts.noJobsSuccess else div [ class gridStyle ] - (List.map (renderInfoCard model) items) + (List.map (renderInfoCard texts model) items) ] @@ -189,14 +190,14 @@ renderJobLog job = ] -renderProgressCard : Model -> JobDetail -> Html Msg -renderProgressCard model job = +renderProgressCard : Texts -> Model -> JobDetail -> Html Msg +renderProgressCard texts model job = div [ class (S.box ++ "px-2 flex flex-col") ] [ Comp.Progress.topAttachedIndicating job.progress , Html.map (DimmerMsg job) (Comp.YesNoDimmer.viewN (model.cancelJobRequest == Just job.id) - dimmerSettings + (dimmerSettings texts) model.deleteConfirm ) , div [ class "py-2 flex flex-row x-space-2 items-center" ] @@ -227,7 +228,7 @@ renderProgressCard model job = ] , div [ class "py-2 flex flex-row justify-end" ] [ button [ class S.secondaryButton, onClick (RequestCancelJob job) ] - [ text "Cancel" + [ text texts.basics.cancel ] ] ] @@ -282,8 +283,8 @@ isFinal job = False -dimmerSettings : Comp.YesNoDimmer.Settings -dimmerSettings = +dimmerSettings : Texts -> Comp.YesNoDimmer.Settings +dimmerSettings texts = let defaults = Comp.YesNoDimmer.defaultSettings @@ -292,12 +293,12 @@ dimmerSettings = | headerClass = "text-lg text-white" , headerIcon = "" , extraClass = "rounded" - , message = "Cancel/Delete this job?" + , message = texts.deleteThisJob } -renderInfoCard : Model -> JobDetail -> Html Msg -renderInfoCard model job = +renderInfoCard : Texts -> Model -> JobDetail -> Html Msg +renderInfoCard texts model job = let prio = Data.Priority.fromString job.priority @@ -315,7 +316,7 @@ renderInfoCard model job = [ Html.map (DimmerMsg job) (Comp.YesNoDimmer.viewN (model.cancelJobRequest == Just job.id) - dimmerSettings + (dimmerSettings texts) model.deleteConfirm ) , div [ class "flex flex-row" ] @@ -345,10 +346,14 @@ renderInfoCard model job = , class S.link , classList [ ( "hidden", not (isFinal job || job.state == "stuck") ) ] ] - [ i [ class "fa fa-file", title "Show log" ] [] + [ i + [ class "fa fa-file" + , title texts.showLog + ] + [] ] , a - [ title "Remove" + [ title texts.remove , href "#" , class S.link , onClick (RequestCancelJob job) @@ -391,7 +396,7 @@ renderInfoCard model job = ] , div [ class (labelStyle False) ] [ span [ class "mr-3" ] - [ text "Retries" + [ text texts.retries ] , span [] [ job.retries |> String.fromInt |> text @@ -403,7 +408,7 @@ renderInfoCard model job = [ class (labelStyle False) , onClick (ChangePrio job.id (Data.Priority.next prio)) , href "#" - , title "Change priority of this job" + , title texts.changePriority ] [ i [ class "sort numeric up icon" ] [] , text "Prio" @@ -422,7 +427,7 @@ renderInfoCard model job = [ class (labelStyle False) ] [ span [ class "mr-3" ] - [ text "Prio" + [ text texts.prio ] , code [ class "font-mono" ] [ Data.Priority.fromString job.priority From 8d15d978574f258497295828c51cae41ab719b8e Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 2 Apr 2021 15:54:02 +0200 Subject: [PATCH 11/25] Refactor Dropdown --- .../webapp/src/main/elm/Comp/AddressForm.elm | 14 +- .../main/elm/Comp/ClassifierSettingsForm.elm | 15 +- .../main/elm/Comp/CollectiveSettingsForm.elm | 23 +- modules/webapp/src/main/elm/Comp/Dropdown.elm | 231 ++++++++---------- .../src/main/elm/Comp/EmailSettingsForm.elm | 32 ++- .../src/main/elm/Comp/ImapSettingsForm.elm | 32 ++- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 73 +++++- .../src/main/elm/Comp/ItemDetail/Model.elm | 43 +--- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 104 ++++---- .../src/main/elm/Comp/ItemDetail/Update.elm | 28 +-- modules/webapp/src/main/elm/Comp/ItemMail.elm | 19 +- .../src/main/elm/Comp/NotificationForm.elm | 27 +- .../webapp/src/main/elm/Comp/PersonForm.elm | 4 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 58 ++--- .../src/main/elm/Comp/ScanMailboxManage.elm | 13 +- .../webapp/src/main/elm/Comp/SearchMenu.elm | 75 +++--- .../webapp/src/main/elm/Comp/SourceForm.elm | 54 ++-- modules/webapp/src/main/elm/Comp/TagForm.elm | 14 +- modules/webapp/src/main/elm/Comp/UserForm.elm | 32 ++- .../webapp/src/main/elm/Data/UiSettings.elm | 16 -- .../src/main/elm/Page/Home/SideMenu.elm | 8 +- .../src/main/elm/Page/ItemDetail/View2.elm | 4 +- .../src/main/elm/Page/UserSettings/View2.elm | 7 +- modules/webapp/src/main/elm/Util/Folder.elm | 2 +- modules/webapp/src/main/elm/Util/Person.elm | 20 ++ modules/webapp/src/main/elm/Util/Tag.elm | 49 ++-- 26 files changed, 493 insertions(+), 504 deletions(-) create mode 100644 modules/webapp/src/main/elm/Util/Person.elm diff --git a/modules/webapp/src/main/elm/Comp/AddressForm.elm b/modules/webapp/src/main/elm/Comp/AddressForm.elm index 8b7a439d..fb32a7df 100644 --- a/modules/webapp/src/main/elm/Comp/AddressForm.elm +++ b/modules/webapp/src/main/elm/Comp/AddressForm.elm @@ -51,9 +51,7 @@ emptyModel = , city = "" , country = Comp.Dropdown.makeSingleList - { makeOption = \c -> { value = c.code, text = c.label, additional = "" } - , placeholder = "Select Country" - , options = countries + { options = countries , selected = Nothing } } @@ -114,6 +112,14 @@ update msg model = view2 : UiSettings -> Model -> Html Msg view2 settings model = + let + countryCfg = + { makeOption = \c -> { text = c.label, additional = "" } + , placeholder = "Select Country" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "mb-2" @@ -178,7 +184,7 @@ view2 settings model = ] , Html.map CountryMsg (Comp.Dropdown.view2 - DS.mainStyle + countryCfg settings model.country ) diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index 564bd4fa..3324c36a 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -64,16 +64,10 @@ init flags sett = , itemCount = Just sett.itemCount , categoryListModel = let - mkOption s = - { value = s, text = s, additional = "" } - minit = Comp.Dropdown.makeModel { multiple = True , searchable = \n -> n > 0 - , makeOption = mkOption - , labelColor = \_ -> \_ -> "grey " - , placeholder = "Choose categories …" } lm = @@ -192,6 +186,13 @@ view2 texts settings model = model.categoryListType (Data.ListType.label model.categoryListType) Nothing + + categoryCfg = + { makeOption = \s -> { text = s, additional = "" } + , labelColor = \_ -> \_ -> "grey " + , placeholder = "Choose categories …" + , style = DS.mainStyle + } in div [] [ Markdown.toHtml [ class "px-2 py-2 opacity-75" ] @@ -213,7 +214,7 @@ view2 texts settings model = ] , Html.map CategoryListMsg (Comp.Dropdown.view2 - DS.mainStyle + categoryCfg settings model.categoryListModel ) diff --git a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm index d666668d..7ff4c716 100644 --- a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm @@ -51,14 +51,7 @@ init flags settings = in ( { langModel = Comp.Dropdown.makeSingleList - { makeOption = - \l -> - { value = Data.Language.toIso3 l - , text = Data.Language.toName l - , additional = "" - } - , placeholder = "" - , options = Data.Language.all + { options = Data.Language.all , selected = Just lang } , intEnabled = settings.integrationEnabled @@ -203,6 +196,18 @@ update flags msg model = view2 : Flags -> Texts -> UiSettings -> Model -> Html Msg view2 flags texts settings model = + let + languageCfg = + { makeOption = + \l -> + { text = Data.Language.toName l + , additional = "" + } + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in div [ classList [ ( "ui form error success", True ) @@ -237,7 +242,7 @@ view2 flags texts settings model = ] , Html.map LangDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + languageCfg settings model.langModel ) diff --git a/modules/webapp/src/main/elm/Comp/Dropdown.elm b/modules/webapp/src/main/elm/Comp/Dropdown.elm index 5da93ae2..02e1c04e 100644 --- a/modules/webapp/src/main/elm/Comp/Dropdown.elm +++ b/modules/webapp/src/main/elm/Comp/Dropdown.elm @@ -2,6 +2,7 @@ module Comp.Dropdown exposing ( Model , Msg(..) , Option + , ViewSettings , getSelected , isDropdownChangeMsg , makeModel @@ -10,16 +11,13 @@ module Comp.Dropdown exposing , makeSingleList , mkOption , notSelected - , orgDropdown + , orgFormViewSettings , setMkOption , update , view2 , viewSingle2 ) -{-| This needs to be rewritten from scratch! --} - import Api.Model.IdName exposing (IdName) import Data.DropdownStyle as DS import Data.UiSettings exposing (UiSettings) @@ -31,32 +29,8 @@ import Util.Html exposing (onKeyUp) import Util.List -orgDropdown : Model IdName -orgDropdown = - makeModel - { multiple = False - , searchable = \n -> n > 0 - , makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , labelColor = \_ -> \_ -> "" - , placeholder = "Choose an organization" - } - - -type alias Option = - { value : String - , text : String - , additional : String - } - - -mkOption : String -> String -> Option -mkOption value text = - Option value text "" - - type alias Item a = { value : a - , option : Option , visible : Bool , selected : Bool , active : Bool @@ -66,7 +40,6 @@ type alias Item a = makeItem : Model a -> a -> Item a makeItem model val = { value = val - , option = model.makeOption val , visible = True , selected = List.any (\i -> i.value == val) model.selected @@ -78,26 +51,15 @@ type alias Model a = { multiple : Bool , selected : List (Item a) , available : List (Item a) - , makeOption : a -> Option , menuOpen : Bool , filterString : String - , labelColor : a -> UiSettings -> String , searchable : Int -> Bool - , placeholder : String } -setMkOption : (a -> Option) -> Model a -> Model a -setMkOption mkopt model = - { model | makeOption = mkopt } - - makeModel : { multiple : Bool , searchable : Int -> Bool - , makeOption : a -> Option - , labelColor : a -> UiSettings -> String - , placeholder : String } -> Model a makeModel input = @@ -105,45 +67,28 @@ makeModel input = , searchable = input.searchable , selected = [] , available = [] - , makeOption = input.makeOption , menuOpen = False , filterString = "" - , labelColor = input.labelColor - , placeholder = input.placeholder } -makeSingle : - { makeOption : a -> Option - , placeholder : String - } - -> Model a -makeSingle opts = +makeSingle : Model a +makeSingle = makeModel { multiple = False , searchable = \n -> n > 0 - , makeOption = opts.makeOption - , labelColor = \_ -> \_ -> "" - , placeholder = - if opts.placeholder == "" then - "Select…" - - else - opts.placeholder } makeSingleList : - { makeOption : a -> Option - , placeholder : String - , options : List a + { options : List a , selected : Maybe a } -> Model a makeSingleList opts = let m = - makeSingle { makeOption = opts.makeOption, placeholder = opts.placeholder } + makeSingle m2 = { m | available = List.map (makeItem m) opts.options } @@ -156,18 +101,11 @@ makeSingleList opts = m3 -makeMultiple : - { makeOption : a -> Option - , labelColor : a -> UiSettings -> String - } - -> Model a -makeMultiple opts = +makeMultiple : Model a +makeMultiple = makeModel { multiple = True , searchable = \n -> n > 0 - , makeOption = opts.makeOption - , labelColor = opts.labelColor - , placeholder = "" } @@ -186,9 +124,8 @@ type Msg a | SetSelection (List a) | ToggleMenu | AddItem (Item a) - | RemoveItem (Item a) | RemoveItem2 (Item a) - | Filter String + | Filter (a -> String) String | ShowMenu Bool | KeyPress Int @@ -215,17 +152,17 @@ deselectItem : Model a -> Item a -> Model a deselectItem model item = let value = - item.option.value + item.value sel = if model.multiple then - List.filter (\e -> e.option.value /= value) model.selected + List.filter (\e -> e.value /= value) model.selected else [] show e = - if e.option.value == value then + if e.value == value then { e | selected = False } else @@ -241,7 +178,7 @@ selectItem : Model a -> Item a -> Model a selectItem model item = let value = - item.option.value + item.value sel = if model.multiple then @@ -251,7 +188,7 @@ selectItem model item = [ item ] hide e = - if e.option.value == value then + if e.value == value then { e | selected = True } else if model.multiple then @@ -266,13 +203,13 @@ selectItem model item = { model | selected = sel, available = avail } -filterOptions : String -> List (Item a) -> List (Item a) -filterOptions str list = - List.map (\e -> { e | visible = Simple.Fuzzy.match str e.option.text, active = False }) list +filterOptions : String -> (a -> String) -> List (Item a) -> List (Item a) +filterOptions str mkText list = + List.map (\e -> { e | visible = Simple.Fuzzy.match str (mkText e.value), active = False }) list -applyFilter : String -> Model a -> Model a -applyFilter str model = +applyFilter : String -> (a -> String) -> Model a -> Model a +applyFilter str mkText model = let selected = if str /= "" && not model.multiple then @@ -281,7 +218,12 @@ applyFilter str model = else model.selected in - { model | filterString = str, available = filterOptions str model.available, selected = selected } + { model | filterString = str, available = filterOptions str mkText model.available, selected = selected } + + +clearFilter : Model a -> Model a +clearFilter model = + { model | filterString = "" } makeNextActive : (Int -> Int) -> Model a -> Model a @@ -299,7 +241,7 @@ makeNextActive nextEl model = |> Maybe.andThen (Util.List.get opts) merge item1 item2 = - { item2 | active = item1.option.value == item2.option.value } + { item2 | active = item1.value == item2.value } updateModel item = { model | available = List.map (merge item) model.available, menuOpen = True } @@ -325,7 +267,7 @@ selectActive model = in case current of Just item -> - selectItem model item |> applyFilter "" + selectItem model item |> clearFilter Nothing -> model @@ -337,9 +279,6 @@ isDropdownChangeMsg cm = AddItem _ -> True - RemoveItem _ -> - True - RemoveItem2 _ -> True @@ -375,34 +314,23 @@ update msg model = AddItem e -> let m = - selectItem model e |> applyFilter "" + selectItem model e |> clearFilter in ( { m | menuOpen = False }, Cmd.none ) - RemoveItem e -> - let - m = - deselectItem model e |> applyFilter "" - in - ( -- Setting to True, because parent click sets it to False… ugly - { m | menuOpen = True } - , Cmd.none - ) - RemoveItem2 e -> let m = - deselectItem model e |> applyFilter "" + deselectItem model e |> clearFilter in - ( -- Hack above only needed with semanticui - m + ( m , Cmd.none ) - Filter str -> + Filter f str -> let m = - applyFilter str model + applyFilter str f model in ( { m | menuOpen = True }, Cmd.none ) @@ -438,7 +366,7 @@ update msg model = [ e ] -> let ( m_, c_ ) = - update (RemoveItem e) model + update (RemoveItem2 e) model in ( { m_ | menuOpen = False }, c_ ) @@ -463,32 +391,65 @@ update msg model = -- View2 -view2 : DS.DropdownStyle -> UiSettings -> Model a -> Html (Msg a) -view2 style settings model = +type alias Option = + { text : String + , additional : String + } + + +mkOption : String -> Option +mkOption text = + Option text "" + + +type alias ViewSettings a = + { makeOption : a -> Option + , placeholder : String + , labelColor : a -> UiSettings -> String + , style : DS.DropdownStyle + } + + +orgFormViewSettings : DS.DropdownStyle -> ViewSettings IdName +orgFormViewSettings ds = + { makeOption = \e -> { text = e.name, additional = "" } + , labelColor = \_ -> \_ -> "" + , placeholder = "Choose an organization" + , style = ds + } + + +setMkOption : (a -> Option) -> ViewSettings a -> ViewSettings a +setMkOption mkopt model = + { model | makeOption = mkopt } + + +view2 : ViewSettings a -> UiSettings -> Model a -> Html (Msg a) +view2 cfg settings model = if model.multiple then - viewMultiple2 style settings model + viewMultiple2 cfg settings model else - viewSingle2 style model + viewSingle2 cfg model -viewSingle2 : DS.DropdownStyle -> Model a -> Html (Msg a) -viewSingle2 style model = +viewSingle2 : ViewSettings a -> Model a -> Html (Msg a) +viewSingle2 cfg model = let renderItem item = a [ href "#" - , class style.item + , class cfg.style.item , classList - [ ( style.itemActive, item.active ) + [ ( cfg.style.itemActive, item.active ) , ( "font-semibold", item.selected ) ] , onClick (AddItem item) , onKeyUp KeyPress ] - [ text item.option.text + [ text <| (.value >> cfg.makeOption >> .text) item , span [ class "text-gray-400 float-right" ] - [ text item.option.additional + [ text <| (.value >> cfg.makeOption >> .additional) item ] ] @@ -500,7 +461,7 @@ viewSingle2 style model = , onKeyUp KeyPress ] [ div - [ class style.link + [ class cfg.style.link ] [ a [ class "flex-grow" @@ -514,8 +475,8 @@ viewSingle2 style model = , onClick ToggleMenu , href "#" ] - [ Maybe.map (.option >> .text) sel - |> Maybe.withDefault model.placeholder + [ Maybe.map (.value >> cfg.makeOption >> .text) sel + |> Maybe.withDefault cfg.placeholder |> text ] , a @@ -532,11 +493,11 @@ viewSingle2 style model = ] , input [ type_ "text" - , placeholder model.placeholder - , onInput Filter + , placeholder cfg.placeholder + , onInput (Filter (cfg.makeOption >> .text)) , value model.filterString , class "inline-block border-0 px-0 w-full py-0 focus:ring-0 " - , class style.input + , class cfg.style.input , classList [ ( "hidden", not (model.menuOpen && isSearchable model) ) ] ] [] @@ -550,43 +511,43 @@ viewSingle2 style model = ] ] , div - [ class style.menu + [ class cfg.style.menu , classList [ ( "hidden", not model.menuOpen ) ] ] (getOptions model |> List.map renderItem) ] -viewMultiple2 : DS.DropdownStyle -> UiSettings -> Model a -> Html (Msg a) -viewMultiple2 style settings model = +viewMultiple2 : ViewSettings a -> UiSettings -> Model a -> Html (Msg a) +viewMultiple2 cfg settings model = let renderItem item = a [ href "#" - , class style.item + , class cfg.style.item , classList - [ ( style.itemActive, item.active ) + [ ( cfg.style.itemActive, item.active ) , ( "font-semibold", item.selected ) ] , onClick (AddItem item) , onKeyUp KeyPress ] - [ text item.option.text + [ text <| (.value >> cfg.makeOption >> .text) item , span [ class "text-gray-400 float-right" ] - [ text item.option.additional + [ text <| (.value >> cfg.makeOption >> .additional) item ] ] renderSelectMultiple : Item a -> Html (Msg a) renderSelectMultiple item = a - [ class (model.labelColor item.value settings) + [ class (cfg.labelColor item.value settings) , class "label font-medium inline-flex relative items-center hover:shadow-md mt-1 mr-1" - , onClick (RemoveItem item) + , onClick (RemoveItem2 item) , href "#" ] [ span [ class "pl-4" ] - [ text item.option.text + [ text <| (.value >> cfg.makeOption >> .text) item ] , span [ class "opacity-75 absolute left-2 my-auto" ] [ i [ class "fa fa-times" ] [] @@ -598,7 +559,7 @@ viewMultiple2 style settings model = , onKeyUp KeyPress ] [ div - [ class style.link + [ class cfg.style.link , class "flex inline-flex flex-wrap items-center" ] [ div @@ -609,10 +570,10 @@ viewMultiple2 style settings model = , input [ type_ "text" , placeholder "Search…" - , onInput Filter + , onInput (Filter (cfg.makeOption >> .text)) , value model.filterString , class "inline-flex w-16 border-0 px-0 focus:ring-0 h-6" - , class style.input + , class cfg.style.input ] [] , a @@ -629,7 +590,7 @@ viewMultiple2 style settings model = ] ] , div - [ class style.menu + [ class cfg.style.menu , classList [ ( "hidden", not model.menuOpen ) ] ] (getOptions model |> List.map renderItem) diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index 3045d045..5303068a 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -55,14 +55,7 @@ emptyModel = , replyTo = Nothing , sslType = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.SSLType.toString s - , text = Data.SSLType.label s - , additional = "" - } - , placeholder = "" - , options = Data.SSLType.all + { options = Data.SSLType.all , selected = Just Data.SSLType.None } , ignoreCertificates = False @@ -83,14 +76,7 @@ init ems = , replyTo = ems.replyTo , sslType = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.SSLType.toString s - , text = Data.SSLType.label s - , additional = "" - } - , placeholder = "" - , options = Data.SSLType.all + { options = Data.SSLType.all , selected = Data.SSLType.fromString ems.sslType |> Maybe.withDefault Data.SSLType.None @@ -186,6 +172,18 @@ update msg model = view2 : UiSettings -> Model -> Html Msg view2 settings model = + let + sslCfg = + { makeOption = + \s -> + { text = Data.SSLType.label s + , additional = "" + } + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in div [ class "grid grid-cols-4 gap-y-4 gap-x-2" ] [ div [ class "col-span-4" ] [ label @@ -291,7 +289,7 @@ view2 settings model = ] , Html.map SSLTypeMsg (Comp.Dropdown.view2 - DS.mainStyle + sslCfg settings model.sslType ) diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index 8027b80f..d1a9d647 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -52,14 +52,7 @@ emptyModel = , password = Nothing , sslType = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.SSLType.toString s - , text = Data.SSLType.label s - , additional = "" - } - , placeholder = "" - , options = Data.SSLType.all + { options = Data.SSLType.all , selected = Just Data.SSLType.None } , ignoreCertificates = False @@ -79,14 +72,7 @@ init ems = , password = ems.imapPassword , sslType = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.SSLType.toString s - , text = Data.SSLType.label s - , additional = "" - } - , placeholder = "" - , options = Data.SSLType.all + { options = Data.SSLType.all , selected = Data.SSLType.fromString ems.sslType |> Maybe.withDefault Data.SSLType.None @@ -178,6 +164,18 @@ update msg model = view2 : UiSettings -> Model -> Html Msg view2 settings model = + let + sslCfg = + { makeOption = + \s -> + { text = Data.SSLType.label s + , additional = "" + } + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in div [ class "grid grid-cols-4 gap-y-4 gap-x-2" ] [ div [ class "col-span-4" ] @@ -251,7 +249,7 @@ view2 settings model = ] , Html.map SSLTypeMsg (Comp.Dropdown.view2 - DS.mainStyle + sslCfg settings model.sslType ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index 1793d875..f8b519b1 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -14,8 +14,10 @@ import Comp.ItemDetail.Model ) import Comp.KeyInput import Comp.Tabs as TB +import Data.Direction import Data.DropdownStyle import Data.Fields +import Data.Flags exposing (Flags) import Data.Icons as Icons import Data.UiSettings exposing (UiSettings) import Dict @@ -27,11 +29,13 @@ import Page exposing (Page(..)) import Set exposing (Set) import Styles as S import Util.Folder +import Util.Person +import Util.Tag import Util.Time -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Flags -> UiSettings -> Model -> Html Msg +view2 flags settings model = let keyAttr = if settings.itemDetailShortcuts then @@ -44,7 +48,7 @@ view2 settings model = TB.searchMenuStyle tabs = - formTabs settings model + formTabs flags settings model allTabNames = List.map .title tabs @@ -57,8 +61,8 @@ view2 settings model = ] -formTabs : UiSettings -> Model -> List (TB.Tab Msg) -formTabs settings model = +formTabs : Flags -> UiSettings -> Model -> List (TB.Tab Msg) +formTabs flags settings model = let dds = Data.DropdownStyle.sidebarStyle @@ -106,6 +110,38 @@ formTabs settings model = else span [ class "invisible hidden" ] [] + + directionCfg = + { makeOption = + \entry -> + { text = Data.Direction.toString entry + , additional = "" + } + , placeholder = "Choose a direction…" + , labelColor = \_ -> \_ -> "" + , style = dds + } + + folderCfg = + { makeOption = Util.Folder.mkFolderOption flags model.allFolders + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = dds + } + + idNameCfg = + { makeOption = \e -> { text = e.name, additional = "" } + , labelColor = \_ -> \_ -> "" + , placeholder = "Select…" + , style = dds + } + + personCfg = + { makeOption = \p -> Util.Person.mkPersonOption p model.allPersons + , labelColor = \_ -> \_ -> "" + , placeholder = "Select…" + , style = dds + } in [ { title = "Name" , titleRight = [] @@ -163,7 +199,11 @@ formTabs settings model = , info = Nothing , body = [ div [ class "mb-4 flex flex-col" ] - [ Html.map TagDropdownMsg (Comp.Dropdown.view2 dds settings model.tagModel) + [ Html.map TagDropdownMsg + (Comp.Dropdown.view2 (Util.Tag.tagSettings dds) + settings + model.tagModel + ) , div [ class "flex flex-row items-center justify-end" ] [ a [ class S.secondaryButton @@ -184,7 +224,7 @@ formTabs settings model = [ div [ class "mb-4" ] [ Html.map FolderDropdownMsg (Comp.Dropdown.view2 - dds + folderCfg settings model.folderModel ) @@ -254,7 +294,12 @@ item visible. This message will disappear then. , addIconLink "Add new organization" StartCorrOrgModal , editIconLink "Edit organization" model.corrOrgModel StartEditCorrOrgModal ] - , Html.map OrgDropdownMsg (Comp.Dropdown.view2 dds settings model.corrOrgModel) + , Html.map OrgDropdownMsg + (Comp.Dropdown.view2 + (Comp.Dropdown.orgFormViewSettings dds) + settings + model.corrOrgModel + ) , renderOrgSuggestions model ] , optional [ Data.Fields.CorrPerson ] <| @@ -267,7 +312,11 @@ item visible. This message will disappear then. model.corrPersonModel (StartEditPersonModal model.corrPersonModel) ] - , Html.map CorrPersonMsg (Comp.Dropdown.view2 dds settings model.corrPersonModel) + , Html.map CorrPersonMsg + (Comp.Dropdown.view2 personCfg + settings + model.corrPersonModel + ) , renderCorrPersonSuggestions model , div [ classList @@ -298,7 +347,7 @@ item visible. This message will disappear then. ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 - dds + personCfg settings model.concPersonModel ) @@ -316,7 +365,7 @@ item visible. This message will disappear then. ] , Html.map ConcEquipMsg (Comp.Dropdown.view2 - dds + idNameCfg settings model.concEquipModel ) @@ -331,7 +380,7 @@ item visible. This message will disappear then. [ div [ class "mb-4" ] [ Html.map DirDropdownMsg (Comp.Dropdown.view2 - dds + directionCfg settings model.directionModel ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Model.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Model.elm index 74a46d5f..02e2e2d8 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Model.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Model.elm @@ -39,7 +39,6 @@ import Comp.KeyInput import Comp.LinkTarget exposing (LinkTarget) import Comp.MarkdownInput import Comp.SentMails -import Comp.YesNoDimmer import Data.Direction exposing (Direction) import Data.Fields exposing (Field) import DatePicker exposing (DatePicker) @@ -136,45 +135,17 @@ emptyModel = , visibleAttach = 0 , attachMenuOpen = False , menuOpen = False - , tagModel = - Util.Tag.makeDropdownModel2 + , tagModel = Util.Tag.makeDropdownModel , directionModel = Comp.Dropdown.makeSingleList - { makeOption = - \entry -> - { value = Data.Direction.toString entry - , text = Data.Direction.toString entry - , additional = "" - } - , options = Data.Direction.all - , placeholder = "Choose a direction…" + { options = Data.Direction.all , selected = Nothing } - , corrOrgModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , corrPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , concPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , concEquipModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , folderModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } + , corrOrgModel = Comp.Dropdown.makeSingle + , corrPersonModel = Comp.Dropdown.makeSingle + , concPersonModel = Comp.Dropdown.makeSingle + , concEquipModel = Comp.Dropdown.makeSingle + , folderModel = Comp.Dropdown.makeSingle , allFolders = [] , nameModel = "" , nameState = SaveSuccess diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index 5a4703b9..5d4ed591 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -48,6 +48,7 @@ import Time import Util.Folder exposing (mkFolderOption) import Util.List import Util.Maybe +import Util.Person import Util.Tag @@ -117,45 +118,17 @@ type Msg init : Model init = - { tagModel = - Util.Tag.makeDropdownModel2 + { tagModel = Util.Tag.makeDropdownModel , directionModel = Comp.Dropdown.makeSingleList - { makeOption = - \entry -> - { value = Data.Direction.toString entry - , text = Data.Direction.toString entry - , additional = "" - } - , options = Data.Direction.all - , placeholder = "Choose a direction…" + { options = Data.Direction.all , selected = Nothing } - , corrOrgModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , corrPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , concPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , concEquipModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } - , folderModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } + , corrOrgModel = Comp.Dropdown.makeSingle + , corrPersonModel = Comp.Dropdown.makeSingle + , concPersonModel = Comp.Dropdown.makeSingle + , concEquipModel = Comp.Dropdown.makeSingle + , folderModel = Comp.Dropdown.makeSingle , allFolders = [] , nameModel = "" , nameSaveThrottle = Throttle.create 1 @@ -310,13 +283,7 @@ update flags msg model = GetFolderResp (Ok fs) -> let model_ = - { model - | allFolders = fs.items - , folderModel = - Comp.Dropdown.setMkOption - (mkFolderOption flags fs.items) - model.folderModel - } + { model | allFolders = fs.items } mkIdName fitem = IdName fitem.id fitem.name @@ -635,13 +602,13 @@ defaultViewConfig = --- View2 -view2 : ViewConfig -> UiSettings -> Model -> Html Msg +view2 : Flags -> ViewConfig -> UiSettings -> Model -> Html Msg view2 = renderEditForm2 -renderEditForm2 : ViewConfig -> UiSettings -> Model -> Html Msg -renderEditForm2 cfg settings model = +renderEditForm2 : Flags -> ViewConfig -> UiSettings -> Model -> Html Msg +renderEditForm2 flags cfg settings model = let fieldVisible field = Data.UiSettings.fieldVisible settings field @@ -700,6 +667,31 @@ renderEditForm2 cfg settings model = tabStyle = TB.searchMenuStyle + + folderCfg = + { makeOption = Util.Folder.mkFolderOption flags model.allFolders + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = dds + } + + idNameCfg = + { makeOption = \e -> { text = e.name, additional = "" } + , labelColor = \_ -> \_ -> "" + , placeholder = "Select…" + , style = dds + } + + directionCfg = + { makeOption = + \entry -> + { text = Data.Direction.toString entry + , additional = "" + } + , placeholder = "Choose a direction…" + , labelColor = \_ -> \_ -> "" + , style = dds + } in div [ class cfg.menuClass, class "mt-2" ] [ TB.akkordion @@ -747,7 +739,11 @@ renderEditForm2 cfg settings model = [ tagModeIcon ] ] - , Html.map TagDropdownMsg (Comp.Dropdown.view2 dds settings model.tagModel) + , Html.map TagDropdownMsg + (Comp.Dropdown.view2 (Util.Tag.tagSettings dds) + settings + model.tagModel + ) , Markdown.toHtml [ class "opacity-50 text-sm" ] tagModeMsg ] ] @@ -756,7 +752,7 @@ renderEditForm2 cfg settings model = , titleRight = [] , info = Nothing , body = - [ Html.map FolderDropdownMsg (Comp.Dropdown.view2 dds settings model.folderModel) + [ Html.map FolderDropdownMsg (Comp.Dropdown.view2 folderCfg settings model.folderModel) , div [ classList [ ( S.message, True ) @@ -835,7 +831,7 @@ item visible. This message will disappear then. [ text "Organization" ] ] - , Html.map OrgDropdownMsg (Comp.Dropdown.view2 dds settings model.corrOrgModel) + , Html.map OrgDropdownMsg (Comp.Dropdown.view2 idNameCfg settings model.corrOrgModel) ] , optional [ Data.Fields.CorrPerson ] <| div [ class "mb-4" ] @@ -845,7 +841,7 @@ item visible. This message will disappear then. [ text "Person" ] ] - , Html.map CorrPersonMsg (Comp.Dropdown.view2 dds settings model.corrPersonModel) + , Html.map CorrPersonMsg (Comp.Dropdown.view2 idNameCfg settings model.corrPersonModel) ] ] } @@ -860,7 +856,7 @@ item visible. This message will disappear then. , span [ class "ml-2" ] [ text "Person" ] ] - , Html.map ConcPersonMsg (Comp.Dropdown.view2 dds settings model.concPersonModel) + , Html.map ConcPersonMsg (Comp.Dropdown.view2 idNameCfg settings model.concPersonModel) ] , optional [ Data.Fields.ConcEquip ] <| div [ class "mb-4" ] @@ -869,7 +865,11 @@ item visible. This message will disappear then. , span [ class "ml-2" ] [ text "Equipment" ] ] - , Html.map ConcEquipMsg (Comp.Dropdown.view2 dds settings model.concEquipModel) + , Html.map ConcEquipMsg + (Comp.Dropdown.view2 idNameCfg + settings + model.concEquipModel + ) ] ] } @@ -877,7 +877,7 @@ item visible. This message will disappear then. , titleRight = [] , info = Nothing , body = - [ Html.map DirDropdownMsg (Comp.Dropdown.view2 dds settings model.directionModel) + [ Html.map DirDropdownMsg (Comp.Dropdown.view2 directionCfg settings model.directionModel) ] } , { title = "Name" diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm index 99709b53..ee7194c1 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm @@ -62,7 +62,6 @@ import Set exposing (Set) import Throttle import Time import Util.File exposing (makeFileId) -import Util.Folder exposing (mkFolderOption) import Util.Http import Util.List import Util.Maybe @@ -576,13 +575,7 @@ update key flags inav settings msg model = GetFolderResp (Ok fs) -> let model_ = - { model - | allFolders = fs.items - , folderModel = - Comp.Dropdown.setMkOption - (mkFolderOption flags fs.items) - model.folderModel - } + { model | allFolders = fs.items } mkIdName fitem = IdName fitem.id fitem.name @@ -645,23 +638,8 @@ update key flags inav settings msg model = List.filter personFilter correspondent |> List.map (\e -> IdName e.id e.name) - mkPersonOption idref = - let - org = - Dict.get idref.id personDict - |> Maybe.andThen .organization - |> Maybe.map .name - |> Maybe.map (Util.String.ellipsis 15) - |> Maybe.withDefault "" - in - Comp.Dropdown.Option idref.id idref.name org - model_ = - { model - | corrPersonModel = Comp.Dropdown.setMkOption mkPersonOption model.corrPersonModel - , concPersonModel = Comp.Dropdown.setMkOption mkPersonOption model.concPersonModel - , allPersons = personDict - } + { model | allPersons = personDict } res1 = update key @@ -1505,7 +1483,7 @@ update key flags inav settings msg model = ToggleOpenAllAkkordionTabs -> let allNames = - Comp.ItemDetail.EditForm.formTabs settings model + Comp.ItemDetail.EditForm.formTabs flags settings model |> List.map .title |> Set.fromList diff --git a/modules/webapp/src/main/elm/Comp/ItemMail.elm b/modules/webapp/src/main/elm/Comp/ItemMail.elm index 718f64a3..60223241 100644 --- a/modules/webapp/src/main/elm/Comp/ItemMail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemMail.elm @@ -69,11 +69,7 @@ type FormAction emptyModel : Model emptyModel = - { connectionModel = - Comp.Dropdown.makeSingle - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select connection..." - } + { connectionModel = Comp.Dropdown.makeSingle , subject = "" , recipients = [] , recipientsModel = Comp.EmailInput.init @@ -160,9 +156,7 @@ update flags msg model = cm = Comp.Dropdown.makeSingleList - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select Connection..." - , options = names + { options = names , selected = List.head names } in @@ -229,6 +223,13 @@ view2 settings model = let dds = Data.DropdownStyle.mainStyle + + connectionCfg = + { makeOption = \a -> { text = a, additional = "" } + , placeholder = "Select connection..." + , labelColor = \_ -> \_ -> "" + , style = dds + } in div [ class "flex flex-col" @@ -238,7 +239,7 @@ view2 settings model = [ text "Send via" , B.inputRequired ] - , Html.map ConnMsg (Comp.Dropdown.view2 dds settings model.connectionModel) + , Html.map ConnMsg (Comp.Dropdown.view2 connectionCfg settings model.connectionModel) ] , div [ class S.errorMessage diff --git a/modules/webapp/src/main/elm/Comp/NotificationForm.elm b/modules/webapp/src/main/elm/Comp/NotificationForm.elm index c5c5932d..42f2c74a 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationForm.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationForm.elm @@ -144,13 +144,9 @@ init flags = Comp.CalEventInput.initDefault in ( { settings = Api.Model.NotificationSettings.empty - , connectionModel = - Comp.Dropdown.makeSingle - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select connection..." - } - , tagInclModel = Util.Tag.makeDropdownModel2 - , tagExclModel = Util.Tag.makeDropdownModel2 + , connectionModel = Comp.Dropdown.makeSingle + , tagInclModel = Util.Tag.makeDropdownModel + , tagExclModel = Util.Tag.makeDropdownModel , recipients = [] , recipientsModel = Comp.EmailInput.init , remindDays = Just 1 @@ -298,9 +294,7 @@ update flags msg model = cm = Comp.Dropdown.makeSingleList - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select Connection..." - , options = names + { options = names , selected = List.head names } in @@ -493,6 +487,13 @@ view2 extraClasses settings model = , title = "Start this task now" , icon = Just "fa fa-play" } + + connectionCfg = + { makeOption = \a -> { text = a, additional = "" } + , placeholder = "Select connection..." + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } in div [ class "flex flex-col md:relative" @@ -579,7 +580,7 @@ view2 extraClasses settings model = ] , Html.map ConnMsg (Comp.Dropdown.view2 - DS.mainStyle + connectionCfg settings model.connectionModel ) @@ -609,7 +610,7 @@ view2 extraClasses settings model = [ text "Tags Include (and)" ] , Html.map TagIncMsg (Comp.Dropdown.view2 - DS.mainStyle + (Util.Tag.tagSettings DS.mainStyle) settings model.tagInclModel ) @@ -622,7 +623,7 @@ view2 extraClasses settings model = [ text "Tags Exclude (or)" ] , Html.map TagExcMsg (Comp.Dropdown.view2 - DS.mainStyle + (Util.Tag.tagSettings DS.mainStyle) settings model.tagExclModel ) diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index 0c875fe0..ac7c1299 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -49,7 +49,7 @@ emptyModel = Comp.FixedDropdown.initMap Data.PersonUse.label Data.PersonUse.all - , orgModel = Comp.Dropdown.orgDropdown + , orgModel = Comp.Dropdown.makeSingle } @@ -242,7 +242,7 @@ view2 mobile settings model = ] , Html.map OrgDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + (Comp.Dropdown.orgFormViewSettings DS.mainStyle) settings model.orgModel ) diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 926c0267..983411ef 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -191,11 +191,7 @@ init flags = Comp.CalEventInput.initDefault in ( { settings = Api.Model.ScanMailboxSettings.empty - , connectionModel = - Comp.Dropdown.makeSingle - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select connection..." - } + , connectionModel = Comp.Dropdown.makeSingle , enabled = False , deleteMail = False , receivedHours = Nothing @@ -209,11 +205,7 @@ init flags = , formMsg = Nothing , loading = 3 , yesNoDelete = Comp.YesNoDimmer.emptyModel - , folderModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } + , folderModel = Comp.Dropdown.makeSingle , allFolders = [] , itemFolderId = Nothing , tagModel = Util.Tag.makeDropdownModel @@ -370,9 +362,7 @@ update flags msg model = cm = Comp.Dropdown.makeSingleList - { makeOption = \a -> { value = a, text = a, additional = "" } - , placeholder = "Select Connection..." - , options = names + { options = names , selected = Util.Maybe.or [ List.head (Comp.Dropdown.getSelected model.connectionModel) @@ -522,10 +512,6 @@ update flags msg model = { model | allFolders = fs.items , loading = model.loading - 1 - , folderModel = - Comp.Dropdown.setMkOption - (mkFolderOption flags fs.items) - model.folderModel } mkIdName fitem = @@ -729,8 +715,8 @@ isFolderMember model = Util.Folder.isFolderMember model.allFolders selected -view2 : String -> UiSettings -> Model -> Html Msg -view2 extraClasses settings model = +view2 : Flags -> String -> UiSettings -> Model -> Html Msg +view2 flags extraClasses settings model = let dimmerSettings = Comp.YesNoDimmer.defaultSettings2 "Really delete this scan mailbox task?" @@ -799,7 +785,7 @@ view2 extraClasses settings model = , Comp.Tabs.akkordion Comp.Tabs.defaultStyle tabActive - (formTabs settings model) + (formTabs flags settings model) , Html.map YesNoDeleteMsg (Comp.YesNoDimmer.viewN True @@ -832,8 +818,8 @@ tabTitle tab = "Schedule" -formTabs : UiSettings -> Model -> List (Comp.Tabs.Tab Msg) -formTabs settings model = +formTabs : Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) +formTabs flags settings model = [ { title = tabTitle TabGeneral , titleRight = [] , info = Nothing @@ -857,7 +843,7 @@ formTabs settings model = , { title = tabTitle TabMetadata , titleRight = [] , info = Just "Define metadata that should be attached to all items created by this task." - , body = viewMetadata2 settings model + , body = viewMetadata2 flags settings model } , { title = tabTitle TabSchedule , titleRight = [] @@ -869,6 +855,14 @@ formTabs settings model = viewGeneral2 : UiSettings -> Model -> List (Html Msg) viewGeneral2 settings model = + let + connectionCfg = + { makeOption = \a -> { text = a, additional = "" } + , placeholder = "Select connection..." + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in [ MB.viewItem <| MB.Checkbox { id = "scanmail-enabled" @@ -899,7 +893,7 @@ viewGeneral2 settings model = ] , Html.map ConnMsg (Comp.Dropdown.view2 - DS.mainStyle + connectionCfg settings model.connectionModel ) @@ -1054,8 +1048,16 @@ viewPostProcessing2 model = ] -viewMetadata2 : UiSettings -> Model -> List (Html Msg) -viewMetadata2 settings model = +viewMetadata2 : Flags -> UiSettings -> Model -> List (Html Msg) +viewMetadata2 flags settings model = + let + folderCfg = + { makeOption = Util.Folder.mkFolderOption flags model.allFolders + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in [ div [ class "mb-4" ] [ label [ class S.inputLabel ] [ text "Item direction" @@ -1105,7 +1107,7 @@ viewMetadata2 settings model = ] , Html.map FolderDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + folderCfg settings model.folderModel ) @@ -1131,7 +1133,7 @@ disappear then. [ text "Tags" ] , Html.map TagDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + (Util.Tag.tagSettings DS.mainStyle) settings model.tagModel ) diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm index c199f7fe..8dd8514d 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm @@ -17,7 +17,6 @@ import Data.Flags exposing (Flags) import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onClick) import Http import Styles as S import Util.Http @@ -213,8 +212,8 @@ update flags msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Flags -> UiSettings -> Model -> Html Msg +view2 flags settings model = div [ class "flex flex-col" ] (div [ classList @@ -229,7 +228,7 @@ view2 settings model = ] :: (case model.detailModel of Just msett -> - viewForm2 settings msett + viewForm2 flags settings msett Nothing -> viewList2 model @@ -237,10 +236,10 @@ view2 settings model = ) -viewForm2 : UiSettings -> Comp.ScanMailboxForm.Model -> List (Html Msg) -viewForm2 settings model = +viewForm2 : Flags -> UiSettings -> Comp.ScanMailboxForm.Model -> List (Html Msg) +viewForm2 flags settings model = [ Html.map DetailMsg - (Comp.ScanMailboxForm.view2 "" settings model) + (Comp.ScanMailboxForm.view2 flags "" settings model) ] diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index 0c7261a2..93b82f89 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -95,36 +95,13 @@ init flags = , tagSelection = Comp.TagSelect.emptySelection , directionModel = Comp.Dropdown.makeSingleList - { makeOption = - \entry -> - { value = Data.Direction.toString entry - , text = Data.Direction.toString entry - , additional = "" - } - , options = Data.Direction.all - , placeholder = "Choose a direction…" + { options = Data.Direction.all , selected = Nothing } - , orgModel = - Comp.Dropdown.orgDropdown - , corrPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "Choose a person" - } - , concPersonModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "Choose a person" - } - , concEquipmentModel = - Comp.Dropdown.makeModel - { multiple = False - , searchable = \n -> n > 0 - , makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , labelColor = \_ -> \_ -> "" - , placeholder = "Choose an equipment" - } + , orgModel = Comp.Dropdown.makeSingle + , corrPersonModel = Comp.Dropdown.makeSingle + , concPersonModel = Comp.Dropdown.makeSingle + , concEquipmentModel = Comp.Dropdown.makeSingle , folderList = Comp.FolderSelect.init Nothing [] , selectedFolder = Nothing , inboxCheckbox = False @@ -1022,6 +999,38 @@ searchTabs ddd flags settings model = tagSelectWM = Comp.TagSelect.makeWorkModel model.tagSelection model.tagSelectModel + + directionCfg = + { makeOption = + \entry -> + { text = Data.Direction.toString entry + , additional = "" + } + , placeholder = "Choose a direction…" + , labelColor = \_ -> \_ -> "" + , style = DS.sidebarStyle + } + + corrPersonCfg = + { makeOption = \e -> { text = e.name, additional = "" } + , placeholder = "Choose a person" + , labelColor = \_ -> \_ -> "" + , style = DS.sidebarStyle + } + + concPersonCfg = + { makeOption = \e -> { text = e.name, additional = "" } + , placeholder = "Choose a person" + , labelColor = \_ -> \_ -> "" + , style = DS.sidebarStyle + } + + concEquipCfg = + { makeOption = \e -> { text = e.name, additional = "" } + , labelColor = \_ -> \_ -> "" + , placeholder = "Choose an equipment" + , style = DS.sidebarStyle + } in [ { title = "Inbox" , info = Nothing @@ -1129,7 +1138,7 @@ searchTabs ddd flags settings model = [ text "Organization" ] , Html.map OrgMsg (Comp.Dropdown.view2 - DS.sidebarStyle + (Comp.Dropdown.orgFormViewSettings DS.sidebarStyle) settings model.orgModel ) @@ -1141,7 +1150,7 @@ searchTabs ddd flags settings model = [ label [ class S.inputLabel ] [ text "Person" ] , Html.map CorrPersonMsg (Comp.Dropdown.view2 - DS.sidebarStyle + corrPersonCfg settings model.corrPersonModel ) @@ -1159,7 +1168,7 @@ searchTabs ddd flags settings model = [ label [ class S.inputLabel ] [ text "Person" ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 - DS.sidebarStyle + concPersonCfg settings model.concPersonModel ) @@ -1171,7 +1180,7 @@ searchTabs ddd flags settings model = [ label [ class S.inputLabel ] [ text "Equipment" ] , Html.map ConcEquipmentMsg (Comp.Dropdown.view2 - DS.sidebarStyle + concEquipCfg settings model.concEquipmentModel ) @@ -1295,7 +1304,7 @@ searchTabs ddd flags settings model = , body = [ Html.map DirectionMsg (Comp.Dropdown.view2 - DS.sidebarStyle + directionCfg settings model.directionModel ) diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 73250bb8..c3ea14e6 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -64,25 +64,14 @@ emptyModel = Data.Priority.all , priority = Data.Priority.Low , enabled = False - , folderModel = - Comp.Dropdown.makeSingle - { makeOption = \e -> { value = e.id, text = e.name, additional = "" } - , placeholder = "" - } + , folderModel = Comp.Dropdown.makeSingle , allFolders = [] , folderId = Nothing - , tagModel = Util.Tag.makeDropdownModel2 + , tagModel = Util.Tag.makeDropdownModel , fileFilter = Nothing , languageModel = Comp.Dropdown.makeSingleList - { makeOption = - \a -> - { value = Data.Language.toName a - , text = Data.Language.toName a - , additional = "" - } - , placeholder = "Select…" - , options = Data.Language.all + { options = Data.Language.all , selected = Nothing } , language = Nothing @@ -237,13 +226,7 @@ update flags msg model = GetFolderResp (Ok fs) -> let model_ = - { model - | allFolders = fs.items - , folderModel = - Comp.Dropdown.setMkOption - (mkFolderOption flags fs.items) - model.folderModel - } + { model | allFolders = fs.items } mkIdName fitem = IdName fitem.id fitem.name @@ -331,13 +314,34 @@ update flags msg model = view2 : Flags -> Texts -> UiSettings -> Model -> Html Msg -view2 _ texts settings model = +view2 flags texts settings model = let priorityItem = Comp.FixedDropdown.Item model.priority (Data.Priority.toName model.priority) Nothing + + folderCfg = + { makeOption = mkFolderOption flags model.allFolders + , placeholder = "" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + + tagCfg = + Util.Tag.tagSettings DS.mainStyle + + languageCfg = + { makeOption = + \a -> + { text = Data.Language.toName a + , additional = "" + } + , placeholder = "Select…" + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } in div [ class "flex flex-col" ] [ div [ class "mb-4" ] @@ -424,7 +428,7 @@ view2 _ texts settings model = ] , Html.map FolderDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + folderCfg settings model.folderModel ) @@ -446,7 +450,7 @@ view2 _ texts settings model = ] , Html.map TagDropdownMsg (Comp.Dropdown.view2 - DS.mainStyle + tagCfg settings model.tagModel ) @@ -479,7 +483,7 @@ view2 _ texts settings model = ] , Html.map LanguageMsg (Comp.Dropdown.view2 - DS.mainStyle + languageCfg settings model.languageModel ) diff --git a/modules/webapp/src/main/elm/Comp/TagForm.elm b/modules/webapp/src/main/elm/Comp/TagForm.elm index 45c202d6..607f3ab6 100644 --- a/modules/webapp/src/main/elm/Comp/TagForm.elm +++ b/modules/webapp/src/main/elm/Comp/TagForm.elm @@ -37,9 +37,7 @@ emptyModel categories = let cm = Comp.Dropdown.makeSingleList - { makeOption = \s -> Comp.Dropdown.mkOption s s - , placeholder = "Select or define category..." - , options = categories + { options = categories , selected = Nothing } in @@ -122,6 +120,14 @@ update _ msg model = view2 : Model -> Html Msg view2 model = + let + categoryCfg = + { makeOption = \s -> Comp.Dropdown.mkOption s + , placeholder = "Select or define category..." + , labelColor = \_ -> \_ -> "" + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "mb-4" ] @@ -155,7 +161,7 @@ view2 model = ] , Html.map CatMsg (Comp.Dropdown.viewSingle2 - DS.mainStyle + categoryCfg model.catDropdown ) ] diff --git a/modules/webapp/src/main/elm/Comp/UserForm.elm b/modules/webapp/src/main/elm/Comp/UserForm.elm index 4255ca01..8d33f651 100644 --- a/modules/webapp/src/main/elm/Comp/UserForm.elm +++ b/modules/webapp/src/main/elm/Comp/UserForm.elm @@ -41,14 +41,7 @@ emptyModel = , password = Nothing , state = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.UserState.toString s - , text = Data.UserState.toString s - , additional = "" - } - , placeholder = "" - , options = Data.UserState.all + { options = Data.UserState.all , selected = List.head Data.UserState.all } } @@ -103,14 +96,7 @@ update _ msg model = let state = Comp.Dropdown.makeSingleList - { makeOption = - \s -> - { value = Data.UserState.toString s - , text = Data.UserState.toString s - , additional = "" - } - , placeholder = "" - , options = Data.UserState.all + { options = Data.UserState.all , selected = Data.UserState.fromString t.state |> Maybe.map (\u -> List.filter ((==) u) Data.UserState.all) @@ -169,6 +155,18 @@ update _ msg model = view2 : Texts -> UiSettings -> Model -> Html Msg view2 texts settings model = + let + stateCfg = + { makeOption = + \s -> + { text = Data.UserState.toString s + , additional = "" + } + , placeholder = "" + , style = DS.mainStyle + , labelColor = \_ -> \_ -> "" + } + in div [ class "flex flex-col" ] [ div [ class "mb-4" ] @@ -205,7 +203,7 @@ view2 texts settings model = ] , Html.map StateMsg (Comp.Dropdown.view2 - DS.mainStyle + stateCfg settings model.state ) diff --git a/modules/webapp/src/main/elm/Data/UiSettings.elm b/modules/webapp/src/main/elm/Data/UiSettings.elm index 3bcbb0c0..1a69438b 100644 --- a/modules/webapp/src/main/elm/Data/UiSettings.elm +++ b/modules/webapp/src/main/elm/Data/UiSettings.elm @@ -7,7 +7,6 @@ module Data.UiSettings exposing , cardPreviewSize2 , catColor , catColorFg2 - , catColorString , catColorString2 , defaults , fieldHidden @@ -18,7 +17,6 @@ module Data.UiSettings exposing , posToString , tagColor , tagColorFg2 - , tagColorString , tagColorString2 , toStoredUiSettings ) @@ -276,13 +274,6 @@ tagColor tag settings = Maybe.andThen (catColor settings) tag.category -catColorString : UiSettings -> String -> String -catColorString settings name = - catColor settings name - |> Maybe.map Data.Color.toString - |> Maybe.withDefault "" - - catColorString2 : UiSettings -> String -> String catColorString2 settings name = catColor settings name @@ -297,13 +288,6 @@ catColorFg2 settings name = |> Maybe.withDefault "" -tagColorString : Tag -> UiSettings -> String -tagColorString tag settings = - tagColor tag settings - |> Maybe.map Data.Color.toString - |> Maybe.withDefault "" - - tagColorString2 : Tag -> UiSettings -> String tagColorString2 tag settings = tagColor tag settings diff --git a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm index 7875e48f..412cddcf 100644 --- a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm +++ b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm @@ -47,7 +47,7 @@ view flags settings model = SelectView svm -> case svm.action of EditSelected -> - viewEditMenu svm settings + viewEditMenu flags svm settings _ -> viewSearch flags settings model @@ -83,8 +83,8 @@ viewSearch flags settings model = ] -viewEditMenu : SelectViewModel -> UiSettings -> List (Html Msg) -viewEditMenu svm settings = +viewEditMenu : Flags -> SelectViewModel -> UiSettings -> List (Html Msg) +viewEditMenu flags svm settings = let cfg_ = Comp.ItemDetail.MultiEditMenu.defaultViewConfig @@ -127,5 +127,5 @@ viewEditMenu svm settings = , rootClasses = "mt-2 text-sm" } , Html.map EditMenuMsg - (Comp.ItemDetail.MultiEditMenu.view2 cfg settings svm.editModel) + (Comp.ItemDetail.MultiEditMenu.view2 flags cfg settings svm.editModel) ] diff --git a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm index 7d5ac3eb..30fb3371 100644 --- a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm @@ -17,7 +17,7 @@ import Styles as S viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg -viewSidebar texts visible _ settings model = +viewSidebar texts visible flags settings model = div [ id "sidebar" , class S.sidebar @@ -49,7 +49,7 @@ viewSidebar texts visible _ settings model = , rootClasses = "text-sm mb-3 " } , Html.map ItemDetailMsg - (Comp.ItemDetail.EditForm.view2 settings model.detail) + (Comp.ItemDetail.EditForm.view2 flags settings model.detail) ] diff --git a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm index 8d6fc120..cbbe02b3 100644 --- a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm @@ -119,7 +119,7 @@ viewContent flags settings model = viewImapSettings settings model Just ScanMailboxTab -> - viewScanMailboxManage settings model + viewScanMailboxManage flags settings model Just UiSettingsTab -> viewUiSettings flags settings model @@ -247,8 +247,8 @@ viewNotificationManage settings model = ] -viewScanMailboxManage : UiSettings -> Model -> List (Html Msg) -viewScanMailboxManage settings model = +viewScanMailboxManage : Flags -> UiSettings -> Model -> List (Html Msg) +viewScanMailboxManage flags settings model = [ h2 [ class S.header1 , class "inline-flex items-center" @@ -276,6 +276,7 @@ viewScanMailboxManage settings model = ] , Html.map ScanMailboxMsg (Comp.ScanMailboxManage.view2 + flags settings model.scanMailboxModel ) diff --git a/modules/webapp/src/main/elm/Util/Folder.elm b/modules/webapp/src/main/elm/Util/Folder.elm index ba32bb67..db6d5dec 100644 --- a/modules/webapp/src/main/elm/Util/Folder.elm +++ b/modules/webapp/src/main/elm/Util/Folder.elm @@ -37,7 +37,7 @@ mkFolderOption flags allFolders idref = else "" in - { value = idref.id, text = idref.name, additional = adds } + { text = idref.name, additional = adds } isFolderMember : List FolderItem -> Maybe String -> Bool diff --git a/modules/webapp/src/main/elm/Util/Person.elm b/modules/webapp/src/main/elm/Util/Person.elm new file mode 100644 index 00000000..cb61762c --- /dev/null +++ b/modules/webapp/src/main/elm/Util/Person.elm @@ -0,0 +1,20 @@ +module Util.Person exposing (mkPersonOption) + +import Api.Model.IdName exposing (IdName) +import Api.Model.Person exposing (Person) +import Comp.Dropdown +import Dict exposing (Dict) +import Util.String + + +mkPersonOption : IdName -> Dict String Person -> Comp.Dropdown.Option +mkPersonOption idref personDict = + let + org = + Dict.get idref.id personDict + |> Maybe.andThen .organization + |> Maybe.map .name + |> Maybe.map (Util.String.ellipsis 15) + |> Maybe.withDefault "" + in + Comp.Dropdown.Option idref.name org diff --git a/modules/webapp/src/main/elm/Util/Tag.elm b/modules/webapp/src/main/elm/Util/Tag.elm index c095c6ff..753adf34 100644 --- a/modules/webapp/src/main/elm/Util/Tag.elm +++ b/modules/webapp/src/main/elm/Util/Tag.elm @@ -1,12 +1,14 @@ module Util.Tag exposing - ( getCategories + ( catSettings + , getCategories , makeCatDropdownModel , makeDropdownModel - , makeDropdownModel2 + , tagSettings ) import Api.Model.Tag exposing (Tag) import Comp.Dropdown +import Data.DropdownStyle as DS import Data.UiSettings import Util.List @@ -16,30 +18,19 @@ makeDropdownModel = Comp.Dropdown.makeModel { multiple = True , searchable = \n -> n > 0 - , makeOption = \tag -> { value = tag.id, text = tag.name, additional = "" } - , labelColor = - \tag -> - \settings -> - "basic " ++ Data.UiSettings.tagColorString tag settings - , placeholder = "Choose a tag…" } -makeDropdownModel2 : Comp.Dropdown.Model Tag -makeDropdownModel2 = - Comp.Dropdown.makeModel - { multiple = True - , searchable = \n -> n > 0 - , makeOption = \tag -> { value = tag.id, text = tag.name, additional = "" } - , labelColor = - \tag -> - \settings -> - Data.UiSettings.tagColorString2 tag settings - ++ -- legacy colors - " basic " - ++ Data.UiSettings.tagColorString tag settings - , placeholder = "Choose a tag…" - } +tagSettings : DS.DropdownStyle -> Comp.Dropdown.ViewSettings Tag +tagSettings ds = + { makeOption = \tag -> { text = tag.name, additional = "" } + , labelColor = + \tag -> + \settings -> + Data.UiSettings.tagColorString2 tag settings + , placeholder = "Choose a tag…" + , style = ds + } makeCatDropdownModel : Comp.Dropdown.Model String @@ -47,12 +38,18 @@ makeCatDropdownModel = Comp.Dropdown.makeModel { multiple = True , searchable = \n -> n > 0 - , makeOption = \cat -> { value = cat, text = cat, additional = "" } - , labelColor = \_ -> \_ -> "" - , placeholder = "Choose a tag category…" } +catSettings : DS.DropdownStyle -> Comp.Dropdown.ViewSettings String +catSettings ds = + { makeOption = \cat -> { text = cat, additional = "" } + , labelColor = \_ -> \_ -> "" + , placeholder = "Choose a tag category…" + , style = ds + } + + getCategories : List Tag -> List String getCategories tags = List.filterMap .category tags From 9a23ba9afb91aef64d28fdfcae40af251e40c3c9 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 2 Apr 2021 22:46:47 +0200 Subject: [PATCH 12/25] Refactor FixedDropdown --- .../main/elm/Comp/ClassifierSettingsForm.elm | 20 +++--- .../webapp/src/main/elm/Comp/ColorTagger.elm | 16 ++++- .../webapp/src/main/elm/Comp/ContactField.elm | 24 ++++--- .../src/main/elm/Comp/CustomFieldForm.elm | 16 +++-- .../main/elm/Comp/CustomFieldMultiInput.elm | 14 ++-- .../src/main/elm/Comp/EquipmentForm.elm | 20 +++--- .../src/main/elm/Comp/FixedDropdown.elm | 71 +++++++------------ .../webapp/src/main/elm/Comp/FolderDetail.elm | 22 +++--- modules/webapp/src/main/elm/Comp/OrgForm.elm | 24 ++++--- .../webapp/src/main/elm/Comp/PersonForm.elm | 19 +++-- .../src/main/elm/Comp/ScanMailboxForm.elm | 19 ++--- .../webapp/src/main/elm/Comp/SourceForm.elm | 22 +++--- .../src/main/elm/Comp/UiSettingsForm.elm | 23 +++--- .../webapp/src/main/elm/Page/Home/Data.elm | 15 +--- .../webapp/src/main/elm/Page/Upload/Data.elm | 9 +-- .../webapp/src/main/elm/Page/Upload/View2.elm | 12 +++- 16 files changed, 170 insertions(+), 176 deletions(-) diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index 3324c36a..f212b812 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -81,7 +81,7 @@ init flags sett = Data.ListType.fromString sett.listType |> Maybe.withDefault Data.ListType.Whitelist , categoryListTypeModel = - Comp.FixedDropdown.initMap Data.ListType.label Data.ListType.all + Comp.FixedDropdown.init Data.ListType.all } , Cmd.batch [ Api.getTags flags "" GetTagsResp @@ -181,18 +181,18 @@ update flags msg model = view2 : Texts -> UiSettings -> Model -> Html Msg view2 texts settings model = let - catListTypeItem = - Comp.FixedDropdown.Item - model.categoryListType - (Data.ListType.label model.categoryListType) - Nothing - categoryCfg = { makeOption = \s -> { text = s, additional = "" } , labelColor = \_ -> \_ -> "grey " , placeholder = "Choose categories …" , style = DS.mainStyle } + + catListCfg = + { display = Data.ListType.label + , icon = \_ -> Nothing + , style = DS.mainStyle + } in div [] [ Markdown.toHtml [ class "px-2 py-2 opacity-75" ] @@ -201,7 +201,11 @@ view2 texts settings model = [ label [ class S.inputLabel ] [ text texts.blacklistOrWhitelist ] , Html.map CategoryListTypeMsg - (Comp.FixedDropdown.view2 (Just catListTypeItem) model.categoryListTypeModel) + (Comp.FixedDropdown.viewStyled2 catListCfg + False + (Just model.categoryListType) + model.categoryListTypeModel + ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] diff --git a/modules/webapp/src/main/elm/Comp/ColorTagger.elm b/modules/webapp/src/main/elm/Comp/ColorTagger.elm index a65ddba2..d9097abc 100644 --- a/modules/webapp/src/main/elm/Comp/ColorTagger.elm +++ b/modules/webapp/src/main/elm/Comp/ColorTagger.elm @@ -9,6 +9,7 @@ module Comp.ColorTagger exposing import Comp.FixedDropdown import Data.Color exposing (Color) +import Data.DropdownStyle as DS import Dict exposing (Dict) import Html exposing (..) import Html.Attributes exposing (..) @@ -37,7 +38,7 @@ type Msg init : List String -> List Color -> Model init leftSel colors = - { leftDropdown = Comp.FixedDropdown.initString leftSel + { leftDropdown = Comp.FixedDropdown.init leftSel , colors = colors , leftSelect = Nothing } @@ -96,12 +97,21 @@ type alias ViewOpts = view2 : FormData -> ViewOpts -> Model -> Html Msg view2 data opts model = + let + colorLabelCfg = + { display = identity + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ label [ class S.inputLabel ] [ text opts.label ] , Html.map LeftMsg - (Comp.FixedDropdown.view2 - (Maybe.map (\s -> Comp.FixedDropdown.Item s s Nothing) model.leftSelect) + (Comp.FixedDropdown.viewStyled2 + colorLabelCfg + False + model.leftSelect model.leftDropdown ) , div [ class "field" ] diff --git a/modules/webapp/src/main/elm/Comp/ContactField.elm b/modules/webapp/src/main/elm/Comp/ContactField.elm index d27646f1..7dd35484 100644 --- a/modules/webapp/src/main/elm/Comp/ContactField.elm +++ b/modules/webapp/src/main/elm/Comp/ContactField.elm @@ -11,6 +11,7 @@ import Api.Model.Contact exposing (Contact) import Comp.Basic as B import Comp.FixedDropdown import Data.ContactType exposing (ContactType) +import Data.DropdownStyle as DS import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) @@ -30,7 +31,7 @@ emptyModel : Model emptyModel = { items = [] , kind = - Comp.FixedDropdown.initMap Data.ContactType.toString Data.ContactType.all + Comp.FixedDropdown.init Data.ContactType.all , selectedKind = List.head Data.ContactType.all , value = "" } @@ -41,14 +42,6 @@ getContacts model = List.filter (\c -> c.value /= "") model.items -makeDropdownItem : ContactType -> Comp.FixedDropdown.Item ContactType -makeDropdownItem ct = - { id = ct - , display = Data.ContactType.toString ct - , icon = Nothing - } - - type Msg = SetValue String | TypeMsg (Comp.FixedDropdown.Msg ContactType) @@ -124,6 +117,13 @@ update msg model = view2 : Bool -> UiSettings -> Model -> Html Msg view2 mobile _ model = + let + kindCfg = + { display = Data.ContactType.toString + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "flex flex-col space-y-2" @@ -133,8 +133,10 @@ view2 mobile _ model = [ classList [ ( "flex-none md:w-1/6", not mobile ) ] ] [ Html.map TypeMsg - (Comp.FixedDropdown.view2 - (Maybe.map makeDropdownItem model.selectedKind) + (Comp.FixedDropdown.viewStyled2 + kindCfg + False + model.selectedKind model.kind ) ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index b1d54aa9..66fe9c4b 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -61,8 +61,7 @@ init field = , label = field.label , ftype = Data.CustomFieldType.fromString field.ftype , ftypeModel = - Comp.FixedDropdown.initMap Data.CustomFieldType.label - Data.CustomFieldType.all + Comp.FixedDropdown.init Data.CustomFieldType.all , loading = False , deleteDimmer = Comp.YesNoDimmer.emptyModel } @@ -200,11 +199,14 @@ type alias ViewSettings = view2 : ViewSettings -> Model -> List (Html Msg) view2 viewSettings model = let - mkItem cft = - Comp.FixedDropdown.Item cft (Data.CustomFieldType.label cft) Nothing - dimmerSettings = Comp.YesNoDimmer.defaultSettings2 "Really delete this custom field?" + + ftypeCfg = + { display = Data.CustomFieldType.label + , icon = \_ -> Nothing + , style = DS.mainStyle + } in (if viewSettings.showControls then [ viewButtons2 model ] @@ -279,9 +281,9 @@ view2 viewSettings model = ] , Html.map FTypeMsg (Comp.FixedDropdown.viewStyled2 - DS.mainStyle + ftypeCfg (model.ftype == Nothing) - (Maybe.map mkItem model.ftype) + model.ftype model.ftypeModel ) , div [ class "opacity-75 text-sm" ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index 459d8138..bb39cf65 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -130,7 +130,7 @@ reset model = mkFieldSelect : List CustomField -> FieldSelect mkFieldSelect fields = { selected = Nothing - , dropdown = Comp.FixedDropdown.init (List.map mkItem fields) + , dropdown = Comp.FixedDropdown.init fields } @@ -145,11 +145,6 @@ type alias UpdateResult = } -mkItem : CustomField -> Comp.FixedDropdown.Item CustomField -mkItem f = - Comp.FixedDropdown.Item f (Maybe.withDefault f.name f.label) Nothing - - update : Flags -> Msg -> Model -> UpdateResult update = update1 False @@ -336,7 +331,10 @@ viewMenuBar2 ddstyle viewSettings model = model.fieldSelect ddstyleFlex = - { ddstyle | root = ddstyle.root ++ " flex-grow" } + { display = \f -> Maybe.withDefault f.name f.label + , icon = \_ -> Nothing + , style = { ddstyle | root = ddstyle.root ++ " flex-grow" } + } in div [ classList @@ -348,7 +346,7 @@ viewMenuBar2 ddstyle viewSettings model = (Comp.FixedDropdown.viewStyled2 ddstyleFlex False - (Maybe.map mkItem selected) + selected dropdown ) :: (if viewSettings.showAddButton then diff --git a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm index 695c64ef..357f6506 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm @@ -11,6 +11,7 @@ module Comp.EquipmentForm exposing import Api.Model.Equipment exposing (Equipment) import Comp.Basic as B import Comp.FixedDropdown +import Data.DropdownStyle as DS import Data.EquipmentUse exposing (EquipmentUse) import Data.Flags exposing (Flags) import Html exposing (..) @@ -36,9 +37,7 @@ emptyModel = , notes = Nothing , use = Data.EquipmentUse.Concerning , useModel = - Comp.FixedDropdown.initMap - Data.EquipmentUse.label - Data.EquipmentUse.all + Comp.FixedDropdown.init Data.EquipmentUse.all } @@ -102,6 +101,13 @@ update _ msg model = view2 : Model -> Html Msg view2 model = + let + equipUseCfg = + { display = Data.EquipmentUse.label + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "mb-4" ] [ label @@ -132,7 +138,7 @@ view2 model = ] [ text "Use" ] , Html.map UseDropdownMsg - (Comp.FixedDropdown.view2 (makeUseItem model) model.useModel) + (Comp.FixedDropdown.viewStyled2 equipUseCfg False (Just model.use) model.useModel) , span [ class "opacity-50 text-sm" ] [ case model.use of Data.EquipmentUse.Concerning -> @@ -156,9 +162,3 @@ view2 model = ] ] ] - - -makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item EquipmentUse) -makeUseItem model = - Just <| - Comp.FixedDropdown.Item model.use (Data.EquipmentUse.label model.use) Nothing diff --git a/modules/webapp/src/main/elm/Comp/FixedDropdown.elm b/modules/webapp/src/main/elm/Comp/FixedDropdown.elm index 6679b06f..6b0c5899 100644 --- a/modules/webapp/src/main/elm/Comp/FixedDropdown.elm +++ b/modules/webapp/src/main/elm/Comp/FixedDropdown.elm @@ -2,12 +2,9 @@ module Comp.FixedDropdown exposing ( Item , Model , Msg + , ViewSettings , init - , initMap - , initString - , initTuple , update - , view2 , viewStyled2 ) @@ -22,8 +19,6 @@ import Util.List type alias Item a = { id : a - , display : String - , icon : Maybe String } @@ -40,31 +35,17 @@ type Msg a | KeyPress (Maybe KeyCode) -init : List (Item a) -> Model a -init options = +initItems : List (Item a) -> Model a +initItems options = { options = options , menuOpen = False , selected = Nothing } -initString : List String -> Model String -initString strings = - init <| List.map (\s -> Item s s Nothing) strings - - -initMap : (a -> String) -> List a -> Model a -initMap elToString els = - init <| List.map (\a -> Item a (elToString a) Nothing) els - - -initTuple : List ( String, a ) -> Model a -initTuple tuples = - let - mkItem ( txt, id ) = - Item id txt Nothing - in - init <| List.map mkItem tuples +init : List a -> Model a +init els = + List.map Item els |> initItems isSelected : Model a -> Item a -> Bool @@ -168,13 +149,20 @@ update msg model = --- View2 -viewStyled2 : DS.DropdownStyle -> Bool -> Maybe (Item a) -> Model a -> Html (Msg a) -viewStyled2 style error sel model = +type alias ViewSettings a = + { display : a -> String + , icon : a -> Maybe String + , style : DS.DropdownStyle + } + + +viewStyled2 : ViewSettings a -> Bool -> Maybe a -> Model a -> Html (Msg a) +viewStyled2 cfg error sel model = let - iconItem item = + iconItem id = span - [ classList [ ( "hidden", item.icon == Nothing ) ] - , class (Maybe.withDefault "" item.icon) + [ classList [ ( "hidden", cfg.icon id == Nothing ) ] + , class (Maybe.withDefault "" (cfg.icon id)) , class "mr-2" ] [] @@ -182,15 +170,15 @@ viewStyled2 style error sel model = renderItem item = a [ href "#" - , class style.item + , class cfg.style.item , classList - [ ( style.itemActive, isSelected model item ) - , ( "font-semibold", Just item == sel ) + [ ( cfg.style.itemActive, isSelected model item ) + , ( "font-semibold", Just item.id == sel ) ] , onClick (SelectItem2 item) ] - [ iconItem item - , text item.display + [ iconItem item.id + , text (cfg.display item.id) ] selIcon = @@ -198,11 +186,11 @@ viewStyled2 style error sel model = |> Maybe.withDefault (span [ class "hidden" ] []) in div - [ class ("relative " ++ style.root) + [ class ("relative " ++ cfg.style.root) , onKeyUpCode KeyPress ] [ a - [ class style.link + [ class cfg.style.link , classList [ ( S.inputErrorBorder, error ) ] , tabindex 0 , onClick ToggleMenu @@ -215,7 +203,7 @@ viewStyled2 style error sel model = ] ] [ selIcon - , Maybe.map .display sel + , Maybe.map cfg.display sel |> Maybe.withDefault "Select…" |> text ] @@ -226,13 +214,8 @@ viewStyled2 style error sel model = ] ] , div - [ class style.menu + [ class cfg.style.menu , classList [ ( "hidden", not model.menuOpen ) ] ] (List.map renderItem model.options) ] - - -view2 : Maybe (Item a) -> Model a -> Html (Msg a) -view2 = - viewStyled2 DS.mainStyle False diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index a86a12eb..721e7e62 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -18,6 +18,7 @@ import Comp.Basic as B import Comp.FixedDropdown import Comp.MenuBar as MB import Comp.YesNoDimmer +import Data.DropdownStyle as DS import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) @@ -65,8 +66,7 @@ init users folder = , members = folder.members , users = users , memberDropdown = - Comp.FixedDropdown.initMap .name - (makeOptions users folder) + Comp.FixedDropdown.init (makeOptions users folder) , selectedMember = Nothing , loading = False , deleteDimmer = Comp.YesNoDimmer.emptyModel @@ -275,11 +275,6 @@ update flags msg model = --- View2 -makeItem : IdName -> Comp.FixedDropdown.Item IdName -makeItem idn = - Comp.FixedDropdown.Item idn idn.name Nothing - - view2 : Flags -> Model -> Html Msg view2 flags model = let @@ -369,6 +364,13 @@ view2 flags model = viewMembers2 : Model -> List (Html Msg) viewMembers2 model = + let + folderCfg = + { display = .name + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in if model.folder.id == "" then [] @@ -383,8 +385,10 @@ viewMembers2 model = [ div [ class "flex flex-row space-x-2" ] [ div [ class "flex-grow" ] [ Html.map MemberDropdownMsg - (Comp.FixedDropdown.view2 - (Maybe.map makeItem model.selectedMember) + (Comp.FixedDropdown.viewStyled2 + folderCfg + False + model.selectedMember model.memberDropdown ) ] diff --git a/modules/webapp/src/main/elm/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Comp/OrgForm.elm index f7305923..3fb2f323 100644 --- a/modules/webapp/src/main/elm/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Comp/OrgForm.elm @@ -13,6 +13,7 @@ import Comp.AddressForm import Comp.Basic as B import Comp.ContactField import Comp.FixedDropdown +import Data.DropdownStyle as DS import Data.Flags exposing (Flags) import Data.OrgUse exposing (OrgUse) import Data.UiSettings exposing (UiSettings) @@ -45,9 +46,7 @@ emptyModel = , shortName = Nothing , use = Data.OrgUse.Correspondent , useModel = - Comp.FixedDropdown.initMap - Data.OrgUse.label - Data.OrgUse.all + Comp.FixedDropdown.init Data.OrgUse.all } @@ -147,14 +146,15 @@ update flags msg model = --- View2 -makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item OrgUse) -makeUseItem model = - Just <| - Comp.FixedDropdown.Item model.use (Data.OrgUse.label model.use) Nothing - - view2 : Bool -> UiSettings -> Model -> Html Msg view2 mobile settings model = + let + orgUseCfg = + { display = Data.OrgUse.label + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "mb-4" ] @@ -203,7 +203,11 @@ view2 mobile settings model = ] [ text "Use" ] , Html.map UseDropdownMsg - (Comp.FixedDropdown.view2 (makeUseItem model) model.useModel) + (Comp.FixedDropdown.viewStyled2 orgUseCfg + False + (Just model.use) + model.useModel + ) , span [ class "opacity-50 text-sm" ] [ case model.use of Data.OrgUse.Correspondent -> diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index ac7c1299..a5b96ab4 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -46,9 +46,7 @@ emptyModel = , notes = Nothing , use = Data.PersonUse.Both , useModel = - Comp.FixedDropdown.initMap - Data.PersonUse.label - Data.PersonUse.all + Comp.FixedDropdown.init Data.PersonUse.all , orgModel = Comp.Dropdown.makeSingle } @@ -176,18 +174,19 @@ update flags msg model = ) -makeUseItem : Model -> Maybe (Comp.FixedDropdown.Item PersonUse) -makeUseItem model = - Just <| - Comp.FixedDropdown.Item model.use (Data.PersonUse.label model.use) Nothing - - --- View2 view2 : Bool -> UiSettings -> Model -> Html Msg view2 mobile settings model = + let + personUseCfg = + { display = Data.PersonUse.label + , icon = \_ -> Nothing + , style = DS.mainStyle + } + in div [ class "flex flex-col" ] [ div [ class "mb-4" @@ -218,7 +217,7 @@ view2 mobile settings model = ] [ text "Use of this person" ] , Html.map UseDropdownMsg - (Comp.FixedDropdown.view2 (makeUseItem model) model.useModel) + (Comp.FixedDropdown.viewStyled2 personUseCfg False (Just model.use) model.useModel) , span [ class "opacity-50 text-sm" ] [ case model.use of Data.PersonUse.Concerning -> diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 983411ef..10673999 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -166,7 +166,7 @@ initWith flags s = , fileFilter = s.fileFilter , subjectFilter = s.subjectFilter , languageModel = - Comp.FixedDropdown.init (List.map mkLanguageItem Data.Language.all) + Comp.FixedDropdown.init Data.Language.all , language = Maybe.andThen Data.Language.fromString s.language , postHandleAll = Maybe.withDefault False s.postHandleAll , summary = s.summary @@ -213,7 +213,7 @@ init flags = , fileFilter = Nothing , subjectFilter = Nothing , languageModel = - Comp.FixedDropdown.init (List.map mkLanguageItem Data.Language.all) + Comp.FixedDropdown.init Data.Language.all , language = Nothing , postHandleAll = False , summary = Nothing @@ -227,11 +227,6 @@ init flags = ) -mkLanguageItem : Language -> Comp.FixedDropdown.Item Language -mkLanguageItem lang = - Comp.FixedDropdown.Item lang (Data.Language.toName lang) Nothing - - --- Update @@ -1057,6 +1052,12 @@ viewMetadata2 flags settings model = , labelColor = \_ -> \_ -> "" , style = DS.mainStyle } + + languageCfg = + { display = Data.Language.toName + , icon = \_ -> Nothing + , style = DS.mainStyleWith "flex-grow mr-2" + } in [ div [ class "mb-4" ] [ label [ class S.inputLabel ] @@ -1148,9 +1149,9 @@ disappear then. , div [ class "flex flex-row" ] [ Html.map LanguageMsg (Comp.FixedDropdown.viewStyled2 - (DS.mainStyleWith "flex-grow mr-2") + languageCfg False - (Maybe.map mkLanguageItem model.language) + model.language model.languageModel ) , a diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index c3ea14e6..1acfc588 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -59,9 +59,7 @@ emptyModel = , abbrev = "" , description = Nothing , priorityModel = - Comp.FixedDropdown.initMap - Data.Priority.toName - Data.Priority.all + Comp.FixedDropdown.init Data.Priority.all , priority = Data.Priority.Low , enabled = False , folderModel = Comp.Dropdown.makeSingle @@ -316,12 +314,6 @@ update flags msg model = view2 : Flags -> Texts -> UiSettings -> Model -> Html Msg view2 flags texts settings model = let - priorityItem = - Comp.FixedDropdown.Item - model.priority - (Data.Priority.toName model.priority) - Nothing - folderCfg = { makeOption = mkFolderOption flags model.allFolders , placeholder = "" @@ -342,6 +334,12 @@ view2 flags texts settings model = , labelColor = \_ -> \_ -> "" , style = DS.mainStyle } + + priorityCfg = + { display = Data.Priority.toName + , icon = \_ -> Nothing + , style = DS.mainStyle + } in div [ class "flex flex-col" ] [ div [ class "mb-4" ] @@ -402,8 +400,10 @@ view2 flags texts settings model = [ text texts.priority ] , Html.map PrioDropdownMsg - (Comp.FixedDropdown.view2 - (Just priorityItem) + (Comp.FixedDropdown.viewStyled2 + priorityCfg + False + (Just model.priority) model.priorityModel ) , div [ class "opacity-50 text-sm" ] diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 3f086604..44d42bab 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -156,8 +156,7 @@ init flags settings = , powerSearchEnabled = settings.powerSearchEnabled , uiLang = settings.uiLang , uiLangModel = - List.map langItem UiLanguage.all - |> Comp.FixedDropdown.init + Comp.FixedDropdown.init UiLanguage.all , openTabs = Set.empty } , Api.getTags flags "" GetTagsResp @@ -187,14 +186,6 @@ type Msg | UiLangMsg (Comp.FixedDropdown.Msg UiLanguage) -langItem : UiLanguage -> Comp.FixedDropdown.Item UiLanguage -langItem lang = - { id = lang - , display = Messages.get lang |> .label - , icon = Just (Messages.get lang |> .flagIcon) - } - - --- Update @@ -516,6 +507,13 @@ view2 flags settings model = settingFormTabs : Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) settingFormTabs flags _ model = + let + langCfg = + { display = \lang -> Messages.get lang |> .label + , icon = \lang -> Just (Messages.get lang |> .flagIcon) + , style = DS.mainStyle + } + in [ { title = "General" , titleRight = [] , info = Nothing @@ -532,9 +530,10 @@ settingFormTabs flags _ model = , div [ class "mb-4" ] [ label [ class S.inputLabel ] [ text "UI Language" ] , Html.map UiLangMsg - (Comp.FixedDropdown.viewStyled2 DS.mainStyle + (Comp.FixedDropdown.viewStyled2 + langCfg False - (Just <| langItem model.uiLang) + (Just model.uiLang) model.uiLangModel ) ] diff --git a/modules/webapp/src/main/elm/Page/Home/Data.elm b/modules/webapp/src/main/elm/Page/Home/Data.elm index 6112de60..450a6b19 100644 --- a/modules/webapp/src/main/elm/Page/Home/Data.elm +++ b/modules/webapp/src/main/elm/Page/Home/Data.elm @@ -13,7 +13,6 @@ module Page.Home.Data exposing , itemNav , menuCollapsed , resultsBelowLimit - , searchTypeString , selectActive ) @@ -30,7 +29,6 @@ import Comp.ItemDetail.MultiEditMenu exposing (SaveNameState(..)) import Comp.LinkTarget exposing (LinkTarget) import Comp.PowerSearchInput import Comp.SearchMenu -import Comp.YesNoDimmer import Data.Flags exposing (Flags) import Data.ItemNav exposing (ItemNav) import Data.ItemQuery as Q @@ -110,8 +108,7 @@ init flags viewMode = , moreInProgress = False , throttle = Throttle.create 1 , searchTypeDropdown = - Comp.FixedDropdown.initMap searchTypeString - searchTypeOptions + Comp.FixedDropdown.init searchTypeOptions , searchTypeDropdownValue = if Comp.SearchMenu.isFulltextSearch searchMenuModel then ContentOnlySearch @@ -226,16 +223,6 @@ type alias SearchParam = } -searchTypeString : SearchType -> String -searchTypeString st = - case st of - BasicSearch -> - "Names" - - ContentOnlySearch -> - "Contents" - - itemNav : String -> Model -> ItemNav itemNav id model = Data.ItemNav.fromList model.itemListModel.results id diff --git a/modules/webapp/src/main/elm/Page/Upload/Data.elm b/modules/webapp/src/main/elm/Page/Upload/Data.elm index 40255518..7274c8f5 100644 --- a/modules/webapp/src/main/elm/Page/Upload/Data.elm +++ b/modules/webapp/src/main/elm/Page/Upload/Data.elm @@ -9,7 +9,6 @@ module Page.Upload.Data exposing , isIdle , isLoading , isSuccessAll - , mkLanguageItem , uploadAllTracker ) @@ -38,11 +37,6 @@ type alias Model = } -mkLanguageItem : Language -> Comp.FixedDropdown.Item Language -mkLanguageItem lang = - Comp.FixedDropdown.Item lang (Data.Language.toName lang) Nothing - - emptyModel : Model emptyModel = { incoming = True @@ -54,8 +48,7 @@ emptyModel = , dropzone = Comp.Dropzone.init [] , skipDuplicates = True , languageModel = - Comp.FixedDropdown.init - (List.map mkLanguageItem Data.Language.all) + Comp.FixedDropdown.init Data.Language.all , language = Nothing } diff --git a/modules/webapp/src/main/elm/Page/Upload/View2.elm b/modules/webapp/src/main/elm/Page/Upload/View2.elm index e5dbf50f..108d64c4 100644 --- a/modules/webapp/src/main/elm/Page/Upload/View2.elm +++ b/modules/webapp/src/main/elm/Page/Upload/View2.elm @@ -5,6 +5,7 @@ import Comp.FixedDropdown import Comp.Progress import Data.DropdownStyle as DS import Data.Flags exposing (Flags) +import Data.Language import Data.UiSettings exposing (UiSettings) import Dict import File exposing (File) @@ -71,6 +72,13 @@ viewContent texts mid _ _ model = renderForm : Texts -> Model -> Html Msg renderForm texts model = + let + languageCfg = + { display = Data.Language.toName + , icon = \_ -> Nothing + , style = DS.mainStyleWith "w-40" + } + in div [ class "row" ] [ Html.form [ action "#" ] [ div [ class "flex flex-col mb-3" ] @@ -128,9 +136,9 @@ renderForm texts model = [ span [ class "mr-2" ] [ text (texts.language ++ ":") ] , Html.map LanguageMsg (Comp.FixedDropdown.viewStyled2 - (DS.mainStyleWith "w-40") + languageCfg False - (Maybe.map mkLanguageItem model.language) + model.language model.languageModel ) ] From dac95e81e67cc6def91e37ba5bc85d50e6daee60 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 2 Apr 2021 23:16:38 +0200 Subject: [PATCH 13/25] Remove unused code for search dropdown --- .../webapp/src/main/elm/Page/Home/Data.elm | 12 ------- .../webapp/src/main/elm/Page/Home/Update.elm | 32 ------------------- 2 files changed, 44 deletions(-) diff --git a/modules/webapp/src/main/elm/Page/Home/Data.elm b/modules/webapp/src/main/elm/Page/Home/Data.elm index 450a6b19..2f2302d5 100644 --- a/modules/webapp/src/main/elm/Page/Home/Data.elm +++ b/modules/webapp/src/main/elm/Page/Home/Data.elm @@ -22,7 +22,6 @@ import Api.Model.ItemLightList exposing (ItemLightList) import Api.Model.SearchStats exposing (SearchStats) import Browser.Dom as Dom import Comp.ConfirmModal -import Comp.FixedDropdown import Comp.ItemCardList import Comp.ItemDetail.FormChange exposing (FormChange) import Comp.ItemDetail.MultiEditMenu exposing (SaveNameState(..)) @@ -50,7 +49,6 @@ type alias Model = , moreAvailable : Bool , moreInProgress : Bool , throttle : Throttle Msg - , searchTypeDropdown : Comp.FixedDropdown.Model SearchType , searchTypeDropdownValue : SearchType , lastSearchType : SearchType , dragDropData : DD.DragDropData @@ -92,13 +90,6 @@ init flags viewMode = let searchMenuModel = Comp.SearchMenu.init flags - - searchTypeOptions = - if flags.config.fullTextSearchEnabled then - [ BasicSearch, ContentOnlySearch ] - - else - [ BasicSearch ] in { searchMenuModel = searchMenuModel , itemListModel = Comp.ItemCardList.init @@ -107,8 +98,6 @@ init flags viewMode = , moreAvailable = True , moreInProgress = False , throttle = Throttle.create 1 - , searchTypeDropdown = - Comp.FixedDropdown.init searchTypeOptions , searchTypeDropdownValue = if Comp.SearchMenu.isFulltextSearch searchMenuModel then ContentOnlySearch @@ -177,7 +166,6 @@ type Msg | LoadMore | UpdateThrottle | SetBasicSearch String - | SearchTypeMsg (Comp.FixedDropdown.Msg SearchType) | ToggleSearchType | KeyUpSearchbarMsg (Maybe KeyCode) | ScrollResult (Result Dom.Error ()) diff --git a/modules/webapp/src/main/elm/Page/Home/Update.elm b/modules/webapp/src/main/elm/Page/Home/Update.elm index 04ad7529..740ffe06 100644 --- a/modules/webapp/src/main/elm/Page/Home/Update.elm +++ b/modules/webapp/src/main/elm/Page/Home/Update.elm @@ -277,38 +277,6 @@ update mId key flags settings msg model = ContentOnlySearch -> update mId key flags settings (SearchMenuMsg Comp.SearchMenu.SetNamesSearch) model - SearchTypeMsg lm -> - let - ( sm, mv ) = - Comp.FixedDropdown.update lm model.searchTypeDropdown - - mvChange = - Util.Maybe.filter (\a -> a /= model.searchTypeDropdownValue) mv - - m0 = - { model - | searchTypeDropdown = sm - , searchTypeDropdownValue = Maybe.withDefault model.searchTypeDropdownValue mv - } - - next = - case mvChange of - Just BasicSearch -> - Just Comp.SearchMenu.SetNamesSearch - - Just ContentOnlySearch -> - Just Comp.SearchMenu.SetFulltextSearch - - _ -> - Nothing - in - case next of - Just lm_ -> - update mId key flags settings (SearchMenuMsg lm_) m0 - - Nothing -> - withSub ( m0, Cmd.none ) - KeyUpSearchbarMsg (Just Enter) -> update mId key flags settings (DoSearch model.searchTypeDropdownValue) model From e76d574ea3b9892b70c650f1018c5ff0de2ef306 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 2 Apr 2021 23:30:51 +0200 Subject: [PATCH 14/25] Externalize strings for document language --- .../main/elm/Comp/CollectiveSettingsForm.elm | 2 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 3 +- .../webapp/src/main/elm/Comp/SourceForm.elm | 4 +- modules/webapp/src/main/elm/Data/Language.elm | 50 ------------------ .../Messages/CollectiveSettingsFormComp.elm | 4 ++ .../src/main/elm/Messages/LanguageData.elm | 52 +++++++++++++++++++ .../src/main/elm/Messages/SourceFormComp.elm | 6 +++ .../src/main/elm/Messages/UploadPage.elm | 4 ++ .../webapp/src/main/elm/Page/Upload/View2.elm | 2 +- 9 files changed, 72 insertions(+), 55 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/LanguageData.elm diff --git a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm index 7ff4c716..3d11b69b 100644 --- a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm @@ -200,7 +200,7 @@ view2 flags texts settings model = languageCfg = { makeOption = \l -> - { text = Data.Language.toName l + { text = texts.languageLabel l , additional = "" } , placeholder = "" diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 10673999..de439fe4 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -39,6 +39,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick, onInput) import Http import Markdown +import Messages.LanguageData import Set exposing (Set) import Styles as S import Util.Folder exposing (mkFolderOption) @@ -1054,7 +1055,7 @@ viewMetadata2 flags settings model = } languageCfg = - { display = Data.Language.toName + { display = Messages.LanguageData.gb , icon = \_ -> Nothing , style = DS.mainStyleWith "flex-grow mr-2" } diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 1acfc588..9ef9003a 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -327,10 +327,10 @@ view2 flags texts settings model = languageCfg = { makeOption = \a -> - { text = Data.Language.toName a + { text = texts.languageLabel a , additional = "" } - , placeholder = "Select…" + , placeholder = texts.selectPlaceholder , labelColor = \_ -> \_ -> "" , style = DS.mainStyle } diff --git a/modules/webapp/src/main/elm/Data/Language.elm b/modules/webapp/src/main/elm/Data/Language.elm index f0cdac3d..3ea22908 100644 --- a/modules/webapp/src/main/elm/Data/Language.elm +++ b/modules/webapp/src/main/elm/Data/Language.elm @@ -3,7 +3,6 @@ module Data.Language exposing , all , fromString , toIso3 - , toName ) @@ -125,55 +124,6 @@ toIso3 lang = "lav" -toName : Language -> String -toName lang = - case lang of - German -> - "German" - - English -> - "English" - - French -> - "French" - - Italian -> - "Italian" - - Spanish -> - "Spanish" - - Portuguese -> - "Portuguese" - - Czech -> - "Czech" - - Danish -> - "Danish" - - Finnish -> - "Finnish" - - Norwegian -> - "Norwegian" - - Swedish -> - "Swedish" - - Russian -> - "Russian" - - Romanian -> - "Romanian" - - Dutch -> - "Dutch" - - Latvian -> - "Latvian" - - all : List Language all = [ German diff --git a/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm index eeabfe34..a00e604e 100644 --- a/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm @@ -1,6 +1,8 @@ module Messages.CollectiveSettingsFormComp exposing (..) +import Data.Language exposing (Language) import Messages.ClassifierSettingsFormComp +import Messages.LanguageData type alias Texts = @@ -17,6 +19,7 @@ type alias Texts = , reindexAllDataHelp : String , autoTagging : String , startNow : String + , languageLabel : Language -> String } @@ -39,4 +42,5 @@ gb = ++ "You must type OK before clicking the button to avoid accidental re-indexing." , autoTagging = "Auto-Tagging" , startNow = "Start now" + , languageLabel = Messages.LanguageData.gb } diff --git a/modules/webapp/src/main/elm/Messages/LanguageData.elm b/modules/webapp/src/main/elm/Messages/LanguageData.elm new file mode 100644 index 00000000..b55a4ef0 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/LanguageData.elm @@ -0,0 +1,52 @@ +module Messages.LanguageData exposing (..) + +import Data.Language exposing (Language(..)) + + +gb : Language -> String +gb lang = + case lang of + German -> + "German" + + English -> + "English" + + French -> + "French" + + Italian -> + "Italian" + + Spanish -> + "Spanish" + + Portuguese -> + "Portuguese" + + Czech -> + "Czech" + + Danish -> + "Danish" + + Finnish -> + "Finnish" + + Norwegian -> + "Norwegian" + + Swedish -> + "Swedish" + + Russian -> + "Russian" + + Romanian -> + "Romanian" + + Dutch -> + "Dutch" + + Latvian -> + "Latvian" diff --git a/modules/webapp/src/main/elm/Messages/SourceFormComp.elm b/modules/webapp/src/main/elm/Messages/SourceFormComp.elm index 9269cd4f..ab941c80 100644 --- a/modules/webapp/src/main/elm/Messages/SourceFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/SourceFormComp.elm @@ -1,6 +1,8 @@ module Messages.SourceFormComp exposing (..) +import Data.Language exposing (Language) import Messages.Basics +import Messages.LanguageData type alias Texts = @@ -20,6 +22,8 @@ type alias Texts = , fileFilterInfo : String , language : String , languageInfo : String + , languageLabel : Language -> String + , selectPlaceholder : String } @@ -58,4 +62,6 @@ Specify a file glob to filter files when uploading archives , languageInfo = "Used for text extraction and analysis. The collective's " ++ "default language is used if not specified here." + , languageLabel = Messages.LanguageData.gb + , selectPlaceholder = "Select…" } diff --git a/modules/webapp/src/main/elm/Messages/UploadPage.elm b/modules/webapp/src/main/elm/Messages/UploadPage.elm index 8ca93efa..08524567 100644 --- a/modules/webapp/src/main/elm/Messages/UploadPage.elm +++ b/modules/webapp/src/main/elm/Messages/UploadPage.elm @@ -1,7 +1,9 @@ module Messages.UploadPage exposing (..) +import Data.Language exposing (Language) import Messages.Basics import Messages.DropzoneComp +import Messages.LanguageData type alias Texts = @@ -25,6 +27,7 @@ type alias Texts = , resetLine2 : String } , selectedFiles : String + , languageLabel : Language -> String } @@ -54,6 +57,7 @@ gb = , resetLine2 = " to upload more files." } , selectedFiles = "Selected Files" + , languageLabel = Messages.LanguageData.gb } diff --git a/modules/webapp/src/main/elm/Page/Upload/View2.elm b/modules/webapp/src/main/elm/Page/Upload/View2.elm index 108d64c4..0cc8cb35 100644 --- a/modules/webapp/src/main/elm/Page/Upload/View2.elm +++ b/modules/webapp/src/main/elm/Page/Upload/View2.elm @@ -74,7 +74,7 @@ renderForm : Texts -> Model -> Html Msg renderForm texts model = let languageCfg = - { display = Data.Language.toName + { display = texts.languageLabel , icon = \_ -> Nothing , style = DS.mainStyleWith "w-40" } From 8f1380fcf5a22e1dc54ddd56e82e9575508d71a8 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 3 Apr 2021 22:25:54 +0200 Subject: [PATCH 15/25] Externalize strings in UiSettings page --- modules/webapp/src/main/elm/App/View2.elm | 19 +++- .../src/main/elm/Comp/ChangePasswordForm.elm | 14 ++- .../src/main/elm/Comp/EmailSettingsForm.elm | 1 + .../src/main/elm/Comp/FieldListSelect.elm | 21 ++-- .../src/main/elm/Comp/ImapSettingsForm.elm | 1 + .../src/main/elm/Comp/PasswordInput.elm | 11 +- .../src/main/elm/Comp/UiSettingsForm.elm | 106 +++++++----------- .../src/main/elm/Comp/UiSettingsManage.elm | 10 +- modules/webapp/src/main/elm/Data/Fields.elm | 41 ------- modules/webapp/src/main/elm/Messages.elm | 4 + .../elm/Messages/ChangePasswordFormComp.elm | 22 ++++ .../src/main/elm/Messages/ColorData.elm | 46 ++++++++ .../src/main/elm/Messages/FieldsData.elm | 43 +++++++ .../main/elm/Messages/UiSettingsFormComp.elm | 77 +++++++++++++ .../elm/Messages/UiSettingsManageComp.elm | 19 ++++ .../main/elm/Messages/UserSettingsPage.elm | 40 +++++++ .../src/main/elm/Page/UserSettings/View2.elm | 48 ++++---- 17 files changed, 371 insertions(+), 152 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ColorData.elm create mode 100644 modules/webapp/src/main/elm/Messages/FieldsData.elm create mode 100644 modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/UserSettingsPage.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 9000009e..a517f10e 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -130,7 +130,7 @@ mainContent model = viewManageData model UserSettingPage -> - viewUserSettings model + viewUserSettings texts model QueuePage -> viewQueue texts model @@ -440,12 +440,21 @@ viewManageData model = ] -viewUserSettings : Model -> List (Html Msg) -viewUserSettings model = +viewUserSettings : Messages -> Model -> List (Html Msg) +viewUserSettings texts model = [ Html.map UserSettingsMsg - (UserSettings.viewSidebar model.sidebarVisible model.flags model.uiSettings model.userSettingsModel) + (UserSettings.viewSidebar texts.userSettings + model.sidebarVisible + model.flags + model.uiSettings + model.userSettingsModel + ) , Html.map UserSettingsMsg - (UserSettings.viewContent model.flags model.uiSettings model.userSettingsModel) + (UserSettings.viewContent texts.userSettings + model.flags + model.uiSettings + model.userSettingsModel + ) ] diff --git a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm index 6c2e9410..6dd20221 100644 --- a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm +++ b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm @@ -16,6 +16,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http +import Messages.ChangePasswordFormComp exposing (Texts) import Styles as S import Util.Http @@ -179,8 +180,8 @@ update flags msg model = --- View2 -view2 : Model -> Html Msg -view2 model = +view2 : Texts -> Model -> Html Msg +view2 texts model = let currentEmpty = model.current == Nothing @@ -195,11 +196,12 @@ view2 model = [ class "flex flex-col space-y-4 relative" ] [ div [] [ label [ class S.inputLabel ] - [ text "Current Password" + [ text texts.currentPassword , B.inputRequired ] , Html.map SetCurrent (Comp.PasswordInput.view2 + { placeholder = texts.currentPasswordPlaceholder } model.current currentEmpty model.currentModel @@ -209,11 +211,12 @@ view2 model = [ label [ class S.inputLabel ] - [ text "New Password" + [ text texts.newPassword , B.inputRequired ] , Html.map SetNew1 (Comp.PasswordInput.view2 + { placeholder = texts.newPasswordPlaceholder } model.newPass1 pass1Empty model.pass1Model @@ -221,11 +224,12 @@ view2 model = ] , div [] [ label [ class S.inputLabel ] - [ text "New Password (repeat)" + [ text texts.repeatPassword , B.inputRequired ] , Html.map SetNew2 (Comp.PasswordInput.view2 + { placeholder = texts.repeatPasswordPlaceholder } model.newPass2 pass2Empty model.pass2Model diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index 5303068a..b233d42f 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -250,6 +250,7 @@ view2 settings model = ] , Html.map PassMsg (Comp.PasswordInput.view2 + { placeholder = "Password" } model.password False model.passField diff --git a/modules/webapp/src/main/elm/Comp/FieldListSelect.elm b/modules/webapp/src/main/elm/Comp/FieldListSelect.elm index 7cfc20a9..50f72c49 100644 --- a/modules/webapp/src/main/elm/Comp/FieldListSelect.elm +++ b/modules/webapp/src/main/elm/Comp/FieldListSelect.elm @@ -1,6 +1,7 @@ module Comp.FieldListSelect exposing ( Model , Msg + , ViewSettings , update , view2 ) @@ -49,17 +50,23 @@ addField selected field = --- View2 -view2 : String -> Model -> Html Msg -view2 classes selected = +type alias ViewSettings = + { fieldLabel : Field -> String + , classes : String + } + + +view2 : ViewSettings -> Model -> Html Msg +view2 cfg selected = div [ class "flex flex-col space-y-4 md:space-y-2" - , class classes + , class cfg.classes ] - (List.map (fieldCheckbox2 selected) Data.Fields.all) + (List.map (fieldCheckbox2 cfg selected) Data.Fields.all) -fieldCheckbox2 : Model -> Field -> Html Msg -fieldCheckbox2 selected field = +fieldCheckbox2 : ViewSettings -> Model -> Field -> Html Msg +fieldCheckbox2 cfg selected field = let isChecked = List.member field selected @@ -69,5 +76,5 @@ fieldCheckbox2 selected field = { id = "field-toggle-" ++ Data.Fields.toString field , value = isChecked , tagger = \_ -> Toggle field - , label = Data.Fields.label field + , label = cfg.fieldLabel field } diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index d1a9d647..8f05ea4e 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -238,6 +238,7 @@ view2 settings model = [ text "IMAP Password" ] , Html.map PassMsg (Comp.PasswordInput.view2 + { placeholder = "Password" } model.password False model.passField diff --git a/modules/webapp/src/main/elm/Comp/PasswordInput.elm b/modules/webapp/src/main/elm/Comp/PasswordInput.elm index 70fc645b..7d245be5 100644 --- a/modules/webapp/src/main/elm/Comp/PasswordInput.elm +++ b/modules/webapp/src/main/elm/Comp/PasswordInput.elm @@ -49,8 +49,13 @@ update msg model = --- View2 -view2 : Maybe String -> Bool -> Model -> Html Msg -view2 pw isError model = +type alias ViewSettings = + { placeholder : String + } + + +view2 : ViewSettings -> Maybe String -> Bool -> Model -> Html Msg +view2 cfg pw isError model = div [ class "relative" ] [ div [ class S.inputIcon ] [ i @@ -81,7 +86,7 @@ view2 pw isError model = else "" - , placeholder "Password" + , placeholder cfg.placeholder ] [] , a diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 44d42bab..4c4c2089 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -29,6 +29,7 @@ import Html.Events exposing (onClick, onInput) import Http import Markdown import Messages +import Messages.UiSettingsFormComp exposing (Texts) import Set exposing (Set) import Styles as S import UiLanguage exposing (UiLanguage) @@ -52,7 +53,6 @@ type alias Model = , searchMenuTagCatCountModel : Comp.IntField.Model , formFields : List Field , itemDetailShortcuts : Bool - , editMenuVisible : Bool , cardPreviewSize : BasicSize , cardTitlePattern : PatternModel , cardSubtitlePattern : PatternModel @@ -146,7 +146,6 @@ init flags settings = "Number of categories in search menu" , formFields = settings.formFields , itemDetailShortcuts = settings.itemDetailShortcuts - , editMenuVisible = settings.editMenuVisible , cardPreviewSize = settings.cardPreviewSize , cardTitlePattern = initPatternModel settings.cardTitleTemplate , cardSubtitlePattern = initPatternModel settings.cardSubtitleTemplate @@ -174,7 +173,6 @@ type Msg | SearchMenuTagCatMsg Comp.IntField.Msg | FieldListMsg Comp.FieldListSelect.Msg | ToggleItemDetailShortcuts - | ToggleEditMenuVisible | CardPreviewSizeMsg Comp.BasicSizeField.Msg | SetCardTitlePattern String | SetCardSubtitlePattern String @@ -340,15 +338,6 @@ update sett msg model = , Just { sett | itemDetailShortcuts = flag } ) - ToggleEditMenuVisible -> - let - flag = - not model.editMenuVisible - in - ( { model | editMenuVisible = flag } - , Just { sett | editMenuVisible = flag } - ) - CardPreviewSizeMsg lm -> let next = @@ -476,22 +465,22 @@ update sett msg model = --- View2 -tagColorViewOpts2 : Comp.ColorTagger.ViewOpts -tagColorViewOpts2 = +tagColorViewOpts2 : Texts -> Comp.ColorTagger.ViewOpts +tagColorViewOpts2 texts = { renderItem = - \( k, v ) -> + \( _, v ) -> span [ class (" label " ++ Data.Color.toString2 v) ] - [ text k ] - , label = "Choose color for tag categories" - , description = Just "Tags can be represented differently based on their category." + [ text (texts.colorLabel v) ] + , label = texts.chooseTagColorLabel + , description = Just texts.tagColorDescription } -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 flags settings model = +view2 : Texts -> Flags -> UiSettings -> Model -> Html Msg +view2 texts flags settings model = let state tab = - if Set.member tab.title model.openTabs then + if Set.member tab.name model.openTabs then Comp.Tabs.Open else @@ -501,12 +490,12 @@ view2 flags settings model = [ Comp.Tabs.akkordion Comp.Tabs.defaultStyle (\t -> ( state t, ToggleAkkordionTab t.title )) - (settingFormTabs flags settings model) + (settingFormTabs texts flags settings model) ] -settingFormTabs : Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) -settingFormTabs flags _ model = +settingFormTabs : Texts -> Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) +settingFormTabs texts flags _ model = let langCfg = { display = \lang -> Messages.get lang |> .label @@ -514,7 +503,7 @@ settingFormTabs flags _ model = , style = DS.mainStyle } in - [ { title = "General" + [ { title = texts.general , titleRight = [] , info = Nothing , body = @@ -522,13 +511,13 @@ settingFormTabs flags _ model = [ MB.viewItem <| MB.Checkbox { id = "uisetting-sidemenu-visible" - , label = "Show side menu by default" + , label = texts.showSideMenuByDefault , tagger = \_ -> ToggleSideMenuVisible , value = model.sideMenuVisible } ] , div [ class "mb-4" ] - [ label [ class S.inputLabel ] [ text "UI Language" ] + [ label [ class S.inputLabel ] [ text texts.uiLanguage ] , Html.map UiLangMsg (Comp.FixedDropdown.viewStyled2 langCfg @@ -539,16 +528,13 @@ settingFormTabs flags _ model = ] ] } - , { title = "Item Search" + , { title = texts.itemSearch , titleRight = [] , info = Nothing , body = [ Html.map SearchPageSizeMsg (Comp.IntField.viewWithInfo2 - ("Maximum results in one page when searching items. At most " - ++ String.fromInt flags.config.maxPageSize - ++ "." - ) + (texts.maxResultsPerPageInfo flags.config.maxPageSize) model.itemSearchPageSize "mb-4" model.searchPageSizeModel @@ -559,7 +545,7 @@ settingFormTabs flags _ model = { id = "uisetting-searchstats-visible" , value = model.searchStatsVisible , tagger = \_ -> ToggleSearchStatsVisible - , label = "Show basic search statistics by default" + , label = texts.showBasicSearchStatsByDefault } ] , div [ class "mb-4" ] @@ -568,21 +554,18 @@ settingFormTabs flags _ model = { id = "uisetting-powersearch-enabled" , value = model.powerSearchEnabled , tagger = \_ -> TogglePowerSearch - , label = "Enable power-user search bar" + , label = texts.enablePowerSearch } ] ] } - , { title = "Item Cards" + , { title = texts.itemCards , titleRight = [] , info = Nothing , body = [ Html.map NoteLengthMsg (Comp.IntField.viewWithInfo2 - ("Maximum size of the item notes to display in card view. Between 0 - " - ++ String.fromInt flags.config.maxNoteLength - ++ "." - ) + (texts.maxNoteSizeInfo flags.config.maxNoteLength) model.itemSearchNoteLength "mb-4" model.searchNoteLengthModel @@ -590,16 +573,16 @@ settingFormTabs flags _ model = , Html.map CardPreviewSizeMsg (Comp.BasicSizeField.view2 "mb-4" - "Size of item preview" + texts.sizeOfItemPreview model.cardPreviewSize ) , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Card Title Pattern" + [ text texts.cardTitlePattern , a [ class "float-right" , class S.link - , title "Toggle pattern help text" + , title texts.togglePatternHelpText , href "#" , onClick TogglePatternHelpMsg ] @@ -616,11 +599,11 @@ settingFormTabs flags _ model = ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Card Subtitle Pattern" + [ text texts.cardSubtitlePattern , a [ class "float-right" , class S.link - , title "Toggle pattern help text" + , title texts.togglePatternHelpText , href "#" , onClick TogglePatternHelpMsg ] @@ -644,34 +627,34 @@ settingFormTabs flags _ model = IT.helpMessage ] } - , { title = "Search Menu" + , { title = texts.searchMenu , titleRight = [] , info = Nothing , body = [ Html.map SearchMenuTagMsg (Comp.IntField.viewWithInfo2 - "How many tags to display in search menu at once. Others can be expanded. Use 0 to always show all." + texts.searchMenuTagCountInfo model.searchMenuTagCount "mb-4" model.searchMenuTagCountModel ) , Html.map SearchMenuTagCatMsg (Comp.IntField.viewWithInfo2 - "How many categories to display in search menu at once. Others can be expanded. Use 0 to always show all." + texts.searchMenuCatCountInfo model.searchMenuTagCatCount "mb-4" model.searchMenuTagCatCountModel ) , Html.map SearchMenuFolderMsg (Comp.IntField.viewWithInfo2 - "How many folders to display in search menu at once. Other folders can be expanded. Use 0 to always show all." + texts.searchMenuFolderCountInfo model.searchMenuFolderCount "mb-4" model.searchMenuFolderCountModel ) ] } - , { title = "Item Detail" + , { title = texts.itemDetail , titleRight = [] , info = Nothing , body = @@ -679,7 +662,7 @@ settingFormTabs flags _ model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> TogglePdfPreview - , label = "Browser-native PDF preview" + , label = texts.browserNativePdfView , value = model.nativePdfPreview , id = "uisetting-pdfpreview-toggle" } @@ -688,44 +671,37 @@ settingFormTabs flags _ model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleItemDetailShortcuts - , label = "Use keyboard shortcuts for navigation and confirm/unconfirm with open edit menu." + , label = texts.keyboardShortcutLabel , value = model.itemDetailShortcuts , id = "uisetting-itemdetailshortcuts-toggle" } ] - , div [ class "mb-4 hidden" ] - [ MB.viewItem <| - MB.Checkbox - { id = "uisetting-editmenu-visible" - , value = model.editMenuVisible - , tagger = \_ -> ToggleEditMenuVisible - , label = "Show edit side menu by default" - } - ] ] } - , { title = "Tag Category Colors" + , { title = texts.tagCategoryColors , titleRight = [] , info = Nothing , body = [ Html.map TagColorMsg (Comp.ColorTagger.view2 model.tagColors - tagColorViewOpts2 + (tagColorViewOpts2 texts) model.tagColorModel ) ] } - , { title = "Fields" + , { title = texts.fields , titleRight = [] , info = Nothing , body = [ span [ class "opacity-50 text-sm" ] - [ text "Choose which fields to display in search and edit menus." + [ text texts.fieldsInfo ] , Html.map FieldListMsg (Comp.FieldListSelect.view2 - "px-2" + { classes = "px-2" + , fieldLabel = texts.fieldLabel + } model.formFields ) ] diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm b/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm index 7cd87d50..1e8cfd7a 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm @@ -14,6 +14,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.UiSettingsManageComp exposing (Texts) import Ports import Styles as S @@ -125,15 +126,15 @@ isSuccess model = Maybe.map .success model.message == Just True -view2 : Flags -> UiSettings -> String -> Model -> Html Msg -view2 flags settings classes model = +view2 : Texts -> Flags -> UiSettings -> String -> Model -> Html Msg +view2 texts flags settings classes model = div [ class classes ] [ MB.view { start = [ MB.PrimaryButton { tagger = Submit - , label = "Submit" - , title = "Save settings" + , label = texts.basics.submit + , title = texts.saveSettings , icon = Just "fa fa-save" } ] @@ -153,6 +154,7 @@ view2 flags settings classes model = ] , Html.map UiSettingsFormMsg (Comp.UiSettingsForm.view2 + texts.uiSettingsForm flags settings model.formModel diff --git a/modules/webapp/src/main/elm/Data/Fields.elm b/modules/webapp/src/main/elm/Data/Fields.elm index ef977d38..d0cf4f3c 100644 --- a/modules/webapp/src/main/elm/Data/Fields.elm +++ b/modules/webapp/src/main/elm/Data/Fields.elm @@ -3,7 +3,6 @@ module Data.Fields exposing , all , fromList , fromString - , label , sort , toString ) @@ -130,46 +129,6 @@ toString field = "sourcename" -label : Field -> String -label field = - case field of - Tag -> - "Tag" - - Folder -> - "Folder" - - CorrOrg -> - "Correspondent Organization" - - CorrPerson -> - "Correspondent Person" - - ConcPerson -> - "Concerning Person" - - ConcEquip -> - "Concerned Equipment" - - Date -> - "Date" - - DueDate -> - "Due Date" - - Direction -> - "Direction" - - PreviewImage -> - "Preview Image" - - CustomFields -> - "Custom Fields" - - SourceName -> - "Item Source" - - fromList : List String -> List Field fromList strings = List.filterMap fromString strings diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index 69d8d155..3b334e37 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -13,6 +13,7 @@ import Messages.NewInvitePage import Messages.QueuePage import Messages.RegisterPage import Messages.UploadPage +import Messages.UserSettingsPage import UiLanguage exposing (UiLanguage(..)) @@ -31,6 +32,7 @@ type alias Messages = , upload : Messages.UploadPage.Texts , itemDetail : Messages.ItemDetailPage.Texts , queue : Messages.QueuePage.Texts + , userSettings : Messages.UserSettingsPage.Texts } @@ -91,6 +93,7 @@ gb = , upload = Messages.UploadPage.gb , itemDetail = Messages.ItemDetailPage.gb , queue = Messages.QueuePage.gb + , userSettings = Messages.UserSettingsPage.gb } @@ -108,4 +111,5 @@ de = , upload = Messages.UploadPage.de , itemDetail = Messages.ItemDetailPage.de , queue = Messages.QueuePage.de + , userSettings = Messages.UserSettingsPage.de } diff --git a/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm b/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm new file mode 100644 index 00000000..b2ec9c6d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm @@ -0,0 +1,22 @@ +module Messages.ChangePasswordFormComp exposing (..) + + +type alias Texts = + { currentPassword : String + , newPassword : String + , repeatPassword : String + , currentPasswordPlaceholder : String + , newPasswordPlaceholder : String + , repeatPasswordPlaceholder : String + } + + +gb : Texts +gb = + { currentPassword = "Current Password" + , newPassword = "New Password" + , repeatPassword = "New Password (repeat)" + , currentPasswordPlaceholder = "Password" + , newPasswordPlaceholder = "Password" + , repeatPasswordPlaceholder = "Password" + } diff --git a/modules/webapp/src/main/elm/Messages/ColorData.elm b/modules/webapp/src/main/elm/Messages/ColorData.elm new file mode 100644 index 00000000..fe495cf1 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ColorData.elm @@ -0,0 +1,46 @@ +module Messages.ColorData exposing (..) + +import Data.Color exposing (Color(..)) + + +gb : Color -> String +gb color = + case color of + Red -> + "Rot" + + Orange -> + "Orange" + + Yellow -> + "Yellow" + + Olive -> + "Olive" + + Green -> + "Green" + + Teal -> + "Teal" + + Blue -> + "Blue" + + Violet -> + "Violet" + + Purple -> + "Purple" + + Pink -> + "Pink" + + Brown -> + "Brown" + + Grey -> + "Grey" + + Black -> + "Black" diff --git a/modules/webapp/src/main/elm/Messages/FieldsData.elm b/modules/webapp/src/main/elm/Messages/FieldsData.elm new file mode 100644 index 00000000..1fd406fa --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/FieldsData.elm @@ -0,0 +1,43 @@ +module Messages.FieldsData exposing (..) + +import Data.Fields exposing (Field(..)) + + +gb : Field -> String +gb field = + case field of + Tag -> + "Tag" + + Folder -> + "Folder" + + CorrOrg -> + "Correspondent Organization" + + CorrPerson -> + "Correspondent Person" + + ConcPerson -> + "Concerning Person" + + ConcEquip -> + "Concerned Equipment" + + Date -> + "Date" + + DueDate -> + "Due Date" + + Direction -> + "Direction" + + PreviewImage -> + "Preview Image" + + CustomFields -> + "Custom Fields" + + SourceName -> + "Item Source" diff --git a/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm new file mode 100644 index 00000000..d03d0a85 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm @@ -0,0 +1,77 @@ +module Messages.UiSettingsFormComp exposing (..) + +import Data.Color exposing (Color) +import Data.Fields exposing (Field) +import Messages.ColorData +import Messages.FieldsData + + +type alias Texts = + { general : String + , showSideMenuByDefault : String + , uiLanguage : String + , itemSearch : String + , maxResultsPerPageInfo : Int -> String + , showBasicSearchStatsByDefault : String + , enablePowerSearch : String + , itemCards : String + , maxNoteSizeInfo : Int -> String + , sizeOfItemPreview : String + , cardTitlePattern : String + , togglePatternHelpText : String + , cardSubtitlePattern : String + , searchMenu : String + , searchMenuTagCountInfo : String + , searchMenuCatCountInfo : String + , searchMenuFolderCountInfo : String + , itemDetail : String + , browserNativePdfView : String + , keyboardShortcutLabel : String + , tagCategoryColors : String + , colorLabel : Color -> String + , chooseTagColorLabel : String + , tagColorDescription : String + , fields : String + , fieldsInfo : String + , fieldLabel : Field -> String + } + + +gb : Texts +gb = + { general = "General" + , showSideMenuByDefault = "Show side menu by default" + , uiLanguage = "UI Language" + , itemSearch = "Item Search" + , maxResultsPerPageInfo = + \max -> + "Maximum results in one page when searching items. At most " + ++ String.fromInt max + ++ "." + , showBasicSearchStatsByDefault = "Show basic search statistics by default" + , enablePowerSearch = "Enable power-user search bar" + , itemCards = "Item Cards" + , maxNoteSizeInfo = + \max -> + "Maximum size of the item notes to display in card view. Between 0 - " + ++ String.fromInt max + ++ "." + , sizeOfItemPreview = "Size of item preview" + , cardTitlePattern = "Card Title Pattern" + , togglePatternHelpText = "Toggle pattern help text" + , cardSubtitlePattern = "Card Subtitle Pattern" + , searchMenu = "Search Menu" + , searchMenuTagCountInfo = "How many tags to display in search menu at once. Others can be expanded. Use 0 to always show all." + , searchMenuCatCountInfo = "How many categories to display in search menu at once. Others can be expanded. Use 0 to always show all." + , searchMenuFolderCountInfo = "How many folders to display in search menu at once. Other folders can be expanded. Use 0 to always show all." + , itemDetail = "Item Detail" + , browserNativePdfView = "Browser-native PDF preview" + , keyboardShortcutLabel = "Use keyboard shortcuts for navigation and confirm/unconfirm with open edit menu." + , tagCategoryColors = "Tag Category Colors" + , colorLabel = Messages.ColorData.gb + , chooseTagColorLabel = "Choose color for tag categories" + , tagColorDescription = "Tags can be represented differently based on their category." + , fields = "Fields" + , fieldsInfo = "Choose which fields to display in search and edit menus." + , fieldLabel = Messages.FieldsData.gb + } diff --git a/modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm new file mode 100644 index 00000000..669e016d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm @@ -0,0 +1,19 @@ +module Messages.UiSettingsManageComp exposing (..) + +import Messages.Basics +import Messages.UiSettingsFormComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , uiSettingsForm : Messages.UiSettingsFormComp.Texts + , saveSettings : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , uiSettingsForm = Messages.UiSettingsFormComp.gb + , saveSettings = "Save settings" + } diff --git a/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm b/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm new file mode 100644 index 00000000..216301dc --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm @@ -0,0 +1,40 @@ +module Messages.UserSettingsPage exposing (..) + +import Messages.ChangePasswordFormComp +import Messages.UiSettingsManageComp + + +type alias Texts = + { changePasswordForm : Messages.ChangePasswordFormComp.Texts + , uiSettingsManage : Messages.UiSettingsManageComp.Texts + , userSettings : String + , uiSettings : String + , notifications : String + , scanMailbox : String + , emailSettingSmtp : String + , emailSettingImap : String + , changePassword : String + , uiSettingsInfo : String + } + + +gb : Texts +gb = + { changePasswordForm = Messages.ChangePasswordFormComp.gb + , uiSettingsManage = Messages.UiSettingsManageComp.gb + , userSettings = "User Settings" + , uiSettings = "UI Settings" + , notifications = "Notifications" + , scanMailbox = "Scan Mailbox" + , emailSettingSmtp = "E-Mail Settings (SMTP)" + , emailSettingImap = "E-Mail Settings (IMAP)" + , changePassword = "Change Password" + , uiSettingsInfo = + "These settings only affect the web ui. They are stored in the browser, " + ++ "so they are separated between browsers and devices." + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm index cbbe02b3..4bcadab8 100644 --- a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm @@ -11,12 +11,13 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.UserSettingsPage exposing (Texts) import Page.UserSettings.Data exposing (..) import Styles as S -viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg -viewSidebar visible _ _ model = +viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg +viewSidebar texts visible _ _ model = div [ id "sidebar" , class S.sidebar @@ -25,7 +26,7 @@ viewSidebar visible _ _ model = ] [ div [ class "" ] [ h1 [ class S.header1 ] - [ text "User Settings" + [ text texts.userSettings ] ] , div [ class "flex flex-col my-2" ] @@ -38,7 +39,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-cog" ] [] , span [ class "ml-3" ] - [ text "UI Settings" ] + [ text texts.uiSettings ] ] , a [ href "#" @@ -49,7 +50,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-bullhorn" ] [] , span [ class "ml-3" ] - [ text "Notifications" ] + [ text texts.notifications ] ] , a [ href "#" @@ -60,7 +61,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-envelope-open font-thin" ] [] , span [ class "ml-3" ] - [ text "Scan Mailbox" ] + [ text texts.scanMailbox ] ] , a [ href "#" @@ -71,7 +72,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-envelope" ] [] , span [ class "ml-3" ] - [ text "E-Mail Settings (SMTP)" ] + [ text texts.emailSettingSmtp ] ] , a [ href "#" @@ -82,7 +83,7 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-envelope" ] [] , span [ class "ml-3" ] - [ text "E-Mail Settings (IMAP)" ] + [ text texts.emailSettingImap ] ] , a [ href "#" @@ -93,21 +94,21 @@ viewSidebar visible _ _ model = [ i [ class "fa fa-user-secret" ] [] , span [ class "ml-3" ] - [ text "Change Password" ] + [ text texts.changePassword ] ] ] ] -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 ChangePassTab -> - viewChangePassword model + viewChangePassword texts model Just EmailSettingsTab -> viewEmailSettings settings model @@ -122,7 +123,7 @@ viewContent flags settings model = viewScanMailboxManage flags settings model Just UiSettingsTab -> - viewUiSettings flags settings model + viewUiSettings texts flags settings model Nothing -> [] @@ -142,38 +143,41 @@ menuEntryActive model tab = class "" -viewChangePassword : Model -> List (Html Msg) -viewChangePassword model = +viewChangePassword : Texts -> Model -> List (Html Msg) +viewChangePassword texts model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-user-secret" ] [] , div [ class "ml-3" ] - [ text "Change Password" + [ text texts.changePassword ] ] - , Html.map ChangePassMsg (Comp.ChangePasswordForm.view2 model.changePassModel) + , Html.map ChangePassMsg + (Comp.ChangePasswordForm.view2 texts.changePasswordForm + model.changePassModel + ) ] -viewUiSettings : Flags -> UiSettings -> Model -> List (Html Msg) -viewUiSettings flags settings model = +viewUiSettings : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewUiSettings texts flags settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-cog" ] [] , span [ class "ml-3" ] - [ text "UI Settings" + [ text texts.uiSettings ] ] , p [ class "opacity-75 text-lg mb-4" ] - [ text "These settings only affect the web ui. They are stored in the browser, " - , text "so they are separated between browsers and devices." + [ text texts.uiSettingsInfo ] , Html.map UiSettingsMsg (Comp.UiSettingsManage.view2 + texts.uiSettingsManage flags settings "" From 594818499e7f9b48709f23f59bec2b5803359fc3 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 4 Apr 2021 15:55:49 +0200 Subject: [PATCH 16/25] Externalize strings in manage-data page --- modules/webapp/src/main/elm/App/View2.elm | 19 +++- .../webapp/src/main/elm/Comp/AddressForm.elm | 21 ++-- .../webapp/src/main/elm/Comp/ContactField.elm | 19 ++-- .../src/main/elm/Comp/CustomFieldForm.elm | 49 ++++----- .../src/main/elm/Comp/CustomFieldManage.elm | 40 ++++--- .../src/main/elm/Comp/CustomFieldTable.elm | 14 +-- .../webapp/src/main/elm/Comp/DetailEdit.elm | 16 ++- modules/webapp/src/main/elm/Comp/Dropdown.elm | 6 +- .../src/main/elm/Comp/EquipmentForm.elm | 7 +- .../src/main/elm/Comp/EquipmentManage.elm | 48 +++++---- .../src/main/elm/Comp/EquipmentTable.elm | 18 ++-- .../webapp/src/main/elm/Comp/FolderDetail.elm | 51 ++++----- .../webapp/src/main/elm/Comp/FolderManage.elm | 42 +++++--- .../webapp/src/main/elm/Comp/FolderTable.elm | 15 ++- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 2 +- modules/webapp/src/main/elm/Comp/OrgForm.elm | 37 ++++--- .../webapp/src/main/elm/Comp/OrgManage.elm | 51 +++++---- modules/webapp/src/main/elm/Comp/OrgTable.elm | 25 +++-- .../webapp/src/main/elm/Comp/PersonForm.elm | 45 +++++--- .../webapp/src/main/elm/Comp/PersonManage.elm | 50 +++++---- .../webapp/src/main/elm/Comp/PersonTable.elm | 13 +-- .../webapp/src/main/elm/Comp/SearchMenu.elm | 2 +- modules/webapp/src/main/elm/Comp/TagForm.elm | 13 +-- .../webapp/src/main/elm/Comp/TagManage.elm | 41 +++---- modules/webapp/src/main/elm/Comp/TagTable.elm | 9 +- .../src/main/elm/Data/CustomFieldType.elm | 20 ---- .../webapp/src/main/elm/Data/EquipmentUse.elm | 11 -- modules/webapp/src/main/elm/Data/OrgUse.elm | 11 -- .../webapp/src/main/elm/Data/PersonUse.elm | 17 --- modules/webapp/src/main/elm/Messages.elm | 4 + .../src/main/elm/Messages/AddressFormComp.elm | 20 ++++ .../webapp/src/main/elm/Messages/Basics.elm | 4 + .../src/main/elm/Messages/ContactTypeData.elm | 25 +++++ .../main/elm/Messages/CustomFieldFormComp.elm | 46 ++++++++ .../elm/Messages/CustomFieldManageComp.elm | 24 +++++ .../elm/Messages/CustomFieldTableComp.elm | 20 ++++ .../main/elm/Messages/CustomFieldTypeData.elm | 22 ++++ .../main/elm/Messages/EquipmentFormComp.elm | 15 +++ .../main/elm/Messages/EquipmentManageComp.elm | 28 +++++ .../main/elm/Messages/EquipmentTableComp.elm | 19 ++++ .../main/elm/Messages/EquipmentUseData.elm | 13 +++ .../main/elm/Messages/FolderDetailComp.elm | 34 ++++++ .../main/elm/Messages/FolderManageComp.elm | 26 +++++ .../src/main/elm/Messages/FolderTableComp.elm | 18 ++++ .../src/main/elm/Messages/ManageDataPage.elm | 49 +++++++++ .../src/main/elm/Messages/OrgFormComp.elm | 38 +++++++ .../src/main/elm/Messages/OrgManageComp.elm | 28 +++++ .../src/main/elm/Messages/OrgTableComp.elm | 24 +++++ .../src/main/elm/Messages/OrgUseData.elm | 13 +++ .../src/main/elm/Messages/PersonFormComp.elm | 44 ++++++++ .../main/elm/Messages/PersonManageComp.elm | 28 +++++ .../src/main/elm/Messages/PersonTableComp.elm | 24 +++++ .../src/main/elm/Messages/PersonUseData.elm | 19 ++++ .../src/main/elm/Messages/TagFormComp.elm | 16 +++ .../src/main/elm/Messages/TagManageComp.elm | 28 +++++ .../src/main/elm/Messages/TagTableComp.elm | 14 +++ .../src/main/elm/Page/ManageData/View2.elm | 102 +++++++++++------- 57 files changed, 1078 insertions(+), 379 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/AddressFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ContactTypeData.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm create mode 100644 modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EquipmentUseData.elm create mode 100644 modules/webapp/src/main/elm/Messages/FolderDetailComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/FolderManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/FolderTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ManageDataPage.elm create mode 100644 modules/webapp/src/main/elm/Messages/OrgFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/OrgManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/OrgTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/OrgUseData.elm create mode 100644 modules/webapp/src/main/elm/Messages/PersonFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/PersonManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/PersonTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/PersonUseData.elm create mode 100644 modules/webapp/src/main/elm/Messages/TagFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/TagManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/TagTableComp.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index a517f10e..ba3cac4e 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -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 + ) ] diff --git a/modules/webapp/src/main/elm/Comp/AddressForm.elm b/modules/webapp/src/main/elm/Comp/AddressForm.elm index fb32a7df..287ddf78 100644 --- a/modules/webapp/src/main/elm/Comp/AddressForm.elm +++ b/modules/webapp/src/main/elm/Comp/AddressForm.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Comp/ContactField.elm b/modules/webapp/src/main/elm/Comp/ContactField.elm index 7dd35484..11078acb 100644 --- a/modules/webapp/src/main/elm/Comp/ContactField.elm +++ b/modules/webapp/src/main/elm/Comp/ContactField.elm @@ -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) ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index 66fe9c4b..afb4b792 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -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 } ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm index b6c596da..f062d834 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm b/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm index 890fc0d1..7e16efdc 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm @@ -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 [] diff --git a/modules/webapp/src/main/elm/Comp/DetailEdit.elm b/modules/webapp/src/main/elm/Comp/DetailEdit.elm index 83950bff..08867e37 100644 --- a/modules/webapp/src/main/elm/Comp/DetailEdit.elm +++ b/modules/webapp/src/main/elm/Comp/DetailEdit.elm @@ -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 } diff --git a/modules/webapp/src/main/elm/Comp/Dropdown.elm b/modules/webapp/src/main/elm/Comp/Dropdown.elm index 02e1c04e..9e1b19e0 100644 --- a/modules/webapp/src/main/elm/Comp/Dropdown.elm +++ b/modules/webapp/src/main/elm/Comp/Dropdown.elm @@ -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 } diff --git a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm index 357f6506..79461883 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm @@ -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 } diff --git a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm index 27df512b..cb570e12 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm index aabaccaa..948fc0dc 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm @@ -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 ] ] diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index 721e7e62..326b7ecf 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -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 == "" ) diff --git a/modules/webapp/src/main/elm/Comp/FolderManage.elm b/modules/webapp/src/main/elm/Comp/FolderManage.elm index cedb2c17..083b0a72 100644 --- a/modules/webapp/src/main/elm/Comp/FolderManage.elm +++ b/modules/webapp/src/main/elm/Comp/FolderManage.elm @@ -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 ) diff --git a/modules/webapp/src/main/elm/Comp/FolderTable.elm b/modules/webapp/src/main/elm/Comp/FolderTable.elm index 7fa2ecf4..6e620303 100644 --- a/modules/webapp/src/main/elm/Comp/FolderTable.elm +++ b/modules/webapp/src/main/elm/Comp/FolderTable.elm @@ -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 [] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index f8b519b1..7be5eaf9 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -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 ) diff --git a/modules/webapp/src/main/elm/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Comp/OrgForm.elm index 3fb2f323..ad869984 100644 --- a/modules/webapp/src/main/elm/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Comp/OrgForm.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Comp/OrgManage.elm b/modules/webapp/src/main/elm/Comp/OrgManage.elm index 1cdc03fe..71c1ba62 100644 --- a/modules/webapp/src/main/elm/Comp/OrgManage.elm +++ b/modules/webapp/src/main/elm/Comp/OrgManage.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Comp/OrgTable.elm b/modules/webapp/src/main/elm/Comp/OrgTable.elm index 33d64e38..4234351c 100644 --- a/modules/webapp/src/main/elm/Comp/OrgTable.elm +++ b/modules/webapp/src/main/elm/Comp/OrgTable.elm @@ -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 ] ] diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index a5b96ab4..1503f027 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Comp/PersonManage.elm b/modules/webapp/src/main/elm/Comp/PersonManage.elm index 6e52da6a..b63f2f89 100644 --- a/modules/webapp/src/main/elm/Comp/PersonManage.elm +++ b/modules/webapp/src/main/elm/Comp/PersonManage.elm @@ -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) ] diff --git a/modules/webapp/src/main/elm/Comp/PersonTable.elm b/modules/webapp/src/main/elm/Comp/PersonTable.elm index 8646cc9f..0cf7002b 100644 --- a/modules/webapp/src/main/elm/Comp/PersonTable.elm +++ b/modules/webapp/src/main/elm/Comp/PersonTable.elm @@ -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 ] ] diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index 93b82f89..d81b0b1d 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -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 ) diff --git a/modules/webapp/src/main/elm/Comp/TagForm.elm b/modules/webapp/src/main/elm/Comp/TagForm.elm index 607f3ab6..d0f921cc 100644 --- a/modules/webapp/src/main/elm/Comp/TagForm.elm +++ b/modules/webapp/src/main/elm/Comp/TagForm.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Comp/TagManage.elm b/modules/webapp/src/main/elm/Comp/TagManage.elm index 33664c83..833fbe06 100644 --- a/modules/webapp/src/main/elm/Comp/TagManage.elm +++ b/modules/webapp/src/main/elm/Comp/TagManage.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Comp/TagTable.elm b/modules/webapp/src/main/elm/Comp/TagTable.elm index 77e36451..b8c089a6 100644 --- a/modules/webapp/src/main/elm/Comp/TagTable.elm +++ b/modules/webapp/src/main/elm/Comp/TagTable.elm @@ -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 [] diff --git a/modules/webapp/src/main/elm/Data/CustomFieldType.elm b/modules/webapp/src/main/elm/Data/CustomFieldType.elm index a9b89719..5bca7135 100644 --- a/modules/webapp/src/main/elm/Data/CustomFieldType.elm +++ b/modules/webapp/src/main/elm/Data/CustomFieldType.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Data/EquipmentUse.elm b/modules/webapp/src/main/elm/Data/EquipmentUse.elm index 7341a2fd..be9f24de 100644 --- a/modules/webapp/src/main/elm/Data/EquipmentUse.elm +++ b/modules/webapp/src/main/elm/Data/EquipmentUse.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Data/OrgUse.elm b/modules/webapp/src/main/elm/Data/OrgUse.elm index ca0f6fec..5f536bd9 100644 --- a/modules/webapp/src/main/elm/Data/OrgUse.elm +++ b/modules/webapp/src/main/elm/Data/OrgUse.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Data/PersonUse.elm b/modules/webapp/src/main/elm/Data/PersonUse.elm index fc5d2060..204d5b92 100644 --- a/modules/webapp/src/main/elm/Data/PersonUse.elm +++ b/modules/webapp/src/main/elm/Data/PersonUse.elm @@ -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 ] diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index 3b334e37..ef8d3956 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -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 } diff --git a/modules/webapp/src/main/elm/Messages/AddressFormComp.elm b/modules/webapp/src/main/elm/Messages/AddressFormComp.elm new file mode 100644 index 00000000..60bcf5a7 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/AddressFormComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm index 089453d3..5237d95f 100644 --- a/modules/webapp/src/main/elm/Messages/Basics.elm +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -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" } diff --git a/modules/webapp/src/main/elm/Messages/ContactTypeData.elm b/modules/webapp/src/main/elm/Messages/ContactTypeData.elm new file mode 100644 index 00000000..8464d08f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ContactTypeData.elm @@ -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" diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm new file mode 100644 index 00000000..9d536715 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm new file mode 100644 index 00000000..b6449cc4 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm new file mode 100644 index 00000000..a3f66c68 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm b/modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm new file mode 100644 index 00000000..2069725b --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm @@ -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" diff --git a/modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm b/modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm new file mode 100644 index 00000000..e5df50d0 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm @@ -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 + } diff --git a/modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm b/modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm new file mode 100644 index 00000000..75c344a2 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm b/modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm new file mode 100644 index 00000000..83dd5288 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm @@ -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 + } diff --git a/modules/webapp/src/main/elm/Messages/EquipmentUseData.elm b/modules/webapp/src/main/elm/Messages/EquipmentUseData.elm new file mode 100644 index 00000000..a10c0eee --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EquipmentUseData.elm @@ -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" diff --git a/modules/webapp/src/main/elm/Messages/FolderDetailComp.elm b/modules/webapp/src/main/elm/Messages/FolderDetailComp.elm new file mode 100644 index 00000000..4714acaf --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/FolderDetailComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/FolderManageComp.elm b/modules/webapp/src/main/elm/Messages/FolderManageComp.elm new file mode 100644 index 00000000..d3d43785 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/FolderManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/FolderTableComp.elm b/modules/webapp/src/main/elm/Messages/FolderTableComp.elm new file mode 100644 index 00000000..e1cfc6ce --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/FolderTableComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/ManageDataPage.elm b/modules/webapp/src/main/elm/Messages/ManageDataPage.elm new file mode 100644 index 00000000..c416169a --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ManageDataPage.elm @@ -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 diff --git a/modules/webapp/src/main/elm/Messages/OrgFormComp.elm b/modules/webapp/src/main/elm/Messages/OrgFormComp.elm new file mode 100644 index 00000000..72e4ec17 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/OrgFormComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/OrgManageComp.elm b/modules/webapp/src/main/elm/Messages/OrgManageComp.elm new file mode 100644 index 00000000..20c6424e --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/OrgManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/OrgTableComp.elm b/modules/webapp/src/main/elm/Messages/OrgTableComp.elm new file mode 100644 index 00000000..5a7fae3d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/OrgTableComp.elm @@ -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 + } diff --git a/modules/webapp/src/main/elm/Messages/OrgUseData.elm b/modules/webapp/src/main/elm/Messages/OrgUseData.elm new file mode 100644 index 00000000..bf318146 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/OrgUseData.elm @@ -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" diff --git a/modules/webapp/src/main/elm/Messages/PersonFormComp.elm b/modules/webapp/src/main/elm/Messages/PersonFormComp.elm new file mode 100644 index 00000000..54f8b612 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/PersonFormComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/PersonManageComp.elm b/modules/webapp/src/main/elm/Messages/PersonManageComp.elm new file mode 100644 index 00000000..d72a23de --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/PersonManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/PersonTableComp.elm b/modules/webapp/src/main/elm/Messages/PersonTableComp.elm new file mode 100644 index 00000000..b87f5920 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/PersonTableComp.elm @@ -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 + } diff --git a/modules/webapp/src/main/elm/Messages/PersonUseData.elm b/modules/webapp/src/main/elm/Messages/PersonUseData.elm new file mode 100644 index 00000000..4db90e04 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/PersonUseData.elm @@ -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" diff --git a/modules/webapp/src/main/elm/Messages/TagFormComp.elm b/modules/webapp/src/main/elm/Messages/TagFormComp.elm new file mode 100644 index 00000000..7e37f3af --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/TagFormComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/TagManageComp.elm b/modules/webapp/src/main/elm/Messages/TagManageComp.elm new file mode 100644 index 00000000..c69b043c --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/TagManageComp.elm @@ -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" + } diff --git a/modules/webapp/src/main/elm/Messages/TagTableComp.elm b/modules/webapp/src/main/elm/Messages/TagTableComp.elm new file mode 100644 index 00000000..611f32c1 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/TagTableComp.elm @@ -0,0 +1,14 @@ +module Messages.TagTableComp exposing (..) + + +type alias Texts = + { name : String + , category : String + } + + +gb : Texts +gb = + { name = "Name" + , category = "Category" + } diff --git a/modules/webapp/src/main/elm/Page/ManageData/View2.elm b/modules/webapp/src/main/elm/Page/ManageData/View2.elm index aee4d244..437f49b7 100644 --- a/modules/webapp/src/main/elm/Page/ManageData/View2.elm +++ b/modules/webapp/src/main/elm/Page/ManageData/View2.elm @@ -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 + ) ] From 9c1beb2240f230a960041fe24e0424ddd648bd97 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 4 Apr 2021 21:57:34 +0200 Subject: [PATCH 17/25] Externalize strings in usersettings page --- .../webapp/src/main/elm/Comp/EmailInput.elm | 17 +- .../src/main/elm/Comp/EmailSettingsForm.elm | 37 +-- .../src/main/elm/Comp/EmailSettingsManage.elm | 47 +-- .../src/main/elm/Comp/EmailSettingsTable.elm | 11 +- .../src/main/elm/Comp/ImapSettingsForm.elm | 33 +-- .../src/main/elm/Comp/ImapSettingsManage.elm | 39 +-- .../src/main/elm/Comp/ImapSettingsTable.elm | 9 +- modules/webapp/src/main/elm/Comp/IntField.elm | 2 + .../src/main/elm/Comp/ItemDetail/EditForm.elm | 31 +- .../elm/Comp/ItemDetail/FieldTabState.elm | 103 ++++++- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 41 +-- .../src/main/elm/Comp/ItemDetail/Update.elm | 8 +- modules/webapp/src/main/elm/Comp/ItemMail.elm | 15 +- .../src/main/elm/Comp/NotificationForm.elm | 70 +++-- .../src/main/elm/Comp/NotificationList.elm | 13 +- .../src/main/elm/Comp/NotificationManage.elm | 29 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 267 ++++++++---------- .../src/main/elm/Comp/ScanMailboxList.elm | 13 +- .../src/main/elm/Comp/ScanMailboxManage.elm | 29 +- .../webapp/src/main/elm/Comp/SearchMenu.elm | 155 ++++++++-- modules/webapp/src/main/elm/Comp/Tabs.elm | 9 +- .../src/main/elm/Comp/UiSettingsForm.elm | 31 +- modules/webapp/src/main/elm/Data/SSLType.elm | 14 - .../elm/Messages/EmailSettingsFormComp.elm | 45 +++ .../elm/Messages/EmailSettingsManageComp.elm | 28 ++ .../elm/Messages/EmailSettingsTableComp.elm | 16 ++ .../elm/Messages/ImapSettingsFormComp.elm | 41 +++ .../elm/Messages/ImapSettingsManageComp.elm | 28 ++ .../elm/Messages/ImapSettingsTableComp.elm | 14 + .../elm/Messages/NotificationFormComp.elm | 62 ++++ .../elm/Messages/NotificationManageComp.elm | 24 ++ .../elm/Messages/NotificationTableComp.elm | 18 ++ .../src/main/elm/Messages/SSLTypeData.elm | 16 ++ .../main/elm/Messages/ScanMailboxFormComp.elm | 133 +++++++++ .../elm/Messages/ScanMailboxManageComp.elm | 24 ++ .../elm/Messages/ScanMailboxTableComp.elm | 18 ++ .../main/elm/Messages/UserSettingsPage.elm | 37 +++ .../src/main/elm/Page/UserSettings/View2.elm | 64 ++--- 38 files changed, 1145 insertions(+), 446 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/NotificationFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/NotificationManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/NotificationTableComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SSLTypeData.elm create mode 100644 modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm diff --git a/modules/webapp/src/main/elm/Comp/EmailInput.elm b/modules/webapp/src/main/elm/Comp/EmailInput.elm index 67cfe6a9..92b5cca6 100644 --- a/modules/webapp/src/main/elm/Comp/EmailInput.elm +++ b/modules/webapp/src/main/elm/Comp/EmailInput.elm @@ -1,6 +1,7 @@ module Comp.EmailInput exposing ( Model , Msg + , ViewSettings , init , update , view2 @@ -137,10 +138,16 @@ update flags current msg model = --- View2 -view2 : DS.DropdownStyle -> List String -> Model -> Html Msg -view2 style values model = +type alias ViewSettings = + { placeholder : String + , style : DS.DropdownStyle + } + + +view2 : ViewSettings -> List String -> Model -> Html Msg +view2 cfg values model = div [ class "text-sm flex-row space-x-2 relative" ] - [ div [ class style.link ] + [ div [ class cfg.style.link ] [ div [ class "flex flex-row space-x-2 mr-2" , classList [ ( "hidden", List.isEmpty values ) ] @@ -149,7 +156,7 @@ view2 style values model = , input [ type_ "text" , value model.input - , placeholder "Recipients…" + , placeholder cfg.placeholder , onKeyUp KeyPress , onInput SetInput , class "inline-flex w-24 border-0 px-0 focus:ring-0 h-6 text-sm" @@ -157,7 +164,7 @@ view2 style values model = ] [] ] - , renderMenu2 style model + , renderMenu2 cfg.style model ] diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index b233d42f..1119eb69 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -21,6 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) +import Messages.EmailSettingsFormComp exposing (Texts) import Styles as S import Util.Maybe @@ -170,13 +171,13 @@ update msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = let sslCfg = { makeOption = \s -> - { text = Data.SSLType.label s + { text = texts.sslTypeLabel s , additional = "" } , placeholder = "" @@ -189,14 +190,14 @@ view2 settings model = [ label [ class S.inputLabel ] - [ text "Name" + [ text texts.name , B.inputRequired ] , input [ type_ "text" , value model.name , onInput SetName - , placeholder "Connection name, e.g. 'gmail.com'" + , placeholder texts.connectionPlaceholder , class S.textInput , classList [ ( S.inputErrorBorder, model.name == "" ) ] ] @@ -205,17 +206,17 @@ view2 settings model = [ class S.message , class "mt-2" ] - [ text "The connection name must not contain whitespace or special characters." + [ text texts.connectionNameInfo ] ] , div [ class "col-span-3" ] [ label [ class S.inputLabel ] - [ text "SMTP Host" + [ text texts.smtpHost , B.inputRequired ] , input [ type_ "text" - , placeholder "SMTP host name, e.g. 'mail.gmail.com'" + , placeholder texts.smtpHostPlaceholder , value model.host , onInput SetHost , class S.textInput @@ -233,11 +234,11 @@ view2 settings model = [ label [ class S.inputLabel ] - [ text "SMTP User" + [ text texts.smtpUser ] , input [ type_ "text" - , placeholder "SMTP Username, e.g. 'your.name@gmail.com'" + , placeholder texts.smtpUserPlaceholder , Maybe.withDefault "" model.user |> value , onInput SetUser , class S.textInput @@ -246,11 +247,11 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "SMTP Password" + [ text texts.smtpPassword ] , Html.map PassMsg (Comp.PasswordInput.view2 - { placeholder = "Password" } + { placeholder = texts.smtpPasswordPlaceholder } model.password False model.passField @@ -258,12 +259,12 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "From Address" + [ text texts.fromAddress , B.inputRequired ] , input [ type_ "text" - , placeholder "Sender E-Mail address" + , placeholder texts.fromAddressPlaceholder , value model.from , onInput SetFrom , class S.textInput @@ -273,11 +274,11 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "Reply-To" + [ text texts.replyTo ] , input [ type_ "text" - , placeholder "Optional reply-to E-Mail address" + , placeholder texts.replyToPlaceholder , Maybe.withDefault "" model.replyTo |> value , onInput SetReplyTo , class S.textInput @@ -286,7 +287,7 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "SSL" + [ text texts.ssl ] , Html.map SSLTypeMsg (Comp.Dropdown.view2 @@ -299,7 +300,7 @@ view2 settings model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleCheckCert - , label = "Ignore certificate check" + , label = texts.ignoreCertCheck , value = model.ignoreCertificates , id = "smpt-no-cert-check" } diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm index 97c5c46d..1698f297 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm @@ -21,6 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http +import Messages.EmailSettingsManageComp exposing (Texts) import Styles as S import Util.Http @@ -206,71 +207,74 @@ update flags msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = case model.viewMode of Table -> - viewTable2 model + viewTable2 texts model Form -> - viewForm2 settings model + viewForm2 texts settings model -viewTable2 : Model -> Html Msg -viewTable2 model = +viewTable2 : Texts -> Model -> Html Msg +viewTable2 texts model = div [] [ 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 = InitNew - , title = "Add new SMTP settings" + , title = texts.addNewSmtpSettings , icon = Just "fa fa-plus" - , label = "New Settings" + , label = texts.newSettings } ] , rootClasses = "mb-4" } - , Html.map TableMsg (Comp.EmailSettingsTable.view2 model.tableModel) + , Html.map TableMsg + (Comp.EmailSettingsTable.view2 texts.settingsTable + model.tableModel + ) ] -viewForm2 : UiSettings -> Model -> Html Msg -viewForm2 settings model = +viewForm2 : Texts -> UiSettings -> Model -> Html Msg +viewForm2 texts settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete these connection?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteConnection in div [ class "flex flex-col md:relative" ] [ MB.view { 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 model.formModel.settings.name /= "" then [ MB.DeleteButton { tagger = RequestDelete - , title = "Delete this settings entry" + , title = texts.deleteThisEntry , icon = Just "fa fa-trash" - , label = "Delete" + , label = texts.basics.delete } ] @@ -288,7 +292,10 @@ viewForm2 settings model = [ Maybe.withDefault "" model.formError |> text ] , Html.map FormMsg - (Comp.EmailSettingsForm.view2 settings model.formModel) + (Comp.EmailSettingsForm.view2 texts.settingsForm + settings + model.formModel + ) , Html.map YesNoMsg (Comp.YesNoDimmer.viewN True diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm index 4cf15b04..52707781 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm @@ -11,6 +11,7 @@ import Api.Model.EmailSettings exposing (EmailSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) +import Messages.EmailSettingsTableComp exposing (Texts) import Styles as S @@ -47,15 +48,15 @@ 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 mr-2" ] [ text "Name" ] - , th [ class "text-left mr-2" ] [ text "Host/Port" ] - , th [ class "text-left mr-2 hidden sm:table-cell" ] [ text "From" ] + , th [ class "text-left mr-2" ] [ text texts.name ] + , th [ class "text-left mr-2" ] [ text texts.hostPort ] + , th [ class "text-left mr-2 hidden sm:table-cell" ] [ text texts.from ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index 8f05ea4e..46426a53 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -21,6 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) +import Messages.ImapSettingsFormComp exposing (Texts) import Styles as S import Util.Maybe @@ -162,13 +163,13 @@ update msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = let sslCfg = { makeOption = \s -> - { text = Data.SSLType.label s + { text = texts.sslTypeLabel s , additional = "" } , placeholder = "" @@ -180,14 +181,14 @@ view2 settings model = [ class "grid grid-cols-4 gap-y-4 gap-x-2" ] [ div [ class "col-span-4" ] [ label [ class S.inputLabel ] - [ text "Name" + [ text texts.name , B.inputRequired ] , input [ type_ "text" , value model.name , onInput SetName - , placeholder "Connection name, e.g. 'gmail.com'" + , placeholder texts.connectionNamePlaceholder , class S.textInput , classList [ ( S.inputErrorBorder, model.name == "" ) ] ] @@ -196,17 +197,17 @@ view2 settings model = [ class S.message , class "mt-2" ] - [ text "The connection name must not contain whitespace or special characters." + [ text texts.connectionNameInfo ] ] , div [ class "col-span-3" ] [ label [ class S.inputLabel ] - [ text "IMAP Host" + [ text texts.imapHost , B.inputRequired ] , input [ type_ "text" - , placeholder "IMAP host name, e.g. 'mail.gmail.com'" + , placeholder texts.imapHostPlaceholder , value model.host , onInput SetHost , class S.textInput @@ -222,11 +223,11 @@ view2 settings model = ) , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "IMAP User" + [ text texts.imapUser ] , input [ type_ "text" - , placeholder "IMAP Username, e.g. 'your.name@gmail.com'" + , placeholder texts.imapUserPlaceholder , Maybe.withDefault "" model.user |> value , onInput SetUser , class S.textInput @@ -235,10 +236,10 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "IMAP Password" ] + [ text texts.imapPassword ] , Html.map PassMsg (Comp.PasswordInput.view2 - { placeholder = "Password" } + { placeholder = texts.imapPasswordPlaceholder } model.password False model.passField @@ -246,7 +247,7 @@ view2 settings model = ] , div [ class "col-span-4 sm:col-span-2" ] [ label [ class S.inputLabel ] - [ text "SSL" + [ text texts.ssl ] , Html.map SSLTypeMsg (Comp.Dropdown.view2 @@ -259,7 +260,7 @@ view2 settings model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleCheckCert - , label = "Ignore certificate check" + , label = texts.ignoreCertCheck , value = model.ignoreCertificates , id = "imap-no-cert-check" } @@ -268,12 +269,12 @@ view2 settings model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleUseOAuth - , label = "Enable OAuth2 authentication" + , label = texts.enableOAuth2 , value = model.useOAuthToken , id = "imap-use-oauth" } , div [ class "opacity-50 text-sm" ] - [ text "Enabling this, allows to connect via XOAuth using the password as access token." + [ text texts.oauth2Info ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm index a36dfb58..48c04dd1 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm @@ -21,6 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http +import Messages.ImapSettingsManageComp exposing (Texts) import Styles as S import Util.Http @@ -206,74 +207,75 @@ update flags msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = case model.viewMode of Table -> - viewTable2 model + viewTable2 texts model Form -> - viewForm2 settings model + viewForm2 texts settings model -viewTable2 : Model -> Html Msg -viewTable2 model = +viewTable2 : Texts -> Model -> Html Msg +viewTable2 texts model = div [] [ 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 = InitNew - , title = "Add new SMTP settings" + , title = texts.addNewImapSettings , icon = Just "fa fa-plus" - , label = "New Settings" + , label = texts.newSettings } ] , rootClasses = "mb-4" } , Html.map TableMsg (Comp.ImapSettingsTable.view2 + texts.imapTable model.tableModel ) ] -viewForm2 : UiSettings -> Model -> Html Msg -viewForm2 settings model = +viewForm2 : Texts -> UiSettings -> Model -> Html Msg +viewForm2 texts settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete this mail-box connection?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteSettings in div [ class "flex flex-col md:relative" ] [ MB.view { 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 model.formModel.settings.name /= "" then [ MB.DeleteButton { tagger = RequestDelete - , title = "Delete this settings entry" + , title = texts.deleteThisEntry , icon = Just "fa fa-trash" - , label = "Delete" + , label = texts.basics.delete } ] @@ -292,6 +294,7 @@ viewForm2 settings model = ] , Html.map FormMsg (Comp.ImapSettingsForm.view2 + texts.imapForm settings model.formModel ) diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm index e6a708e7..2ae6c551 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm @@ -11,6 +11,7 @@ import Api.Model.ImapSettings exposing (ImapSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) +import Messages.ImapSettingsTableComp exposing (Texts) import Styles as S @@ -47,14 +48,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 [] [] - , th [ class "text-left mr-2" ] [ text "Name" ] - , th [ class "text-left mr-2" ] [ text "Host/Port" ] + , th [ class "text-left mr-2" ] [ text texts.name ] + , th [ class "text-left mr-2" ] [ text texts.hostPort ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/IntField.elm b/modules/webapp/src/main/elm/Comp/IntField.elm index a62fe41b..49ee0adf 100644 --- a/modules/webapp/src/main/elm/Comp/IntField.elm +++ b/modules/webapp/src/main/elm/Comp/IntField.elm @@ -8,6 +8,8 @@ module Comp.IntField exposing , viewWithInfo2 ) +--- L10N TODO + import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index 7be5eaf9..3cedc45f 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -3,7 +3,7 @@ module Comp.ItemDetail.EditForm exposing (formTabs, view2) import Comp.CustomFieldMultiInput import Comp.DatePicker import Comp.Dropdown -import Comp.ItemDetail.FieldTabState as FTabState +import Comp.ItemDetail.FieldTabState as FTabState exposing (EditTab(..)) import Comp.ItemDetail.Model exposing ( Model @@ -143,7 +143,8 @@ formTabs flags settings model = , style = dds } in - [ { title = "Name" + [ { name = FTabState.tabName TabName + , title = "Name" , titleRight = [] , info = Nothing , body = @@ -169,7 +170,8 @@ formTabs flags settings model = ] ] } - , { title = "Date" + , { name = FTabState.tabName TabDate + , title = "Date" , titleRight = [] , info = Nothing , body = @@ -194,7 +196,8 @@ formTabs flags settings model = ] ] } - , { title = "Tags" + , { name = FTabState.tabName TabTags + , title = "Tags" , titleRight = [] , info = Nothing , body = @@ -217,7 +220,8 @@ formTabs flags settings model = ] ] } - , { title = "Folder" + , { name = FTabState.tabName TabFolder + , title = "Folder" , titleRight = [] , info = Nothing , body = @@ -243,7 +247,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Custom Fields" + , { name = FTabState.tabName TabCustomFields + , title = "Custom Fields" , titleRight = [] , info = Nothing , body = @@ -257,7 +262,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Due Date" + , { name = FTabState.tabName TabDueDate + , title = "Due Date" , titleRight = [] , info = Nothing , body = @@ -282,7 +288,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Correspondent" + , { name = FTabState.tabName TabCorrespondent + , title = "Correspondent" , titleRight = [] , info = Nothing , body = @@ -331,7 +338,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Concerning" + , { name = FTabState.tabName TabConcerning + , title = "Concerning" , titleRight = [] , info = Nothing , body = @@ -373,7 +381,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Direction" + , { name = FTabState.tabName TabDirection + , title = "Direction" , titleRight = [] , info = Nothing , body = @@ -494,4 +503,4 @@ tabState settings allNames model = FTabState.tabState settings openTabs Nothing - (.title >> ToggleAkkordionTab) + (.name >> ToggleAkkordionTab) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm index 8952f2b5..b1d39ece 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm @@ -1,4 +1,4 @@ -module Comp.ItemDetail.FieldTabState exposing (tabState) +module Comp.ItemDetail.FieldTabState exposing (EditTab(..), findTab, tabName, tabState) import Comp.CustomFieldMultiInput import Comp.Tabs as TB @@ -7,6 +7,87 @@ import Data.UiSettings exposing (UiSettings) import Set exposing (Set) +type EditTab + = TabName + | TabDate + | TabTags + | TabFolder + | TabCustomFields + | TabDueDate + | TabCorrespondent + | TabConcerning + | TabDirection + | TabConfirmUnconfirm + + +tabName : EditTab -> String +tabName tab = + case tab of + TabName -> + "name" + + TabTags -> + "tags" + + TabDate -> + "date" + + TabFolder -> + "folder" + + TabCustomFields -> + "custom-fields" + + TabDueDate -> + "due-date" + + TabCorrespondent -> + "correspondent" + + TabConcerning -> + "concerning" + + TabDirection -> + "direction" + + TabConfirmUnconfirm -> + "confirm-unconfirm" + + +findTab : TB.Tab msg -> Maybe EditTab +findTab tab = + case tab.name of + "name" -> + Just TabName + + "tags" -> + Just TabTags + + "date" -> + Just TabDate + + "folder" -> + Just TabFolder + + "custom-fields" -> + Just TabCustomFields + + "due-date" -> + Just TabDueDate + + "correspondent" -> + Just TabCorrespondent + + "concerning" -> + Just TabConcerning + + "direction" -> + Just TabDirection + + _ -> + Nothing + + tabState : UiSettings -> Set String @@ -20,32 +101,32 @@ tabState settings openTabs cfmodel toggle tab = Data.UiSettings.fieldHidden settings f hidden = - case tab.title of - "Tags" -> + case findTab tab of + Just TabTags -> isHidden Data.Fields.Tag - "Folder" -> + Just TabFolder -> isHidden Data.Fields.Folder - "Correspondent" -> + Just TabCorrespondent -> isHidden Data.Fields.CorrOrg && isHidden Data.Fields.CorrPerson - "Concerning" -> + Just TabConcerning -> isHidden Data.Fields.ConcEquip && isHidden Data.Fields.ConcPerson - "Custom Fields" -> + Just TabCustomFields -> isHidden Data.Fields.CustomFields || (Maybe.map Comp.CustomFieldMultiInput.isEmpty cfmodel |> Maybe.withDefault False ) - "Date" -> + Just TabDate -> isHidden Data.Fields.Date - "Due Date" -> + Just TabDueDate -> isHidden Data.Fields.DueDate - "Direction" -> + Just TabDirection -> isHidden Data.Fields.Direction _ -> @@ -55,7 +136,7 @@ tabState settings openTabs cfmodel toggle tab = if hidden then TB.Hidden - else if Set.member tab.title openTabs then + else if Set.member tab.name openTabs then TB.Open else diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index 5d4ed591..cc734ea7 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -22,7 +22,7 @@ import Comp.CustomFieldMultiInput import Comp.DatePicker import Comp.DetailEdit import Comp.Dropdown exposing (isDropdownChangeMsg) -import Comp.ItemDetail.FieldTabState as FTabState +import Comp.ItemDetail.FieldTabState as FTabState exposing (EditTab(..), tabName) import Comp.ItemDetail.FormChange exposing (FormChange(..)) import Comp.Tabs as TB import Data.CustomFieldChange exposing (CustomFieldChange(..)) @@ -48,7 +48,6 @@ import Time import Util.Folder exposing (mkFolderOption) import Util.List import Util.Maybe -import Util.Person import Util.Tag @@ -560,14 +559,14 @@ update flags msg model = in UpdateResult model_ cmd_ Sub.none change - ToggleAkkordionTab title -> + ToggleAkkordionTab name -> let tabs = - if Set.member title model.openTabs then - Set.remove title model.openTabs + if Set.member name model.openTabs then + Set.remove name model.openTabs else - Set.insert title model.openTabs + Set.insert name model.openTabs in UpdateResult { model | openTabs = tabs } Cmd.none Sub.none NoFormChange @@ -697,7 +696,8 @@ renderEditForm2 flags cfg settings model = [ TB.akkordion tabStyle (tabState settings model) - [ { title = "Confirm/Unconfirm item metadata" + [ { name = tabName TabConfirmUnconfirm + , title = "Confirm/Unconfirm item metadata" , titleRight = [] , info = Nothing , body = @@ -721,7 +721,8 @@ renderEditForm2 flags cfg settings model = ] ] } - , { title = "Tags" + , { name = tabName TabTags + , title = "Tags" , titleRight = [] , info = Nothing , body = @@ -748,7 +749,8 @@ renderEditForm2 flags cfg settings model = ] ] } - , { title = "Folder" + , { name = tabName TabFolder + , title = "Folder" , titleRight = [] , info = Nothing , body = @@ -767,7 +769,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Custom Fields" + , { name = tabName TabCustomFields + , title = "Custom Fields" , titleRight = [] , info = Nothing , body = @@ -775,7 +778,8 @@ item visible. This message will disappear then. (Comp.CustomFieldMultiInput.view2 dds customFieldSettings model.customFieldModel) ] } - , { title = "Date" + , { name = tabName TabDate + , title = "Date" , titleRight = [] , info = Nothing , body = @@ -797,7 +801,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Due Date" + , { name = tabName TabDueDate + , title = "Due Date" , titleRight = [] , info = Nothing , body = @@ -819,7 +824,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Correspondent" + , { name = tabName TabCorrespondent + , title = "Correspondent" , titleRight = [] , info = Nothing , body = @@ -845,7 +851,8 @@ item visible. This message will disappear then. ] ] } - , { title = "Concerning" + , { name = tabName TabConcerning + , title = "Concerning" , titleRight = [] , info = Nothing , body = @@ -873,14 +880,16 @@ item visible. This message will disappear then. ] ] } - , { title = "Direction" + , { name = tabName TabDirection + , title = "Direction" , titleRight = [] , info = Nothing , body = [ Html.map DirDropdownMsg (Comp.Dropdown.view2 directionCfg settings model.directionModel) ] } - , { title = "Name" + , { name = tabName TabName + , title = "Name" , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm index ee7194c1..8e523908 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm @@ -1469,14 +1469,14 @@ update key flags inav settings msg model = ToggleAttachmentDropdown -> resultModel { model | attachmentDropdownOpen = not model.attachmentDropdownOpen } - ToggleAkkordionTab title -> + ToggleAkkordionTab name -> let tabs = - if Set.member title model.editMenuTabsOpen then - Set.remove title model.editMenuTabsOpen + if Set.member name model.editMenuTabsOpen then + Set.remove name model.editMenuTabsOpen else - Set.insert title model.editMenuTabsOpen + Set.insert name model.editMenuTabsOpen in resultModel { model | editMenuTabsOpen = tabs } diff --git a/modules/webapp/src/main/elm/Comp/ItemMail.elm b/modules/webapp/src/main/elm/Comp/ItemMail.elm index 60223241..ad8db394 100644 --- a/modules/webapp/src/main/elm/Comp/ItemMail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemMail.elm @@ -255,21 +255,30 @@ view2 settings model = , B.inputRequired ] , Html.map RecipientMsg - (Comp.EmailInput.view2 dds model.recipients model.recipientsModel) + (Comp.EmailInput.view2 { style = dds, placeholder = "Recipient(s)..." } + model.recipients + model.recipientsModel + ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] [ text "CC(s)" ] , Html.map CCRecipientMsg - (Comp.EmailInput.view2 dds model.ccRecipients model.ccRecipientsModel) + (Comp.EmailInput.view2 { style = dds, placeholder = "CC recipient(s)..." } + model.ccRecipients + model.ccRecipientsModel + ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] [ text "BCC(s)" ] , Html.map BCCRecipientMsg - (Comp.EmailInput.view2 dds model.bccRecipients model.bccRecipientsModel) + (Comp.EmailInput.view2 { style = dds, placeholder = "BCC recipient(s)..." } + model.bccRecipients + model.bccRecipientsModel + ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] diff --git a/modules/webapp/src/main/elm/Comp/NotificationForm.elm b/modules/webapp/src/main/elm/Comp/NotificationForm.elm index 42f2c74a..d053b203 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationForm.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationForm.elm @@ -30,6 +30,8 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) import Http +import Markdown +import Messages.NotificationFormComp exposing (Texts) import Styles as S import Util.Http import Util.Maybe @@ -474,23 +476,23 @@ isFormSuccess model = |> Maybe.withDefault False -view2 : String -> UiSettings -> Model -> Html Msg -view2 extraClasses settings model = +view2 : Texts -> String -> UiSettings -> Model -> Html Msg +view2 texts extraClasses settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete this notification task?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTask startOnceBtn = MB.SecondaryButton { tagger = StartOnce - , label = "Start Once" - , title = "Start this task now" + , label = texts.startOnce + , title = texts.startTaskNow , icon = Just "fa fa-play" } connectionCfg = { makeOption = \a -> { text = a, additional = "" } - , placeholder = "Select connection..." + , placeholder = texts.selectConnection , labelColor = \_ -> \_ -> "" , style = DS.mainStyle } @@ -509,14 +511,14 @@ view2 extraClasses settings model = { start = [ MB.PrimaryButton { tagger = Submit - , label = "Submit" - , title = "Save" + , label = texts.basics.submit + , title = texts.basics.submitThisForm , icon = Just "fa fa-save" } , MB.SecondaryButton { tagger = Cancel - , label = "Cancel" - , title = "Back to list" + , label = texts.basics.cancel + , title = texts.basics.backToList , icon = Just "fa fa-arrow-left" } ] @@ -525,8 +527,8 @@ view2 extraClasses settings model = [ startOnceBtn , MB.DeleteButton { tagger = RequestDelete - , label = "Delete" - , title = "Delete this task" + , label = texts.basics.delete + , title = texts.deleteThisTask , icon = Just "fa fa-trash" } ] @@ -552,14 +554,14 @@ view2 extraClasses settings model = [ MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleEnabled - , label = "Enable or disable this task." + , label = texts.enableDisable , value = model.enabled , id = "notify-enabled" } ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Summary" + [ text texts.summary ] , input [ type_ "text" @@ -570,12 +572,12 @@ view2 extraClasses settings model = ] [] , span [ class "opacity-50 text-sm" ] - [ text "Some human readable name, only for displaying" + [ text texts.summaryInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Send via" + [ text texts.sendVia , B.inputRequired ] , Html.map ConnMsg @@ -585,29 +587,29 @@ view2 extraClasses settings model = model.connectionModel ) , span [ class "opacity-50 text-sm" ] - [ text "The SMTP connection to use when sending notification mails." + [ text texts.sendViaInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Recipient(s)" + [ text texts.recipients , B.inputRequired ] , Html.map RecipientMsg (Comp.EmailInput.view2 - DS.mainStyle + { style = DS.mainStyle, placeholder = texts.recipients } model.recipients model.recipientsModel ) , span [ class "opacity-50 text-sm" ] - [ text "One or more mail addresses, confirm each by pressing 'Return'." + [ text texts.recipientsInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Tags Include (and)" ] + [ text texts.tagsInclude ] , Html.map TagIncMsg (Comp.Dropdown.view2 (Util.Tag.tagSettings DS.mainStyle) @@ -615,12 +617,12 @@ view2 extraClasses settings model = model.tagInclModel ) , span [ class "opacity-50 text-sm" ] - [ text "Items must have all the tags specified here." + [ text texts.tagsIncludeInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Tags Exclude (or)" ] + [ text texts.tagsExclude ] , Html.map TagExcMsg (Comp.Dropdown.view2 (Util.Tag.tagSettings DS.mainStyle) @@ -628,12 +630,12 @@ view2 extraClasses settings model = model.tagExclModel ) , span [ class "small-info" ] - [ text "Items must not have any tag specified here." + [ text texts.tagsExcludeInfo ] ] , Html.map RemindDaysMsg (Comp.IntField.viewWithInfo2 - "Select items with a due date *lower than* `today+remindDays`" + texts.remindDaysInfo model.remindDays "mb-4" model.remindDaysModel @@ -644,20 +646,15 @@ view2 extraClasses settings model = { tagger = \_ -> ToggleCapOverdue , id = "notify-toggle-cap-overdue" , value = model.capOverdue - , label = "Cap overdue items" + , label = texts.capOverdue } , div [ class "opacity-50 text-sm" ] - [ text "If checked, only items with a due date" - , em [ class "font-italic" ] - [ text " greater than " ] - , code [ class "font-mono" ] - [ text "today-remindDays" ] - , text " are considered." + [ Markdown.toHtml [] texts.capOverdueInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Schedule" + [ text texts.schedule , a [ class "float-right" , class S.link @@ -666,7 +663,7 @@ view2 extraClasses settings model = ] [ i [ class "fa fa-question" ] [] , span [ class "pl-2" ] - [ text "Click here for help" + [ text texts.scheduleClickForHelp ] ] ] @@ -676,10 +673,7 @@ view2 extraClasses settings model = model.scheduleModel ) , span [ class "opacity-50 text-sm" ] - [ text "Specify how often and when this task should run. " - , text "Use English 3-letter weekdays. Either a single value, " - , text "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) " - , text "is allowed for each part." + [ text texts.scheduleInfo ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/NotificationList.elm b/modules/webapp/src/main/elm/Comp/NotificationList.elm index c87bf16b..4ff25f98 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationList.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationList.elm @@ -11,6 +11,7 @@ import Api.Model.NotificationSettings exposing (NotificationSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) +import Messages.NotificationTableComp exposing (Texts) import Styles as S import Util.Html @@ -44,8 +45,8 @@ update msg model = --- View2 -view2 : Model -> List NotificationSettings -> Html Msg -view2 _ items = +view2 : Texts -> Model -> List NotificationSettings -> Html Msg +view2 texts _ items = div [] [ table [ class S.tableMain ] [ thead [] @@ -54,13 +55,13 @@ view2 _ items = , th [ class "text-center mr-2" ] [ i [ class "fa fa-check" ] [] ] - , th [ class "text-left " ] [ text "Summary" ] + , th [ class "text-left " ] [ text texts.summary ] , th [ class "text-left hidden sm:table-cell mr-2" ] - [ text "Schedule" ] + [ text texts.schedule ] , th [ class "text-left mr-2" ] - [ text "Connection" ] + [ text texts.connection ] , th [ class "text-left hidden sm:table-cell mr-2" ] - [ text "Recipients" ] + [ text texts.recipients ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/NotificationManage.elm b/modules/webapp/src/main/elm/Comp/NotificationManage.elm index e1b2467a..903d8717 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationManage.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationManage.elm @@ -18,6 +18,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http +import Messages.NotificationManageComp exposing (Texts) import Styles as S import Util.Http @@ -212,8 +213,8 @@ update flags msg model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = div [ class "flex flex-col" ] (div [ classList @@ -229,34 +230,38 @@ view2 settings model = ] :: (case model.detailModel of Just msett -> - viewForm2 settings msett + viewForm2 texts settings msett Nothing -> - viewList2 model + viewList2 texts model ) ) -viewForm2 : UiSettings -> Comp.NotificationForm.Model -> List (Html Msg) -viewForm2 settings model = +viewForm2 : Texts -> UiSettings -> Comp.NotificationForm.Model -> List (Html Msg) +viewForm2 texts settings model = [ Html.map DetailMsg - (Comp.NotificationForm.view2 "flex flex-col" settings model) + (Comp.NotificationForm.view2 texts.notificationForm "flex flex-col" settings model) ] -viewList2 : Model -> List (Html Msg) -viewList2 model = +viewList2 : Texts -> Model -> List (Html Msg) +viewList2 texts model = [ MB.view { start = [ MB.PrimaryButton { tagger = NewTask - , label = "New Task" + , label = texts.newTask , icon = Just "fa fa-plus" - , title = "Create a new notification task" + , title = texts.createNewTask } ] , end = [] , rootClasses = "mb-4" } - , Html.map ListMsg (Comp.NotificationList.view2 model.listModel model.items) + , Html.map ListMsg + (Comp.NotificationList.view2 texts.notificationTable + model.listModel + model.items + ) ] diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index de439fe4..3a1c97d9 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -40,6 +40,7 @@ import Html.Events exposing (onCheck, onClick, onInput) import Http import Markdown import Messages.LanguageData +import Messages.ScanMailboxFormComp exposing (Texts) import Set exposing (Set) import Styles as S import Util.Folder exposing (mkFolderOption) @@ -98,6 +99,30 @@ type MenuTab | TabSchedule +{-| Only exits to be able to put tabs in a Set. +-} +tabName : MenuTab -> String +tabName tab = + case tab of + TabGeneral -> + "general" + + TabProcessing -> + "processing" + + TabAdditionalFilter -> + "additional-filter" + + TabPostProcessing -> + "post-processing" + + TabMetadata -> + "metadata" + + TabSchedule -> + "schedule" + + type Msg = Submit | Cancel @@ -218,7 +243,7 @@ init flags = , language = Nothing , postHandleAll = False , summary = Nothing - , openTabs = Set.insert (tabTitle TabGeneral) Set.empty + , openTabs = Set.singleton (tabName TabGeneral) } , Cmd.batch [ Api.getImapSettings flags "" ConnResp @@ -662,14 +687,14 @@ update flags msg model = , Cmd.none ) - ToggleAkkordionTab title -> + ToggleAkkordionTab name -> let tabs = - if Set.member title model.openTabs then - Set.remove title model.openTabs + if Set.member name model.openTabs then + Set.remove name model.openTabs else - Set.insert title model.openTabs + Set.insert name model.openTabs in ( { model | openTabs = tabs } , NoAction @@ -711,26 +736,26 @@ isFolderMember model = Util.Folder.isFolderMember model.allFolders selected -view2 : Flags -> String -> UiSettings -> Model -> Html Msg -view2 flags extraClasses settings model = +view2 : Texts -> Flags -> String -> UiSettings -> Model -> Html Msg +view2 texts flags extraClasses settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 "Really delete this scan mailbox task?" + Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTask startOnceBtn = MB.SecondaryButton { tagger = StartOnce - , label = "Start Once" - , title = "Start this task now" + , label = texts.startOnce + , title = texts.startNow , icon = Just "fa fa-play" } tabActive t = - if Set.member t.title model.openTabs then - ( Comp.Tabs.Open, ToggleAkkordionTab t.title ) + if Set.member t.name model.openTabs then + ( Comp.Tabs.Open, ToggleAkkordionTab t.name ) else - ( Comp.Tabs.Closed, ToggleAkkordionTab t.title ) + ( Comp.Tabs.Closed, ToggleAkkordionTab t.name ) in div [ class extraClasses @@ -740,14 +765,14 @@ view2 flags extraClasses settings model = { start = [ MB.PrimaryButton { tagger = Submit - , label = "Submit" - , title = "Save" + , label = texts.basics.submit + , title = texts.basics.submitThisForm , icon = Just "fa fa-save" } , MB.SecondaryButton { tagger = Cancel - , label = "Cancel" - , title = "Back to list" + , label = texts.basics.cancel + , title = texts.basics.backToList , icon = Just "fa fa-arrow-left" } ] @@ -756,8 +781,8 @@ view2 flags extraClasses settings model = [ startOnceBtn , MB.DeleteButton { tagger = RequestDelete - , label = "Delete" - , title = "Delete this task" + , label = texts.basics.delete + , title = texts.deleteThisTask , icon = Just "fa fa-trash" } ] @@ -781,7 +806,7 @@ view2 flags extraClasses settings model = , Comp.Tabs.akkordion Comp.Tabs.defaultStyle tabActive - (formTabs flags settings model) + (formTabs texts flags settings model) , Html.map YesNoDeleteMsg (Comp.YesNoDimmer.viewN True @@ -792,69 +817,53 @@ view2 flags extraClasses settings model = ] -tabTitle : MenuTab -> String -tabTitle tab = - case tab of - TabGeneral -> - "General" - - TabProcessing -> - "Processing" - - TabAdditionalFilter -> - "Additional Filter" - - TabPostProcessing -> - "Post Processing" - - TabMetadata -> - "Metadata" - - TabSchedule -> - "Schedule" - - -formTabs : Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) -formTabs flags settings model = - [ { title = tabTitle TabGeneral +formTabs : Texts -> Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) +formTabs texts flags settings model = + [ { name = tabName TabGeneral + , title = texts.generalTab , titleRight = [] , info = Nothing - , body = viewGeneral2 settings model + , body = viewGeneral2 texts settings model } - , { title = tabTitle TabProcessing + , { name = tabName TabProcessing + , title = texts.processingTab , titleRight = [] - , info = Just "These settings define which mails are fetched from the mail server." - , body = viewProcessing2 model + , info = Just texts.processingTabInfo + , body = viewProcessing2 texts model } - , { title = tabTitle TabAdditionalFilter + , { name = tabName TabAdditionalFilter + , title = texts.additionalFilterTab , titleRight = [] - , info = Just "These filters are applied to mails that have been fetched from the mailbox to select those that should be imported." - , body = viewAdditionalFilter2 model + , info = Just texts.additionalFilterTabInfo + , body = viewAdditionalFilter2 texts model } - , { title = tabTitle TabPostProcessing + , { name = tabName TabPostProcessing + , title = texts.postProcessingTab , titleRight = [] - , info = Just "This defines what happens to mails that have been downloaded." - , body = viewPostProcessing2 model + , info = Just texts.postProcessingTabInfo + , body = viewPostProcessing2 texts model } - , { title = tabTitle TabMetadata + , { name = tabName TabMetadata + , title = texts.metadataTab , titleRight = [] - , info = Just "Define metadata that should be attached to all items created by this task." - , body = viewMetadata2 flags settings model + , info = Just texts.metadataTabInfo + , body = viewMetadata2 texts flags settings model } - , { title = tabTitle TabSchedule + , { name = tabName TabSchedule + , title = texts.scheduleTab , titleRight = [] - , info = Just "Define when mails should be imported." - , body = viewSchedule2 model + , info = Just texts.scheduleTabInfo + , body = viewSchedule2 texts model } ] -viewGeneral2 : UiSettings -> Model -> List (Html Msg) -viewGeneral2 settings model = +viewGeneral2 : Texts -> UiSettings -> Model -> List (Html Msg) +viewGeneral2 texts settings model = let connectionCfg = { makeOption = \a -> { text = a, additional = "" } - , placeholder = "Select connection..." + , placeholder = texts.selectConnection , labelColor = \_ -> \_ -> "" , style = DS.mainStyle } @@ -864,16 +873,16 @@ viewGeneral2 settings model = { id = "scanmail-enabled" , value = model.enabled , tagger = \_ -> ToggleEnabled - , label = "Enable or disable this task." + , label = texts.enableDisable } , div [ class "mb-4 mt-4" ] [ label [ class S.inputLabel ] - [ text "Mailbox" + [ text texts.mailbox , B.inputRequired ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Summary" + [ text texts.summary ] , input [ type_ "text" @@ -884,7 +893,7 @@ viewGeneral2 settings model = ] [] , span [ class "opacity-50 text-sm" ] - [ text "Some human readable name, only for displaying" + [ text texts.summaryInfo ] ] , Html.map ConnMsg @@ -894,17 +903,17 @@ viewGeneral2 settings model = model.connectionModel ) , span [ class "opacity-50 text-sm" ] - [ text "The IMAP connection to use when sending notification mails." + [ text texts.connectionInfo ] ] ] -viewProcessing2 : Model -> List (Html Msg) -viewProcessing2 model = +viewProcessing2 : Texts -> Model -> List (Html Msg) +viewProcessing2 texts model = [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Folders" + [ text texts.folders , B.inputRequired ] , Html.map FoldersMsg @@ -913,12 +922,12 @@ viewProcessing2 model = model.foldersModel ) , span [ class "opacity-50 text-sm mt-1" ] - [ text "The folders to look for mails." + [ text texts.foldersInfo ] ] , Html.map ReceivedHoursMsg (Comp.IntField.viewWithInfo2 - "Select mails newer than `now - receivedHours`" + texts.receivedHoursInfo model.receivedHours "mb-4" model.receivedHoursModel @@ -926,19 +935,19 @@ viewProcessing2 model = ] -viewAdditionalFilter2 : Model -> List (Html Msg) -viewAdditionalFilter2 model = +viewAdditionalFilter2 : Texts -> Model -> List (Html Msg) +viewAdditionalFilter2 texts model = [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "File Filter" ] + [ text texts.fileFilter ] , input [ type_ "text" , onInput SetFileFilter - , placeholder "File Filter" + , placeholder texts.fileFilter , model.fileFilter |> Maybe.withDefault "" |> value @@ -946,34 +955,18 @@ viewAdditionalFilter2 model = ] [] , div [ class "opacity-50 text-sm" ] - [ text "Specify a file glob to filter attachments. For example, to only extract pdf files: " - , code [ class "font-mono" ] - [ text "*.pdf" - ] - , text ". If you want to include the mail body, allow html files or " - , code [ class "font-mono" ] - [ text "mail.html" - ] - , text ". Globs can be combined via OR, like this: " - , code [ class "font-mono" ] - [ text "*.pdf|mail.html" - ] - , text ". No file filter defaults to " - , code [ class "font-mono" ] - [ text "*" - ] - , text " that includes all" + [ Markdown.toHtml [] texts.fileFilterInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Subject Filter" ] + [ text texts.subjectFilter ] , input [ type_ "text" , onInput SetSubjectFilter - , placeholder "Subject Filter" + , placeholder texts.subjectFilter , model.subjectFilter |> Maybe.withDefault "" |> value @@ -981,40 +974,29 @@ viewAdditionalFilter2 model = ] [] , div [ class "opacity-50 text-sm" ] - [ text "Specify a file glob to filter mails by subject. For example: " - , code [ class "font-mono" ] - [ text "*Scanned Document*" - ] - , text ". No file filter defaults to " - , code [ class "font-mono" ] - [ text "*" - ] - , text " that includes all" + [ Markdown.toHtml [] texts.subjectFilterInfo ] ] ] -viewPostProcessing2 : Model -> List (Html Msg) -viewPostProcessing2 model = +viewPostProcessing2 : Texts -> Model -> List (Html Msg) +viewPostProcessing2 texts model = [ div [ class "mb-4" ] [ MB.viewItem <| MB.Checkbox { id = "scanmail-posthandle-all" , value = model.postHandleAll - , label = "Apply post-processing to all fetched mails." + , label = texts.postProcessingLabel , tagger = \_ -> TogglePostHandleAll } , span [ class "opacity-50 text-sm mt-1" ] - [ text "When mails are fetched but not imported due to the 'Additional Filters', this flag can " - , text "control whether they should be moved to a target folder or deleted (whatever is " - , text "defined here) nevertheless. If unchecked only imported mails " - , text "are post-processed, others stay where they are." + [ Markdown.toHtml [] texts.postProcessingInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Target folder" + [ text texts.targetFolder ] , input [ type_ "text" @@ -1024,28 +1006,26 @@ viewPostProcessing2 model = ] [] , span [ class "opacity-50 text-sm" ] - [ text "Move mails into this folder." + [ text texts.targetFolderInfo ] ] , div [ class "mb-4" ] [ MB.viewItem <| MB.Checkbox { id = "scanmail-delete-all" - , label = "Delete imported mails" + , label = texts.deleteMailLabel , tagger = \_ -> ToggleDeleteMail , value = model.deleteMail } , span [ class "opacity-50 text-sm" ] - [ text "Whether to delete all mails fetched by docspell. This only applies if " - , em [] [ text "target folder" ] - , text " is not set." + [ Markdown.toHtml [] texts.deleteMailInfo ] ] ] -viewMetadata2 : Flags -> UiSettings -> Model -> List (Html Msg) -viewMetadata2 flags settings model = +viewMetadata2 : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewMetadata2 texts flags settings model = let folderCfg = { makeOption = Util.Folder.mkFolderOption flags model.allFolders @@ -1062,7 +1042,7 @@ viewMetadata2 flags settings model = in [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Item direction" + [ text texts.itemDirection , B.inputRequired ] , div [ class "flex flex-col " ] @@ -1074,7 +1054,7 @@ viewMetadata2 flags settings model = , class S.radioInput ] [] - , span [ class "ml-2" ] [ text "Automatic" ] + , span [ class "ml-2" ] [ text texts.automatic ] ] , label [ class "inline-flex items-center" ] [ input @@ -1084,7 +1064,7 @@ viewMetadata2 flags settings model = , onCheck (\_ -> DirectionMsg (Just Incoming)) ] [] - , span [ class "ml-2" ] [ text "Incoming" ] + , span [ class "ml-2" ] [ text texts.basics.incoming ] ] , label [ class "inline-flex items-center" ] [ input @@ -1094,18 +1074,16 @@ viewMetadata2 flags settings model = , class S.radioInput ] [] - , span [ class "ml-2" ] [ text "Outgoing" ] + , span [ class "ml-2" ] [ text texts.basics.outgoing ] ] , span [ class "opacity-50 text-sm" ] - [ text "Sets the direction for an item. If you know all mails are incoming or " - , text "outgoing, you can set it here. Otherwise it will be guessed from looking " - , text "at sender and receiver." + [ Markdown.toHtml [] texts.itemDirectionInfo ] ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Item Folder" + [ text texts.itemFolder ] , Html.map FolderDropdownMsg (Comp.Dropdown.view2 @@ -1114,7 +1092,7 @@ viewMetadata2 flags settings model = model.folderModel ) , span [ class "opacity-50 text-sm" ] - [ text "Put all items from this mailbox into the selected folder" + [ text texts.itemFolderInfo ] , div [ classList @@ -1122,17 +1100,12 @@ viewMetadata2 flags settings model = ] , class S.message ] - [ Markdown.toHtml [] """ -You are **not a member** of this folder. Items created from mails in -this mailbox will be **hidden** from any search results. Use a folder -where you are a member of to make items visible. This message will -disappear then. - """ + [ Markdown.toHtml [] texts.folderOwnerWarning ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Tags" ] + [ text texts.basics.tags ] , Html.map TagDropdownMsg (Comp.Dropdown.view2 (Util.Tag.tagSettings DS.mainStyle) @@ -1140,12 +1113,12 @@ disappear then. model.tagModel ) , div [ class "opacity-50 text-sm" ] - [ text "Choose tags that should be applied to items." + [ text texts.tagsInfo ] ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Language" + [ text texts.documentLanguage ] , div [ class "flex flex-row" ] [ Html.map LanguageMsg @@ -1165,18 +1138,17 @@ disappear then. ] ] , div [ class "opacity-50 text-sm" ] - [ text "Used for text extraction and text analysis. The " - , text "collective's default language is used, if not specified here." + [ text texts.documentLanguageInfo ] ] ] -viewSchedule2 : Model -> List (Html Msg) -viewSchedule2 model = +viewSchedule2 : Texts -> Model -> List (Html Msg) +viewSchedule2 texts model = [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Schedule" + [ text texts.schedule , B.inputRequired , a [ class "float-right" @@ -1186,7 +1158,7 @@ viewSchedule2 model = ] [ i [ class "fa fa-question" ] [] , span [ class "ml-2" ] - [ text "Click here for help" + [ text texts.scheduleClickForHelp ] ] ] @@ -1196,10 +1168,7 @@ viewSchedule2 model = model.scheduleModel ) , span [ class "opacity-50 text-sm" ] - [ text "Specify how often and when this task should run. " - , text "Use English 3-letter weekdays. Either a single value, " - , text "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) " - , text "is allowed for each part." + [ Markdown.toHtml [] texts.scheduleInfo ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm index e58b33d5..07d2b8d0 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm @@ -11,6 +11,7 @@ import Api.Model.ScanMailboxSettings exposing (ScanMailboxSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) +import Messages.ScanMailboxTableComp exposing (Texts) import Styles as S import Util.Html @@ -44,8 +45,8 @@ update msg model = --- View2 -view2 : Model -> List ScanMailboxSettings -> Html Msg -view2 _ items = +view2 : Texts -> Model -> List ScanMailboxSettings -> Html Msg +view2 texts _ items = div [] [ table [ class S.tableMain ] [ thead [] @@ -54,11 +55,11 @@ view2 _ items = , th [ class "" ] [ i [ class "fa fa-check" ] [] ] - , th [ class "text-left" ] [ text "Summary" ] + , th [ class "text-left" ] [ text texts.summary ] , th [ class "text-left mr-2" ] [ text "Schedule" ] - , th [ class "text-left mr-2 hidden md:table-cell" ] [ text "Connection" ] - , th [ class "text-left mr-2 hidden md:table-cell" ] [ text "Folders" ] - , th [ class "text-left mr-2 hidden lg:table-cell" ] [ text "Received Since" ] + , th [ class "text-left mr-2 hidden md:table-cell" ] [ text texts.connection ] + , th [ class "text-left mr-2 hidden md:table-cell" ] [ text texts.folders ] + , th [ class "text-left mr-2 hidden lg:table-cell" ] [ text texts.receivedSince ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm index 8dd8514d..72000d6f 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm @@ -18,6 +18,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http +import Messages.ScanMailboxManageComp exposing (Texts) import Styles as S import Util.Http @@ -212,8 +213,8 @@ update flags msg model = --- View2 -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 flags settings model = +view2 : Texts -> Flags -> UiSettings -> Model -> Html Msg +view2 texts flags settings model = div [ class "flex flex-col" ] (div [ classList @@ -228,34 +229,38 @@ view2 flags settings model = ] :: (case model.detailModel of Just msett -> - viewForm2 flags settings msett + viewForm2 texts flags settings msett Nothing -> - viewList2 model + viewList2 texts model ) ) -viewForm2 : Flags -> UiSettings -> Comp.ScanMailboxForm.Model -> List (Html Msg) -viewForm2 flags settings model = +viewForm2 : Texts -> Flags -> UiSettings -> Comp.ScanMailboxForm.Model -> List (Html Msg) +viewForm2 texts flags settings model = [ Html.map DetailMsg - (Comp.ScanMailboxForm.view2 flags "" settings model) + (Comp.ScanMailboxForm.view2 texts.form flags "" settings model) ] -viewList2 : Model -> List (Html Msg) -viewList2 model = +viewList2 : Texts -> Model -> List (Html Msg) +viewList2 texts model = [ MB.view { start = [ MB.PrimaryButton { tagger = NewTask - , label = "New Task" + , label = texts.newTask , icon = Just "fa fa-plus" - , title = "Create a new scan mailbox task" + , title = texts.createNewTask } ] , end = [] , rootClasses = "mb-4" } - , Html.map ListMsg (Comp.ScanMailboxList.view2 model.listModel model.items) + , Html.map ListMsg + (Comp.ScanMailboxList.view2 texts.table + model.listModel + model.items + ) ] diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index d81b0b1d..ff3c335f 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -936,6 +936,97 @@ viewDrop2 ddd flags settings model = (searchTabs ddd flags settings model) +type SearchTab + = TabInbox + | TabTags + | TabTagCategories + | TabFolder + | TabCorrespondent + | TabConcerning + | TabCustomFields + | TabDate + | TabDueDate + | TabSource + | TabDirection + + +tabName : SearchTab -> String +tabName tab = + case tab of + TabInbox -> + "inbox" + + TabTags -> + "tags" + + TabTagCategories -> + "categories" + + TabFolder -> + "folder" + + TabCorrespondent -> + "correspondent" + + TabConcerning -> + "concerning" + + TabCustomFields -> + "custom-fields" + + TabDate -> + "date" + + TabDueDate -> + "due-date" + + TabSource -> + "source" + + TabDirection -> + "direction" + + +findTab : Comp.Tabs.Tab msg -> Maybe SearchTab +findTab tab = + case tab.name of + "inbox" -> + Just TabInbox + + "tags" -> + Just TabTags + + "categories" -> + Just TabTagCategories + + "folder" -> + Just TabFolder + + "correspondent" -> + Just TabCorrespondent + + "concerning" -> + Just TabConcerning + + "custom-fields" -> + Just TabCustomFields + + "date" -> + Just TabDate + + "due-date" -> + Just TabDueDate + + "source" -> + Just TabSource + + "direction" -> + Just TabDirection + + _ -> + Nothing + + searchTabState : UiSettings -> Model -> Comp.Tabs.Tab Msg -> ( Comp.Tabs.State, Msg ) searchTabState settings model tab = let @@ -943,52 +1034,55 @@ searchTabState settings model tab = Data.UiSettings.fieldHidden settings f hidden = - case tab.title of - "Tags" -> + case findTab tab of + Just TabTags -> isHidden Data.Fields.Tag - "Tag Categories" -> + Just TabTagCategories -> isHidden Data.Fields.Tag - "Folder" -> + Just TabFolder -> isHidden Data.Fields.Folder - "Correspondent" -> + Just TabCorrespondent -> isHidden Data.Fields.CorrOrg && isHidden Data.Fields.CorrPerson - "Concerning" -> + Just TabConcerning -> isHidden Data.Fields.ConcEquip && isHidden Data.Fields.ConcPerson - "Custom Fields" -> + Just TabCustomFields -> isHidden Data.Fields.CustomFields || Comp.CustomFieldMultiInput.isEmpty model.customFieldModel - "Date" -> + Just TabDate -> isHidden Data.Fields.Date - "Due Date" -> + Just TabDueDate -> isHidden Data.Fields.DueDate - "Source" -> + Just TabSource -> isHidden Data.Fields.SourceName - "Direction" -> + Just TabDirection -> isHidden Data.Fields.Direction - _ -> + Just TabInbox -> + False + + Nothing -> False state = if hidden then Comp.Tabs.Hidden - else if Set.member tab.title model.openTabs then + else if Set.member tab.name model.openTabs then Comp.Tabs.Open else Comp.Tabs.Closed in - ( state, ToggleAkkordionTab tab.title ) + ( state, ToggleAkkordionTab tab.name ) searchTabs : DD.DragDropData -> Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) @@ -1032,7 +1126,8 @@ searchTabs ddd flags settings model = , style = DS.sidebarStyle } in - [ { title = "Inbox" + [ { name = tabName TabInbox + , title = "Inbox" , info = Nothing , titleRight = [] , body = @@ -1091,7 +1186,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Tags" + , { name = tabName TabTags + , title = "Tags" , titleRight = [] , info = Nothing , body = @@ -1103,7 +1199,8 @@ searchTabs ddd flags settings model = model.tagSelectModel ) } - , { title = "Tag Categories" + , { name = tabName TabTagCategories + , title = "Tag Categories" , titleRight = [] , info = Nothing , body = @@ -1115,7 +1212,8 @@ searchTabs ddd flags settings model = ) ] } - , { title = "Folder" + , { name = tabName TabFolder + , title = "Folder" , titleRight = [] , info = Nothing , body = @@ -1126,7 +1224,8 @@ searchTabs ddd flags settings model = ) ] } - , { title = "Correspondent" + , { name = tabName TabCorrespondent + , title = "Correspondent" , titleRight = [] , info = Nothing , body = @@ -1157,7 +1256,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Concerning" + , { name = tabName TabConcerning + , title = "Concerning" , titleRight = [] , info = Nothing , body = @@ -1187,7 +1287,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Custom Fields" + , { name = tabName TabCustomFields + , title = "Custom Fields" , titleRight = [] , info = Nothing , body = @@ -1199,7 +1300,8 @@ searchTabs ddd flags settings model = ) ] } - , { title = "Date" + , { name = tabName TabDate + , title = "Date" , titleRight = [] , info = Nothing , body = @@ -1238,7 +1340,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Due Date" + , { name = tabName TabDueDate + , title = "Due Date" , titleRight = [] , info = Nothing , body = @@ -1281,7 +1384,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Source" + , { name = tabName TabSource + , title = "Source" , titleRight = [] , info = Nothing , body = @@ -1298,7 +1402,8 @@ searchTabs ddd flags settings model = ] ] } - , { title = "Direction" + , { name = tabName TabDirection + , title = "Direction" , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/Tabs.elm b/modules/webapp/src/main/elm/Comp/Tabs.elm index be5e99f0..348d0f46 100644 --- a/modules/webapp/src/main/elm/Comp/Tabs.elm +++ b/modules/webapp/src/main/elm/Comp/Tabs.elm @@ -11,11 +11,11 @@ module Comp.Tabs exposing import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Styles as S type alias Tab msg = - { title : String + { name : String + , title : String , titleRight : List (Html msg) , info : Maybe String , body : List (Html msg) @@ -79,7 +79,7 @@ akkordionTab style state toggle tab = [ class "flex flex-row" , class style.titleClasses ] - ([ a + (a [ class "flex flex-row items-center flex-grow" , href "#" , onClick toggle @@ -100,8 +100,7 @@ akkordionTab style state toggle tab = ] ] ] - ] - ++ tab.titleRight + :: tab.titleRight ) tabContent = diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 4c4c2089..865c9a91 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -413,14 +413,14 @@ update sett msg model = , Just { sett | searchStatsVisible = flag } ) - ToggleAkkordionTab title -> + ToggleAkkordionTab name -> let tabs = - if Set.member title model.openTabs then - Set.remove title model.openTabs + if Set.member name model.openTabs then + Set.remove name model.openTabs else - Set.insert title model.openTabs + Set.insert name model.openTabs in ( { model | openTabs = tabs } , Nothing @@ -489,7 +489,7 @@ view2 texts flags settings model = div [ class "flex flex-col" ] [ Comp.Tabs.akkordion Comp.Tabs.defaultStyle - (\t -> ( state t, ToggleAkkordionTab t.title )) + (\t -> ( state t, ToggleAkkordionTab t.name )) (settingFormTabs texts flags settings model) ] @@ -503,7 +503,8 @@ settingFormTabs texts flags _ model = , style = DS.mainStyle } in - [ { title = texts.general + [ { name = "general" + , title = texts.general , titleRight = [] , info = Nothing , body = @@ -528,7 +529,8 @@ settingFormTabs texts flags _ model = ] ] } - , { title = texts.itemSearch + , { name = "item-search" + , title = texts.itemSearch , titleRight = [] , info = Nothing , body = @@ -559,7 +561,8 @@ settingFormTabs texts flags _ model = ] ] } - , { title = texts.itemCards + , { name = "item-cards" + , title = texts.itemCards , titleRight = [] , info = Nothing , body = @@ -627,7 +630,8 @@ settingFormTabs texts flags _ model = IT.helpMessage ] } - , { title = texts.searchMenu + , { name = "search-menu" + , title = texts.searchMenu , titleRight = [] , info = Nothing , body = @@ -654,7 +658,8 @@ settingFormTabs texts flags _ model = ) ] } - , { title = texts.itemDetail + , { name = "item-detail" + , title = texts.itemDetail , titleRight = [] , info = Nothing , body = @@ -678,7 +683,8 @@ settingFormTabs texts flags _ model = ] ] } - , { title = texts.tagCategoryColors + , { name = "tag-category-colors" + , title = texts.tagCategoryColors , titleRight = [] , info = Nothing , body = @@ -690,7 +696,8 @@ settingFormTabs texts flags _ model = ) ] } - , { title = texts.fields + , { name = "fields" + , title = texts.fields , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Data/SSLType.elm b/modules/webapp/src/main/elm/Data/SSLType.elm index 35327f56..44f9b836 100644 --- a/modules/webapp/src/main/elm/Data/SSLType.elm +++ b/modules/webapp/src/main/elm/Data/SSLType.elm @@ -2,7 +2,6 @@ module Data.SSLType exposing ( SSLType(..) , all , fromString - , label , toString ) @@ -45,16 +44,3 @@ fromString str = _ -> Nothing - - -label : SSLType -> String -label st = - case st of - None -> - "None" - - SSL -> - "SSL/TLS" - - StartTLS -> - "StartTLS" diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm new file mode 100644 index 00000000..a3117c6b --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm @@ -0,0 +1,45 @@ +module Messages.EmailSettingsFormComp exposing (..) + +import Data.SSLType exposing (SSLType) +import Messages.SSLTypeData + + +type alias Texts = + { sslTypeLabel : SSLType -> String + , name : String + , connectionPlaceholder : String + , connectionNameInfo : String + , smtpHost : String + , smtpHostPlaceholder : String + , smtpUser : String + , smtpUserPlaceholder : String + , smtpPassword : String + , smtpPasswordPlaceholder : String + , fromAddress : String + , fromAddressPlaceholder : String + , replyTo : String + , replyToPlaceholder : String + , ssl : String + , ignoreCertCheck : String + } + + +gb : Texts +gb = + { sslTypeLabel = Messages.SSLTypeData.gb + , name = "Name" + , connectionPlaceholder = "Connection name, e.g. 'gmail.com'" + , connectionNameInfo = "The connection name must not contain whitespace or special characters." + , smtpHost = "SMTP Host" + , smtpHostPlaceholder = "SMTP host name, e.g. 'mail.gmail.com'" + , smtpUser = "SMTP User" + , smtpUserPlaceholder = "SMTP Username, e.g. 'your.name@gmail.com'" + , smtpPassword = "SMTP Password" + , smtpPasswordPlaceholder = "Password" + , fromAddress = "From Address" + , fromAddressPlaceholder = "Sender E-Mail address" + , replyTo = "Reply-To" + , replyToPlaceholder = "Optional reply-to E-Mail address" + , ssl = "SSL" + , ignoreCertCheck = "Ignore certificate check" + } diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm new file mode 100644 index 00000000..2fba48f2 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm @@ -0,0 +1,28 @@ +module Messages.EmailSettingsManageComp exposing (..) + +import Messages.Basics +import Messages.EmailSettingsFormComp +import Messages.EmailSettingsTableComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , settingsForm : Messages.EmailSettingsFormComp.Texts + , settingsTable : Messages.EmailSettingsTableComp.Texts + , newSettings : String + , addNewSmtpSettings : String + , reallyDeleteConnection : String + , deleteThisEntry : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , settingsForm = Messages.EmailSettingsFormComp.gb + , settingsTable = Messages.EmailSettingsTableComp.gb + , newSettings = "New Settings" + , addNewSmtpSettings = "Add new SMTP settings" + , reallyDeleteConnection = "Really delete these connection?" + , deleteThisEntry = "Delete this connection" + } diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm b/modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm new file mode 100644 index 00000000..49a8ef51 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm @@ -0,0 +1,16 @@ +module Messages.EmailSettingsTableComp exposing (..) + + +type alias Texts = + { name : String + , hostPort : String + , from : String + } + + +gb : Texts +gb = + { name = "Name" + , hostPort = "Host/Port" + , from = "From" + } diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm new file mode 100644 index 00000000..6a5c095d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm @@ -0,0 +1,41 @@ +module Messages.ImapSettingsFormComp exposing (..) + +import Data.SSLType exposing (SSLType) +import Messages.SSLTypeData + + +type alias Texts = + { sslTypeLabel : SSLType -> String + , name : String + , connectionNamePlaceholder : String + , connectionNameInfo : String + , imapHost : String + , imapHostPlaceholder : String + , imapUser : String + , imapUserPlaceholder : String + , imapPassword : String + , imapPasswordPlaceholder : String + , ssl : String + , ignoreCertCheck : String + , enableOAuth2 : String + , oauth2Info : String + } + + +gb : Texts +gb = + { sslTypeLabel = Messages.SSLTypeData.gb + , name = "Name" + , connectionNamePlaceholder = "Connection name, e.g. 'gmail.com'" + , connectionNameInfo = "The connection name must not contain whitespace or special characters." + , imapHost = "IMAP Host" + , imapHostPlaceholder = "IMAP host name, e.g. 'mail.gmail.com'" + , imapUser = "IMAP User" + , imapUserPlaceholder = "IMAP Username, e.g. 'your.name@gmail.com'" + , imapPassword = "IMAP Password" + , imapPasswordPlaceholder = "Password" + , ssl = "SSL" + , ignoreCertCheck = "Ignore certificate check" + , enableOAuth2 = "Enable OAuth2 authentication" + , oauth2Info = "Enabling this, allows to connect via XOAuth using the password as access token." + } diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm new file mode 100644 index 00000000..77bd5cd2 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm @@ -0,0 +1,28 @@ +module Messages.ImapSettingsManageComp exposing (..) + +import Messages.Basics +import Messages.ImapSettingsFormComp +import Messages.ImapSettingsTableComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , imapForm : Messages.ImapSettingsFormComp.Texts + , imapTable : Messages.ImapSettingsTableComp.Texts + , addNewImapSettings : String + , newSettings : String + , reallyDeleteSettings : String + , deleteThisEntry : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , imapForm = Messages.ImapSettingsFormComp.gb + , imapTable = Messages.ImapSettingsTableComp.gb + , addNewImapSettings = "Add new IMAP settings" + , newSettings = "New Settings" + , reallyDeleteSettings = "Really delete this mail-box connection?" + , deleteThisEntry = "Delete this settings entry" + } diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm b/modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm new file mode 100644 index 00000000..4f758bb6 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm @@ -0,0 +1,14 @@ +module Messages.ImapSettingsTableComp exposing (..) + + +type alias Texts = + { name : String + , hostPort : String + } + + +gb : Texts +gb = + { name = "Name" + , hostPort = "Host/Port" + } diff --git a/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm b/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm new file mode 100644 index 00000000..b5a5acf0 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm @@ -0,0 +1,62 @@ +module Messages.NotificationFormComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , reallyDeleteTask : String + , startOnce : String + , startTaskNow : String + , selectConnection : String + , deleteThisTask : String + , enableDisable : String + , summary : String + , summaryInfo : String + , sendVia : String + , sendViaInfo : String + , recipients : String + , recipientsInfo : String + , tagsInclude : String + , tagsIncludeInfo : String + , tagsExclude : String + , tagsExcludeInfo : String + , remindDaysInfo : String + , capOverdue : String + , capOverdueInfo : String + , schedule : String + , scheduleClickForHelp : String + , scheduleInfo : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , reallyDeleteTask = "Really delete this notification task?" + , startOnce = "Start Once" + , startTaskNow = "Start this task now" + , selectConnection = "Select connection..." + , deleteThisTask = "Delete this task" + , enableDisable = "Enable or disable this task." + , summary = "Summary" + , summaryInfo = "Some human readable name, only for displaying" + , sendVia = "Send via" + , sendViaInfo = "The SMTP connection to use when sending notification mails." + , recipients = "Recipient(s)" + , recipientsInfo = "One or more mail addresses, confirm each by pressing 'Return'." + , tagsInclude = "Tags Include (and)" + , tagsIncludeInfo = "Items must have all the tags specified here." + , tagsExclude = "Tags Exclude (or)" + , tagsExcludeInfo = "Items must not have any tag specified here." + , remindDaysInfo = "Select items with a due date *lower than* `today+remindDays`" + , capOverdue = "Cap overdue items" + , capOverdueInfo = "If checked, only items with a due date *greater than* `today - remindDays` are considered." + , schedule = "Schedule" + , scheduleClickForHelp = "Click here for help" + , scheduleInfo = + "Specify how often and when this task should run. " + ++ "Use English 3-letter weekdays. Either a single value, " + ++ "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) " + ++ "is allowed for each part." + } diff --git a/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm b/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm new file mode 100644 index 00000000..30b8547e --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm @@ -0,0 +1,24 @@ +module Messages.NotificationManageComp exposing (..) + +import Messages.Basics +import Messages.NotificationFormComp +import Messages.NotificationTableComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , notificationForm : Messages.NotificationFormComp.Texts + , notificationTable : Messages.NotificationTableComp.Texts + , newTask : String + , createNewTask : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , notificationForm = Messages.NotificationFormComp.gb + , notificationTable = Messages.NotificationTableComp.gb + , newTask = "New Task" + , createNewTask = "Create a new notification task" + } diff --git a/modules/webapp/src/main/elm/Messages/NotificationTableComp.elm b/modules/webapp/src/main/elm/Messages/NotificationTableComp.elm new file mode 100644 index 00000000..c6c259a8 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/NotificationTableComp.elm @@ -0,0 +1,18 @@ +module Messages.NotificationTableComp exposing (..) + + +type alias Texts = + { summary : String + , schedule : String + , connection : String + , recipients : String + } + + +gb : Texts +gb = + { summary = "Summary" + , schedule = "Schedule" + , connection = "Connection" + , recipients = "Recipients" + } diff --git a/modules/webapp/src/main/elm/Messages/SSLTypeData.elm b/modules/webapp/src/main/elm/Messages/SSLTypeData.elm new file mode 100644 index 00000000..803f7ba7 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SSLTypeData.elm @@ -0,0 +1,16 @@ +module Messages.SSLTypeData exposing (..) + +import Data.SSLType exposing (SSLType(..)) + + +gb : SSLType -> String +gb st = + case st of + None -> + "None" + + SSL -> + "SSL/TLS" + + StartTLS -> + "StartTLS" diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm b/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm new file mode 100644 index 00000000..ccdbe265 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm @@ -0,0 +1,133 @@ +module Messages.ScanMailboxFormComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , reallyDeleteTask : String + , startOnce : String + , startNow : String + , deleteThisTask : String + , generalTab : String + , processingTab : String + , additionalFilterTab : String + , postProcessingTab : String + , metadataTab : String + , scheduleTab : String + , processingTabInfo : String + , additionalFilterTabInfo : String + , postProcessingTabInfo : String + , metadataTabInfo : String + , scheduleTabInfo : String + , selectConnection : String + , enableDisable : String + , mailbox : String + , summary : String + , summaryInfo : String + , connectionInfo : String + , folders : String + , foldersInfo : String + , receivedHoursInfo : String + , fileFilter : String + , fileFilterInfo : String + , subjectFilter : String + , subjectFilterInfo : String + , postProcessingLabel : String + , postProcessingInfo : String + , targetFolder : String + , targetFolderInfo : String + , deleteMailLabel : String + , deleteMailInfo : String + , itemDirection : String + , automatic : String + , itemDirectionInfo : String + , itemFolder : String + , itemFolderInfo : String + , folderOwnerWarning : String + , tagsInfo : String + , documentLanguage : String + , documentLanguageInfo : String + , schedule : String + , scheduleClickForHelp : String + , scheduleInfo : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , reallyDeleteTask = "Really delete this scan mailbox task?" + , startOnce = "Start Once" + , startNow = "Start this task now" + , deleteThisTask = "Delete this task" + , generalTab = "General" + , processingTab = "Processing" + , additionalFilterTab = "Additional Filter" + , postProcessingTab = "Post Processing" + , metadataTab = "Metadata" + , scheduleTab = "Schedule" + , processingTabInfo = "These settings define which mails are fetched from the mail server." + , additionalFilterTabInfo = "These filters are applied to mails that have been fetched from the mailbox to select those that should be imported." + , postProcessingTabInfo = "This defines what happens to mails that have been downloaded." + , metadataTabInfo = "Define metadata that should be attached to all items created by this task." + , scheduleTabInfo = "Define when mails should be imported." + , selectConnection = "Select connection..." + , enableDisable = "Enable or disable this task." + , mailbox = "Mailbox" + , summary = "Summary" + , summaryInfo = "Some human readable name, only for displaying" + , connectionInfo = "The IMAP connection to use when sending notification mails." + , folders = "Folders" + , foldersInfo = "The folders to look for mails." + , receivedHoursInfo = "Select mails newer than `now - receivedHours`" + , fileFilter = "File Filter" + , fileFilterInfo = + "Specify a file glob to filter attachments. For example, to only extract pdf files: " + ++ "`*.pdf`. If you want to include the mail body, allow html files or " + ++ "`mail.html`. Globs can be combined via OR, like this: " + ++ "`*.pdf|mail.html`. No file filter defaults to " + ++ "`*` that includes all" + , subjectFilter = "Subject Filter" + , subjectFilterInfo = + "Specify a file glob to filter mails by subject. For example: " + ++ "`*Scanned Document*`. No file filter defaults to `*` that includes all." + , postProcessingLabel = "Apply post-processing to all fetched mails." + , postProcessingInfo = + "When mails are fetched but not imported due to the 'Additional Filters', this flag can " + ++ "control whether they should be moved to a target folder or deleted (whatever is " + ++ "defined here) nevertheless. If unchecked only imported mails " + ++ "are post-processed, others stay where they are." + , targetFolder = "Target folder" + , targetFolderInfo = "Move mails into this folder." + , deleteMailLabel = "Delete imported mails" + , deleteMailInfo = + "Whether to delete all mails fetched by docspell. This only applies if " + ++ "*target folder* is not set." + , itemDirection = "Item direction" + , automatic = "Automatic" + , itemDirectionInfo = + "Sets the direction for an item. If you know all mails are incoming or " + ++ "outgoing, you can set it here. Otherwise it will be guessed from looking " + ++ "at sender and receiver." + , itemFolder = "Item Folder" + , itemFolderInfo = "Put all items from this mailbox into the selected folder" + , folderOwnerWarning = """ +You are **not a member** of this folder. Items created from mails in +this mailbox will be **hidden** from any search results. Use a folder +where you are a member of to make items visible. This message will +disappear then. + """ + , tagsInfo = "Choose tags that should be applied to items." + , documentLanguage = "Language" + , documentLanguageInfo = + "Used for text extraction and text analysis. The " + ++ "collective's default language is used, if not specified here." + , schedule = "Schedule" + , scheduleClickForHelp = "Click here for help" + , scheduleInfo = + "Specify how often and when this task should run. " + ++ "Use English 3-letter weekdays. Either a single value, " + ++ "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) " + ++ "is allowed for each part." + } diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm b/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm new file mode 100644 index 00000000..2d0b7c24 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm @@ -0,0 +1,24 @@ +module Messages.ScanMailboxManageComp exposing (..) + +import Messages.Basics +import Messages.ScanMailboxFormComp +import Messages.ScanMailboxTableComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , form : Messages.ScanMailboxFormComp.Texts + , table : Messages.ScanMailboxTableComp.Texts + , newTask : String + , createNewTask : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , form = Messages.ScanMailboxFormComp.gb + , table = Messages.ScanMailboxTableComp.gb + , newTask = "New Task" + , createNewTask = "Create a new scan mailbox task" + } diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm b/modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm new file mode 100644 index 00000000..7fd6638c --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm @@ -0,0 +1,18 @@ +module Messages.ScanMailboxTableComp exposing (..) + + +type alias Texts = + { summary : String + , connection : String + , folders : String + , receivedSince : String + } + + +gb : Texts +gb = + { summary = "Summary" + , connection = "Connection" + , folders = "Folders" + , receivedSince = "Received Since" + } diff --git a/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm b/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm index 216301dc..ad4d5aea 100644 --- a/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm +++ b/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm @@ -1,12 +1,20 @@ module Messages.UserSettingsPage exposing (..) import Messages.ChangePasswordFormComp +import Messages.EmailSettingsManageComp +import Messages.ImapSettingsManageComp +import Messages.NotificationManageComp +import Messages.ScanMailboxManageComp import Messages.UiSettingsManageComp type alias Texts = { changePasswordForm : Messages.ChangePasswordFormComp.Texts , uiSettingsManage : Messages.UiSettingsManageComp.Texts + , emailSettingsManage : Messages.EmailSettingsManageComp.Texts + , imapSettingsManage : Messages.ImapSettingsManageComp.Texts + , notificationManage : Messages.NotificationManageComp.Texts + , scanMailboxManage : Messages.ScanMailboxManageComp.Texts , userSettings : String , uiSettings : String , notifications : String @@ -15,6 +23,10 @@ type alias Texts = , emailSettingImap : String , changePassword : String , uiSettingsInfo : String + , notificationInfoText : String + , notificationRemindDaysInfo : String + , scanMailboxInfo1 : String + , scanMailboxInfo2 : String } @@ -22,6 +34,10 @@ gb : Texts gb = { changePasswordForm = Messages.ChangePasswordFormComp.gb , uiSettingsManage = Messages.UiSettingsManageComp.gb + , emailSettingsManage = Messages.EmailSettingsManageComp.gb + , imapSettingsManage = Messages.ImapSettingsManageComp.gb + , notificationManage = Messages.NotificationManageComp.gb + , scanMailboxManage = Messages.ScanMailboxManageComp.gb , userSettings = "User Settings" , uiSettings = "UI Settings" , notifications = "Notifications" @@ -32,6 +48,27 @@ gb = , uiSettingsInfo = "These settings only affect the web ui. They are stored in the browser, " ++ "so they are separated between browsers and devices." + , notificationInfoText = + """ + Docspell can notify you once the due dates of your items + come closer. Notification is done via e-mail. You need to + provide a connection in your e-mail settings.""" + , notificationRemindDaysInfo = + "Docspell finds all items that are due in *Remind Days* days and sends this list via e-mail." + , scanMailboxInfo1 = + "Docspell can scan folders of your mailbox to import your mails. " + ++ "You need to provide a connection in " + ++ "your e-mail (imap) settings." + , scanMailboxInfo2 = + """ + Docspell goes through all configured folders and imports + mails matching the search criteria. Mails are skipped if + they were imported in a previous run and the corresponding + items still exist. After submitting a mail into docspell, + you can choose to move it to another folder, to delete it + or to just leave it there. In the latter case you should + adjust the schedule to avoid reading over the same mails + again.""" } diff --git a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm index 4bcadab8..0756cbfb 100644 --- a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm @@ -11,6 +11,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Markdown import Messages.UserSettingsPage exposing (Texts) import Page.UserSettings.Data exposing (..) import Styles as S @@ -111,16 +112,16 @@ viewContent texts flags settings model = viewChangePassword texts model Just EmailSettingsTab -> - viewEmailSettings settings model + viewEmailSettings texts settings model Just NotificationTab -> - viewNotificationManage settings model + viewNotificationManage texts settings model Just ImapSettingsTab -> - viewImapSettings settings model + viewImapSettings texts settings model Just ScanMailboxTab -> - viewScanMailboxManage flags settings model + viewScanMailboxManage texts flags settings model Just UiSettingsTab -> viewUiSettings texts flags settings model @@ -186,100 +187,91 @@ viewUiSettings texts flags settings model = ] -viewEmailSettings : UiSettings -> Model -> List (Html Msg) -viewEmailSettings settings model = +viewEmailSettings : Texts -> UiSettings -> Model -> List (Html Msg) +viewEmailSettings texts settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-envelope" ] [] , div [ class "ml-3" ] - [ text "E-Mail Settings (Smtp)" + [ text texts.emailSettingSmtp ] ] , Html.map EmailSettingsMsg (Comp.EmailSettingsManage.view2 + texts.emailSettingsManage settings model.emailSettingsModel ) ] -viewImapSettings : UiSettings -> Model -> List (Html Msg) -viewImapSettings settings model = +viewImapSettings : Texts -> UiSettings -> Model -> List (Html Msg) +viewImapSettings texts settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-envelope" ] [] , div [ class "ml-3" ] - [ text "E-Mail Settings (Imap)" + [ text texts.emailSettingImap ] ] , Html.map ImapSettingsMsg (Comp.ImapSettingsManage.view2 + texts.imapSettingsManage settings model.imapSettingsModel ) ] -viewNotificationManage : UiSettings -> Model -> List (Html Msg) -viewNotificationManage settings model = +viewNotificationManage : Texts -> UiSettings -> Model -> List (Html Msg) +viewNotificationManage texts settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-bullhorn" ] [] , div [ class "ml-3" ] - [ text "Notification" + [ text texts.notifications ] ] , p [ class "opacity-80 text-lg mb-3" ] - [ text """ - Docspell can notify you once the due dates of your items - come closer. Notification is done via e-mail. You need to - provide a connection in your e-mail settings.""" + [ text texts.notificationInfoText ] , p [ class "opacity-80 text-lg mb-3" ] - [ text "Docspell finds all items that are due in " - , em [ class "font-italic" ] [ text "Remind Days" ] - , text " days and sends this list via e-mail." + [ Markdown.toHtml [] texts.notificationRemindDaysInfo ] , Html.map NotificationMsg - (Comp.NotificationManage.view2 settings model.notificationModel) + (Comp.NotificationManage.view2 texts.notificationManage + settings + model.notificationModel + ) ] -viewScanMailboxManage : Flags -> UiSettings -> Model -> List (Html Msg) -viewScanMailboxManage flags settings model = +viewScanMailboxManage : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewScanMailboxManage texts flags settings model = [ h2 [ class S.header1 , class "inline-flex items-center" ] [ i [ class "fa fa-envelope-open font-thin" ] [] , div [ class "ml-3" ] - [ text "Scan Mailbox" + [ text texts.scanMailbox ] ] , p [ class "opacity-80 text-lg mb-3" ] - [ text "Docspell can scan folders of your mailbox to import your mails. " - , text "You need to provide a connection in " - , text "your e-mail (imap) settings." + [ text texts.scanMailboxInfo1 ] , p [ class "opacity-80 text-lg mb-3 hidden" ] - [ text """ - Docspell goes through all configured folders and imports - mails matching the search criteria. Mails are skipped if - they were imported in a previous run and the corresponding - items still exist. After submitting a mail into docspell, - you can choose to move it to another folder, to delete it - or to just leave it there. In the latter case you should - adjust the schedule to avoid reading over the same mails - again.""" + [ text texts.scanMailboxInfo2 ] , Html.map ScanMailboxMsg (Comp.ScanMailboxManage.view2 + texts.scanMailboxManage flags settings model.scanMailboxModel From 1762e7afac02996f35af0ce783dd5dae31dfacba Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Mon, 5 Apr 2021 21:31:45 +0200 Subject: [PATCH 18/25] Externalize strings for home page --- modules/webapp/src/main/elm/App/View2.elm | 21 +++- .../webapp/src/main/elm/Comp/ConfirmModal.elm | 8 +- .../main/elm/Comp/CustomFieldMultiInput.elm | 23 ++-- modules/webapp/src/main/elm/Comp/ItemCard.elm | 28 +++-- .../webapp/src/main/elm/Comp/ItemCardList.elm | 19 +-- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 11 +- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 102 +++++++++------- .../src/main/elm/Comp/ItemDetail/Update.elm | 8 ++ .../src/main/elm/Comp/PowerSearchInput.elm | 15 ++- .../webapp/src/main/elm/Comp/SearchMenu.elm | 115 ++++++++++-------- .../src/main/elm/Comp/SearchStatsView.elm | 17 +-- modules/webapp/src/main/elm/Messages.elm | 4 + .../webapp/src/main/elm/Messages/Basics.elm | 6 + .../webapp/src/main/elm/Messages/HomePage.elm | 58 +++++++++ .../src/main/elm/Messages/HomeSideMenu.elm | 27 ++++ .../src/main/elm/Messages/ItemCardComp.elm | 12 ++ .../main/elm/Messages/ItemCardListComp.elm | 14 +++ .../src/main/elm/Messages/MultiEditComp.elm | 61 ++++++++++ .../src/main/elm/Messages/SearchMenuComp.elm | 74 +++++++++++ .../main/elm/Messages/SearchStatsViewComp.elm | 22 ++++ .../webapp/src/main/elm/Page/Home/Data.elm | 11 +- .../src/main/elm/Page/Home/SideMenu.elm | 40 +++--- .../webapp/src/main/elm/Page/Home/Update.elm | 19 +-- .../webapp/src/main/elm/Page/Home/View2.elm | 111 ++++++++++------- 24 files changed, 601 insertions(+), 225 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/HomePage.elm create mode 100644 modules/webapp/src/main/elm/Messages/HomeSideMenu.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemCardComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemCardListComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/MultiEditComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SearchMenuComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index ba3cac4e..0cf078cf 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -118,7 +118,7 @@ mainContent model = ] (case model.page of HomePage -> - viewHome model + viewHome texts model CollectiveSettingPage -> viewCollectiveSettings texts model @@ -397,10 +397,21 @@ dropdownMenu = " absolute right-0 bg-white dark:bg-bluegray-800 border dark:border-bluegray-700 dark:text-bluegray-300 shadow-lg opacity-1 transition duration-200 min-w-max " -viewHome : Model -> List (Html Msg) -viewHome model = - [ Html.map HomeMsg (Home.viewSidebar model.sidebarVisible model.flags model.uiSettings model.homeModel) - , Html.map HomeMsg (Home.viewContent model.flags model.uiSettings model.homeModel) +viewHome : Messages -> Model -> List (Html Msg) +viewHome texts model = + [ Html.map HomeMsg + (Home.viewSidebar texts.home + model.sidebarVisible + model.flags + model.uiSettings + model.homeModel + ) + , Html.map HomeMsg + (Home.viewContent texts.home + model.flags + model.uiSettings + model.homeModel + ) ] diff --git a/modules/webapp/src/main/elm/Comp/ConfirmModal.elm b/modules/webapp/src/main/elm/Comp/ConfirmModal.elm index 10b5a3ad..5f01a733 100644 --- a/modules/webapp/src/main/elm/Comp/ConfirmModal.elm +++ b/modules/webapp/src/main/elm/Comp/ConfirmModal.elm @@ -23,14 +23,14 @@ type alias Settings msg = } -defaultSettings : msg -> msg -> String -> Settings msg -defaultSettings confirm cancel confirmMsg = +defaultSettings : msg -> msg -> String -> String -> String -> Settings msg +defaultSettings confirm cancel okLabel cancelLabel confirmMsg = { enabled = True , extraClass = "" , headerIcon = "fa fa-exclamation-circle mr-3" , headerClass = "text-2xl font-bold text-center w-full" - , confirmText = "Ok" - , cancelText = "Cancel" + , confirmText = okLabel + , cancelText = cancelLabel , message = confirmMsg , confirm = confirm , cancel = cancel diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index bb39cf65..8cf7ed94 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -313,23 +313,28 @@ type alias ViewSettings = { showAddButton : Bool , classes : String , fieldIcon : CustomField -> Maybe String + , style : DS.DropdownStyle + , createCustomFieldTitle : String } -view2 : DS.DropdownStyle -> ViewSettings -> Model -> Html Msg -view2 ddstyle viewSettings model = +view2 : ViewSettings -> Model -> Html Msg +view2 viewSettings model = div [ class viewSettings.classes ] - (viewMenuBar2 ddstyle viewSettings model + (viewMenuBar2 viewSettings model :: List.map (viewCustomField2 viewSettings model) (visibleFields model) ) -viewMenuBar2 : DS.DropdownStyle -> ViewSettings -> Model -> Html Msg -viewMenuBar2 ddstyle viewSettings model = +viewMenuBar2 : ViewSettings -> Model -> Html Msg +viewMenuBar2 viewSettings model = let { dropdown, selected } = model.fieldSelect + ddstyle = + viewSettings.style + ddstyleFlex = { display = \f -> Maybe.withDefault f.name f.label , icon = \_ -> Nothing @@ -350,7 +355,7 @@ viewMenuBar2 ddstyle viewSettings model = dropdown ) :: (if viewSettings.showAddButton then - [ addFieldLink2 "ml-1" model + [ addFieldLink2 viewSettings.createCustomFieldTitle "ml-1" model ] else @@ -377,8 +382,8 @@ viewCustomField2 viewSettings model field = span [] [] -addFieldLink2 : String -> Model -> Html Msg -addFieldLink2 classes _ = +addFieldLink2 : String -> String -> Model -> Html Msg +addFieldLink2 titleStr classes _ = a [ class classes , class S.secondaryButton @@ -386,7 +391,7 @@ addFieldLink2 classes _ = -- , class "absolute -right-12 top-0" , href "#" , onClick CreateNewField - , title "Create a new custom field" + , title titleStr ] [ i [ class "fa fa-plus" ] [] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemCard.elm b/modules/webapp/src/main/elm/Comp/ItemCard.elm index b361830f..0e18bd73 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCard.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCard.elm @@ -23,6 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Markdown +import Messages.ItemCardComp exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S @@ -135,12 +136,11 @@ update ddm msg model = ---- View --- View2 -view2 : ViewConfig -> UiSettings -> Model -> ItemLight -> Html Msg -view2 cfg settings model item = +view2 : Texts -> ViewConfig -> UiSettings -> Model -> ItemLight -> Html Msg +view2 texts cfg settings model item = let isConfirmed = item.state /= "created" @@ -200,8 +200,8 @@ view2 cfg settings model item = [ previewImage2 settings cardAction model item ] ) - ++ [ mainContent2 cardAction cardColor isConfirmed settings cfg item - , metaDataContent2 settings item + ++ [ mainContent2 texts cardAction cardColor isConfirmed settings cfg item + , metaDataContent2 texts settings item , notesContent2 settings item , fulltextResultsContent2 item , previewMenu2 settings model item (currentAttachment model item) @@ -221,8 +221,8 @@ fulltextResultsContent2 item = (List.map renderHighlightEntry2 item.highlighting) -metaDataContent2 : UiSettings -> ItemLight -> Html Msg -metaDataContent2 settings item = +metaDataContent2 : Texts -> UiSettings -> ItemLight -> Html Msg +metaDataContent2 texts settings item = let fieldHidden f = Data.UiSettings.fieldHidden settings f @@ -234,7 +234,7 @@ metaDataContent2 settings item = [ ( "hidden", fieldHidden Data.Fields.Folder ) ] , class "hover:opacity-60" - , title "Folder" + , title texts.folder ] [ Icons.folderIcon2 "mr-2" , Comp.LinkTarget.makeFolderLink item @@ -273,8 +273,16 @@ notesContent2 settings item = ] -mainContent2 : List (Attribute Msg) -> String -> Bool -> UiSettings -> ViewConfig -> ItemLight -> Html Msg -mainContent2 cardAction cardColor isConfirmed settings _ item = +mainContent2 : + Texts + -> List (Attribute Msg) + -> String + -> Bool + -> UiSettings + -> ViewConfig + -> ItemLight + -> Html Msg +mainContent2 texts cardAction cardColor isConfirmed settings _ item = let dirIcon = i diff --git a/modules/webapp/src/main/elm/Comp/ItemCardList.elm b/modules/webapp/src/main/elm/Comp/ItemCardList.elm index e3432c19..19f8a59d 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCardList.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCardList.elm @@ -22,6 +22,7 @@ import Data.UiSettings exposing (UiSettings) import Dict exposing (Dict) import Html exposing (..) import Html.Attributes exposing (..) +import Messages.ItemCardListComp exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.ItemDragDrop as DD @@ -148,19 +149,19 @@ type alias ViewConfig = } -view2 : ViewConfig -> UiSettings -> Model -> Html Msg -view2 cfg settings model = +view2 : Texts -> ViewConfig -> UiSettings -> Model -> Html Msg +view2 texts cfg settings model = div [ classList [ ( "ds-item-list", True ) , ( "ds-multi-select-mode", isMultiSelectMode cfg ) ] ] - (List.map (viewGroup2 model cfg settings) model.results.groups) + (List.map (viewGroup2 texts model cfg settings) model.results.groups) -viewGroup2 : Model -> ViewConfig -> UiSettings -> ItemLightGroup -> Html Msg -viewGroup2 model cfg settings group = +viewGroup2 : Texts -> Model -> ViewConfig -> UiSettings -> ItemLightGroup -> Html Msg +viewGroup2 texts model cfg settings group = div [ class "ds-item-group" ] [ div [ class "flex py-0 mt-2 flex flex-row items-center" @@ -185,12 +186,12 @@ viewGroup2 model cfg settings group = [] ] , div [ class "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-2" ] - (List.map (viewItem2 model cfg settings) group.items) + (List.map (viewItem2 texts model cfg settings) group.items) ] -viewItem2 : Model -> ViewConfig -> UiSettings -> ItemLight -> Html Msg -viewItem2 model cfg settings item = +viewItem2 : Texts -> Model -> ViewConfig -> UiSettings -> ItemLight -> Html Msg +viewItem2 texts model cfg settings item = let currentClass = if cfg.current == Just item.id then @@ -207,7 +208,7 @@ viewItem2 model cfg settings item = |> Maybe.withDefault Comp.ItemCard.init cardHtml = - Comp.ItemCard.view2 vvcfg settings cardModel item + Comp.ItemCard.view2 texts.itemCard vvcfg settings cardModel item in Html.map (ItemCardMsg item) cardHtml diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index 3cedc45f..c5370009 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -96,10 +96,12 @@ formTabs flags settings model = Data.UiSettings.fieldVisible settings field customFieldSettings = - Comp.CustomFieldMultiInput.ViewSettings - True - "field" - (\f -> Dict.get f.id model.customFieldSavingIcon) + { showAddButton = True + , classes = "" + , fieldIcon = \f -> Dict.get f.id model.customFieldSavingIcon + , style = dds + , createCustomFieldTitle = "Create new custom field" + } optional fields html = if @@ -255,7 +257,6 @@ item visible. This message will disappear then. [ div [ class "mb-4" ] [ Html.map CustomFieldMsg (Comp.CustomFieldMultiInput.view2 - dds customFieldSettings model.customFieldsModel ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index cc734ea7..d63af8ce 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -39,6 +39,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http import Markdown +import Messages.MultiEditComp exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S @@ -601,13 +602,13 @@ defaultViewConfig = --- View2 -view2 : Flags -> ViewConfig -> UiSettings -> Model -> Html Msg +view2 : Texts -> Flags -> ViewConfig -> UiSettings -> Model -> Html Msg view2 = renderEditForm2 -renderEditForm2 : Flags -> ViewConfig -> UiSettings -> Model -> Html Msg -renderEditForm2 flags cfg settings model = +renderEditForm2 : Texts -> Flags -> ViewConfig -> UiSettings -> Model -> Html Msg +renderEditForm2 texts flags cfg settings model = let fieldVisible field = Data.UiSettings.fieldVisible settings field @@ -636,13 +637,13 @@ renderEditForm2 flags cfg settings model = tagModeMsg = case model.tagEditMode of AddTags -> - "Tags chosen here are *added* to all selected items." + texts.tagModeAddInfo RemoveTags -> - "Tags chosen here are *removed* from all selected items." + texts.tagModeRemoveInfo ReplaceTags -> - "Tags chosen here *replace* those on selected items." + texts.tagModeReplaceInfo customFieldIcon field = case cfg.customFieldState field.id of @@ -656,10 +657,12 @@ renderEditForm2 flags cfg settings model = Just "fa fa-sync-alt animate-spin" customFieldSettings = - Comp.CustomFieldMultiInput.ViewSettings - False - "mb-4" - customFieldIcon + { showAddButton = False + , classes = "mb-4" + , fieldIcon = customFieldIcon + , style = dds + , createCustomFieldTitle = "" + } dds = Data.DropdownStyle.sidebarStyle @@ -677,7 +680,7 @@ renderEditForm2 flags cfg settings model = idNameCfg = { makeOption = \e -> { text = e.name, additional = "" } , labelColor = \_ -> \_ -> "" - , placeholder = "Select…" + , placeholder = texts.selectPlaceholder , style = dds } @@ -687,7 +690,7 @@ renderEditForm2 flags cfg settings model = { text = Data.Direction.toString entry , additional = "" } - , placeholder = "Choose a direction…" + , placeholder = texts.chooseDirection , labelColor = \_ -> \_ -> "" , style = dds } @@ -697,7 +700,7 @@ renderEditForm2 flags cfg settings model = tabStyle (tabState settings model) [ { name = tabName TabConfirmUnconfirm - , title = "Confirm/Unconfirm item metadata" + , title = texts.confirmUnconfirm , titleRight = [] , info = Nothing , body = @@ -709,32 +712,32 @@ renderEditForm2 flags cfg settings model = , class "flex-grow" , onClick (ConfirmMsg True) ] - [ text "Confirm" + [ text texts.confirm ] , button [ class S.secondaryButton , class "flex-grow" , onClick (ConfirmMsg False) ] - [ text "Unconfirm" + [ text texts.unconfirm ] ] ] } , { name = tabName TabTags - , title = "Tags" + , title = texts.basics.tags , titleRight = [] , info = Nothing , body = [ div [ class "field" ] [ label [ class S.inputLabel ] [ Icons.tagsIcon2 "" - , text "Tags" + , text texts.basics.tags , a [ class "float-right" , class S.link , href "#" - , title "Change tag edit mode" + , title texts.changeTagMode , onClick ToggleTagEditMode ] [ tagModeIcon @@ -750,7 +753,7 @@ renderEditForm2 flags cfg settings model = ] } , { name = tabName TabFolder - , title = "Folder" + , title = texts.folderTab , titleRight = [] , info = Nothing , body = @@ -761,25 +764,24 @@ renderEditForm2 flags cfg settings model = , ( "hidden", isFolderMember model ) ] ] - [ Markdown.toHtml [] """ -You are **not a member** of this folder. This item will be **hidden** -from any search now. Use a folder where you are a member of to make this -item visible. This message will disappear then. - """ + [ Markdown.toHtml [] texts.folderNotOwnerWarning ] ] } , { name = tabName TabCustomFields - , title = "Custom Fields" + , title = texts.customFieldsTab , titleRight = [] , info = Nothing , body = [ Html.map CustomFieldMsg - (Comp.CustomFieldMultiInput.view2 dds customFieldSettings model.customFieldModel) + (Comp.CustomFieldMultiInput.view2 + customFieldSettings + model.customFieldModel + ) ] } , { name = tabName TabDate - , title = "Date" + , title = texts.dateTab , titleRight = [] , info = Nothing , body = @@ -802,7 +804,7 @@ item visible. This message will disappear then. ] } , { name = tabName TabDueDate - , title = "Due Date" + , title = texts.dueDateTab , titleRight = [] , info = Nothing , body = @@ -825,7 +827,7 @@ item visible. This message will disappear then. ] } , { name = tabName TabCorrespondent - , title = "Correspondent" + , title = texts.correspondentTab , titleRight = [] , info = Nothing , body = @@ -834,25 +836,35 @@ item visible. This message will disappear then. [ label [ class S.inputLabel ] [ Icons.organizationIcon2 "" , span [ class "ml-2" ] - [ text "Organization" + [ text texts.organization ] ] - , Html.map OrgDropdownMsg (Comp.Dropdown.view2 idNameCfg settings model.corrOrgModel) + , Html.map OrgDropdownMsg + (Comp.Dropdown.view2 + idNameCfg + settings + model.corrOrgModel + ) ] , optional [ Data.Fields.CorrPerson ] <| div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.personIcon2 "" , span [ class "ml-2" ] - [ text "Person" + [ text texts.person ] ] - , Html.map CorrPersonMsg (Comp.Dropdown.view2 idNameCfg settings model.corrPersonModel) + , Html.map CorrPersonMsg + (Comp.Dropdown.view2 + idNameCfg + settings + model.corrPersonModel + ) ] ] } , { name = tabName TabConcerning - , title = "Concerning" + , title = texts.concerningTab , titleRight = [] , info = Nothing , body = @@ -861,7 +873,7 @@ item visible. This message will disappear then. [ label [ class S.inputLabel ] [ Icons.personIcon2 "" , span [ class "ml-2" ] - [ text "Person" ] + [ text texts.person ] ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 idNameCfg settings model.concPersonModel) ] @@ -870,7 +882,7 @@ item visible. This message will disappear then. [ label [ class S.inputLabel ] [ Icons.equipmentIcon2 "" , span [ class "ml-2" ] - [ text "Equipment" ] + [ text texts.equipment ] ] , Html.map ConcEquipMsg (Comp.Dropdown.view2 idNameCfg @@ -881,7 +893,7 @@ item visible. This message will disappear then. ] } , { name = tabName TabDirection - , title = "Direction" + , title = texts.directionTab , titleRight = [] , info = Nothing , body = @@ -889,7 +901,7 @@ item visible. This message will disappear then. ] } , { name = tabName TabName - , title = "Name" + , title = texts.nameTab , titleRight = [] , info = Nothing , body = @@ -904,9 +916,15 @@ item visible. This message will disappear then. , span [ class S.inputLeftIconOnly ] [ i [ classList - [ ( "text-green-500 fa fa-check", cfg.nameState == SaveSuccess ) - , ( "text-red-500 fa fa-exclamation-triangle", cfg.nameState == SaveFailed ) - , ( "sync fa fa-circle-notch animate-spin", cfg.nameState == Saving ) + [ ( "text-green-500 fa fa-check" + , cfg.nameState == SaveSuccess + ) + , ( "text-red-500 fa fa-exclamation-triangle" + , cfg.nameState == SaveFailed + ) + , ( "sync fa fa-circle-notch animate-spin" + , cfg.nameState == Saving + ) ] ] [] @@ -923,7 +941,7 @@ tabState settings model tab = FTabState.tabState settings model.openTabs (Just model.customFieldModel) - (.title >> ToggleAkkordionTab) + (.name >> ToggleAkkordionTab) tab diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm index 8e523908..d47da245 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm @@ -550,6 +550,8 @@ update key flags inav settings msg model = Comp.ConfirmModal.defaultSettings DeleteItemConfirmed ItemModalCancelled + "Ok" + "Cancel" confirmMsg in resultModel { model | itemModal = Just confirm } @@ -923,6 +925,8 @@ update key flags inav settings msg model = Comp.ConfirmModal.defaultSettings (DeleteAttachConfirmed id) AttachModalCancelled + "Ok" + "Cancel" "Really delete this file?" model_ = @@ -1511,6 +1515,8 @@ update key flags inav settings msg model = Comp.ConfirmModal.defaultSettings (ReprocessFileConfirmed id) AttachModalCancelled + "Ok" + "Cancel" confirmMsg model_ = @@ -1546,6 +1552,8 @@ update key flags inav settings msg model = Comp.ConfirmModal.defaultSettings ReprocessItemConfirmed ItemModalCancelled + "Ok" + "Cancel" confirmMsg model_ = diff --git a/modules/webapp/src/main/elm/Comp/PowerSearchInput.elm b/modules/webapp/src/main/elm/Comp/PowerSearchInput.elm index ac1b35f3..6d51b2e0 100644 --- a/modules/webapp/src/main/elm/Comp/PowerSearchInput.elm +++ b/modules/webapp/src/main/elm/Comp/PowerSearchInput.elm @@ -2,6 +2,7 @@ module Comp.PowerSearchInput exposing ( Action(..) , Model , Msg + , ViewSettings , init , update , viewInput @@ -133,12 +134,18 @@ throttleUpdate model = --- View -viewInput : List (Attribute Msg) -> Model -> Html Msg -viewInput attrs model = +type alias ViewSettings = + { placeholder : String + , extraAttrs : List (Attribute Msg) + } + + +viewInput : ViewSettings -> Model -> Html Msg +viewInput cfg model = input - (attrs + (cfg.extraAttrs ++ [ type_ "text" - , placeholder "Search query …" + , placeholder cfg.placeholder , onInput SetSearch , Util.Html.onKeyUpCode KeyUpMsg , Maybe.map value model.input diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index ff3c335f..2e7a16b7 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -44,6 +44,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http +import Messages.SearchMenuComp exposing (Texts) import Set exposing (Set) import Styles as S import Util.Html exposing (KeyCode(..)) @@ -902,8 +903,7 @@ updateDrop ddm flags settings msg model = ToggleOpenAllAkkordionTabs -> let allNames = - searchTabs (DD.DragDropData ddm Nothing) flags settings model - |> List.map .title + List.map tabName allTabs |> Set.fromList next = @@ -924,8 +924,8 @@ updateDrop ddm flags settings msg model = --- View2 -viewDrop2 : DD.DragDropData -> Flags -> UiSettings -> Model -> Html Msg -viewDrop2 ddd flags settings model = +viewDrop2 : Texts -> DD.DragDropData -> Flags -> UiSettings -> Model -> Html Msg +viewDrop2 texts ddd flags settings model = let akkordionStyle = Comp.Tabs.searchMenuStyle @@ -933,7 +933,7 @@ viewDrop2 ddd flags settings model = Comp.Tabs.akkordion akkordionStyle (searchTabState settings model) - (searchTabs ddd flags settings model) + (searchTabs texts ddd flags settings model) type SearchTab @@ -950,6 +950,22 @@ type SearchTab | TabDirection +allTabs : List SearchTab +allTabs = + [ TabInbox + , TabTags + , TabTagCategories + , TabFolder + , TabCorrespondent + , TabConcerning + , TabCustomFields + , TabDate + , TabDueDate + , TabSource + , TabDirection + ] + + tabName : SearchTab -> String tabName tab = case tab of @@ -1085,8 +1101,8 @@ searchTabState settings model tab = ( state, ToggleAkkordionTab tab.name ) -searchTabs : DD.DragDropData -> Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) -searchTabs ddd flags settings model = +searchTabs : Texts -> DD.DragDropData -> Flags -> UiSettings -> Model -> List (Comp.Tabs.Tab Msg) +searchTabs texts ddd flags settings model = let isHidden f = Data.UiSettings.fieldHidden settings f @@ -1100,21 +1116,14 @@ searchTabs ddd flags settings model = { text = Data.Direction.toString entry , additional = "" } - , placeholder = "Choose a direction…" + , placeholder = texts.chooseDirection , labelColor = \_ -> \_ -> "" , style = DS.sidebarStyle } - corrPersonCfg = + personCfg = { makeOption = \e -> { text = e.name, additional = "" } - , placeholder = "Choose a person" - , labelColor = \_ -> \_ -> "" - , style = DS.sidebarStyle - } - - concPersonCfg = - { makeOption = \e -> { text = e.name, additional = "" } - , placeholder = "Choose a person" + , placeholder = texts.choosePerson , labelColor = \_ -> \_ -> "" , style = DS.sidebarStyle } @@ -1122,12 +1131,12 @@ searchTabs ddd flags settings model = concEquipCfg = { makeOption = \e -> { text = e.name, additional = "" } , labelColor = \_ -> \_ -> "" - , placeholder = "Choose an equipment" + , placeholder = texts.chooseEquipment , style = DS.sidebarStyle } in [ { name = tabName TabInbox - , title = "Inbox" + , title = texts.inbox , info = Nothing , titleRight = [] , body = @@ -1135,7 +1144,7 @@ searchTabs ddd flags settings model = MB.Checkbox { id = "search-inbox" , value = model.inboxCheckbox - , label = "Inbox" + , label = texts.inbox , tagger = \_ -> ToggleInbox } , div [ class "mt-2 hidden" ] @@ -1143,10 +1152,10 @@ searchTabs ddd flags settings model = [ text (case model.textSearchModel of Fulltext _ -> - "Fulltext Search" + texts.fulltextSearch Names _ -> - "Search in names" + texts.searchInNames ) , a [ classList @@ -1156,7 +1165,7 @@ searchTabs ddd flags settings model = , class S.link , href "#" , onClick SwapTextSearch - , title "Switch between text search modes" + , title texts.switchSearchModes ] [ i [ class "fa fa-exchange-alt" ] [] ] @@ -1168,26 +1177,26 @@ searchTabs ddd flags settings model = , textSearchString model.textSearchModel |> Maybe.withDefault "" |> value , case model.textSearchModel of Fulltext _ -> - placeholder "Content search…" + placeholder texts.contentSearch Names _ -> - placeholder "Search in various names…" + placeholder texts.searchInNamesPlaceholder , class S.textInputSidebar ] [] , span [ class "opacity-50 text-sm" ] [ case model.textSearchModel of Fulltext _ -> - text "Fulltext search in document contents and notes." + text texts.fulltextSearchInfo Names _ -> - text "Looks in correspondents, concerned entities, item name and notes." + text texts.nameSearchInfo ] ] ] } , { name = tabName TabTags - , title = "Tags" + , title = texts.basics.tags , titleRight = [] , info = Nothing , body = @@ -1200,7 +1209,7 @@ searchTabs ddd flags settings model = ) } , { name = tabName TabTagCategories - , title = "Tag Categories" + , title = texts.tagCategoryTab , titleRight = [] , info = Nothing , body = @@ -1213,7 +1222,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabFolder - , title = "Folder" + , title = texts.folderTab , titleRight = [] , info = Nothing , body = @@ -1225,7 +1234,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabCorrespondent - , title = "Correspondent" + , title = texts.correspondentTab , titleRight = [] , info = Nothing , body = @@ -1234,10 +1243,10 @@ searchTabs ddd flags settings model = , classList [ ( "hidden", isHidden Data.Fields.CorrOrg ) ] ] [ label [ class S.inputLabel ] - [ text "Organization" ] + [ text texts.organization ] , Html.map OrgMsg (Comp.Dropdown.view2 - (Comp.Dropdown.orgFormViewSettings "Choose an organization" DS.sidebarStyle) + (Comp.Dropdown.orgFormViewSettings texts.chooseOrganization DS.sidebarStyle) settings model.orgModel ) @@ -1246,10 +1255,10 @@ searchTabs ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.CorrPerson ) ] ] - [ label [ class S.inputLabel ] [ text "Person" ] + [ label [ class S.inputLabel ] [ text texts.person ] , Html.map CorrPersonMsg (Comp.Dropdown.view2 - corrPersonCfg + personCfg settings model.corrPersonModel ) @@ -1257,7 +1266,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabConcerning - , title = "Concerning" + , title = texts.concerningTab , titleRight = [] , info = Nothing , body = @@ -1265,10 +1274,10 @@ searchTabs ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.ConcPerson ) ] ] - [ label [ class S.inputLabel ] [ text "Person" ] + [ label [ class S.inputLabel ] [ text texts.person ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 - concPersonCfg + personCfg settings model.concPersonModel ) @@ -1277,7 +1286,7 @@ searchTabs ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.ConcEquip ) ] ] - [ label [ class S.inputLabel ] [ text "Equipment" ] + [ label [ class S.inputLabel ] [ text texts.equipment ] , Html.map ConcEquipmentMsg (Comp.Dropdown.view2 concEquipCfg @@ -1288,20 +1297,24 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabCustomFields - , title = "Custom Fields" + , title = texts.customFieldsTab , titleRight = [] , info = Nothing , body = [ Html.map CustomFieldMsg (Comp.CustomFieldMultiInput.view2 - DS.sidebarStyle - (Comp.CustomFieldMultiInput.ViewSettings False "field" (\_ -> Nothing)) + { showAddButton = False + , classes = "" + , fieldIcon = \_ -> Nothing + , style = DS.sidebarStyle + , createCustomFieldTitle = texts.createCustomFieldTitle + } model.customFieldModel ) ] } , { name = tabName TabDate - , title = "Date" + , title = texts.dateTab , titleRight = [] , info = Nothing , body = @@ -1309,7 +1322,7 @@ searchTabs ddd flags settings model = [ class "flex flex-col" ] [ div [ class "mb-2" ] [ label [ class S.inputLabel ] - [ text "From" + [ text texts.from ] , div [ class "relative" ] [ Html.map FromDateMsg @@ -1326,7 +1339,7 @@ searchTabs ddd flags settings model = ] , div [ class "mb-2" ] [ label [ class S.inputLabel ] - [ text "To" + [ text texts.to ] , div [ class "relative" ] [ Html.map UntilDateMsg @@ -1341,7 +1354,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabDueDate - , title = "Due Date" + , title = texts.dueDateTab , titleRight = [] , info = Nothing , body = @@ -1349,7 +1362,7 @@ searchTabs ddd flags settings model = [ class "flex flex-col" ] [ div [ class "mb-2" ] [ label [ class S.inputLabel ] - [ text "Due From" + [ text texts.dueFrom ] , div [ class "relative" ] [ Html.map FromDueDateMsg @@ -1366,7 +1379,7 @@ searchTabs ddd flags settings model = ] , div [ class "mb-2" ] [ label [ class S.inputLabel ] - [ text "Due To" + [ text texts.dueTo ] , div [ class "relative" ] [ Html.map UntilDueDateMsg @@ -1385,7 +1398,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabSource - , title = "Source" + , title = texts.sourceTab , titleRight = [] , info = Nothing , body = @@ -1395,7 +1408,7 @@ searchTabs ddd flags settings model = , onInput SetSource , Util.Html.onKeyUpCode KeyUpMsg , model.sourceModel |> Maybe.withDefault "" |> value - , placeholder "Search in item source…" + , placeholder texts.searchInItemSource , class S.textInputSidebar ] [] @@ -1403,7 +1416,7 @@ searchTabs ddd flags settings model = ] } , { name = tabName TabDirection - , title = "Direction" + , title = texts.directionTab , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/SearchStatsView.elm b/modules/webapp/src/main/elm/Comp/SearchStatsView.elm index 6e03fd35..861680eb 100644 --- a/modules/webapp/src/main/elm/Comp/SearchStatsView.elm +++ b/modules/webapp/src/main/elm/Comp/SearchStatsView.elm @@ -11,6 +11,7 @@ import Data.Icons as Icons import Data.Money import Html exposing (..) import Html.Attributes exposing (..) +import Messages.SearchStatsViewComp exposing (Texts) import Styles as S @@ -28,8 +29,8 @@ sortFields fields = --- View2 -view2 : String -> SearchStats -> Html msg -view2 classes stats = +view2 : Texts -> String -> SearchStats -> Html msg +view2 texts classes stats = let isNumField f = f.sum > 0 @@ -75,7 +76,7 @@ view2 classes stats = { rootClass = "" , valueClass = "text-4xl" , value = String.fromInt stats.count - , label = "Items" + , label = texts.items } ] , div [ class "flex-grow" ] @@ -87,15 +88,15 @@ view2 classes stats = [ tr [ class "" ] [ th [ class "py-2 text-left" ] [] , th [ class "py-2 text-center" ] - [ text "Count" ] + [ text texts.count ] , th [ class "py-2 text-center" ] - [ text "Sum" ] + [ text texts.sum ] , th [ class "py-2 text-center hidden md:table-cell" ] - [ text "Avg" ] + [ text texts.avg ] , th [ class "py-2 text-center hidden md:table-cell" ] - [ text "Min" ] + [ text texts.min ] , th [ class "py-2 text-center hidden md:table-cell" ] - [ text "Max" ] + [ text texts.max ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index ef8d3956..5b9d80ba 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -7,6 +7,7 @@ module Messages exposing import Messages.App import Messages.CollectiveSettingsPage +import Messages.HomePage import Messages.ItemDetailPage import Messages.LoginPage import Messages.ManageDataPage @@ -35,6 +36,7 @@ type alias Messages = , queue : Messages.QueuePage.Texts , userSettings : Messages.UserSettingsPage.Texts , manageData : Messages.ManageDataPage.Texts + , home : Messages.HomePage.Texts } @@ -97,6 +99,7 @@ gb = , queue = Messages.QueuePage.gb , userSettings = Messages.UserSettingsPage.gb , manageData = Messages.ManageDataPage.gb + , home = Messages.HomePage.gb } @@ -116,4 +119,5 @@ de = , queue = Messages.QueuePage.de , userSettings = Messages.UserSettingsPage.de , manageData = Messages.ManageDataPage.de + , home = Messages.HomePage.de } diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm index 5237d95f..aef37b84 100644 --- a/modules/webapp/src/main/elm/Messages/Basics.elm +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -16,6 +16,9 @@ type alias Texts = , backToList : String , searchPlaceholder : String , id : String + , ok : String + , yes : String + , no : String } @@ -35,6 +38,9 @@ gb = , backToList = "Back to list" , searchPlaceholder = "Search…" , id = "Id" + , ok = "Ok" + , yes = "Yes" + , no = "No" } diff --git a/modules/webapp/src/main/elm/Messages/HomePage.elm b/modules/webapp/src/main/elm/Messages/HomePage.elm new file mode 100644 index 00000000..575af594 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/HomePage.elm @@ -0,0 +1,58 @@ +module Messages.HomePage exposing (..) + +import Messages.Basics +import Messages.HomeSideMenu +import Messages.ItemCardListComp +import Messages.SearchStatsViewComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , sideMenu : Messages.HomeSideMenu.Texts + , itemCardList : Messages.ItemCardListComp.Texts + , searchStatsView : Messages.SearchStatsViewComp.Texts + , contentSearch : String + , searchInNames : String + , selectModeTitle : String + , fullHeightPreviewTitle : String + , fullWidthPreviewTitle : String + , powerSearchPlaceholder : String + , reallyReprocessQuestion : String + , reallyDeleteQuestion : String + , editSelectedItems : Int -> String + , reprocessSelectedItems : Int -> String + , deleteSelectedItems : Int -> String + , selectAllVisible : String + , selectNone : String + , resetSearchForm : String + , exitSelectMode : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , sideMenu = Messages.HomeSideMenu.gb + , itemCardList = Messages.ItemCardListComp.gb + , searchStatsView = Messages.SearchStatsViewComp.gb + , contentSearch = "Content search…" + , searchInNames = "Search in names…" + , selectModeTitle = "Select Mode" + , fullHeightPreviewTitle = "Full height preview" + , fullWidthPreviewTitle = "Full width preview" + , powerSearchPlaceholder = "Search query …" + , reallyReprocessQuestion = "Really reprocess all selected items? Metadata of unconfirmed items may change." + , reallyDeleteQuestion = "Really delete all selected items?" + , editSelectedItems = \n -> "Edit " ++ String.fromInt n ++ " selected items" + , reprocessSelectedItems = \n -> "Reprocess " ++ String.fromInt n ++ " selected items" + , deleteSelectedItems = \n -> "Delete " ++ String.fromInt n ++ " selected items" + , selectAllVisible = "Select all visible" + , selectNone = "Select none" + , resetSearchForm = "Reset search form" + , exitSelectMode = "Exit Select Mode" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm b/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm new file mode 100644 index 00000000..bc6a9256 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm @@ -0,0 +1,27 @@ +module Messages.HomeSideMenu exposing (..) + +import Messages.MultiEditComp +import Messages.SearchMenuComp + + +type alias Texts = + { searchMenu : Messages.SearchMenuComp.Texts + , multiEdit : Messages.MultiEditComp.Texts + , editMode : String + , resetSearchForm : String + , multiEditHeader : String + , multiEditInfo : String + , close : String + } + + +gb : Texts +gb = + { searchMenu = Messages.SearchMenuComp.gb + , multiEdit = Messages.MultiEditComp.gb + , editMode = "Edit Mode" + , resetSearchForm = "Reset search form" + , multiEditHeader = "Multi-Edit" + , multiEditInfo = "Note that a change here immediatly affects all selected items on the right!" + , close = "Close" + } diff --git a/modules/webapp/src/main/elm/Messages/ItemCardComp.elm b/modules/webapp/src/main/elm/Messages/ItemCardComp.elm new file mode 100644 index 00000000..e83dc466 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemCardComp.elm @@ -0,0 +1,12 @@ +module Messages.ItemCardComp exposing (..) + + +type alias Texts = + { folder : String + } + + +gb : Texts +gb = + { folder = "Folder" + } diff --git a/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm b/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm new file mode 100644 index 00000000..79a5adeb --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm @@ -0,0 +1,14 @@ +module Messages.ItemCardListComp exposing (..) + +import Messages.ItemCardComp + + +type alias Texts = + { itemCard : Messages.ItemCardComp.Texts + } + + +gb : Texts +gb = + { itemCard = Messages.ItemCardComp.gb + } diff --git a/modules/webapp/src/main/elm/Messages/MultiEditComp.elm b/modules/webapp/src/main/elm/Messages/MultiEditComp.elm new file mode 100644 index 00000000..77f0752f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/MultiEditComp.elm @@ -0,0 +1,61 @@ +module Messages.MultiEditComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , tagModeAddInfo : String + , tagModeRemoveInfo : String + , tagModeReplaceInfo : String + , selectPlaceholder : String + , chooseDirection : String + , confirmUnconfirm : String + , confirm : String + , unconfirm : String + , changeTagMode : String + , folderTab : String + , folderNotOwnerWarning : String + , customFieldsTab : String + , dateTab : String + , dueDateTab : String + , correspondentTab : String + , organization : String + , person : String + , concerningTab : String + , equipment : String + , directionTab : String + , nameTab : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.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" + , unconfirm = "Unconfirm" + , changeTagMode = "Change tag edit mode" + , folderTab = "Folder" + , folderNotOwnerWarning = + """ +You are **not a member** of this folder. This item will be **hidden** +from any search now. Use a folder where you are a member of to make this +item visible. This message will disappear then. + """ + , customFieldsTab = "Custom Fields" + , dateTab = "Date" + , dueDateTab = "Due Date" + , correspondentTab = "Correspondent" + , organization = "Organization" + , person = "Person" + , concerningTab = "Concerning" + , equipment = "Equipment" + , directionTab = "Direction" + , nameTab = "Name" + } diff --git a/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm b/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm new file mode 100644 index 00000000..80fad1d6 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm @@ -0,0 +1,74 @@ +module Messages.SearchMenuComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , chooseDirection : String + , choosePerson : String + , chooseEquipment : String + , inbox : String + , fulltextSearch : String + , searchInNames : String + , switchSearchModes : String + , contentSearch : String + , searchInNamesPlaceholder : String + , fulltextSearchInfo : String + , nameSearchInfo : String + , tagCategoryTab : String + , folderTab : String + , correspondentTab : String + , organization : String + , chooseOrganization : String + , person : String + , concerningTab : String + , equipment : String + , customFieldsTab : String + , createCustomFieldTitle : String + , dateTab : String + , from : String + , to : String + , dueDateTab : String + , dueFrom : String + , dueTo : String + , sourceTab : String + , searchInItemSource : String + , directionTab : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , chooseDirection = "Choose a direction…" + , choosePerson = "Choose a person" + , chooseEquipment = "Choose an equipment" + , inbox = "Inbox" + , fulltextSearch = "Fulltext Search" + , searchInNames = "Search in names" + , switchSearchModes = "Switch between text search modes" + , contentSearch = "Content search…" + , searchInNamesPlaceholder = "Search in various names…" + , fulltextSearchInfo = "Fulltext search in document contents and notes." + , nameSearchInfo = "Looks in correspondents, concerned entities, item name and notes." + , tagCategoryTab = "Tag Categories" + , folderTab = "Folder" + , correspondentTab = "Correspondent" + , organization = "Organization" + , chooseOrganization = "Choose an organization" + , person = "Person" + , concerningTab = "Concerning" + , equipment = "Equipment" + , customFieldsTab = "Custom Fields" + , createCustomFieldTitle = "Create a new custom field" + , dateTab = "Date" + , from = "From" + , to = "To" + , dueDateTab = "Due Date" + , dueFrom = "Due From" + , dueTo = "Due To" + , sourceTab = "Source" + , searchInItemSource = "Search in item source…" + , directionTab = "Direction" + } diff --git a/modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm b/modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm new file mode 100644 index 00000000..d6913f09 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm @@ -0,0 +1,22 @@ +module Messages.SearchStatsViewComp exposing (..) + + +type alias Texts = + { items : String + , count : String + , sum : String + , avg : String + , min : String + , max : String + } + + +gb : Texts +gb = + { items = "Items" + , count = "Count" + , sum = "Sum" + , avg = "Avg" + , min = "Min" + , max = "Max" + } diff --git a/modules/webapp/src/main/elm/Page/Home/Data.elm b/modules/webapp/src/main/elm/Page/Home/Data.elm index 2f2302d5..2190afb7 100644 --- a/modules/webapp/src/main/elm/Page/Home/Data.elm +++ b/modules/webapp/src/main/elm/Page/Home/Data.elm @@ -1,5 +1,6 @@ module Page.Home.Data exposing - ( Model + ( ConfirmModalValue(..) + , Model , Msg(..) , SearchParam , SearchType(..) @@ -21,7 +22,6 @@ import Api.Model.BasicResult exposing (BasicResult) import Api.Model.ItemLightList exposing (ItemLightList) import Api.Model.SearchStats exposing (SearchStats) import Browser.Dom as Dom -import Comp.ConfirmModal import Comp.ItemCardList import Comp.ItemDetail.FormChange exposing (FormChange) import Comp.ItemDetail.MultiEditMenu exposing (SaveNameState(..)) @@ -58,10 +58,15 @@ type alias Model = } +type ConfirmModalValue + = ConfirmReprocessItems + | ConfirmDelete + + type alias SelectViewModel = { ids : Set String , action : SelectActionMode - , confirmModal : Maybe (Comp.ConfirmModal.Settings Msg) + , confirmModal : Maybe ConfirmModalValue , editModel : Comp.ItemDetail.MultiEditMenu.Model , saveNameState : SaveNameState , saveCustomFieldState : Set String diff --git a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm index 412cddcf..f09c84e9 100644 --- a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm +++ b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm @@ -9,13 +9,14 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.HomeSideMenu exposing (Texts) import Page.Home.Data exposing (..) import Set import Styles as S -view : Flags -> UiSettings -> Model -> Html Msg -view flags settings model = +view : Texts -> Flags -> UiSettings -> Model -> Html Msg +view texts flags settings model = div [ class "flex flex-col" ] @@ -25,7 +26,7 @@ view flags settings model = { tagger = ToggleSelectView , label = "" , icon = Just "fa fa-tasks" - , title = "Edit Mode" + , title = texts.editMode , inputClass = [ ( S.secondaryBasicButton, True ) , ( "bg-gray-200 dark:bg-bluegray-600", selectActive model ) @@ -35,7 +36,7 @@ view flags settings model = { tagger = ResetSearch , label = "" , icon = Just "fa fa-sync" - , title = "Reset search form" + , title = texts.resetSearchForm , inputClass = [ ( S.secondaryBasicButton, True ) ] } ] @@ -47,19 +48,19 @@ view flags settings model = SelectView svm -> case svm.action of EditSelected -> - viewEditMenu flags svm settings + viewEditMenu texts flags svm settings _ -> - viewSearch flags settings model + viewSearch texts flags settings model _ -> - viewSearch flags settings model + viewSearch texts flags settings model ) ] -viewSearch : Flags -> UiSettings -> Model -> List (Html Msg) -viewSearch flags settings model = +viewSearch : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +viewSearch texts flags settings model = [ MB.viewSide { start = [ MB.CustomElement <| @@ -75,7 +76,8 @@ viewSearch flags settings model = , rootClasses = "my-1 text-xs hidden sm:flex" } , Html.map SearchMenuMsg - (Comp.SearchMenu.viewDrop2 model.dragDropData + (Comp.SearchMenu.viewDrop2 texts.searchMenu + model.dragDropData flags settings model.searchMenuModel @@ -83,8 +85,8 @@ viewSearch flags settings model = ] -viewEditMenu : Flags -> SelectViewModel -> UiSettings -> List (Html Msg) -viewEditMenu flags svm settings = +viewEditMenu : Texts -> Flags -> SelectViewModel -> UiSettings -> List (Html Msg) +viewEditMenu texts flags svm settings = let cfg_ = Comp.ItemDetail.MultiEditMenu.defaultViewConfig @@ -104,17 +106,17 @@ viewEditMenu flags svm settings = [ div [ class S.header2 ] [ i [ class "fa fa-edit" ] [] , span [ class "ml-2" ] - [ text "Multi-Edit" + [ text texts.multiEditHeader ] ] , div [ class S.infoMessage ] - [ text "Note that a change here immediatly affects all selected items on the right!" + [ text texts.multiEditInfo ] , MB.viewSide { start = [ MB.CustomElement <| B.secondaryButton - { label = "Close" + { label = texts.close , disabled = False , icon = "fa fa-times" , handler = onClick ToggleSelectView @@ -127,5 +129,11 @@ viewEditMenu flags svm settings = , rootClasses = "mt-2 text-sm" } , Html.map EditMenuMsg - (Comp.ItemDetail.MultiEditMenu.view2 flags cfg settings svm.editModel) + (Comp.ItemDetail.MultiEditMenu.view2 + texts.multiEdit + flags + cfg + settings + svm.editModel + ) ] diff --git a/modules/webapp/src/main/elm/Page/Home/Update.elm b/modules/webapp/src/main/elm/Page/Home/Update.elm index 740ffe06..97abd815 100644 --- a/modules/webapp/src/main/elm/Page/Home/Update.elm +++ b/modules/webapp/src/main/elm/Page/Home/Update.elm @@ -3,8 +3,6 @@ module Page.Home.Update exposing (update) import Api import Api.Model.ItemLightList exposing (ItemLightList) import Browser.Navigation as Nav -import Comp.ConfirmModal -import Comp.FixedDropdown import Comp.ItemCardList import Comp.ItemDetail.FormChange exposing (FormChange(..)) import Comp.ItemDetail.MultiEditMenu exposing (SaveNameState(..)) @@ -27,7 +25,6 @@ import Throttle import Time import Util.Html exposing (KeyCode(..)) import Util.ItemDragDrop as DD -import Util.Maybe import Util.Update @@ -378,19 +375,13 @@ update mId key flags settings msg model = else let - lmsg = - Comp.ConfirmModal.defaultSettings - ReprocessSelectedConfirmed - CloseConfirmModal - "Really reprocess all selected items? Metadata of unconfirmed items may change." - model_ = { model | viewMode = SelectView { svm | action = ReprocessSelected - , confirmModal = Just lmsg + , confirmModal = Just ConfirmReprocessItems } } in @@ -446,19 +437,13 @@ update mId key flags settings msg model = else let - lmsg = - Comp.ConfirmModal.defaultSettings - DeleteSelectedConfirmed - CloseConfirmModal - "Really delete all selected items?" - model_ = { model | viewMode = SelectView { svm | action = DeleteSelected - , confirmModal = Just lmsg + , confirmModal = Just ConfirmDelete } } in diff --git a/modules/webapp/src/main/elm/Page/Home/View2.elm b/modules/webapp/src/main/elm/Page/Home/View2.elm index 15602b8a..a1e223e4 100644 --- a/modules/webapp/src/main/elm/Page/Home/View2.elm +++ b/modules/webapp/src/main/elm/Page/Home/View2.elm @@ -13,6 +13,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) +import Messages.HomePage exposing (Texts) import Page exposing (Page(..)) import Page.Home.Data exposing (..) import Page.Home.SideMenu @@ -21,28 +22,28 @@ import Styles as S import Util.Html -viewSidebar : Bool -> Flags -> UiSettings -> Model -> Html Msg -viewSidebar visible flags settings model = +viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg +viewSidebar texts visible flags settings model = div [ id "sidebar" , class S.sidebar , class S.sidebarBg , classList [ ( "hidden", not visible ) ] ] - [ Page.Home.SideMenu.view flags settings model + [ Page.Home.SideMenu.view texts.sideMenu flags settings model ] -viewContent : Flags -> UiSettings -> Model -> Html Msg -viewContent flags settings model = +viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg +viewContent texts flags settings model = div [ id "item-card-list" -- this id is used in scroll-to-card , class S.content ] - (searchStats flags settings model - ++ itemsBar flags settings model - ++ itemCardList flags settings model - ++ deleteSelectedDimmer model + (searchStats texts flags settings model + ++ itemsBar texts flags settings model + ++ itemCardList texts flags settings model + ++ confirmModal texts model ) @@ -50,13 +51,32 @@ viewContent flags settings model = --- Helpers -deleteSelectedDimmer : Model -> List (Html Msg) -deleteSelectedDimmer model = +confirmModal : Texts -> Model -> List (Html Msg) +confirmModal texts model = + let + settings modalValue = + case modalValue of + ConfirmReprocessItems -> + Comp.ConfirmModal.defaultSettings + ReprocessSelectedConfirmed + CloseConfirmModal + texts.basics.yes + texts.basics.no + texts.reallyReprocessQuestion + + ConfirmDelete -> + Comp.ConfirmModal.defaultSettings + DeleteSelectedConfirmed + CloseConfirmModal + texts.basics.yes + texts.basics.no + texts.reallyDeleteQuestion + in case model.viewMode of SelectView svm -> case svm.confirmModal of Just confirm -> - [ Comp.ConfirmModal.view confirm + [ Comp.ConfirmModal.view (settings confirm) ] Nothing -> @@ -66,21 +86,21 @@ deleteSelectedDimmer model = [] -itemsBar : Flags -> UiSettings -> Model -> List (Html Msg) -itemsBar flags settings model = +itemsBar : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +itemsBar texts flags settings model = case model.viewMode of SimpleView -> - [ defaultMenuBar flags settings model ] + [ defaultMenuBar texts flags settings model ] SearchView -> - [ defaultMenuBar flags settings model ] + [ defaultMenuBar texts flags settings model ] SelectView svm -> - [ editMenuBar model svm ] + [ editMenuBar texts model svm ] -defaultMenuBar : Flags -> UiSettings -> Model -> Html Msg -defaultMenuBar _ settings model = +defaultMenuBar : Texts -> Flags -> UiSettings -> Model -> Html Msg +defaultMenuBar texts _ settings model = let btnStyle = S.secondaryBasicButton ++ " text-sm" @@ -97,10 +117,10 @@ defaultMenuBar _ settings model = , placeholder (case model.searchTypeDropdownValue of ContentOnlySearch -> - "Content search…" + texts.contentSearch BasicSearch -> - "Search in names…" + texts.searchInNames ) , onInput SetBasicSearch , Util.Html.onKeyUpCode KeyUpSearchbarMsg @@ -124,7 +144,10 @@ defaultMenuBar _ settings model = div [ class "relative flex flex-grow flex-row" ] [ Html.map PowerSearchMsg - (Comp.PowerSearchInput.viewInput [] + (Comp.PowerSearchInput.viewInput + { placeholder = texts.powerSearchPlaceholder + , extraAttrs = [] + } model.powerSearchInput ) , Html.map PowerSearchMsg @@ -150,7 +173,7 @@ defaultMenuBar _ settings model = { tagger = ToggleSelectView , label = "" , icon = Just "fa fa-tasks" - , title = "Select Mode" + , title = texts.selectModeTitle , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", selectActive model ) @@ -170,10 +193,10 @@ defaultMenuBar _ settings model = , icon = Just "fa fa-expand" , title = if settings.cardPreviewFullWidth then - "Full height preview" + texts.fullHeightPreviewTitle else - "Full width preview" + texts.fullHeightPreviewTitle , inputClass = [ ( btnStyle, True ) , ( "hidden sm:inline-block", False ) @@ -185,11 +208,11 @@ defaultMenuBar _ settings model = } -editMenuBar : Model -> SelectViewModel -> Html Msg -editMenuBar model svm = +editMenuBar : Texts -> Model -> SelectViewModel -> Html Msg +editMenuBar texts model svm = let selectCount = - Set.size svm.ids |> String.fromInt + Set.size svm.ids btnStyle = S.secondaryBasicButton ++ " text-sm" @@ -200,7 +223,7 @@ editMenuBar model svm = { tagger = EditSelectedItems , label = "" , icon = Just "fa fa-edit" - , title = "Edit " ++ selectCount ++ " selected items" + , title = texts.editSelectedItems selectCount , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", svm.action == EditSelected ) @@ -210,7 +233,7 @@ editMenuBar model svm = { tagger = RequestReprocessSelected , label = "" , icon = Just "fa fa-redo" - , title = "Reprocess " ++ selectCount ++ " selected items" + , title = texts.reprocessSelectedItems selectCount , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", svm.action == ReprocessSelected ) @@ -220,7 +243,7 @@ editMenuBar model svm = { tagger = RequestDeleteSelected , label = "" , icon = Just "fa fa-trash" - , title = "Delete " ++ selectCount ++ " selected items" + , title = texts.deleteSelectedItems selectCount , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", svm.action == DeleteSelected ) @@ -232,7 +255,7 @@ editMenuBar model svm = { tagger = SelectAllItems , label = "" , icon = Just "fa fa-check-square font-thin" - , title = "Select all visible" + , title = texts.selectAllVisible , inputClass = [ ( btnStyle, True ) ] @@ -241,21 +264,21 @@ editMenuBar model svm = { tagger = SelectNoItems , label = "" , icon = Just "fa fa-square font-thin" - , title = "Select none" + , title = texts.selectNone , inputClass = [ ( btnStyle, True ) ] } , MB.TextLabel { icon = "" - , label = selectCount + , label = String.fromInt selectCount , class = "px-4 py-2 w-10 rounded-full font-bold bg-blue-100 dark:bg-lightblue-600 " } , MB.CustomButton { tagger = ResetSearch , label = "" , icon = Just "fa fa-sync" - , title = "Reset search form" + , title = texts.resetSearchForm , inputClass = [ ( btnStyle, True ) , ( "hidden sm:block", True ) @@ -265,7 +288,7 @@ editMenuBar model svm = { tagger = ToggleSelectView , label = "" , icon = Just "fa fa-tasks" - , title = "Exit Select Mode" + , title = texts.exitSelectMode , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", selectActive model ) @@ -276,18 +299,18 @@ editMenuBar model svm = } -searchStats : Flags -> UiSettings -> Model -> List (Html Msg) -searchStats _ settings model = +searchStats : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +searchStats texts _ settings model = if settings.searchStatsVisible then - [ Comp.SearchStatsView.view2 "my-2" model.searchStats + [ Comp.SearchStatsView.view2 texts.searchStatsView "my-2" model.searchStats ] else [] -itemCardList : Flags -> UiSettings -> Model -> List (Html Msg) -itemCardList _ settings model = +itemCardList : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) +itemCardList texts _ settings model = let itemViewCfg = case model.viewMode of @@ -302,7 +325,11 @@ itemCardList _ settings model = Data.ItemSelection.Inactive in [ Html.map ItemCardListMsg - (Comp.ItemCardList.view2 itemViewCfg settings model.itemListModel) + (Comp.ItemCardList.view2 texts.itemCardList + itemViewCfg + settings + model.itemListModel + ) , loadMore settings model ] From 2f678aca1701271bd50b60bd6a5038ca423b5611 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Wed, 7 Apr 2021 01:09:58 +0200 Subject: [PATCH 19/25] Externalize strings in detail page --- .../webapp/src/main/elm/Comp/DetailEdit.elm | 46 +++---- .../main/elm/Comp/ItemDetail/AddFilesForm.elm | 11 +- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 127 +++++++++--------- .../elm/Comp/ItemDetail/FieldTabState.elm | 17 ++- .../elm/Comp/ItemDetail/ItemInfoHeader.elm | 19 +-- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 2 +- .../src/main/elm/Comp/ItemDetail/Notes.elm | 23 ++-- .../elm/Comp/ItemDetail/SingleAttachment.elm | 45 ++++--- .../src/main/elm/Comp/ItemDetail/Update.elm | 4 +- .../src/main/elm/Comp/ItemDetail/View2.elm | 86 ++++++------ modules/webapp/src/main/elm/Comp/ItemMail.elm | 41 +++--- .../src/main/elm/Comp/MarkdownInput.elm | 24 ++-- .../src/main/elm/Comp/NotificationForm.elm | 4 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 2 +- .../webapp/src/main/elm/Comp/SentMails.elm | 21 +-- .../webapp/src/main/elm/Comp/SourceForm.elm | 2 +- .../webapp/src/main/elm/Messages/Basics.elm | 2 + .../src/main/elm/Messages/DetailEditComp.elm | 29 ++++ .../src/main/elm/Messages/EditFormComp.elm | 65 +++++++++ .../src/main/elm/Messages/FixedDropdown.elm | 22 --- .../elm/Messages/ItemDetail/AddFilesForm.elm | 19 ++- .../src/main/elm/Messages/ItemDetailComp.elm | 50 +++++++ .../src/main/elm/Messages/ItemDetailPage.elm | 5 + .../main/elm/Messages/ItemInfoHeaderComp.elm | 24 ++++ .../src/main/elm/Messages/ItemMailComp.elm | 30 +++++ .../src/main/elm/Messages/NotesComp.elm | 20 +++ .../src/main/elm/Messages/SentMailsComp.elm | 22 +++ .../elm/Messages/SingleAttachmentComp.elm | 30 +++++ .../src/main/elm/Page/ItemDetail/View2.elm | 4 +- modules/webapp/src/main/elm/Util/Tag.elm | 12 +- 30 files changed, 554 insertions(+), 254 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/DetailEditComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/EditFormComp.elm delete mode 100644 modules/webapp/src/main/elm/Messages/FixedDropdown.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/ItemMailComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/NotesComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SentMailsComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm diff --git a/modules/webapp/src/main/elm/Comp/DetailEdit.elm b/modules/webapp/src/main/elm/Comp/DetailEdit.elm index 08867e37..1ceaeadf 100644 --- a/modules/webapp/src/main/elm/Comp/DetailEdit.elm +++ b/modules/webapp/src/main/elm/Comp/DetailEdit.elm @@ -47,11 +47,7 @@ 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 Messages.DetailEditComp exposing (Texts) import Styles as S import Util.Http @@ -644,10 +640,10 @@ update flags msg model = --- View2 -view2 : List (Attribute Msg) -> UiSettings -> Model -> Html Msg -view2 attr settings model = +view2 : Texts -> List (Attribute Msg) -> UiSettings -> Model -> Html Msg +view2 texts attr settings model = div attr - (viewIntern2 settings True model) + (viewIntern2 texts settings True model) formHeading : String -> Model -> Html msg @@ -673,8 +669,8 @@ formHeading classes model = ] -viewModal2 : UiSettings -> Maybe Model -> Html Msg -viewModal2 settings mm = +viewModal2 : Texts -> UiSettings -> Maybe Model -> Html Msg +viewModal2 texts settings mm = let hidden = mm == Nothing @@ -715,7 +711,7 @@ viewModal2 settings mm = , div [ class "scrolling content" ] (case mm of Just model -> - viewIntern2 settings False model + viewIntern2 texts settings False model Nothing -> [] @@ -723,7 +719,7 @@ viewModal2 settings mm = , div [ class "flex flex-row space-x-2" ] (case mm of Just model -> - viewButtons2 model + viewButtons2 texts model Nothing -> [] @@ -732,10 +728,10 @@ viewModal2 settings mm = ] -viewButtons2 : Model -> List (Html Msg) -viewButtons2 model = +viewButtons2 : Texts -> Model -> List (Html Msg) +viewButtons2 texts model = [ B.primaryButton - { label = "Submit" + { label = texts.basics.submit , icon = if model.submitting || model.loading then "fa fa-circle-notch animate-spin" @@ -747,7 +743,7 @@ viewButtons2 model = , attrs = [ href "#" ] } , B.secondaryButton - { label = "Cancel" + { label = texts.basics.cancel , handler = onClick Cancel , disabled = False , icon = "fa fa-times" @@ -756,8 +752,8 @@ viewButtons2 model = ] -viewIntern2 : UiSettings -> Bool -> Model -> List (Html Msg) -viewIntern2 settings withButtons model = +viewIntern2 : Texts -> UiSettings -> Bool -> Model -> List (Html Msg) +viewIntern2 texts settings withButtons model = [ div [ classList [ ( S.errorMessage, Maybe.map .success model.result == Just False ) @@ -771,25 +767,25 @@ viewIntern2 settings withButtons model = ] , case model.form of TM tm -> - Html.map TagMsg (Comp.TagForm.view2 Messages.TagFormComp.gb tm) + Html.map TagMsg (Comp.TagForm.view2 texts.tagForm tm) PMR pm -> - Html.map PersonMsg (Comp.PersonForm.view2 Messages.PersonFormComp.gb True settings pm) + Html.map PersonMsg (Comp.PersonForm.view2 texts.personForm True settings pm) PMC pm -> - Html.map PersonMsg (Comp.PersonForm.view2 Messages.PersonFormComp.gb True settings pm) + Html.map PersonMsg (Comp.PersonForm.view2 texts.personForm True settings pm) OM om -> - Html.map OrgMsg (Comp.OrgForm.view2 Messages.OrgFormComp.gb True settings om) + Html.map OrgMsg (Comp.OrgForm.view2 texts.orgForm True settings om) EM em -> - Html.map EquipMsg (Comp.EquipmentForm.view2 Messages.EquipmentFormComp.gb em) + Html.map EquipMsg (Comp.EquipmentForm.view2 texts.equipmentForm em) CFM fm -> div [] (List.map (Html.map CustomFieldMsg) (Comp.CustomFieldForm.view2 - Messages.CustomFieldFormComp.gb + texts.customFieldForm { classes = "" , showControls = False } @@ -799,7 +795,7 @@ viewIntern2 settings withButtons model = ] ++ (if withButtons then [ div [ class "flex flex-row space-x-2" ] - (viewButtons2 model) + (viewButtons2 texts model) ] else diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm index fb3e7147..73cf872c 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm @@ -25,7 +25,7 @@ view texts model = , class S.box ] [ div [ class "text-lg font-bold" ] - [ text "Add more files to this item" + [ text texts.addMoreFilesToItem ] , Html.map AddFilesMsg (Comp.Dropzone.view2 texts.dropzone model.addFilesModel) @@ -35,14 +35,14 @@ view texts model = , href "#" , onClick AddFilesSubmitUpload ] - [ text "Submit" + [ text texts.basics.submit ] , button [ class S.secondaryButton , href "#" , onClick AddFilesReset ] - [ text "Reset" + [ text texts.reset ] ] , div @@ -52,14 +52,13 @@ view texts model = ] , class "mt-2" ] - [ text "All files have been uploaded. They are being processed, some data " - , text "may not be available immediately. " + [ text texts.filesSubmittedInfo , a [ class S.successMessageLink , href "#" , onClick ReloadItem ] - [ text "Refresh now" + [ text texts.refreshNow ] ] , div diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index c5370009..9f5b1666 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -25,6 +25,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Markdown +import Messages.EditFormComp exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S @@ -34,8 +35,8 @@ import Util.Tag import Util.Time -view2 : Flags -> UiSettings -> Model -> Html Msg -view2 flags settings model = +view2 : Texts -> Flags -> UiSettings -> Model -> Html Msg +view2 texts flags settings model = let keyAttr = if settings.itemDetailShortcuts then @@ -48,7 +49,7 @@ view2 flags settings model = TB.searchMenuStyle tabs = - formTabs flags settings model + formTabs texts flags settings model allTabNames = List.map .title tabs @@ -61,8 +62,8 @@ view2 flags settings model = ] -formTabs : Flags -> UiSettings -> Model -> List (TB.Tab Msg) -formTabs flags settings model = +formTabs : Texts -> Flags -> UiSettings -> Model -> List (TB.Tab Msg) +formTabs texts flags settings model = let dds = Data.DropdownStyle.sidebarStyle @@ -100,7 +101,7 @@ formTabs flags settings model = , classes = "" , fieldIcon = \f -> Dict.get f.id model.customFieldSavingIcon , style = dds - , createCustomFieldTitle = "Create new custom field" + , createCustomFieldTitle = texts.createNewCustomField } optional fields html = @@ -119,7 +120,7 @@ formTabs flags settings model = { text = Data.Direction.toString entry , additional = "" } - , placeholder = "Choose a direction…" + , placeholder = texts.chooseDirection , labelColor = \_ -> \_ -> "" , style = dds } @@ -134,19 +135,19 @@ formTabs flags settings model = idNameCfg = { makeOption = \e -> { text = e.name, additional = "" } , labelColor = \_ -> \_ -> "" - , placeholder = "Select…" + , placeholder = texts.selectPlaceholder , style = dds } personCfg = { makeOption = \p -> Util.Person.mkPersonOption p model.allPersons , labelColor = \_ -> \_ -> "" - , placeholder = "Select…" + , placeholder = texts.selectPlaceholder , style = dds } in [ { name = FTabState.tabName TabName - , title = "Name" + , title = texts.nameTab , titleRight = [] , info = Nothing , body = @@ -173,7 +174,7 @@ formTabs flags settings model = ] } , { name = FTabState.tabName TabDate - , title = "Date" + , title = texts.dateTab , titleRight = [] , info = Nothing , body = @@ -194,18 +195,18 @@ formTabs flags settings model = ] , Icons.dateIcon2 S.dateInputIcon ] - , renderItemDateSuggestions model + , renderItemDateSuggestions texts model ] ] } , { name = FTabState.tabName TabTags - , title = "Tags" + , title = texts.basics.tags , titleRight = [] , info = Nothing , body = [ div [ class "mb-4 flex flex-col" ] [ Html.map TagDropdownMsg - (Comp.Dropdown.view2 (Util.Tag.tagSettings dds) + (Comp.Dropdown.view2 (Util.Tag.tagSettings texts.basics.chooseTag dds) settings model.tagModel ) @@ -223,7 +224,7 @@ formTabs flags settings model = ] } , { name = FTabState.tabName TabFolder - , title = "Folder" + , title = texts.folderTab , titleRight = [] , info = Nothing , body = @@ -240,17 +241,13 @@ formTabs flags settings model = , ( "hidden", isFolderMember model ) ] ] - [ Markdown.toHtml [] """ -You are **not a member** of this folder. This item will be **hidden** -from any search now. Use a folder where you are a member of to make this -item visible. This message will disappear then. - """ + [ Markdown.toHtml [] texts.folderNotOwnerWarning ] ] ] } , { name = FTabState.tabName TabCustomFields - , title = "Custom Fields" + , title = texts.customFieldsTab , titleRight = [] , info = Nothing , body = @@ -264,7 +261,7 @@ item visible. This message will disappear then. ] } , { name = FTabState.tabName TabDueDate - , title = "Due Date" + , title = texts.dueDateTab , titleRight = [] , info = Nothing , body = @@ -285,12 +282,12 @@ item visible. This message will disappear then. ] , Icons.dueDateIcon2 S.dateInputIcon ] - , renderDueDateSuggestions model + , renderDueDateSuggestions texts model ] ] } , { name = FTabState.tabName TabCorrespondent - , title = "Correspondent" + , title = texts.correspondentTab , titleRight = [] , info = Nothing , body = @@ -298,25 +295,25 @@ item visible. This message will disappear then. div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.organizationIcon2 "mr-2" - , text "Organization" - , addIconLink "Add new organization" StartCorrOrgModal - , editIconLink "Edit organization" model.corrOrgModel StartEditCorrOrgModal + , text texts.organization + , addIconLink texts.addNewOrg StartCorrOrgModal + , editIconLink texts.editOrg model.corrOrgModel StartEditCorrOrgModal ] , Html.map OrgDropdownMsg (Comp.Dropdown.view2 - (Comp.Dropdown.orgFormViewSettings "Choose an organization" dds) + (Comp.Dropdown.orgFormViewSettings texts.chooseOrg dds) settings model.corrOrgModel ) - , renderOrgSuggestions model + , renderOrgSuggestions texts model ] , optional [ Data.Fields.CorrPerson ] <| div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.personIcon2 "mr-2" , text "Person" - , addIconLink "Add new correspondent person" StartCorrPersonModal - , editIconLink "Edit person" + , addIconLink texts.addNewCorrespondentPerson StartCorrPersonModal + , editIconLink texts.editPerson model.corrPersonModel (StartEditPersonModal model.corrPersonModel) ] @@ -325,7 +322,7 @@ item visible. This message will disappear then. settings model.corrPersonModel ) - , renderCorrPersonSuggestions model + , renderCorrPersonSuggestions texts model , div [ classList [ ( "hidden", personMatchesOrg model ) @@ -334,13 +331,13 @@ item visible. This message will disappear then. , class "my-2" ] [ i [ class "fa fa-info mr-2 " ] [] - , text "The selected person doesn't belong to the selected organization." + , text texts.personOrgInfo ] ] ] } , { name = FTabState.tabName TabConcerning - , title = "Concerning" + , title = texts.concerningTab , titleRight = [] , info = Nothing , body = @@ -349,8 +346,8 @@ item visible. This message will disappear then. [ label [ class S.inputLabel ] [ Icons.personIcon2 "mr-2" , text "Person" - , addIconLink "Add new concerning person" StartConcPersonModal - , editIconLink "Edit person" + , addIconLink texts.addNewConcerningPerson StartConcPersonModal + , editIconLink texts.editPerson model.concPersonModel (StartEditPersonModal model.concPersonModel) ] @@ -360,15 +357,15 @@ item visible. This message will disappear then. settings model.concPersonModel ) - , renderConcPersonSuggestions model + , renderConcPersonSuggestions texts model ] , optional [ Data.Fields.ConcEquip ] <| div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.equipmentIcon2 "mr-2" , text "Equipment" - , addIconLink "Add new equipment" StartEquipModal - , editIconLink "Edit equipment" + , addIconLink texts.addNewEquipment StartEquipModal + , editIconLink texts.editEquipment model.concEquipModel StartEditEquipModal ] @@ -378,12 +375,12 @@ item visible. This message will disappear then. settings model.concEquipModel ) - , renderConcEquipSuggestions model + , renderConcEquipSuggestions texts model ] ] } , { name = FTabState.tabName TabDirection - , title = "Direction" + , title = texts.directionTab , titleRight = [] , info = Nothing , body = @@ -400,8 +397,8 @@ item visible. This message will disappear then. ] -renderSuggestions : Model -> (a -> String) -> List a -> (a -> Msg) -> Html Msg -renderSuggestions model mkName idnames tagger = +renderSuggestions : Texts -> Model -> (a -> String) -> List a -> (a -> Msg) -> Html Msg +renderSuggestions texts model mkName idnames tagger = div [ classList [ ( "hidden", model.item.state /= "created" ) @@ -409,7 +406,7 @@ renderSuggestions model mkName idnames tagger = , class "flex flex-col text-sm" ] [ div [ class "font-bold my-1" ] - [ text "Suggestions" + [ text texts.suggestions ] , ul [ class "list-disc ml-6" ] <| (idnames @@ -428,49 +425,55 @@ renderSuggestions model mkName idnames tagger = ] -renderOrgSuggestions : Model -> Html Msg -renderOrgSuggestions model = - renderSuggestions model +renderOrgSuggestions : Texts -> Model -> Html Msg +renderOrgSuggestions texts model = + renderSuggestions texts + model .name (List.take 6 model.itemProposals.corrOrg) SetCorrOrgSuggestion -renderCorrPersonSuggestions : Model -> Html Msg -renderCorrPersonSuggestions model = - renderSuggestions model +renderCorrPersonSuggestions : Texts -> Model -> Html Msg +renderCorrPersonSuggestions texts model = + renderSuggestions texts + model .name (List.take 6 model.itemProposals.corrPerson) SetCorrPersonSuggestion -renderConcPersonSuggestions : Model -> Html Msg -renderConcPersonSuggestions model = - renderSuggestions model +renderConcPersonSuggestions : Texts -> Model -> Html Msg +renderConcPersonSuggestions texts model = + renderSuggestions texts + model .name (List.take 6 model.itemProposals.concPerson) SetConcPersonSuggestion -renderConcEquipSuggestions : Model -> Html Msg -renderConcEquipSuggestions model = - renderSuggestions model +renderConcEquipSuggestions : Texts -> Model -> Html Msg +renderConcEquipSuggestions texts model = + renderSuggestions texts + model .name (List.take 6 model.itemProposals.concEquipment) SetConcEquipSuggestion -renderItemDateSuggestions : Model -> Html Msg -renderItemDateSuggestions model = - renderSuggestions model +renderItemDateSuggestions : Texts -> Model -> Html Msg +renderItemDateSuggestions texts model = + renderSuggestions texts + model Util.Time.formatDate (List.take 6 model.itemProposals.itemDate) SetItemDateSuggestion -renderDueDateSuggestions : Model -> Html Msg -renderDueDateSuggestions model = - renderSuggestions model +renderDueDateSuggestions : Texts -> Model -> Html Msg +renderDueDateSuggestions texts model = + renderSuggestions texts + model Util.Time.formatDate (List.take 6 model.itemProposals.dueDate) SetDueDateSuggestion diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm index b1d39ece..0a3c48cf 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/FieldTabState.elm @@ -1,4 +1,4 @@ -module Comp.ItemDetail.FieldTabState exposing (EditTab(..), findTab, tabName, tabState) +module Comp.ItemDetail.FieldTabState exposing (EditTab(..), allTabs, findTab, tabName, tabState) import Comp.CustomFieldMultiInput import Comp.Tabs as TB @@ -20,6 +20,21 @@ type EditTab | TabConfirmUnconfirm +allTabs : List EditTab +allTabs = + [ TabName + , TabDate + , TabTags + , TabFolder + , TabCustomFields + , TabDueDate + , TabCorrespondent + , TabConcerning + , TabDirection + , TabConfirmUnconfirm + ] + + tabName : EditTab -> String tabName tab = case tab of diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm index 30e11f49..1d1ef6cd 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm @@ -15,19 +15,20 @@ import Data.Icons as Icons import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) +import Messages.ItemInfoHeaderComp exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Maybe import Util.Time -view : UiSettings -> Model -> Html Msg -view settings model = +view : Texts -> UiSettings -> Model -> Html Msg +view texts settings model = let date = ( div [ class "ml-2 sm:ml-0 whitespace-nowrap py-1 whitespace-nowrap opacity-75" - , title "Item Date" + , title texts.itemDate ] [ Icons.dateIcon2 "mr-2" , Maybe.withDefault model.item.created model.item.itemDate @@ -47,7 +48,7 @@ view settings model = ( div [ class "ml-2 sm:ml-4 py-1 max-w-min whitespace-nowrap opacity-100" , class S.basicLabel - , title "Due Date" + , title texts.dueDate ] [ Icons.dueDateIcon2 "mr-2" , Maybe.map Util.Time.formatDate model.item.dueDate @@ -61,7 +62,7 @@ view settings model = corr = ( div [ class itemStyle - , title "Correspondent" + , title texts.correspondent ] (Icons.correspondentIcon2 "mr-2" :: Comp.LinkTarget.makeCorrLink model.item @@ -75,7 +76,7 @@ view settings model = conc = ( div [ class itemStyle - , title "Concerning" + , title texts.concerning ] (Icons.concernedIcon2 "mr-2" :: Comp.LinkTarget.makeConcLink model.item @@ -89,7 +90,7 @@ view settings model = itemfolder = ( div [ class itemStyle - , title "Folder" + , title texts.folder ] [ Icons.folderIcon2 "mr-2" , Comp.LinkTarget.makeFolderLink model.item @@ -102,7 +103,7 @@ view settings model = src = ( div [ class itemStyle - , title "Source" + , title texts.source ] [ Icons.sourceIcon2 "mr-2" , Comp.LinkTarget.makeSourceLink [ ( linkStyle, True ) ] @@ -132,7 +133,7 @@ view settings model = ] , class "ml-3 text-base label bg-blue-500 dark:bg-lightblue-500 text-white rounded-lg" ] - [ text "New" + [ text texts.new , i [ class "fa fa-exclamation ml-2" ] [] ] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index d63af8ce..77600cff 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -744,7 +744,7 @@ renderEditForm2 texts flags cfg settings model = ] ] , Html.map TagDropdownMsg - (Comp.Dropdown.view2 (Util.Tag.tagSettings dds) + (Comp.Dropdown.view2 (Util.Tag.tagSettings texts.basics.chooseTag dds) settings model.tagModel ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm index 58478bc3..48dfd20d 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm @@ -12,19 +12,20 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Markdown +import Messages.NotesComp exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.String -view : Model -> Html Msg -view model = +view : Texts -> Model -> Html Msg +view texts model = case model.notesField of ViewNotes -> div [ class "flex flex-col ds-item-detail-notes" ] [ div [ class "flex flex-row items-center border-b dark:border-bluegray-600" ] [ div [ class "flex-grow font-bold text-lg" ] - [ text "Notes" + [ text texts.notes ] , div [ class "" ] [ a @@ -33,7 +34,7 @@ view model = , href "#" ] [ i [ class "fa fa-edit mr-2" ] [] - , text "Edit" + , text texts.basics.edit ] ] ] @@ -55,14 +56,14 @@ view model = [ div [ class "flex flex-col" ] [ div [ class "flex flex-row items-center" ] [ div [ class "font-bold text-lg" ] - [ text "Notes" + [ text texts.notes ] , div [ class "flex flex-grow justify-end text-sm" ] [ Html.map NotesEditMsg - (Comp.MarkdownInput.viewEditLink2 classes mm) + (Comp.MarkdownInput.viewEditLink2 texts.basics.edit classes mm) , span [ class "px-3" ] [ text "•" ] , Html.map NotesEditMsg - (Comp.MarkdownInput.viewPreviewLink2 classes mm) + (Comp.MarkdownInput.viewPreviewLink2 texts.preview classes mm) ] ] ] @@ -73,7 +74,9 @@ view model = mm ) , div [ class "text-sm flex justify-end" ] - [ Comp.MarkdownInput.viewCheatLink2 S.link mm + [ Comp.MarkdownInput.viewCheatLink2 texts.supportsMarkdown + S.link + mm ] , div [ class "flex flex-row mt-1" ] [ a @@ -82,7 +85,7 @@ view model = , onClick SaveNotes ] [ i [ class "fa fa-save font-thin mr-2" ] [] - , text "Save" + , text texts.basics.submit ] , a [ classList @@ -94,7 +97,7 @@ view model = , onClick ToggleEditNotes ] [ i [ class "fa fa-times mr-2" ] [] - , text "Cancel" + , text texts.basics.cancel ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm index 7d3cd714..9394daa6 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm @@ -18,6 +18,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Html5.DragDrop as DD +import Messages.SingleAttachmentComp exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Maybe @@ -25,8 +26,8 @@ import Util.Size import Util.String -view : UiSettings -> Model -> Int -> Attachment -> Html Msg -view settings model pos attach = +view : Texts -> UiSettings -> Model -> Int -> Attachment -> Html Msg +view texts settings model pos attach = let fileUrl = Api.fileURL attach.id @@ -42,10 +43,10 @@ view settings model pos attach = [ class "flex flex-row px-2 py-2 text-sm" , class S.border ] - [ attachHeader settings model pos attach + [ attachHeader texts settings model pos attach ] , editAttachmentName model attach - , attachmentSelect model pos attach + , attachmentSelect texts model pos attach , if isAttachMetaOpen model attach.id then case Dict.get attach.id model.attachMeta of Just am -> @@ -94,11 +95,11 @@ view settings model pos attach = - native view -} -attachHeader : UiSettings -> Model -> Int -> Attachment -> Html Msg -attachHeader settings model _ attach = +attachHeader : Texts -> UiSettings -> Model -> Int -> Attachment -> Html Msg +attachHeader texts settings model _ attach = let attachName = - Maybe.withDefault "No name" attach.name + Maybe.withDefault texts.noName attach.name fileUrl = Api.fileURL attach.id @@ -138,7 +139,7 @@ attachHeader settings model _ attach = , a [ href fileUrl , target "_new" - , title "Open file in new tab" + , title texts.openFileInNewTab , class S.secondaryBasicButton , class "ml-2" ] @@ -155,21 +156,21 @@ attachHeader settings model _ attach = , menuOpen = model.attachmentDropdownOpen , items = [ { icon = "fa fa-download" - , label = "Download file" + , label = texts.downloadFile , attrs = [ download attachName , href fileUrl ] } , { icon = "fa fa-file" - , label = "Rename file" + , label = texts.renameFile , attrs = [ href "#" , onClick (EditAttachNameStart attach.id) ] } , { icon = "fa fa-file-archive" - , label = "Download original archive" + , label = texts.downloadOriginalArchiveFile , attrs = [ href (fileUrl ++ "/archive") , target "_new" @@ -177,7 +178,7 @@ attachHeader settings model _ attach = ] } , { icon = "fa fa-external-link-alt" - , label = "Original file" + , label = texts.originalFile , attrs = [ href (fileUrl ++ "/original") , target "_new" @@ -190,7 +191,7 @@ attachHeader settings model _ attach = else "fa fa-toggle-off" - , label = "Render pdf by browser" + , label = texts.renderPdfByBrowser , attrs = [ onClick (TogglePdfNativeView settings.nativePdfPreview) , href "#" @@ -202,21 +203,21 @@ attachHeader settings model _ attach = else "fa fa-toggle-off" - , label = "View extracted data" + , label = texts.viewExtractedData , attrs = [ onClick (AttachMetaClick attach.id) , href "#" ] } , { icon = "fa fa-redo-alt" - , label = "Re-process this file" + , label = texts.reprocessFile , attrs = [ onClick (RequestReprocessFile attach.id) , href "#" ] } , { icon = "fa fa-trash" - , label = "Delete this file" + , label = texts.deleteThisFile , attrs = [ onClick (RequestDeleteAttachment attach.id) , href "#" @@ -279,8 +280,8 @@ editAttachmentName model attach = span [ class "hidden" ] [] -attachmentSelect : Model -> Int -> Attachment -> Html Msg -attachmentSelect model _ _ = +attachmentSelect : Texts -> Model -> Int -> Attachment -> Html Msg +attachmentSelect texts model _ _ = div [ class "flex flex-row border-l border-r px-2 py-2 dark:border-bluegray-600 " , class "overflow-x-auto overflow-y-none" @@ -288,11 +289,11 @@ attachmentSelect model _ _ = [ ( "hidden", not model.attachMenuOpen ) ] ] - (List.indexedMap (menuItem model) model.item.attachments) + (List.indexedMap (menuItem texts model) model.item.attachments) -menuItem : Model -> Int -> Attachment -> Html Msg -menuItem model pos attach = +menuItem : Texts -> Model -> Int -> Attachment -> Html Msg +menuItem texts model pos attach = let highlight = let @@ -342,7 +343,7 @@ menuItem model pos attach = ] , div [ class "mt-1 text-sm break-all w-28 text-center" ] [ Maybe.map (Util.String.ellipsis 36) attach.name - |> Maybe.withDefault "No Name" + |> Maybe.withDefault texts.noName |> text ] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm index d47da245..c8ebf07a 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Update.elm @@ -24,6 +24,7 @@ import Comp.Dropdown exposing (isDropdownChangeMsg) import Comp.Dropzone import Comp.EquipmentForm import Comp.ItemDetail.EditForm +import Comp.ItemDetail.FieldTabState as FTabState import Comp.ItemDetail.Model exposing ( AttachmentRename @@ -1487,8 +1488,7 @@ update key flags inav settings msg model = ToggleOpenAllAkkordionTabs -> let allNames = - Comp.ItemDetail.EditForm.formTabs flags settings model - |> List.map .title + List.map FTabState.tabName FTabState.allTabs |> Set.fromList next = diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm index af3c849e..a1ecf2fc 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm @@ -32,8 +32,8 @@ import Util.Time view : Texts -> ItemNav -> UiSettings -> Model -> Html Msg view texts inav settings model = div [ class "flex flex-col h-full" ] - [ header settings model - , menuBar inav settings model + [ header texts settings model + , menuBar texts inav settings model , body texts inav settings model , itemModal model ] @@ -49,18 +49,18 @@ itemModal model = span [ class "hidden" ] [] -header : UiSettings -> Model -> Html Msg -header settings model = +header : Texts -> UiSettings -> Model -> Html Msg +header texts settings model = div [ class "my-3" ] - [ Comp.ItemDetail.ItemInfoHeader.view settings model ] + [ Comp.ItemDetail.ItemInfoHeader.view texts.itemInfoHeader settings model ] -menuBar : ItemNav -> UiSettings -> Model -> Html Msg -menuBar inav settings model = +menuBar : Texts -> ItemNav -> UiSettings -> Model -> Html Msg +menuBar texts inav settings model = let keyDescr name = if settings.itemDetailShortcuts && model.menuOpen then - " Key '" ++ name ++ "'." + " " ++ texts.key ++ "'" ++ name ++ "'." else "" @@ -71,7 +71,7 @@ menuBar inav settings model = a [ class S.secondaryBasicButton , Page.href HomePage - , title "Back to search results" + , title texts.backToSearchResults ] [ i [ class "fa fa-arrow-left" ] [] ] @@ -88,7 +88,7 @@ menuBar inav settings model = |> Maybe.withDefault (href "#") , disabled = inav.prev == Nothing , attrs = - [ title ("Previous item." ++ keyDescr "Ctrl-,") + [ title (texts.previousItem ++ keyDescr "Ctrl-,") ] } , div @@ -117,7 +117,7 @@ menuBar inav settings model = |> Maybe.withDefault (href "#") , disabled = inav.next == Nothing , attrs = - [ title ("Next item." ++ keyDescr "Ctrl-.") + [ title (texts.nextItem ++ keyDescr "Ctrl-.") ] } ] @@ -126,7 +126,7 @@ menuBar inav settings model = [ classList [ ( "bg-gray-200 dark:bg-bluegray-600", model.mailOpen ) ] - , title "Send Mail" + , title texts.sendMail , onClick ToggleMail , class S.secondaryBasicButton , href "#" @@ -142,7 +142,7 @@ menuBar inav settings model = title "Close" else - title "Add more files to this item" + title texts.addMoreFiles , onClick AddFilesToggle , class S.secondaryBasicButton , href "#" @@ -154,11 +154,11 @@ menuBar inav settings model = [ class S.primaryButton , href "#" , onClick ConfirmItem - , title "Confirm item metadata" + , title texts.confirmItemMetadata , classList [ ( "hidden", model.item.state /= "created" ) ] ] [ i [ class "fa fa-check mr-2" ] [] - , text "Confirm" + , text texts.confirm ] ] , end = @@ -167,7 +167,7 @@ menuBar inav settings model = [ class S.secondaryBasicButton , href "#" , onClick UnconfirmItem - , title "Un-confirm item metadata" + , title texts.unconfirmItemMetadata , classList [ ( "hidden", model.item.state == "created" ) ] ] [ i [ class "fa fa-eye-slash font-thin" ] [] @@ -177,7 +177,7 @@ menuBar inav settings model = [ class S.secondaryBasicButton , href "#" , onClick RequestReprocessItem - , title "Reprocess this item" + , title texts.reprocessItem ] [ i [ class "fa fa-redo" ] [] ] @@ -186,7 +186,7 @@ menuBar inav settings model = [ class S.deleteButton , href "#" , onClick RequestDelete - , title "Delete this item" + , title texts.deleteThisItem ] [ i [ class "fa fa-trash" ] [] ] @@ -199,17 +199,17 @@ body : Texts -> ItemNav -> UiSettings -> Model -> Html Msg body texts _ settings model = div [ class "grid gap-2 grid-cols-1 md:grid-cols-3 h-full" ] [ leftArea texts settings model - , rightArea settings model + , rightArea texts settings model ] leftArea : Texts -> UiSettings -> Model -> Html Msg leftArea texts settings model = div [ class "w-full md:order-first md:mr-2 flex flex-col" ] - [ addDetailForm settings model - , sendMailForm settings model + [ addDetailForm texts settings model + , sendMailForm texts settings model , Comp.ItemDetail.AddFilesForm.view texts.addFilesForm model - , Comp.ItemDetail.Notes.view model + , Comp.ItemDetail.Notes.view texts.notes model , div [ classList [ ( "hidden", Comp.SentMails.isEmpty model.sentMails ) @@ -217,29 +217,29 @@ leftArea texts settings model = , class "mt-4 " ] [ h3 [ class "flex flex-row items-center border-b dark:border-bluegray-600 font-bold text-lg" ] - [ text "Sent E-Mails" + [ text texts.sentEmails ] - , Html.map SentMailsMsg (Comp.SentMails.view2 model.sentMails) + , Html.map SentMailsMsg (Comp.SentMails.view2 texts.sentMails model.sentMails) ] , div [ class "flex-grow" ] [] - , itemIdInfo model + , itemIdInfo texts model ] -rightArea : UiSettings -> Model -> Html Msg -rightArea settings model = +rightArea : Texts -> UiSettings -> Model -> Html Msg +rightArea texts settings model = div [ class "md:col-span-2 h-full" ] - (attachmentsBody settings model) + (attachmentsBody texts settings model) -attachmentsBody : UiSettings -> Model -> List (Html Msg) -attachmentsBody settings model = - List.indexedMap (Comp.ItemDetail.SingleAttachment.view settings model) +attachmentsBody : Texts -> UiSettings -> Model -> List (Html Msg) +attachmentsBody texts settings model = + List.indexedMap (Comp.ItemDetail.SingleAttachment.view texts.singleAttachment settings model) model.item.attachments -sendMailForm : UiSettings -> Model -> Html Msg -sendMailForm settings model = +sendMailForm : Texts -> UiSettings -> Model -> Html Msg +sendMailForm texts settings model = div [ classList [ ( "hidden", not model.mailOpen ) @@ -248,10 +248,10 @@ sendMailForm settings model = , class "mb-4 px-2 py-2" ] [ div [ class "text-lg font-bold" ] - [ text "Send this item via E-Mail" + [ text texts.sendThisItemViaEmail ] , B.loadingDimmer model.mailSending - , Html.map ItemMailMsg (Comp.ItemMail.view2 settings model.itemMail) + , Html.map ItemMailMsg (Comp.ItemMail.view2 texts.itemMail settings model.itemMail) , div [ classList [ ( S.errorMessage @@ -274,26 +274,26 @@ sendMailForm settings model = ] -itemIdInfo : Model -> Html msg -itemIdInfo model = +itemIdInfo : Texts -> Model -> Html msg +itemIdInfo texts model = div [ class "flex flex-col opacity-50 text-xs pb-1 mt-3 border-t dark:border-bluegray-600" ] [ div [ class "inline-flex items-center" - , title "Item ID" + , title texts.itemId ] [ i [ class "fa fa-bullseye mr-2" ] [] , text model.item.id ] , div [ class "inline-flex items-center" - , title "Created on" + , title texts.createdOn ] [ i [ class "fa fa-sun font-thin mr-2" ] [] , Util.Time.formatDateTime model.item.created |> text ] , div [ class "inline-flex items-center" - , title "Last update on" + , title texts.lastUpdateOn ] [ i [ class "fa fa-pencil-alt mr-2" ] [] , Util.Time.formatDateTime model.item.updated |> text @@ -301,8 +301,8 @@ itemIdInfo model = ] -addDetailForm : UiSettings -> Model -> Html Msg -addDetailForm settings model = +addDetailForm : Texts -> UiSettings -> Model -> Html Msg +addDetailForm texts settings model = case model.modalEdit of Just mm -> div @@ -310,7 +310,7 @@ addDetailForm settings model = , class S.box ] [ Comp.DetailEdit.formHeading S.header3 mm - , Html.map ModalEditMsg (Comp.DetailEdit.view2 [] settings mm) + , Html.map ModalEditMsg (Comp.DetailEdit.view2 texts.detailEdit [] settings mm) ] Nothing -> diff --git a/modules/webapp/src/main/elm/Comp/ItemMail.elm b/modules/webapp/src/main/elm/Comp/ItemMail.elm index ad8db394..a656a42e 100644 --- a/modules/webapp/src/main/elm/Comp/ItemMail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemMail.elm @@ -23,6 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http +import Messages.ItemMailComp exposing (Texts) import Styles as S import Util.Http @@ -218,15 +219,15 @@ isValid model = --- View2 -view2 : UiSettings -> Model -> Html Msg -view2 settings model = +view2 : Texts -> UiSettings -> Model -> Html Msg +view2 texts settings model = let dds = Data.DropdownStyle.mainStyle connectionCfg = { makeOption = \a -> { text = a, additional = "" } - , placeholder = "Select connection..." + , placeholder = texts.selectConnection , labelColor = \_ -> \_ -> "" , style = dds } @@ -236,10 +237,15 @@ view2 settings model = ] [ div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Send via" + [ text texts.sendVia , B.inputRequired ] - , Html.map ConnMsg (Comp.Dropdown.view2 connectionCfg settings model.connectionModel) + , Html.map ConnMsg + (Comp.Dropdown.view2 + connectionCfg + settings + model.connectionModel + ) ] , div [ class S.errorMessage @@ -251,38 +257,38 @@ view2 settings model = [ label [ class S.inputLabel ] - [ text "Recipient(s)" + [ text texts.recipients , B.inputRequired ] , Html.map RecipientMsg - (Comp.EmailInput.view2 { style = dds, placeholder = "Recipient(s)..." } + (Comp.EmailInput.view2 { style = dds, placeholder = appendDots texts.recipients } model.recipients model.recipientsModel ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "CC(s)" + [ text texts.ccRecipients ] , Html.map CCRecipientMsg - (Comp.EmailInput.view2 { style = dds, placeholder = "CC recipient(s)..." } + (Comp.EmailInput.view2 { style = dds, placeholder = appendDots texts.ccRecipients } model.ccRecipients model.ccRecipientsModel ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "BCC(s)" + [ text texts.bccRecipients ] , Html.map BCCRecipientMsg - (Comp.EmailInput.view2 { style = dds, placeholder = "BCC recipient(s)..." } + (Comp.EmailInput.view2 { style = dds, placeholder = appendDots texts.bccRecipients } model.bccRecipients model.bccRecipientsModel ) ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Subject" + [ text texts.subject , B.inputRequired ] , input @@ -295,7 +301,7 @@ view2 settings model = ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text "Body" + [ text texts.body , B.inputRequired ] , textarea @@ -308,7 +314,7 @@ view2 settings model = , MB.viewItem <| MB.Checkbox { tagger = \_ -> ToggleAttachAll - , label = "Include all item attachments" + , label = texts.includeAllAttachments , value = model.attachAll , id = "item-send-mail-attach-all" } @@ -321,7 +327,7 @@ view2 settings model = , disabled = not (isValid model) } , B.secondaryButton - { label = "Cancel" + { label = texts.basics.cancel , icon = "fa fa-times" , handler = onClick Cancel , attrs = [ href "#" ] @@ -329,3 +335,8 @@ view2 settings model = } ] ] + + +appendDots : String -> String +appendDots name = + name ++ "…" diff --git a/modules/webapp/src/main/elm/Comp/MarkdownInput.elm b/modules/webapp/src/main/elm/Comp/MarkdownInput.elm index 9209d739..8254d325 100644 --- a/modules/webapp/src/main/elm/Comp/MarkdownInput.elm +++ b/modules/webapp/src/main/elm/Comp/MarkdownInput.elm @@ -68,48 +68,48 @@ viewContent2 txt model = splitDisplay2 txt -viewEditLink2 : (Bool -> Attribute Msg) -> Model -> Html Msg -viewEditLink2 classes model = +viewEditLink2 : String -> (Bool -> Attribute Msg) -> Model -> Html Msg +viewEditLink2 label classes model = a [ onClick (SetDisplay Edit) , classes (model.display == Edit) , href "#" ] - [ text "Edit" + [ text label ] -viewPreviewLink2 : (Bool -> Attribute Msg) -> Model -> Html Msg -viewPreviewLink2 classes model = +viewPreviewLink2 : String -> (Bool -> Attribute Msg) -> Model -> Html Msg +viewPreviewLink2 label classes model = a [ onClick (SetDisplay Preview) , classes (model.display == Preview) , href "#" ] - [ text "Preview" + [ text label ] -viewSplitLink2 : (Bool -> Attribute Msg) -> Model -> Html Msg -viewSplitLink2 classes model = +viewSplitLink2 : String -> (Bool -> Attribute Msg) -> Model -> Html Msg +viewSplitLink2 label classes model = a [ onClick (SetDisplay Split) , classes (model.display == Split) , href "#" ] - [ text "Split" + [ text label ] -viewCheatLink2 : String -> Model -> Html msg -viewCheatLink2 classes model = +viewCheatLink2 : String -> String -> Model -> Html msg +viewCheatLink2 label classes model = a [ class classes , target "_new" , href model.cheatSheetUrl ] [ i [ class "fa fa-question mr-2" ] [] - , text "Supports Markdown" + , text label ] diff --git a/modules/webapp/src/main/elm/Comp/NotificationForm.elm b/modules/webapp/src/main/elm/Comp/NotificationForm.elm index d053b203..46d34b1f 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationForm.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationForm.elm @@ -612,7 +612,7 @@ view2 texts extraClasses settings model = [ text texts.tagsInclude ] , Html.map TagIncMsg (Comp.Dropdown.view2 - (Util.Tag.tagSettings DS.mainStyle) + (Util.Tag.tagSettings texts.basics.chooseTag DS.mainStyle) settings model.tagInclModel ) @@ -625,7 +625,7 @@ view2 texts extraClasses settings model = [ text texts.tagsExclude ] , Html.map TagExcMsg (Comp.Dropdown.view2 - (Util.Tag.tagSettings DS.mainStyle) + (Util.Tag.tagSettings texts.basics.chooseTag DS.mainStyle) settings model.tagExclModel ) diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 3a1c97d9..0dd02167 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -1108,7 +1108,7 @@ viewMetadata2 texts flags settings model = [ text texts.basics.tags ] , Html.map TagDropdownMsg (Comp.Dropdown.view2 - (Util.Tag.tagSettings DS.mainStyle) + (Util.Tag.tagSettings texts.basics.chooseTag DS.mainStyle) settings model.tagModel ) diff --git a/modules/webapp/src/main/elm/Comp/SentMails.elm b/modules/webapp/src/main/elm/Comp/SentMails.elm index df28d3c3..bf846162 100644 --- a/modules/webapp/src/main/elm/Comp/SentMails.elm +++ b/modules/webapp/src/main/elm/Comp/SentMails.elm @@ -13,6 +13,7 @@ import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) +import Messages.SentMailsComp exposing (Texts) import Styles as S import Util.Time @@ -59,15 +60,15 @@ update msg model = --- View2 -view2 : Model -> Html Msg -view2 model = +view2 : Texts -> Model -> Html Msg +view2 texts model = case model.selected of Just mail -> div [ class "flex flex-col" ] [ div [ class "text-sm flex-flex-col" ] [ div [ class "flex flex-row" ] [ span [ class "font-bold" ] - [ text "From:" + [ text (texts.from ++ ":") ] , div [ class "ml-2" ] [ text mail.sender @@ -78,7 +79,7 @@ view2 model = ] , div [ class "flex flex-row" ] [ span [ class "font-bold" ] - [ text "Date:" + [ text (texts.date ++ ":") ] , div [ class "ml-2" ] [ Util.Time.formatDateTime mail.created |> text @@ -86,7 +87,7 @@ view2 model = ] , div [ class "flex flex-row" ] [ span [ class "font-bold" ] - [ text "Recipients:" + [ text (texts.recipients ++ ":") ] , div [ class "ml-2" ] [ String.join ", " mail.recipients |> text @@ -94,7 +95,7 @@ view2 model = ] , div [ class "flex flex-row" ] [ span [ class "font-bold" ] - [ text "Subject:" + [ text (texts.subject ++ ":") ] , div [ class "ml-2" ] [ text mail.subject @@ -122,10 +123,10 @@ view2 model = [ thead [] [ tr [] [ th [] [] - , th [ class "text-left" ] [ text "Recipients" ] - , th [ class "hidden" ] [ text "Subject" ] - , th [ class "hidden text-center xl:table-cell" ] [ text "Sent" ] - , th [ class "hidden" ] [ text "Sender" ] + , th [ class "text-left" ] [ text texts.recipients ] + , th [ class "hidden" ] [ text texts.subject ] + , th [ class "hidden text-center xl:table-cell" ] [ text texts.sent ] + , th [ class "hidden" ] [ text texts.sender ] ] ] , tbody [] <| diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 9ef9003a..3a63a4d9 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -322,7 +322,7 @@ view2 flags texts settings model = } tagCfg = - Util.Tag.tagSettings DS.mainStyle + Util.Tag.tagSettings texts.basics.chooseTag DS.mainStyle languageCfg = { makeOption = diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm index aef37b84..9a1f5790 100644 --- a/modules/webapp/src/main/elm/Messages/Basics.elm +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -19,6 +19,7 @@ type alias Texts = , ok : String , yes : String , no : String + , chooseTag : String } @@ -41,6 +42,7 @@ gb = , ok = "Ok" , yes = "Yes" , no = "No" + , chooseTag = "Choose a tag…" } diff --git a/modules/webapp/src/main/elm/Messages/DetailEditComp.elm b/modules/webapp/src/main/elm/Messages/DetailEditComp.elm new file mode 100644 index 00000000..7a6ddeb9 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/DetailEditComp.elm @@ -0,0 +1,29 @@ +module Messages.DetailEditComp exposing (..) + +import Messages.Basics +import Messages.CustomFieldFormComp +import Messages.EquipmentFormComp +import Messages.OrgFormComp +import Messages.PersonFormComp +import Messages.TagFormComp + + +type alias Texts = + { basics : Messages.Basics.Texts + , tagForm : Messages.TagFormComp.Texts + , personForm : Messages.PersonFormComp.Texts + , orgForm : Messages.OrgFormComp.Texts + , equipmentForm : Messages.EquipmentFormComp.Texts + , customFieldForm : Messages.CustomFieldFormComp.Texts + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , tagForm = Messages.TagFormComp.gb + , personForm = Messages.PersonFormComp.gb + , orgForm = Messages.OrgFormComp.gb + , equipmentForm = Messages.EquipmentFormComp.gb + , customFieldForm = Messages.CustomFieldFormComp.gb + } diff --git a/modules/webapp/src/main/elm/Messages/EditFormComp.elm b/modules/webapp/src/main/elm/Messages/EditFormComp.elm new file mode 100644 index 00000000..871c03fb --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/EditFormComp.elm @@ -0,0 +1,65 @@ +module Messages.EditFormComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , createNewCustomField : String + , chooseDirection : String + , selectPlaceholder : String + , nameTab : String + , dateTab : String + , folderTab : String + , folderNotOwnerWarning : String + , customFieldsTab : String + , dueDateTab : String + , correspondentTab : String + , organization : String + , addNewOrg : String + , editOrg : String + , chooseOrg : String + , addNewCorrespondentPerson : String + , editPerson : String + , personOrgInfo : String + , concerningTab : String + , addNewConcerningPerson : String + , addNewEquipment : String + , editEquipment : String + , directionTab : String + , suggestions : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , createNewCustomField = "Create new custom field" + , chooseDirection = "Choose a direction…" + , selectPlaceholder = "Select…" + , nameTab = "Name" + , dateTab = "Date" + , folderTab = "Folder" + , folderNotOwnerWarning = + """ +You are **not a member** of this folder. This item will be **hidden** +from any search now. Use a folder where you are a member of to make this +item visible. This message will disappear then. +""" + , customFieldsTab = "Custom Fields" + , dueDateTab = "Due Date" + , correspondentTab = "Correspondent" + , organization = "Organization" + , addNewOrg = "Add new organization" + , editOrg = "Edit organization" + , chooseOrg = "Choose an organization" + , addNewCorrespondentPerson = "Add new correspondent person" + , editPerson = "Edit person" + , personOrgInfo = "The selected person doesn't belong to the selected organization." + , concerningTab = "Concerning" + , addNewConcerningPerson = "Add new concerning person" + , addNewEquipment = "Add new equipment" + , editEquipment = "Edit equipment" + , directionTab = "Direction" + , suggestions = "Suggestions" + } diff --git a/modules/webapp/src/main/elm/Messages/FixedDropdown.elm b/modules/webapp/src/main/elm/Messages/FixedDropdown.elm deleted file mode 100644 index 32f7e983..00000000 --- a/modules/webapp/src/main/elm/Messages/FixedDropdown.elm +++ /dev/null @@ -1,22 +0,0 @@ -module Messages.FixedDropdown exposing - ( Texts - , de - , gb - ) - - -type alias Texts = - { select : String - } - - -gb : Texts -gb = - { select = "Select…" - } - - -de : Texts -de = - { select = "Auswahl…" - } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm index ec4e0b47..66e18079 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm +++ b/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm @@ -1,12 +1,27 @@ module Messages.ItemDetail.AddFilesForm exposing (..) +import Messages.Basics import Messages.DropzoneComp type alias Texts = - { dropzone : Messages.DropzoneComp.Texts } + { dropzone : Messages.DropzoneComp.Texts + , basics : Messages.Basics.Texts + , addMoreFilesToItem : String + , reset : String + , filesSubmittedInfo : String + , refreshNow : String + } gb : Texts gb = - { dropzone = Messages.DropzoneComp.gb } + { dropzone = Messages.DropzoneComp.gb + , basics = Messages.Basics.gb + , addMoreFilesToItem = "Add more files to this item" + , reset = "Reset" + , filesSubmittedInfo = + "All files have been uploaded. They are being processed, some data " + ++ "may not be available immediately. " + , refreshNow = "Refresh now" + } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm index 30e17929..715badec 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm +++ b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm @@ -1,14 +1,64 @@ module Messages.ItemDetailComp exposing (..) +import Messages.DetailEditComp import Messages.ItemDetail.AddFilesForm +import Messages.ItemInfoHeaderComp +import Messages.ItemMailComp +import Messages.NotesComp +import Messages.SentMailsComp +import Messages.SingleAttachmentComp type alias Texts = { addFilesForm : Messages.ItemDetail.AddFilesForm.Texts + , itemInfoHeader : Messages.ItemInfoHeaderComp.Texts + , singleAttachment : Messages.SingleAttachmentComp.Texts + , sentMails : Messages.SentMailsComp.Texts + , notes : Messages.NotesComp.Texts + , itemMail : Messages.ItemMailComp.Texts + , detailEdit : Messages.DetailEditComp.Texts + , key : String + , backToSearchResults : String + , previousItem : String + , nextItem : String + , sendMail : String + , addMoreFiles : String + , confirmItemMetadata : String + , confirm : String + , unconfirmItemMetadata : String + , reprocessItem : String + , deleteThisItem : String + , sentEmails : String + , sendThisItemViaEmail : String + , itemId : String + , createdOn : String + , lastUpdateOn : String } gb : Texts gb = { addFilesForm = Messages.ItemDetail.AddFilesForm.gb + , itemInfoHeader = Messages.ItemInfoHeaderComp.gb + , singleAttachment = Messages.SingleAttachmentComp.gb + , sentMails = Messages.SentMailsComp.gb + , notes = Messages.NotesComp.gb + , itemMail = Messages.ItemMailComp.gb + , detailEdit = Messages.DetailEditComp.gb + , key = "Key" + , backToSearchResults = "Back to search results" + , previousItem = "Previous item." + , nextItem = "Next item." + , sendMail = "Send Mail" + , addMoreFiles = "Add more files to this item" + , confirmItemMetadata = "Confirm item metadata" + , confirm = "Confirm" + , unconfirmItemMetadata = "Un-confirm item metadata" + , reprocessItem = "Reprocess this item" + , deleteThisItem = "Delete this item" + , sentEmails = "Sent E-Mails" + , sendThisItemViaEmail = "Send this item via E-Mail" + , itemId = "Item ID" + , createdOn = "Created on" + , lastUpdateOn = "Last update on" } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm b/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm index 0b8e43bd..ea1fbda3 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm +++ b/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm @@ -1,18 +1,23 @@ module Messages.ItemDetailPage exposing (..) +import Messages.EditFormComp import Messages.ItemDetailComp type alias Texts = { itemDetail : Messages.ItemDetailComp.Texts + , editForm : Messages.EditFormComp.Texts , editMetadata : String + , collapseExpand : String } gb : Texts gb = { itemDetail = Messages.ItemDetailComp.gb + , editForm = Messages.EditFormComp.gb , editMetadata = "Edit Metadata" + , collapseExpand = "Collapse/Expand" } diff --git a/modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm b/modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm new file mode 100644 index 00000000..3f09358f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm @@ -0,0 +1,24 @@ +module Messages.ItemInfoHeaderComp exposing (..) + + +type alias Texts = + { itemDate : String + , dueDate : String + , correspondent : String + , concerning : String + , folder : String + , source : String + , new : String + } + + +gb : Texts +gb = + { itemDate = "Item Date" + , dueDate = "Due Date" + , correspondent = "Correspondent" + , concerning = "Concerning" + , folder = "Folder" + , source = "Source" + , new = "New" + } diff --git a/modules/webapp/src/main/elm/Messages/ItemMailComp.elm b/modules/webapp/src/main/elm/Messages/ItemMailComp.elm new file mode 100644 index 00000000..4ebfc3b0 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/ItemMailComp.elm @@ -0,0 +1,30 @@ +module Messages.ItemMailComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , selectConnection : String + , sendVia : String + , recipients : String + , ccRecipients : String + , bccRecipients : String + , subject : String + , body : String + , includeAllAttachments : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , selectConnection = "Select connection..." + , sendVia = "Send via" + , recipients = "Recipient(s)" + , ccRecipients = "CC recipient(s)" + , bccRecipients = "BCC recipient(s)..." + , subject = "Subject" + , body = "Body" + , includeAllAttachments = "Include all item attachments" + } diff --git a/modules/webapp/src/main/elm/Messages/NotesComp.elm b/modules/webapp/src/main/elm/Messages/NotesComp.elm new file mode 100644 index 00000000..8ab60e8a --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/NotesComp.elm @@ -0,0 +1,20 @@ +module Messages.NotesComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , notes : String + , preview : String + , supportsMarkdown : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , notes = "Notes" + , preview = "Preview" + , supportsMarkdown = "Supports Markdown" + } diff --git a/modules/webapp/src/main/elm/Messages/SentMailsComp.elm b/modules/webapp/src/main/elm/Messages/SentMailsComp.elm new file mode 100644 index 00000000..6f68bc65 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SentMailsComp.elm @@ -0,0 +1,22 @@ +module Messages.SentMailsComp exposing (..) + + +type alias Texts = + { from : String + , date : String + , recipients : String + , subject : String + , sent : String + , sender : String + } + + +gb : Texts +gb = + { from = "From" + , date = "Date" + , recipients = "Recipients" + , subject = "Subject" + , sent = "Sent" + , sender = "Sender" + } diff --git a/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm b/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm new file mode 100644 index 00000000..f044d653 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm @@ -0,0 +1,30 @@ +module Messages.SingleAttachmentComp exposing (..) + + +type alias Texts = + { noName : String + , openFileInNewTab : String + , downloadFile : String + , renameFile : String + , downloadOriginalArchiveFile : String + , originalFile : String + , renderPdfByBrowser : String + , viewExtractedData : String + , reprocessFile : String + , deleteThisFile : String + } + + +gb : Texts +gb = + { noName = "No name" + , openFileInNewTab = "Open file in new tab" + , downloadFile = "Download file" + , renameFile = "Rename file" + , downloadOriginalArchiveFile = "Download original archive" + , originalFile = "Original file" + , renderPdfByBrowser = "Render pdf by browser" + , viewExtractedData = "View extracted data" + , reprocessFile = "Re-process this file" + , deleteThisFile = "Delete this file" + } diff --git a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm index 30fb3371..e3d4b3d9 100644 --- a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm @@ -40,7 +40,7 @@ viewSidebar texts visible flags settings model = , disabled = model.detail.item.state == "created" , handler = onClick (ItemDetailMsg Comp.ItemDetail.Model.ToggleOpenAllAkkordionTabs) , attrs = - [ title "Collapse/Expand" + [ title texts.collapseExpand , href "#" ] } @@ -49,7 +49,7 @@ viewSidebar texts visible flags settings model = , rootClasses = "text-sm mb-3 " } , Html.map ItemDetailMsg - (Comp.ItemDetail.EditForm.view2 flags settings model.detail) + (Comp.ItemDetail.EditForm.view2 texts.editForm flags settings model.detail) ] diff --git a/modules/webapp/src/main/elm/Util/Tag.elm b/modules/webapp/src/main/elm/Util/Tag.elm index 753adf34..583f3f0a 100644 --- a/modules/webapp/src/main/elm/Util/Tag.elm +++ b/modules/webapp/src/main/elm/Util/Tag.elm @@ -21,14 +21,14 @@ makeDropdownModel = } -tagSettings : DS.DropdownStyle -> Comp.Dropdown.ViewSettings Tag -tagSettings ds = +tagSettings : String -> DS.DropdownStyle -> Comp.Dropdown.ViewSettings Tag +tagSettings placeholder ds = { makeOption = \tag -> { text = tag.name, additional = "" } , labelColor = \tag -> \settings -> Data.UiSettings.tagColorString2 tag settings - , placeholder = "Choose a tag…" + , placeholder = placeholder , style = ds } @@ -41,11 +41,11 @@ makeCatDropdownModel = } -catSettings : DS.DropdownStyle -> Comp.Dropdown.ViewSettings String -catSettings ds = +catSettings : String -> DS.DropdownStyle -> Comp.Dropdown.ViewSettings String +catSettings placeholder ds = { makeOption = \cat -> { text = cat, additional = "" } , labelColor = \_ -> \_ -> "" - , placeholder = "Choose a tag category…" + , placeholder = placeholder , style = ds } From fa2c5750dd1dbb26616da498ad8b8a8fefd0e43b Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Fri, 9 Apr 2021 22:39:44 +0200 Subject: [PATCH 20/25] Externalize strings in other of components --- .../src/main/elm/Comp/AttachmentMeta.elm | 42 ++++++----- modules/webapp/src/main/elm/Comp/Basic.elm | 20 +---- .../src/main/elm/Comp/CalEventInput.elm | 24 +++--- .../src/main/elm/Comp/ChangePasswordForm.elm | 5 +- .../main/elm/Comp/ClassifierSettingsForm.elm | 3 +- .../src/main/elm/Comp/CustomFieldForm.elm | 4 +- .../src/main/elm/Comp/CustomFieldInput.elm | 75 +++++++++++++------ .../src/main/elm/Comp/CustomFieldManage.elm | 5 +- .../main/elm/Comp/CustomFieldMultiInput.elm | 14 ++-- .../src/main/elm/Comp/EmailSettingsForm.elm | 13 ++-- .../src/main/elm/Comp/EmailSettingsManage.elm | 9 ++- .../src/main/elm/Comp/EquipmentManage.elm | 9 ++- .../webapp/src/main/elm/Comp/FolderDetail.elm | 4 +- .../webapp/src/main/elm/Comp/FolderSelect.elm | 29 +++---- .../src/main/elm/Comp/ImapSettingsForm.elm | 13 ++-- .../src/main/elm/Comp/ImapSettingsManage.elm | 9 ++- modules/webapp/src/main/elm/Comp/IntField.elm | 15 ++-- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 5 +- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 3 +- .../elm/Comp/ItemDetail/SingleAttachment.elm | 1 + .../src/main/elm/Comp/ItemDetail/View2.elm | 5 +- .../src/main/elm/Comp/NotificationForm.elm | 25 +++++-- .../webapp/src/main/elm/Comp/OrgManage.elm | 14 +++- .../webapp/src/main/elm/Comp/PersonManage.elm | 14 +++- .../src/main/elm/Comp/ScanMailboxForm.elm | 23 ++++-- .../webapp/src/main/elm/Comp/SearchMenu.elm | 2 + .../webapp/src/main/elm/Comp/SourceManage.elm | 14 +++- .../webapp/src/main/elm/Comp/TagManage.elm | 9 ++- .../webapp/src/main/elm/Comp/TagSelect.elm | 17 +++-- .../src/main/elm/Comp/UiSettingsForm.elm | 55 +++++++------- .../webapp/src/main/elm/Comp/UserManage.elm | 14 +++- .../webapp/src/main/elm/Comp/YesNoDimmer.elm | 20 +---- modules/webapp/src/main/elm/Data/Money.elm | 14 +++- .../main/elm/Messages/AttachmentMetaComp.elm | 34 +++++++++ .../webapp/src/main/elm/Messages/Basics.elm | 2 + .../main/elm/Messages/CalEventInputComp.elm | 28 +++++++ .../elm/Messages/ChangePasswordFormComp.elm | 8 +- .../Messages/ClassifierSettingsFormComp.elm | 8 +- .../elm/Messages/CustomFieldInputComp.elm | 18 +++++ .../Messages/CustomFieldMultiInputComp.elm | 14 ++++ .../src/main/elm/Messages/EditFormComp.elm | 3 + .../elm/Messages/EmailSettingsFormComp.elm | 2 + .../src/main/elm/Messages/HomeSideMenu.elm | 6 +- .../elm/Messages/ImapSettingsFormComp.elm | 2 + .../src/main/elm/Messages/ItemDetailComp.elm | 2 + ...ultiEditComp.elm => MultiEditMenuComp.elm} | 5 +- .../elm/Messages/NotificationFormComp.elm | 5 ++ .../main/elm/Messages/ScanMailboxFormComp.elm | 5 ++ .../src/main/elm/Messages/SearchMenuComp.elm | 6 ++ .../elm/Messages/SingleAttachmentComp.elm | 8 +- .../src/main/elm/Messages/TagSelectComp.elm | 16 ++++ .../main/elm/Messages/UiSettingsFormComp.elm | 10 +++ .../webapp/src/main/elm/Page/Queue/View2.elm | 3 +- 53 files changed, 490 insertions(+), 223 deletions(-) create mode 100644 modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CalEventInputComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm create mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm rename modules/webapp/src/main/elm/Messages/{MultiEditComp.elm => MultiEditMenuComp.elm} (88%) create mode 100644 modules/webapp/src/main/elm/Messages/TagSelectComp.elm diff --git a/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm b/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm index 780e4561..37db3a0c 100644 --- a/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm +++ b/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm @@ -15,6 +15,7 @@ import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) import Http +import Messages.AttachmentMetaComp exposing (Texts) import Styles as S import Util.Http import Util.Time @@ -64,15 +65,18 @@ update msg model = --- View2 -view2 : List (Attribute Msg) -> Model -> Html Msg -view2 attrs model = +view2 : Texts -> List (Attribute Msg) -> Model -> Html Msg +view2 texts attrs model = div attrs [ h3 [ class S.header3 ] - [ text "Extracted Meta Data" + [ text texts.extractedMetadata ] , case model.meta of NotAvailable -> - B.loadingDimmer True + B.loadingDimmer + { active = True + , label = texts.basics.loading + } Failure msg -> div [ class S.errorMessage ] @@ -80,33 +84,33 @@ view2 attrs model = ] Success data -> - viewData2 data + viewData2 texts data ] -viewData2 : AttachmentMeta -> Html Msg -viewData2 meta = +viewData2 : Texts -> AttachmentMeta -> Html Msg +viewData2 texts meta = div [ class "flex flex-col" ] [ div [ class "text-lg font-bold" ] - [ text "Content" + [ text texts.content ] , div [ class "px-2 py-2 text-sm bg-yellow-50 dark:bg-warmgray-800 break-words whitespace-pre max-h-80 overflow-auto" ] [ text meta.content ] , div [ class "text-lg font-bold mt-2" ] - [ text "Labels" + [ text texts.labels ] , div [ class "flex fex-row flex-wrap" ] (List.map renderLabelItem2 meta.labels) , div [ class "text-lg font-bold mt-2" ] - [ text "Proposals" + [ text texts.proposals ] - , viewProposals2 meta.proposals + , viewProposals2 texts meta.proposals ] -viewProposals2 : ItemProposals -> Html Msg -viewProposals2 props = +viewProposals2 : Texts -> ItemProposals -> Html Msg +viewProposals2 texts props = let mkItem n lbl = div @@ -130,32 +134,32 @@ viewProposals2 props = in div [ class "flex flex-col" ] [ div [ class "font-bold mb-2" ] - [ text "Correspondent Organization" + [ text texts.correspondentOrg ] , div [ class "flex flex-row flex-wrap space-x-2" ] (List.indexedMap mkItem props.corrOrg) , div [ class "font-bold mt-3 mb-2" ] - [ text "Correspondent Person" + [ text texts.correspondentPerson ] , div [ class "flex flex-row flex-wrap space-x-2" ] (List.indexedMap mkItem props.corrPerson) , div [ class "font-bold mt-3 mb-2" ] - [ text "Concerning Person" + [ text texts.concerningPerson ] , div [ class "flex flex-row flex-wrap space-x-2" ] (List.indexedMap mkItem props.concPerson) , div [ class "font-bold mt-3 mb-2" ] - [ text "Concerning Equipment" + [ text texts.concerningEquipment ] , div [ class "flex flex-row flex-wrap space-x-2" ] (List.indexedMap mkItem props.concEquipment) , div [ class "font-bold mb-2 mt-3" ] - [ text "Item Date" + [ text texts.itemDate ] , div [ class "flex flex-row flex-wrap space-x-2" ] (List.map mkTimeItem props.itemDate) , div [ class "font-bold mt-3 mb-2" ] - [ text "Item Due Date" + [ text texts.itemDueDate ] , div [ class "flex flex-row flex-wrap space-x-2 mb-2" ] (List.map mkTimeItem props.dueDate) diff --git a/modules/webapp/src/main/elm/Comp/Basic.elm b/modules/webapp/src/main/elm/Comp/Basic.elm index 9629e3a0..f34f010d 100644 --- a/modules/webapp/src/main/elm/Comp/Basic.elm +++ b/modules/webapp/src/main/elm/Comp/Basic.elm @@ -12,7 +12,6 @@ module Comp.Basic exposing , secondaryBasicButton , secondaryButton , stats - , tooltipRight ) import Html exposing (..) @@ -176,18 +175,18 @@ linkLabel model = genericLink model.icon model.label attrs -loadingDimmer : Bool -> Html msg -loadingDimmer active = +loadingDimmer : { label : String, active : Bool } -> Html msg +loadingDimmer cfg = div [ classList - [ ( "hidden", not active ) + [ ( "hidden", not cfg.active ) ] , class S.dimmer ] [ div [ class "text-gray-200" ] [ i [ class "fa fa-circle-notch animate-spin" ] [] , span [ class "ml-2" ] - [ text "Loading…" + [ text cfg.label ] ] ] @@ -279,17 +278,6 @@ inputRequired = ] -tooltipRight : Bool -> String -> Html msg -tooltipRight show msg = - div - [ class "absolute bottom-0 right-5 px-2 py-2 rounded-lg z-50 w-40" - , class "bg-white border" - , class "text-sm font-thin" - ] - [ text msg - ] - - --- Helpers diff --git a/modules/webapp/src/main/elm/Comp/CalEventInput.elm b/modules/webapp/src/main/elm/Comp/CalEventInput.elm index f69fb809..dfa1c319 100644 --- a/modules/webapp/src/main/elm/Comp/CalEventInput.elm +++ b/modules/webapp/src/main/elm/Comp/CalEventInput.elm @@ -17,6 +17,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) import Http +import Messages.CalEventInputComp exposing (Texts) import Styles as S import Util.Http import Util.Maybe @@ -129,8 +130,8 @@ update flags ev msg model = --- View2 -view2 : String -> CalEvent -> Model -> Html Msg -view2 extraClasses ev model = +view2 : Texts -> String -> CalEvent -> Model -> Html Msg +view2 texts extraClasses ev model = let yearLen = Basics.max 4 (String.length ev.year) @@ -155,7 +156,7 @@ view2 extraClasses ev model = [ label [ class S.inputLabel ] - [ text "Weekday" ] + [ text texts.weekday ] , input [ type_ "text" , class S.textInput @@ -172,7 +173,7 @@ view2 extraClasses ev model = ] , div [ class "flex flex-col space-y-2 mr-2" ] [ label [ class S.inputLabel ] - [ text "Year" ] + [ text texts.year ] , input [ type_ "text" , class S.textInput @@ -188,7 +189,7 @@ view2 extraClasses ev model = ] , div [ class "flex flex-col space-y-2 mr-2" ] [ label [ class S.inputLabel ] - [ text "Month" ] + [ text texts.month ] , input [ type_ "text" , class styleInput @@ -204,7 +205,7 @@ view2 extraClasses ev model = ] , div [ class "flex flex-col space-y-2 mr-4 mr-2" ] [ label [ class S.inputLabel ] - [ text "Day" + [ text texts.day ] , input [ type_ "text" @@ -218,7 +219,8 @@ view2 extraClasses ev model = ] , div [ class "flex flex-col space-y-2 mr-2" ] [ label [ class S.inputLabel ] - [ text "Hour" ] + [ text texts.hour + ] , input [ type_ "text" , class styleInput @@ -234,7 +236,7 @@ view2 extraClasses ev model = ] , div [ class "flex flex-col space-y-2" ] [ label [ class S.inputLabel ] - [ text "Minute" + [ text texts.minute ] , input [ type_ "text" @@ -253,7 +255,7 @@ view2 extraClasses ev model = ] , class S.errorMessage ] - [ text "Error: " + [ text (texts.error ++ ": ") , Maybe.map .message model.checkResult |> Maybe.withDefault "" |> text @@ -269,7 +271,7 @@ view2 extraClasses ev model = ] [ div [] [ div [ class S.inputLabel ] - [ text "Schedule: " + [ text (texts.schedule ++ ": ") ] , div [ class "px-12 font-mono " ] [ Maybe.andThen .event model.checkResult @@ -277,7 +279,7 @@ view2 extraClasses ev model = |> text ] , div [ class S.inputLabel ] - [ text "Next: " + [ text (texts.next ++ ": ") ] , ul [ class "list-decimal list-inside text-sm" ] (Maybe.map .next model.checkResult diff --git a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm index 6dd20221..7f6e58de 100644 --- a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm +++ b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm @@ -267,5 +267,8 @@ view2 texts model = [ text "Submit" ] ] - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index f212b812..0333c81a 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -60,7 +60,7 @@ init flags sett = in ( { scheduleModel = cem , schedule = Data.Validated.Unknown newSchedule - , itemCountModel = Comp.IntField.init (Just 0) Nothing True "" + , itemCountModel = Comp.IntField.init (Just 0) Nothing True , itemCount = Just sett.itemCount , categoryListModel = let @@ -237,6 +237,7 @@ view2 texts settings model = [ text texts.schedule ] , Html.map ScheduleMsg (Comp.CalEventInput.view2 + texts.calEventInput "" (Data.Validated.value model.schedule) model.scheduleModel diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index afb4b792..f5a6d835 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -201,7 +201,9 @@ view2 : Texts -> ViewSettings -> Model -> List (Html Msg) view2 texts viewSettings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteField + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteField + texts.basics.yes + texts.basics.no ftypeCfg = { display = texts.fieldTypeLabel diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm index f725c66d..c9e5b107 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm @@ -16,12 +16,13 @@ import Comp.DatePicker import Comp.MenuBar as MB import Data.CustomFieldType exposing (CustomFieldType) import Data.Icons as Icons -import Data.Money +import Data.Money exposing (MoneyParseError(..)) import Date exposing (Date) import DatePicker exposing (DatePicker) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onCheck, onClick, onInput) +import Html.Events exposing (onClick, onInput) +import Messages.CustomFieldInputComp exposing (Texts) import Styles as S import Util.Maybe @@ -32,9 +33,15 @@ type alias Model = } +type FieldError + = NoValue + | NotANumber String + | NotMoney MoneyParseError + + type alias FloatModel = { input : String - , result : Result String Float + , result : Result FieldError Float } @@ -61,27 +68,47 @@ fieldType field = |> Maybe.withDefault Data.CustomFieldType.Text -errorMsg : Model -> Maybe String -errorMsg model = +errorMsg : Texts -> Model -> Maybe String +errorMsg texts model = let - getMsg res = - case res of - Ok _ -> - Nothing + parseMsg isMoneyField perr = + case perr of + NoValue -> + if isMoneyField then + Just <| texts.errorNoAmount - Err m -> - Just m + else + Just <| texts.errorNoNumber + + NotANumber str -> + Just <| texts.errorNotANumber str + + NotMoney (RequireTwoDigitsAfterDot _) -> + Just "Two digits required after the dot." + + NotMoney (NoOrTooManyPoints _) -> + Just "One single dot + digits required for money." in case model.fieldModel of NumberField fm -> - getMsg fm.result + case fm.result of + Ok _ -> + Nothing + + Err parseError -> + parseMsg False parseError MoneyField fm -> - getMsg fm.result + case fm.result of + Ok _ -> + Nothing + + Err parseError -> + parseMsg True parseError TextField mt -> if mt == Nothing then - Just "Please fill in some value" + Just texts.errorNoValue else Nothing @@ -103,10 +130,10 @@ init field = TextField Nothing Data.CustomFieldType.Numeric -> - NumberField (FloatModel "" (Err "No number given")) + NumberField (FloatModel "" (Err NoValue)) Data.CustomFieldType.Money -> - MoneyField (FloatModel "" (Err "No amount given")) + MoneyField (FloatModel "" (Err NoValue)) Data.CustomFieldType.Boolean -> BoolField False @@ -150,7 +177,7 @@ initWith value = updateFloatModel False value.value - Data.Money.fromString + (Data.Money.fromString >> Result.mapError NotMoney) Data.Money.normalizeInput in MoneyField fm @@ -230,7 +257,7 @@ update1 forSearch msg model = updateFloatModel forSearch str - Data.Money.fromString + (Data.Money.fromString >> Result.mapError NotMoney) Data.Money.normalizeInput model_ = @@ -294,7 +321,7 @@ update1 forSearch msg model = updateFloatModel : Bool -> String - -> (String -> Result String Float) + -> (String -> Result FieldError Float) -> (String -> String) -> ( FloatModel, FieldResult ) updateFloatModel forSearch msg parse normalize = @@ -331,11 +358,11 @@ hasWildCards msg = --- View2 -view2 : String -> Maybe String -> Model -> Html Msg -view2 classes icon model = +view2 : Texts -> String -> Maybe String -> Model -> Html Msg +view2 texts classes icon model = let error = - errorMsg model + errorMsg texts model in div [ class classes @@ -473,11 +500,11 @@ mkLabel model = Maybe.withDefault model.field.name model.field.label -string2Float : String -> Result String Float +string2Float : String -> Result FieldError Float string2Float str = case String.toFloat str of Just n -> Ok n Nothing -> - Err ("Not a number: " ++ str) + Err (NotANumber str) diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm index f062d834..c9fa672f 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm @@ -203,5 +203,8 @@ viewTable2 texts model = model.tableModel model.fields ) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index 8cf7ed94..9fe2dcf4 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -29,6 +29,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http +import Messages.CustomFieldMultiInputComp exposing (Texts) import Styles as S import Util.CustomField import Util.Maybe @@ -318,11 +319,11 @@ type alias ViewSettings = } -view2 : ViewSettings -> Model -> Html Msg -view2 viewSettings model = +view2 : Texts -> ViewSettings -> Model -> Html Msg +view2 texts viewSettings model = div [ class viewSettings.classes ] (viewMenuBar2 viewSettings model - :: List.map (viewCustomField2 viewSettings model) (visibleFields model) + :: List.map (viewCustomField2 texts viewSettings model) (visibleFields model) ) @@ -364,8 +365,8 @@ viewMenuBar2 viewSettings model = ) -viewCustomField2 : ViewSettings -> Model -> CustomField -> Html Msg -viewCustomField2 viewSettings model field = +viewCustomField2 : Texts -> ViewSettings -> Model -> CustomField -> Html Msg +viewCustomField2 texts viewSettings model field = let visibleField = Dict.get field.name model.visibleFields @@ -373,7 +374,8 @@ viewCustomField2 viewSettings model field = case visibleField of Just vf -> Html.map (CustomFieldInputMsg field) - (Comp.CustomFieldInput.view2 "mt-2" + (Comp.CustomFieldInput.view2 texts.customFieldInput + "mt-2" (viewSettings.fieldIcon vf.field) vf.inputModel ) diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index 1119eb69..96c17354 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -47,7 +47,7 @@ emptyModel = { settings = Api.Model.EmailSettings.empty , name = "" , host = "" - , portField = Comp.IntField.init (Just 0) Nothing True "SMTP Port" + , portField = Comp.IntField.init (Just 0) Nothing True , portNum = Nothing , user = Nothing , passField = Comp.PasswordInput.init @@ -68,7 +68,7 @@ init ems = { settings = ems , name = ems.name , host = ems.smtpHost - , portField = Comp.IntField.init (Just 0) Nothing True "SMTP Port" + , portField = Comp.IntField.init (Just 0) Nothing True , portNum = ems.smtpPort , user = ems.smtpUser , passField = Comp.PasswordInput.init @@ -225,9 +225,12 @@ view2 texts settings model = [] ] , Html.map PortMsg - (Comp.IntField.viewWithInfo2 "" - model.portNum - "" + (Comp.IntField.view + { label = texts.smtpPort + , info = "" + , number = model.portNum + , classes = "" + } model.portField ) , div [ class "col-span-4 sm:col-span-2" ] diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm index 1698f297..1452268f 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm @@ -250,7 +250,9 @@ viewForm2 : Texts -> UiSettings -> Model -> Html Msg viewForm2 texts settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteConnection + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteConnection + texts.basics.yes + texts.basics.no in div [ class "flex flex-col md:relative" ] [ MB.view @@ -302,5 +304,8 @@ viewForm2 texts settings model = dimmerSettings model.deleteConfirm ) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm index cb570e12..e10f8af1 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm @@ -258,7 +258,9 @@ viewForm2 texts model = model.formModel.equipment.id == "" dimmerSettings2 = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteEquipment + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteEquipment + texts.basics.yes + texts.basics.no in Html.form [ class "relative flex flex-col" @@ -322,5 +324,8 @@ viewForm2 texts model = [ Maybe.withDefault "" model.formError |> text ] , Html.map FormMsg (Comp.EquipmentForm.view2 texts.equipmentForm model.formModel) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index 326b7ecf..438d53c0 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -286,7 +286,9 @@ view2 texts flags model = dimmerSettings : Comp.YesNoDimmer.Settings dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteThisFolder + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteThisFolder + texts.basics.yes + texts.basics.no in div [ class "flex flex-col md:relative" ] (viewButtons2 texts model diff --git a/modules/webapp/src/main/elm/Comp/FolderSelect.elm b/modules/webapp/src/main/elm/Comp/FolderSelect.elm index 3b65eff9..f7034af8 100644 --- a/modules/webapp/src/main/elm/Comp/FolderSelect.elm +++ b/modules/webapp/src/main/elm/Comp/FolderSelect.elm @@ -156,25 +156,20 @@ viewDrop2 dropModel constr model = highlightDrop = DD.getDropId dropModel == Just DD.FolderRemove in - div [ class "ui list" ] - [ div [ class "item" ] - [ i [ class "folder open icon" ] [] - , div [ class "content" ] - [ div - (classList - [ ( "hidden", True ) - , ( "current-drop-target", highlightDrop ) - ] - :: DD.droppable FolderDDMsg DD.FolderRemove - -- note: re-enable this when adding a "no-folder selection" - -- this enables a drop target that removes a folder - ) - [ text "Folders" - ] - , div [ class "flex flex-col space-y-2 md:space-y-1" ] - (renderItems2 dropModel constr model) + div [] + [ div + (classList + [ ( "hidden", True ) + , ( "current-drop-target", highlightDrop ) ] + :: DD.droppable FolderDDMsg DD.FolderRemove + -- note: re-enable this when adding a "no-folder selection" + -- this enables a drop target that removes a folder + ) + [ text "Folders" ] + , div [ class "flex flex-col space-y-2 md:space-y-1" ] + (renderItems2 dropModel constr model) ] diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index 46426a53..a47db36c 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -46,7 +46,7 @@ emptyModel = { settings = Api.Model.ImapSettings.empty , name = "" , host = "" - , portField = Comp.IntField.init (Just 0) Nothing True "IMAP Port" + , portField = Comp.IntField.init (Just 0) Nothing True , portNum = Nothing , user = Nothing , passField = Comp.PasswordInput.init @@ -66,7 +66,7 @@ init ems = { settings = ems , name = ems.name , host = ems.imapHost - , portField = Comp.IntField.init (Just 0) Nothing True "IMAP Port" + , portField = Comp.IntField.init (Just 0) Nothing True , portNum = ems.imapPort , user = ems.imapUser , passField = Comp.PasswordInput.init @@ -216,9 +216,12 @@ view2 texts settings model = [] ] , Html.map PortMsg - (Comp.IntField.viewWithInfo2 "" - model.portNum - "" + (Comp.IntField.view + { label = texts.imapPort + , info = "" + , number = model.portNum + , classes = "" + } model.portField ) , div [ class "col-span-4 sm:col-span-2" ] diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm index 48c04dd1..09ea6112 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm @@ -251,7 +251,9 @@ viewForm2 : Texts -> UiSettings -> Model -> Html Msg viewForm2 texts settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteSettings + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteSettings + texts.basics.yes + texts.basics.no in div [ class "flex flex-col md:relative" ] [ MB.view @@ -304,5 +306,8 @@ viewForm2 texts settings model = dimmerSettings model.deleteConfirm ) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/IntField.elm b/modules/webapp/src/main/elm/Comp/IntField.elm index 49ee0adf..1ecbac18 100644 --- a/modules/webapp/src/main/elm/Comp/IntField.elm +++ b/modules/webapp/src/main/elm/Comp/IntField.elm @@ -5,11 +5,8 @@ module Comp.IntField exposing , init , update , view - , viewWithInfo2 ) ---- L10N TODO - import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) @@ -20,7 +17,6 @@ import Styles as S type alias Model = { min : Maybe Int , max : Maybe Int - , label : String , error : Maybe String , lastInput : String , optional : Bool @@ -31,11 +27,10 @@ type Msg = SetValue String -init : Maybe Int -> Maybe Int -> Bool -> String -> Model -init min max opt label = +init : Maybe Int -> Maybe Int -> Bool -> Model +init min max opt = { min = min , max = max - , label = label , error = Nothing , lastInput = "" , optional = opt @@ -149,11 +144,11 @@ view cfg model = ] -viewWithInfo2 : String -> Maybe Int -> String -> Model -> Html Msg -viewWithInfo2 info nval classes model = +viewWithInfo2 : String -> String -> Maybe Int -> String -> Model -> Html Msg +viewWithInfo2 label info nval classes model = let cfg = - { label = model.label + { label = label , info = info , number = nval , classes = classes diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index 9f5b1666..bed67bad 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -52,7 +52,7 @@ view2 texts flags settings model = formTabs texts flags settings model allTabNames = - List.map .title tabs + List.map .name tabs |> Set.fromList in div (class "flex flex-col relative" :: keyAttr) @@ -127,7 +127,7 @@ formTabs texts flags settings model = folderCfg = { makeOption = Util.Folder.mkFolderOption flags model.allFolders - , placeholder = "" + , placeholder = texts.selectPlaceholder , labelColor = \_ -> \_ -> "" , style = dds } @@ -254,6 +254,7 @@ formTabs texts flags settings model = [ div [ class "mb-4" ] [ Html.map CustomFieldMsg (Comp.CustomFieldMultiInput.view2 + texts.customFieldInput customFieldSettings model.customFieldsModel ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index 77600cff..99076884 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -39,7 +39,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http import Markdown -import Messages.MultiEditComp exposing (Texts) +import Messages.MultiEditMenuComp exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S @@ -775,6 +775,7 @@ renderEditForm2 texts flags cfg settings model = , body = [ Html.map CustomFieldMsg (Comp.CustomFieldMultiInput.view2 + texts.customFieldMultiInput customFieldSettings model.customFieldModel ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm index 9394daa6..e22b5f90 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm @@ -52,6 +52,7 @@ view texts settings model pos attach = Just am -> Html.map (AttachMetaMsg attach.id) (Comp.AttachmentMeta.view2 + texts.attachmentMeta [ class "border-r border-l border-b dark:border-bluegray-600 px-2" ] am ) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm index a1ecf2fc..31a3dbc7 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm @@ -250,7 +250,10 @@ sendMailForm texts settings model = [ div [ class "text-lg font-bold" ] [ text texts.sendThisItemViaEmail ] - , B.loadingDimmer model.mailSending + , B.loadingDimmer + { active = model.mailSending + , label = texts.sendingMailNow + } , Html.map ItemMailMsg (Comp.ItemMail.view2 texts.itemMail settings model.itemMail) , div [ classList diff --git a/modules/webapp/src/main/elm/Comp/NotificationForm.elm b/modules/webapp/src/main/elm/Comp/NotificationForm.elm index 46d34b1f..3422c17c 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationForm.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationForm.elm @@ -152,7 +152,7 @@ init flags = , recipients = [] , recipientsModel = Comp.EmailInput.init , remindDays = Just 1 - , remindDaysModel = Comp.IntField.init (Just 1) Nothing True "Remind Days" + , remindDaysModel = Comp.IntField.init (Just 1) Nothing True , enabled = False , capOverdue = False , schedule = initialSchedule @@ -480,7 +480,9 @@ view2 : Texts -> String -> UiSettings -> Model -> Html Msg view2 texts extraClasses settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTask + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteTask + texts.basics.yes + texts.basics.no startOnceBtn = MB.SecondaryButton @@ -506,7 +508,10 @@ view2 texts extraClasses settings model = dimmerSettings model.yesNoDelete ) - , B.loadingDimmer (model.loading > 0) + , B.loadingDimmer + { active = model.loading > 0 + , label = texts.basics.loading + } , MB.view { start = [ MB.PrimaryButton @@ -634,10 +639,12 @@ view2 texts extraClasses settings model = ] ] , Html.map RemindDaysMsg - (Comp.IntField.viewWithInfo2 - texts.remindDaysInfo - model.remindDays - "mb-4" + (Comp.IntField.view + { label = texts.remindDaysLabel + , info = texts.remindDaysInfo + , number = model.remindDays + , classes = "mb-4" + } model.remindDaysModel ) , div [ class "mb-4" ] @@ -668,7 +675,9 @@ view2 texts extraClasses settings model = ] ] , Html.map CalEventMsg - (Comp.CalEventInput.view2 "" + (Comp.CalEventInput.view2 + texts.calEventInput + "" (Data.Validated.value model.schedule) model.scheduleModel ) diff --git a/modules/webapp/src/main/elm/Comp/OrgManage.elm b/modules/webapp/src/main/elm/Comp/OrgManage.elm index 71c1ba62..38c01908 100644 --- a/modules/webapp/src/main/elm/Comp/OrgManage.elm +++ b/modules/webapp/src/main/elm/Comp/OrgManage.elm @@ -238,7 +238,10 @@ viewTable2 texts model = , rootClasses = "mb-4" } , Html.map TableMsg (Comp.OrgTable.view2 texts.orgTable model.tableModel) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] @@ -249,7 +252,9 @@ viewForm2 texts settings model = model.formModel.org.id == "" dimmerSettings2 = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteOrg + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteOrg + texts.basics.yes + texts.basics.no in Html.form [ class "md:relative flex flex-col" @@ -319,5 +324,8 @@ viewForm2 texts settings model = settings model.formModel ) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/PersonManage.elm b/modules/webapp/src/main/elm/Comp/PersonManage.elm index b63f2f89..257cd2b4 100644 --- a/modules/webapp/src/main/elm/Comp/PersonManage.elm +++ b/modules/webapp/src/main/elm/Comp/PersonManage.elm @@ -275,7 +275,10 @@ viewTable2 texts model = , rootClasses = "mb-4" } , Html.map TableMsg (Comp.PersonTable.view2 texts.personTable model.tableModel) - , B.loadingDimmer (isLoading model) + , B.loadingDimmer + { active = isLoading model + , label = texts.basics.loading + } ] @@ -286,7 +289,9 @@ viewForm2 texts settings model = model.formModel.person.id == "" dimmerSettings2 = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeletePerson + Comp.YesNoDimmer.defaultSettings texts.reallyDeletePerson + texts.basics.yes + texts.basics.no in Html.form [ class "md:relative flex flex-col" @@ -355,5 +360,8 @@ viewForm2 texts settings model = settings model.formModel ) - , B.loadingDimmer (isLoading model) + , B.loadingDimmer + { active = isLoading model + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 0dd02167..74236f85 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -221,7 +221,7 @@ init flags = , enabled = False , deleteMail = False , receivedHours = Nothing - , receivedHoursModel = Comp.IntField.init (Just 1) Nothing True "Received Since Hours" + , receivedHoursModel = Comp.IntField.init (Just 1) Nothing True , foldersModel = Comp.StringListInput.init , folders = [] , targetFolder = Nothing @@ -740,7 +740,7 @@ view2 : Texts -> Flags -> String -> UiSettings -> Model -> Html Msg view2 texts flags extraClasses settings model = let dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTask + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteTask texts.basics.yes texts.basics.no startOnceBtn = MB.SecondaryButton @@ -813,7 +813,10 @@ view2 texts flags extraClasses settings model = dimmerSettings model.yesNoDelete ) - , B.loadingDimmer (model.loading > 0) + , B.loadingDimmer + { active = model.loading > 0 + , label = texts.basics.loading + } ] @@ -926,10 +929,12 @@ viewProcessing2 texts model = ] ] , Html.map ReceivedHoursMsg - (Comp.IntField.viewWithInfo2 - texts.receivedHoursInfo - model.receivedHours - "mb-4" + (Comp.IntField.view + { label = texts.receivedHoursLabel + , info = texts.receivedHoursInfo + , number = model.receivedHours + , classes = "mb-4" + } model.receivedHoursModel ) ] @@ -1163,7 +1168,9 @@ viewSchedule2 texts model = ] ] , Html.map CalEventMsg - (Comp.CalEventInput.view2 "" + (Comp.CalEventInput.view2 + texts.calEventInput + "" (Data.Validated.value model.schedule) model.scheduleModel ) diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index 2e7a16b7..7e9ac390 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -1202,6 +1202,7 @@ searchTabs texts ddd flags settings model = , body = List.map (Html.map TagSelectMsg) (Comp.TagSelect.viewTagsDrop2 + texts.tagSelect ddd.model tagSelectWM settings @@ -1303,6 +1304,7 @@ searchTabs texts ddd flags settings model = , body = [ Html.map CustomFieldMsg (Comp.CustomFieldMultiInput.view2 + texts.customFieldMultiInput { showAddButton = False , classes = "" , fieldIcon = \_ -> Nothing diff --git a/modules/webapp/src/main/elm/Comp/SourceManage.elm b/modules/webapp/src/main/elm/Comp/SourceManage.elm index 0734abc9..e3044782 100644 --- a/modules/webapp/src/main/elm/Comp/SourceManage.elm +++ b/modules/webapp/src/main/elm/Comp/SourceManage.elm @@ -249,7 +249,10 @@ viewTable2 texts model = , rootClasses = "mb-4" } , Html.map TableMsg (Comp.SourceTable.view2 texts.sourceTable model.sources) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] @@ -386,7 +389,9 @@ viewForm2 texts flags settings model = model.formModel.source.source.id == "" dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteSource + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteSource + texts.basics.yes + texts.basics.no in [ if newSource then h3 [ class S.header2 ] @@ -449,6 +454,9 @@ viewForm2 texts flags settings model = dimmerSettings model.deleteConfirm ) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] ] diff --git a/modules/webapp/src/main/elm/Comp/TagManage.elm b/modules/webapp/src/main/elm/Comp/TagManage.elm index 833fbe06..617038a0 100644 --- a/modules/webapp/src/main/elm/Comp/TagManage.elm +++ b/modules/webapp/src/main/elm/Comp/TagManage.elm @@ -264,7 +264,9 @@ viewForm2 texts model = model.tagFormModel.tag.id == "" dimmerSettings2 = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteTag + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteTag + texts.basics.yes + texts.basics.no in Html.form [ class "relative flex flex-col" @@ -328,5 +330,8 @@ viewForm2 texts model = [ Maybe.withDefault "" model.formError |> text ] , Html.map FormMsg (Comp.TagForm.view2 texts.tagForm model.tagFormModel) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/TagSelect.elm b/modules/webapp/src/main/elm/Comp/TagSelect.elm index 2d89ae4a..579b4c6d 100644 --- a/modules/webapp/src/main/elm/Comp/TagSelect.elm +++ b/modules/webapp/src/main/elm/Comp/TagSelect.elm @@ -26,6 +26,7 @@ import Dict exposing (Dict) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) +import Messages.TagSelectComp exposing (Texts) import Set import Simple.Fuzzy import String as S @@ -422,17 +423,17 @@ catState model name = --- View2 -viewAll2 : DD.Model -> UiSettings -> Selection -> Model -> List (Html Msg) -viewAll2 ddm settings sel model = +viewAll2 : Texts -> DD.Model -> UiSettings -> Selection -> Model -> List (Html Msg) +viewAll2 texts ddm settings sel model = let wm = makeWorkModel sel model in - viewTagsDrop2 ddm wm settings model ++ [ viewCats2 settings wm model ] + viewTagsDrop2 texts ddm wm settings model ++ [ viewCats2 settings wm model ] -viewTagsDrop2 : DD.Model -> WorkModel -> UiSettings -> Model -> List (Html Msg) -viewTagsDrop2 ddm wm settings model = +viewTagsDrop2 : Texts -> DD.Model -> WorkModel -> UiSettings -> Model -> List (Html Msg) +viewTagsDrop2 texts ddm wm settings model = [ div [ class "flex flex-col" ] [ div [ class "flex flex-row h-6 items-center text-xs mb-2" ] [ a @@ -442,16 +443,16 @@ viewTagsDrop2 ddm wm settings model = , onClick ToggleShowEmpty ] [ if model.showEmpty then - text " Hide empty" + text (" " ++ texts.hideEmpty) else - text " Show empty" + text (" " ++ texts.showEmpty) ] , div [ class "flex-grow" ] [] , div [ class " relative h-6" ] [ input [ type_ "text" - , placeholder "Filter …" + , placeholder texts.filterPlaceholder , onInput Search , class "bg-blue-50 w-30 h-6 px-0 py-0 text-xs" , class "border-0 border-b border-gray-200 focus:ring-0 focus:border-black" diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 865c9a91..23e9cf48 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -109,7 +109,6 @@ init flags settings = (Just 10) (Just flags.config.maxPageSize) False - "Page size" , tagColors = settings.tagCategoryColors , tagColorModel = Comp.ColorTagger.init @@ -122,28 +121,24 @@ init flags settings = (Just 0) (Just flags.config.maxNoteLength) False - "Max. Note Length" , searchMenuFolderCount = Just settings.searchMenuFolderCount , searchMenuFolderCountModel = Comp.IntField.init (Just 0) (Just 2000) False - "Number of folders in search menu" , searchMenuTagCount = Just settings.searchMenuTagCount , searchMenuTagCountModel = Comp.IntField.init (Just 0) (Just 2000) False - "Number of tags in search menu" , searchMenuTagCatCount = Just settings.searchMenuTagCatCount , searchMenuTagCatCountModel = Comp.IntField.init (Just 0) (Just 2000) False - "Number of categories in search menu" , formFields = settings.formFields , itemDetailShortcuts = settings.itemDetailShortcuts , cardPreviewSize = settings.cardPreviewSize @@ -535,10 +530,12 @@ settingFormTabs texts flags _ model = , info = Nothing , body = [ Html.map SearchPageSizeMsg - (Comp.IntField.viewWithInfo2 - (texts.maxResultsPerPageInfo flags.config.maxPageSize) - model.itemSearchPageSize - "mb-4" + (Comp.IntField.view + { label = texts.maxResultsPerPage + , info = texts.maxResultsPerPageInfo flags.config.maxPageSize + , number = model.itemSearchPageSize + , classes = "mb-4" + } model.searchPageSizeModel ) , div [ class "mb-4" ] @@ -567,10 +564,12 @@ settingFormTabs texts flags _ model = , info = Nothing , body = [ Html.map NoteLengthMsg - (Comp.IntField.viewWithInfo2 - (texts.maxNoteSizeInfo flags.config.maxNoteLength) - model.itemSearchNoteLength - "mb-4" + (Comp.IntField.view + { label = texts.maxNoteSize + , info = texts.maxNoteSizeInfo flags.config.maxNoteLength + , number = model.itemSearchNoteLength + , classes = "mb-4" + } model.searchNoteLengthModel ) , Html.map CardPreviewSizeMsg @@ -636,24 +635,30 @@ settingFormTabs texts flags _ model = , info = Nothing , body = [ Html.map SearchMenuTagMsg - (Comp.IntField.viewWithInfo2 - texts.searchMenuTagCountInfo - model.searchMenuTagCount - "mb-4" + (Comp.IntField.view + { label = texts.searchMenuTagCount + , info = texts.searchMenuTagCountInfo + , number = model.searchMenuTagCount + , classes = "mb-4" + } model.searchMenuTagCountModel ) , Html.map SearchMenuTagCatMsg - (Comp.IntField.viewWithInfo2 - texts.searchMenuCatCountInfo - model.searchMenuTagCatCount - "mb-4" + (Comp.IntField.view + { label = texts.searchMenuCatCount + , info = texts.searchMenuCatCountInfo + , number = model.searchMenuTagCatCount + , classes = "mb-4" + } model.searchMenuTagCatCountModel ) , Html.map SearchMenuFolderMsg - (Comp.IntField.viewWithInfo2 - texts.searchMenuFolderCountInfo - model.searchMenuFolderCount - "mb-4" + (Comp.IntField.view + { label = texts.searchMenuFolderCount + , info = texts.searchMenuFolderCountInfo + , number = model.searchMenuFolderCount + , classes = "mb-4" + } model.searchMenuFolderCountModel ) ] diff --git a/modules/webapp/src/main/elm/Comp/UserManage.elm b/modules/webapp/src/main/elm/Comp/UserManage.elm index 5bb7fe2d..70519b5e 100644 --- a/modules/webapp/src/main/elm/Comp/UserManage.elm +++ b/modules/webapp/src/main/elm/Comp/UserManage.elm @@ -239,7 +239,10 @@ viewTable2 texts model = , rootClasses = "mb-4" } , Html.map TableMsg (Comp.UserTable.view2 texts.userTable model.tableModel) - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] @@ -251,7 +254,9 @@ viewForm2 texts settings model = dimmerSettings : Comp.YesNoDimmer.Settings dimmerSettings = - Comp.YesNoDimmer.defaultSettings2 texts.reallyDeleteUser + Comp.YesNoDimmer.defaultSettings texts.reallyDeleteUser + texts.basics.yes + texts.basics.no in Html.form [ class "flex flex-col md:relative" @@ -317,5 +322,8 @@ viewForm2 texts settings model = FormErrorInvalid -> text texts.pleaseCorrectErrors ] - , B.loadingDimmer model.loading + , B.loadingDimmer + { active = model.loading + , label = texts.basics.loading + } ] diff --git a/modules/webapp/src/main/elm/Comp/YesNoDimmer.elm b/modules/webapp/src/main/elm/Comp/YesNoDimmer.elm index e4006c49..d32ed1c3 100644 --- a/modules/webapp/src/main/elm/Comp/YesNoDimmer.elm +++ b/modules/webapp/src/main/elm/Comp/YesNoDimmer.elm @@ -4,7 +4,6 @@ module Comp.YesNoDimmer exposing , Settings , activate , defaultSettings - , defaultSettings2 , disable , emptyModel , initActive @@ -58,24 +57,13 @@ type alias Settings = } -defaultSettings : Settings -defaultSettings = - { message = "Delete this item permanently?" - , headerIcon = "exclamation icon" - , headerClass = "ui inverted icon header" - , confirmButton = "Yes, do it!" - , cancelButton = "No" - , extraClass = "" - } - - -defaultSettings2 : String -> Settings -defaultSettings2 msg = +defaultSettings : String -> String -> String -> Settings +defaultSettings msg yesLabel noLabel = { message = msg , headerIcon = "fa fa-exclamation-circle mr-3" , headerClass = "text-2xl font-bold text-center w-full" - , confirmButton = "Yes, do it!" - , cancelButton = "No" + , confirmButton = yesLabel + , cancelButton = noLabel , extraClass = "" } diff --git a/modules/webapp/src/main/elm/Data/Money.elm b/modules/webapp/src/main/elm/Data/Money.elm index 7856f517..cffe7dfc 100644 --- a/modules/webapp/src/main/elm/Data/Money.elm +++ b/modules/webapp/src/main/elm/Data/Money.elm @@ -1,5 +1,6 @@ module Data.Money exposing ( Money + , MoneyParseError(..) , format , fromString , normalizeInput @@ -11,7 +12,12 @@ type alias Money = Float -fromString : String -> Result String Money +type MoneyParseError + = RequireTwoDigitsAfterDot String + | NoOrTooManyPoints String + + +fromString : String -> Result MoneyParseError Money fromString str = let input = @@ -28,13 +34,13 @@ fromString str = if index == (len - 3) then String.toFloat input |> Maybe.map Ok - |> Maybe.withDefault (Err "Two digits required after the dot.") + |> Maybe.withDefault (Err (RequireTwoDigitsAfterDot str)) else - Err ("Two digits required after the dot: " ++ str) + Err (RequireTwoDigitsAfterDot str) _ -> - Err "One single dot + digits required for money." + Err (NoOrTooManyPoints str) format : Float -> String diff --git a/modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm b/modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm new file mode 100644 index 00000000..73c47b01 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm @@ -0,0 +1,34 @@ +module Messages.AttachmentMetaComp exposing (..) + +import Messages.Basics + + +type alias Texts = + { basics : Messages.Basics.Texts + , extractedMetadata : String + , content : String + , labels : String + , proposals : String + , correspondentOrg : String + , correspondentPerson : String + , concerningPerson : String + , concerningEquipment : String + , itemDate : String + , itemDueDate : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , extractedMetadata = "Extracted Meta Data" + , content = "Content" + , labels = "Labels" + , proposals = "Proposals" + , correspondentOrg = "Correspondent Organization" + , correspondentPerson = "Correspondent Person" + , concerningPerson = "Concerning Person" + , concerningEquipment = "Concerning Equipment" + , itemDate = "Item Date" + , itemDueDate = "Item Due Date" + } diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm index 9a1f5790..3cf515da 100644 --- a/modules/webapp/src/main/elm/Messages/Basics.elm +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -20,6 +20,7 @@ type alias Texts = , yes : String , no : String , chooseTag : String + , loading : String } @@ -43,6 +44,7 @@ gb = , yes = "Yes" , no = "No" , chooseTag = "Choose a tag…" + , loading = "Loading…" } diff --git a/modules/webapp/src/main/elm/Messages/CalEventInputComp.elm b/modules/webapp/src/main/elm/Messages/CalEventInputComp.elm new file mode 100644 index 00000000..16f67534 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CalEventInputComp.elm @@ -0,0 +1,28 @@ +module Messages.CalEventInputComp exposing (..) + + +type alias Texts = + { weekday : String + , year : String + , month : String + , day : String + , hour : String + , minute : String + , error : String + , schedule : String + , next : String + } + + +gb : Texts +gb = + { weekday = "Weekday" + , year = "Year" + , month = "Month" + , day = "Day" + , hour = "Hour" + , minute = "Minute" + , error = "Error" + , schedule = "Schedule" + , next = "Next" + } diff --git a/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm b/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm index b2ec9c6d..3a6d9696 100644 --- a/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm @@ -1,8 +1,11 @@ module Messages.ChangePasswordFormComp exposing (..) +import Messages.Basics + type alias Texts = - { currentPassword : String + { basics : Messages.Basics.Texts + , currentPassword : String , newPassword : String , repeatPassword : String , currentPasswordPlaceholder : String @@ -13,7 +16,8 @@ type alias Texts = gb : Texts gb = - { currentPassword = "Current Password" + { basics = Messages.Basics.gb + , currentPassword = "Current Password" , newPassword = "New Password" , repeatPassword = "New Password (repeat)" , currentPasswordPlaceholder = "Password" diff --git a/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm index 38a4ef45..b342742a 100644 --- a/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm @@ -1,8 +1,11 @@ module Messages.ClassifierSettingsFormComp exposing (..) +import Messages.CalEventInputComp + type alias Texts = - { autoTaggingText : String + { calEventInput : Messages.CalEventInputComp.Texts + , autoTaggingText : String , blacklistOrWhitelist : String , whitelistLabel : String , blacklistLabel : String @@ -14,7 +17,8 @@ type alias Texts = gb : Texts gb = - { autoTaggingText = + { calEventInput = Messages.CalEventInputComp.gb + , autoTaggingText = """ Auto-tagging works by learning from existing documents. The more diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm new file mode 100644 index 00000000..63d9982c --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm @@ -0,0 +1,18 @@ +module Messages.CustomFieldInputComp exposing (..) + + +type alias Texts = + { errorNoValue : String + , errorNoNumber : String + , errorNoAmount : String + , errorNotANumber : String -> String + } + + +gb : Texts +gb = + { errorNoValue = "Please fill in some value" + , errorNoNumber = "No number given" + , errorNoAmount = "No amount given" + , errorNotANumber = \str -> "Not a number: " ++ str + } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm new file mode 100644 index 00000000..96e2a209 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm @@ -0,0 +1,14 @@ +module Messages.CustomFieldMultiInputComp exposing (..) + +import Messages.CustomFieldInputComp + + +type alias Texts = + { customFieldInput : Messages.CustomFieldInputComp.Texts + } + + +gb : Texts +gb = + { customFieldInput = Messages.CustomFieldInputComp.gb + } diff --git a/modules/webapp/src/main/elm/Messages/EditFormComp.elm b/modules/webapp/src/main/elm/Messages/EditFormComp.elm index 871c03fb..9b0b085e 100644 --- a/modules/webapp/src/main/elm/Messages/EditFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/EditFormComp.elm @@ -1,10 +1,12 @@ module Messages.EditFormComp exposing (..) import Messages.Basics +import Messages.CustomFieldMultiInputComp type alias Texts = { basics : Messages.Basics.Texts + , customFieldInput : Messages.CustomFieldMultiInputComp.Texts , createNewCustomField : String , chooseDirection : String , selectPlaceholder : String @@ -34,6 +36,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb + , customFieldInput = Messages.CustomFieldMultiInputComp.gb , createNewCustomField = "Create new custom field" , chooseDirection = "Choose a direction…" , selectPlaceholder = "Select…" diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm index a3117c6b..1b971a48 100644 --- a/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm @@ -11,6 +11,7 @@ type alias Texts = , connectionNameInfo : String , smtpHost : String , smtpHostPlaceholder : String + , smtpPort : String , smtpUser : String , smtpUserPlaceholder : String , smtpPassword : String @@ -32,6 +33,7 @@ gb = , connectionNameInfo = "The connection name must not contain whitespace or special characters." , smtpHost = "SMTP Host" , smtpHostPlaceholder = "SMTP host name, e.g. 'mail.gmail.com'" + , smtpPort = "SMTP Port" , smtpUser = "SMTP User" , smtpUserPlaceholder = "SMTP Username, e.g. 'your.name@gmail.com'" , smtpPassword = "SMTP Password" diff --git a/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm b/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm index bc6a9256..0517f6cf 100644 --- a/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm +++ b/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm @@ -1,12 +1,12 @@ module Messages.HomeSideMenu exposing (..) -import Messages.MultiEditComp +import Messages.MultiEditMenuComp import Messages.SearchMenuComp type alias Texts = { searchMenu : Messages.SearchMenuComp.Texts - , multiEdit : Messages.MultiEditComp.Texts + , multiEdit : Messages.MultiEditMenuComp.Texts , editMode : String , resetSearchForm : String , multiEditHeader : String @@ -18,7 +18,7 @@ type alias Texts = gb : Texts gb = { searchMenu = Messages.SearchMenuComp.gb - , multiEdit = Messages.MultiEditComp.gb + , multiEdit = Messages.MultiEditMenuComp.gb , editMode = "Edit Mode" , resetSearchForm = "Reset search form" , multiEditHeader = "Multi-Edit" diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm index 6a5c095d..9c2ae4be 100644 --- a/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm @@ -11,6 +11,7 @@ type alias Texts = , connectionNameInfo : String , imapHost : String , imapHostPlaceholder : String + , imapPort : String , imapUser : String , imapUserPlaceholder : String , imapPassword : String @@ -30,6 +31,7 @@ gb = , connectionNameInfo = "The connection name must not contain whitespace or special characters." , imapHost = "IMAP Host" , imapHostPlaceholder = "IMAP host name, e.g. 'mail.gmail.com'" + , imapPort = "IMAP Port" , imapUser = "IMAP User" , imapUserPlaceholder = "IMAP Username, e.g. 'your.name@gmail.com'" , imapPassword = "IMAP Password" diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm index 715badec..d3e64c2c 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm +++ b/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm @@ -33,6 +33,7 @@ type alias Texts = , itemId : String , createdOn : String , lastUpdateOn : String + , sendingMailNow : String } @@ -61,4 +62,5 @@ gb = , itemId = "Item ID" , createdOn = "Created on" , lastUpdateOn = "Last update on" + , sendingMailNow = "Sending e-mail…" } diff --git a/modules/webapp/src/main/elm/Messages/MultiEditComp.elm b/modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm similarity index 88% rename from modules/webapp/src/main/elm/Messages/MultiEditComp.elm rename to modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm index 77f0752f..38920dbc 100644 --- a/modules/webapp/src/main/elm/Messages/MultiEditComp.elm +++ b/modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm @@ -1,10 +1,12 @@ -module Messages.MultiEditComp exposing (..) +module Messages.MultiEditMenuComp exposing (..) import Messages.Basics +import Messages.CustomFieldMultiInputComp type alias Texts = { basics : Messages.Basics.Texts + , customFieldMultiInput : Messages.CustomFieldMultiInputComp.Texts , tagModeAddInfo : String , tagModeRemoveInfo : String , tagModeReplaceInfo : String @@ -32,6 +34,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb + , customFieldMultiInput = Messages.CustomFieldMultiInputComp.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." diff --git a/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm b/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm index b5a5acf0..40360189 100644 --- a/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm @@ -1,10 +1,12 @@ module Messages.NotificationFormComp exposing (..) import Messages.Basics +import Messages.CalEventInputComp type alias Texts = { basics : Messages.Basics.Texts + , calEventInput : Messages.CalEventInputComp.Texts , reallyDeleteTask : String , startOnce : String , startTaskNow : String @@ -22,6 +24,7 @@ type alias Texts = , tagsExclude : String , tagsExcludeInfo : String , remindDaysInfo : String + , remindDaysLabel : String , capOverdue : String , capOverdueInfo : String , schedule : String @@ -33,6 +36,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb + , calEventInput = Messages.CalEventInputComp.gb , reallyDeleteTask = "Really delete this notification task?" , startOnce = "Start Once" , startTaskNow = "Start this task now" @@ -49,6 +53,7 @@ gb = , tagsIncludeInfo = "Items must have all the tags specified here." , tagsExclude = "Tags Exclude (or)" , tagsExcludeInfo = "Items must not have any tag specified here." + , remindDaysLabel = "Remind Days" , remindDaysInfo = "Select items with a due date *lower than* `today+remindDays`" , capOverdue = "Cap overdue items" , capOverdueInfo = "If checked, only items with a due date *greater than* `today - remindDays` are considered." diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm b/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm index ccdbe265..4972896c 100644 --- a/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm @@ -1,10 +1,12 @@ module Messages.ScanMailboxFormComp exposing (..) import Messages.Basics +import Messages.CalEventInputComp type alias Texts = { basics : Messages.Basics.Texts + , calEventInput : Messages.CalEventInputComp.Texts , reallyDeleteTask : String , startOnce : String , startNow : String @@ -29,6 +31,7 @@ type alias Texts = , folders : String , foldersInfo : String , receivedHoursInfo : String + , receivedHoursLabel : String , fileFilter : String , fileFilterInfo : String , subjectFilter : String @@ -57,6 +60,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb + , calEventInput = Messages.CalEventInputComp.gb , reallyDeleteTask = "Really delete this scan mailbox task?" , startOnce = "Start Once" , startNow = "Start this task now" @@ -81,6 +85,7 @@ gb = , folders = "Folders" , foldersInfo = "The folders to look for mails." , receivedHoursInfo = "Select mails newer than `now - receivedHours`" + , receivedHoursLabel = "Received Since Hours" , fileFilter = "File Filter" , fileFilterInfo = "Specify a file glob to filter attachments. For example, to only extract pdf files: " diff --git a/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm b/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm index 80fad1d6..92119a90 100644 --- a/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm +++ b/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm @@ -1,10 +1,14 @@ module Messages.SearchMenuComp exposing (..) import Messages.Basics +import Messages.CustomFieldMultiInputComp +import Messages.TagSelectComp type alias Texts = { basics : Messages.Basics.Texts + , customFieldMultiInput : Messages.CustomFieldMultiInputComp.Texts + , tagSelect : Messages.TagSelectComp.Texts , chooseDirection : String , choosePerson : String , chooseEquipment : String @@ -41,6 +45,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb + , customFieldMultiInput = Messages.CustomFieldMultiInputComp.gb + , tagSelect = Messages.TagSelectComp.gb , chooseDirection = "Choose a direction…" , choosePerson = "Choose a person" , chooseEquipment = "Choose an equipment" diff --git a/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm b/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm index f044d653..40aca0e9 100644 --- a/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm +++ b/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm @@ -1,8 +1,11 @@ module Messages.SingleAttachmentComp exposing (..) +import Messages.AttachmentMetaComp + type alias Texts = - { noName : String + { attachmentMeta : Messages.AttachmentMetaComp.Texts + , noName : String , openFileInNewTab : String , downloadFile : String , renameFile : String @@ -17,7 +20,8 @@ type alias Texts = gb : Texts gb = - { noName = "No name" + { attachmentMeta = Messages.AttachmentMetaComp.gb + , noName = "No name" , openFileInNewTab = "Open file in new tab" , downloadFile = "Download file" , renameFile = "Rename file" diff --git a/modules/webapp/src/main/elm/Messages/TagSelectComp.elm b/modules/webapp/src/main/elm/Messages/TagSelectComp.elm new file mode 100644 index 00000000..e07949ac --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/TagSelectComp.elm @@ -0,0 +1,16 @@ +module Messages.TagSelectComp exposing (..) + + +type alias Texts = + { hideEmpty : String + , showEmpty : String + , filterPlaceholder : String + } + + +gb : Texts +gb = + { hideEmpty = "Hide empty" + , showEmpty = "Show empty" + , filterPlaceholder = "Filter …" + } diff --git a/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm index d03d0a85..5da66fcb 100644 --- a/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm @@ -12,17 +12,22 @@ type alias Texts = , uiLanguage : String , itemSearch : String , maxResultsPerPageInfo : Int -> String + , maxResultsPerPage : String , showBasicSearchStatsByDefault : String , enablePowerSearch : String , itemCards : String + , maxNoteSize : String , maxNoteSizeInfo : Int -> String , sizeOfItemPreview : String , cardTitlePattern : String , togglePatternHelpText : String , cardSubtitlePattern : String , searchMenu : String + , searchMenuTagCount : String , searchMenuTagCountInfo : String + , searchMenuCatCount : String , searchMenuCatCountInfo : String + , searchMenuFolderCount : String , searchMenuFolderCountInfo : String , itemDetail : String , browserNativePdfView : String @@ -48,9 +53,11 @@ gb = "Maximum results in one page when searching items. At most " ++ String.fromInt max ++ "." + , maxResultsPerPage = "Page size" , showBasicSearchStatsByDefault = "Show basic search statistics by default" , enablePowerSearch = "Enable power-user search bar" , itemCards = "Item Cards" + , maxNoteSize = "Max. Note Length" , maxNoteSizeInfo = \max -> "Maximum size of the item notes to display in card view. Between 0 - " @@ -61,8 +68,11 @@ gb = , togglePatternHelpText = "Toggle pattern help text" , cardSubtitlePattern = "Card Subtitle Pattern" , searchMenu = "Search Menu" + , searchMenuTagCount = "Number of tags in search menu" , searchMenuTagCountInfo = "How many tags to display in search menu at once. Others can be expanded. Use 0 to always show all." + , searchMenuCatCount = "Number of categories in search menu" , searchMenuCatCountInfo = "How many categories to display in search menu at once. Others can be expanded. Use 0 to always show all." + , searchMenuFolderCount = "Number of folders in search menu" , searchMenuFolderCountInfo = "How many folders to display in search menu at once. Other folders can be expanded. Use 0 to always show all." , itemDetail = "Item Detail" , browserNativePdfView = "Browser-native PDF preview" diff --git a/modules/webapp/src/main/elm/Page/Queue/View2.elm b/modules/webapp/src/main/elm/Page/Queue/View2.elm index c137cf92..1fd14053 100644 --- a/modules/webapp/src/main/elm/Page/Queue/View2.elm +++ b/modules/webapp/src/main/elm/Page/Queue/View2.elm @@ -287,13 +287,12 @@ dimmerSettings : Texts -> Comp.YesNoDimmer.Settings dimmerSettings texts = let defaults = - Comp.YesNoDimmer.defaultSettings + Comp.YesNoDimmer.defaultSettings texts.deleteThisJob texts.basics.yes texts.basics.no in { defaults | headerClass = "text-lg text-white" , headerIcon = "" , extraClass = "rounded" - , message = texts.deleteThisJob } From 7c43fa087425ddd1278eabc24e3240867fecc0d2 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 10 Apr 2021 00:30:42 +0200 Subject: [PATCH 21/25] Reorganize messages to reflect page structure --- .../webapp/src/main/elm/Comp/AddressForm.elm | 2 +- .../src/main/elm/Comp/AttachmentMeta.elm | 2 +- .../src/main/elm/Comp/CalEventInput.elm | 2 +- .../src/main/elm/Comp/ChangePasswordForm.elm | 2 +- .../main/elm/Comp/ClassifierSettingsForm.elm | 2 +- .../main/elm/Comp/CollectiveSettingsForm.elm | 2 +- .../src/main/elm/Comp/CustomFieldForm.elm | 2 +- .../src/main/elm/Comp/CustomFieldInput.elm | 2 +- .../src/main/elm/Comp/CustomFieldManage.elm | 2 +- .../main/elm/Comp/CustomFieldMultiInput.elm | 2 +- .../src/main/elm/Comp/CustomFieldTable.elm | 2 +- .../webapp/src/main/elm/Comp/DetailEdit.elm | 2 +- modules/webapp/src/main/elm/Comp/Dropzone.elm | 2 +- .../src/main/elm/Comp/EmailSettingsForm.elm | 2 +- .../src/main/elm/Comp/EmailSettingsManage.elm | 2 +- .../src/main/elm/Comp/EmailSettingsTable.elm | 2 +- .../src/main/elm/Comp/EquipmentForm.elm | 2 +- .../src/main/elm/Comp/EquipmentManage.elm | 2 +- .../src/main/elm/Comp/EquipmentTable.elm | 2 +- .../webapp/src/main/elm/Comp/FolderDetail.elm | 2 +- .../webapp/src/main/elm/Comp/FolderManage.elm | 2 +- .../webapp/src/main/elm/Comp/FolderTable.elm | 2 +- .../src/main/elm/Comp/ImapSettingsForm.elm | 2 +- .../src/main/elm/Comp/ImapSettingsManage.elm | 2 +- .../src/main/elm/Comp/ImapSettingsTable.elm | 2 +- modules/webapp/src/main/elm/Comp/ItemCard.elm | 2 +- .../webapp/src/main/elm/Comp/ItemCardList.elm | 2 +- .../webapp/src/main/elm/Comp/ItemDetail.elm | 2 +- .../main/elm/Comp/ItemDetail/AddFilesForm.elm | 2 +- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 2 +- .../elm/Comp/ItemDetail/ItemInfoHeader.elm | 2 +- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 2 +- .../src/main/elm/Comp/ItemDetail/Notes.elm | 2 +- .../elm/Comp/ItemDetail/SingleAttachment.elm | 2 +- .../src/main/elm/Comp/ItemDetail/View2.elm | 2 +- modules/webapp/src/main/elm/Comp/ItemMail.elm | 2 +- .../src/main/elm/Comp/NotificationForm.elm | 2 +- .../src/main/elm/Comp/NotificationList.elm | 2 +- .../src/main/elm/Comp/NotificationManage.elm | 2 +- modules/webapp/src/main/elm/Comp/OrgForm.elm | 2 +- .../webapp/src/main/elm/Comp/OrgManage.elm | 2 +- modules/webapp/src/main/elm/Comp/OrgTable.elm | 2 +- .../webapp/src/main/elm/Comp/PersonForm.elm | 2 +- .../webapp/src/main/elm/Comp/PersonManage.elm | 2 +- .../webapp/src/main/elm/Comp/PersonTable.elm | 2 +- .../src/main/elm/Comp/ScanMailboxForm.elm | 6 +- .../src/main/elm/Comp/ScanMailboxList.elm | 2 +- .../src/main/elm/Comp/ScanMailboxManage.elm | 2 +- .../webapp/src/main/elm/Comp/SearchMenu.elm | 2 +- .../src/main/elm/Comp/SearchStatsView.elm | 2 +- .../webapp/src/main/elm/Comp/SentMails.elm | 2 +- .../webapp/src/main/elm/Comp/SourceForm.elm | 2 +- .../webapp/src/main/elm/Comp/SourceManage.elm | 2 +- .../webapp/src/main/elm/Comp/SourceTable.elm | 2 +- modules/webapp/src/main/elm/Comp/TagForm.elm | 2 +- .../webapp/src/main/elm/Comp/TagManage.elm | 2 +- .../webapp/src/main/elm/Comp/TagSelect.elm | 2 +- modules/webapp/src/main/elm/Comp/TagTable.elm | 2 +- .../src/main/elm/Comp/UiSettingsForm.elm | 2 +- .../src/main/elm/Comp/UiSettingsManage.elm | 2 +- modules/webapp/src/main/elm/Comp/UserForm.elm | 2 +- .../webapp/src/main/elm/Comp/UserManage.elm | 2 +- .../webapp/src/main/elm/Comp/UserTable.elm | 2 +- modules/webapp/src/main/elm/Messages.elm | 80 +++++++++---------- .../AddressForm.elm} | 2 +- .../AttachmentMeta.elm} | 2 +- .../CalEventInput.elm} | 2 +- .../ChangePasswordForm.elm} | 2 +- .../ClassifierSettingsForm.elm} | 8 +- .../CollectiveSettingsForm.elm} | 12 +-- .../CustomFieldForm.elm} | 6 +- .../CustomFieldInput.elm} | 2 +- .../elm/Messages/Comp/CustomFieldManage.elm | 24 ++++++ .../Messages/Comp/CustomFieldMultiInput.elm | 14 ++++ .../CustomFieldTable.elm} | 2 +- .../src/main/elm/Messages/Comp/DetailEdit.elm | 29 +++++++ .../{DropzoneComp.elm => Comp/Dropzone.elm} | 2 +- .../EmailSettingsForm.elm} | 6 +- .../EmailSettingsManage.elm} | 14 ++-- .../EmailSettingsTable.elm} | 2 +- .../EquipmentForm.elm} | 6 +- .../EquipmentManage.elm} | 14 ++-- .../EquipmentTable.elm} | 6 +- .../FolderDetail.elm} | 2 +- .../FolderManage.elm} | 14 ++-- .../FolderTable.elm} | 2 +- .../ImapSettingsForm.elm} | 6 +- .../ImapSettingsManage.elm} | 14 ++-- .../ImapSettingsTable.elm} | 2 +- .../{ItemCardComp.elm => Comp/ItemCard.elm} | 2 +- .../main/elm/Messages/Comp/ItemCardList.elm | 14 ++++ .../ItemDetail.elm} | 44 +++++----- .../{ => Comp}/ItemDetail/AddFilesForm.elm | 8 +- .../ItemDetail/EditForm.elm} | 8 +- .../ItemDetail/ItemInfoHeader.elm} | 2 +- .../ItemDetail/MultiEditMenu.elm} | 8 +- .../ItemDetail/Notes.elm} | 2 +- .../ItemDetail/SingleAttachment.elm} | 8 +- .../{ItemMailComp.elm => Comp/ItemMail.elm} | 2 +- .../NotificationForm.elm} | 8 +- .../elm/Messages/Comp/NotificationManage.elm | 24 ++++++ .../NotificationTable.elm} | 2 +- .../{OrgFormComp.elm => Comp/OrgForm.elm} | 16 ++-- .../{OrgManageComp.elm => Comp/OrgManage.elm} | 14 ++-- .../{OrgTableComp.elm => Comp/OrgTable.elm} | 6 +- .../PersonForm.elm} | 16 ++-- .../PersonManage.elm} | 14 ++-- .../PersonTable.elm} | 6 +- .../ScanMailboxForm.elm} | 8 +- .../elm/Messages/Comp/ScanMailboxManage.elm | 24 ++++++ .../ScanMailboxTable.elm} | 2 +- .../SearchMenu.elm} | 14 ++-- .../SearchStatsView.elm} | 2 +- .../{SentMailsComp.elm => Comp/SentMails.elm} | 2 +- .../SourceForm.elm} | 6 +- .../SourceManage.elm} | 14 ++-- .../SourceTable.elm} | 2 +- .../{TagFormComp.elm => Comp/TagForm.elm} | 2 +- .../{TagManageComp.elm => Comp/TagManage.elm} | 14 ++-- .../{TagSelectComp.elm => Comp/TagSelect.elm} | 2 +- .../{TagTableComp.elm => Comp/TagTable.elm} | 2 +- .../UiSettingsForm.elm} | 10 +-- .../UiSettingsManage.elm} | 8 +- .../{UserFormComp.elm => Comp/UserForm.elm} | 2 +- .../UserManage.elm} | 14 ++-- .../{UserTableComp.elm => Comp/UserTable.elm} | 2 +- .../elm/Messages/CustomFieldManageComp.elm | 24 ------ .../Messages/CustomFieldMultiInputComp.elm | 14 ---- .../{ColorData.elm => Data/Color.elm} | 2 +- .../ContactType.elm} | 2 +- .../CustomFieldType.elm} | 2 +- .../EquipmentUse.elm} | 2 +- .../{FieldsData.elm => Data/Fields.elm} | 2 +- .../{LanguageData.elm => Data/Language.elm} | 2 +- .../{OrgUseData.elm => Data/OrgUse.elm} | 2 +- .../{PersonUseData.elm => Data/PersonUse.elm} | 2 +- .../{SSLTypeData.elm => Data/SSLType.elm} | 2 +- .../src/main/elm/Messages/DetailEditComp.elm | 29 ------- .../main/elm/Messages/ItemCardListComp.elm | 14 ---- .../src/main/elm/Messages/ItemDetailPage.elm | 26 ------ .../src/main/elm/Messages/ManageDataPage.elm | 49 ------------ .../elm/Messages/NotificationManageComp.elm | 24 ------ .../CollectiveSettings.elm} | 20 ++--- .../Messages/{HomePage.elm => Page/Home.elm} | 20 ++--- .../elm/Messages/{ => Page}/HomeSideMenu.elm | 14 ++-- .../src/main/elm/Messages/Page/ItemDetail.elm | 26 ++++++ .../{LoginPage.elm => Page/Login.elm} | 2 +- .../src/main/elm/Messages/Page/ManageData.elm | 49 ++++++++++++ .../{NewInvitePage.elm => Page/NewInvite.elm} | 2 +- .../{QueuePage.elm => Page/Queue.elm} | 2 +- .../{RegisterPage.elm => Page/Register.elm} | 2 +- .../{UploadPage.elm => Page/Upload.elm} | 12 +-- .../UserSettings.elm} | 38 ++++----- .../elm/Messages/ScanMailboxManageComp.elm | 24 ------ .../elm/Page/CollectiveSettings/View2.elm | 2 +- .../src/main/elm/Page/Home/SideMenu.elm | 2 +- .../webapp/src/main/elm/Page/Home/View2.elm | 2 +- .../src/main/elm/Page/ItemDetail/View2.elm | 2 +- .../webapp/src/main/elm/Page/Login/View2.elm | 2 +- .../src/main/elm/Page/ManageData/View2.elm | 2 +- .../src/main/elm/Page/NewInvite/View2.elm | 2 +- .../webapp/src/main/elm/Page/Queue/View2.elm | 2 +- .../src/main/elm/Page/Register/View2.elm | 2 +- .../webapp/src/main/elm/Page/Upload/View2.elm | 3 +- .../src/main/elm/Page/UserSettings/View2.elm | 2 +- 165 files changed, 585 insertions(+), 586 deletions(-) rename modules/webapp/src/main/elm/Messages/{AddressFormComp.elm => Comp/AddressForm.elm} (86%) rename modules/webapp/src/main/elm/Messages/{AttachmentMetaComp.elm => Comp/AttachmentMeta.elm} (94%) rename modules/webapp/src/main/elm/Messages/{CalEventInputComp.elm => Comp/CalEventInput.elm} (90%) rename modules/webapp/src/main/elm/Messages/{ChangePasswordFormComp.elm => Comp/ChangePasswordForm.elm} (91%) rename modules/webapp/src/main/elm/Messages/{ClassifierSettingsFormComp.elm => Comp/ClassifierSettingsForm.elm} (83%) rename modules/webapp/src/main/elm/Messages/{CollectiveSettingsFormComp.elm => Comp/CollectiveSettingsForm.elm} (81%) rename modules/webapp/src/main/elm/Messages/{CustomFieldFormComp.elm => Comp/CustomFieldForm.elm} (90%) rename modules/webapp/src/main/elm/Messages/{CustomFieldInputComp.elm => Comp/CustomFieldInput.elm} (87%) create mode 100644 modules/webapp/src/main/elm/Messages/Comp/CustomFieldManage.elm create mode 100644 modules/webapp/src/main/elm/Messages/Comp/CustomFieldMultiInput.elm rename modules/webapp/src/main/elm/Messages/{CustomFieldTableComp.elm => Comp/CustomFieldTable.elm} (85%) create mode 100644 modules/webapp/src/main/elm/Messages/Comp/DetailEdit.elm rename modules/webapp/src/main/elm/Messages/{DropzoneComp.elm => Comp/Dropzone.elm} (89%) rename modules/webapp/src/main/elm/Messages/{EmailSettingsFormComp.elm => Comp/EmailSettingsForm.elm} (91%) rename modules/webapp/src/main/elm/Messages/{EmailSettingsManageComp.elm => Comp/EmailSettingsManage.elm} (56%) rename modules/webapp/src/main/elm/Messages/{EmailSettingsTableComp.elm => Comp/EmailSettingsTable.elm} (77%) rename modules/webapp/src/main/elm/Messages/{EquipmentFormComp.elm => Comp/EquipmentForm.elm} (51%) rename modules/webapp/src/main/elm/Messages/{EquipmentManageComp.elm => Comp/EquipmentManage.elm} (58%) rename modules/webapp/src/main/elm/Messages/{EquipmentTableComp.elm => Comp/EquipmentTable.elm} (61%) rename modules/webapp/src/main/elm/Messages/{FolderDetailComp.elm => Comp/FolderDetail.elm} (95%) rename modules/webapp/src/main/elm/Messages/{FolderManageComp.elm => Comp/FolderManage.elm} (53%) rename modules/webapp/src/main/elm/Messages/{FolderTableComp.elm => Comp/FolderTable.elm} (83%) rename modules/webapp/src/main/elm/Messages/{ImapSettingsFormComp.elm => Comp/ImapSettingsForm.elm} (90%) rename modules/webapp/src/main/elm/Messages/{ImapSettingsManageComp.elm => Comp/ImapSettingsManage.elm} (58%) rename modules/webapp/src/main/elm/Messages/{ImapSettingsTableComp.elm => Comp/ImapSettingsTable.elm} (73%) rename modules/webapp/src/main/elm/Messages/{ItemCardComp.elm => Comp/ItemCard.elm} (68%) create mode 100644 modules/webapp/src/main/elm/Messages/Comp/ItemCardList.elm rename modules/webapp/src/main/elm/Messages/{ItemDetailComp.elm => Comp/ItemDetail.elm} (52%) rename modules/webapp/src/main/elm/Messages/{ => Comp}/ItemDetail/AddFilesForm.elm (74%) rename modules/webapp/src/main/elm/Messages/{EditFormComp.elm => Comp/ItemDetail/EditForm.elm} (89%) rename modules/webapp/src/main/elm/Messages/{ItemInfoHeaderComp.elm => Comp/ItemDetail/ItemInfoHeader.elm} (86%) rename modules/webapp/src/main/elm/Messages/{MultiEditMenuComp.elm => Comp/ItemDetail/MultiEditMenu.elm} (88%) rename modules/webapp/src/main/elm/Messages/{NotesComp.elm => Comp/ItemDetail/Notes.elm} (85%) rename modules/webapp/src/main/elm/Messages/{SingleAttachmentComp.elm => Comp/ItemDetail/SingleAttachment.elm} (78%) rename modules/webapp/src/main/elm/Messages/{ItemMailComp.elm => Comp/ItemMail.elm} (93%) rename modules/webapp/src/main/elm/Messages/{NotificationFormComp.elm => Comp/NotificationForm.elm} (92%) create mode 100644 modules/webapp/src/main/elm/Messages/Comp/NotificationManage.elm rename modules/webapp/src/main/elm/Messages/{NotificationTableComp.elm => Comp/NotificationTable.elm} (83%) rename modules/webapp/src/main/elm/Messages/{OrgFormComp.elm => Comp/OrgForm.elm} (66%) rename modules/webapp/src/main/elm/Messages/{OrgManageComp.elm => Comp/OrgManage.elm} (63%) rename modules/webapp/src/main/elm/Messages/{OrgTableComp.elm => Comp/OrgTable.elm} (75%) rename modules/webapp/src/main/elm/Messages/{PersonFormComp.elm => Comp/PersonForm.elm} (74%) rename modules/webapp/src/main/elm/Messages/{PersonManageComp.elm => Comp/PersonManage.elm} (58%) rename modules/webapp/src/main/elm/Messages/{PersonTableComp.elm => Comp/PersonTable.elm} (74%) rename modules/webapp/src/main/elm/Messages/{ScanMailboxFormComp.elm => Comp/ScanMailboxForm.elm} (96%) create mode 100644 modules/webapp/src/main/elm/Messages/Comp/ScanMailboxManage.elm rename modules/webapp/src/main/elm/Messages/{ScanMailboxTableComp.elm => Comp/ScanMailboxTable.elm} (84%) rename modules/webapp/src/main/elm/Messages/{SearchMenuComp.elm => Comp/SearchMenu.elm} (86%) rename modules/webapp/src/main/elm/Messages/{SearchStatsViewComp.elm => Comp/SearchStatsView.elm} (84%) rename modules/webapp/src/main/elm/Messages/{SentMailsComp.elm => Comp/SentMails.elm} (87%) rename modules/webapp/src/main/elm/Messages/{SourceFormComp.elm => Comp/SourceForm.elm} (94%) rename modules/webapp/src/main/elm/Messages/{SourceManageComp.elm => Comp/SourceManage.elm} (82%) rename modules/webapp/src/main/elm/Messages/{SourceTableComp.elm => Comp/SourceTable.elm} (87%) rename modules/webapp/src/main/elm/Messages/{TagFormComp.elm => Comp/TagForm.elm} (84%) rename modules/webapp/src/main/elm/Messages/{TagManageComp.elm => Comp/TagManage.elm} (59%) rename modules/webapp/src/main/elm/Messages/{TagSelectComp.elm => Comp/TagSelect.elm} (83%) rename modules/webapp/src/main/elm/Messages/{TagTableComp.elm => Comp/TagTable.elm} (76%) rename modules/webapp/src/main/elm/Messages/{UiSettingsFormComp.elm => Comp/UiSettingsForm.elm} (94%) rename modules/webapp/src/main/elm/Messages/{UiSettingsManageComp.elm => Comp/UiSettingsManage.elm} (51%) rename modules/webapp/src/main/elm/Messages/{UserFormComp.elm => Comp/UserForm.elm} (84%) rename modules/webapp/src/main/elm/Messages/{UserManageComp.elm => Comp/UserManage.elm} (69%) rename modules/webapp/src/main/elm/Messages/{UserTableComp.elm => Comp/UserTable.elm} (90%) delete mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm delete mode 100644 modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm rename modules/webapp/src/main/elm/Messages/{ColorData.elm => Data/Color.elm} (93%) rename modules/webapp/src/main/elm/Messages/{ContactTypeData.elm => Data/ContactType.elm} (87%) rename modules/webapp/src/main/elm/Messages/{CustomFieldTypeData.elm => Data/CustomFieldType.elm} (85%) rename modules/webapp/src/main/elm/Messages/{EquipmentUseData.elm => Data/EquipmentUse.elm} (80%) rename modules/webapp/src/main/elm/Messages/{FieldsData.elm => Data/Fields.elm} (94%) rename modules/webapp/src/main/elm/Messages/{LanguageData.elm => Data/Language.elm} (94%) rename modules/webapp/src/main/elm/Messages/{OrgUseData.elm => Data/OrgUse.elm} (81%) rename modules/webapp/src/main/elm/Messages/{PersonUseData.elm => Data/PersonUse.elm} (86%) rename modules/webapp/src/main/elm/Messages/{SSLTypeData.elm => Data/SSLType.elm} (82%) delete mode 100644 modules/webapp/src/main/elm/Messages/DetailEditComp.elm delete mode 100644 modules/webapp/src/main/elm/Messages/ItemCardListComp.elm delete mode 100644 modules/webapp/src/main/elm/Messages/ItemDetailPage.elm delete mode 100644 modules/webapp/src/main/elm/Messages/ManageDataPage.elm delete mode 100644 modules/webapp/src/main/elm/Messages/NotificationManageComp.elm rename modules/webapp/src/main/elm/Messages/{CollectiveSettingsPage.elm => Page/CollectiveSettings.elm} (53%) rename modules/webapp/src/main/elm/Messages/{HomePage.elm => Page/Home.elm} (77%) rename modules/webapp/src/main/elm/Messages/{ => Page}/HomeSideMenu.elm (54%) create mode 100644 modules/webapp/src/main/elm/Messages/Page/ItemDetail.elm rename modules/webapp/src/main/elm/Messages/{LoginPage.elm => Page/Login.elm} (97%) create mode 100644 modules/webapp/src/main/elm/Messages/Page/ManageData.elm rename modules/webapp/src/main/elm/Messages/{NewInvitePage.elm => Page/NewInvite.elm} (94%) rename modules/webapp/src/main/elm/Messages/{QueuePage.elm => Page/Queue.elm} (96%) rename modules/webapp/src/main/elm/Messages/{RegisterPage.elm => Page/Register.elm} (95%) rename modules/webapp/src/main/elm/Messages/{UploadPage.elm => Page/Upload.elm} (87%) rename modules/webapp/src/main/elm/Messages/{UserSettingsPage.elm => Page/UserSettings.elm} (65%) delete mode 100644 modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm diff --git a/modules/webapp/src/main/elm/Comp/AddressForm.elm b/modules/webapp/src/main/elm/Comp/AddressForm.elm index 287ddf78..e8b2fd61 100644 --- a/modules/webapp/src/main/elm/Comp/AddressForm.elm +++ b/modules/webapp/src/main/elm/Comp/AddressForm.elm @@ -14,7 +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 Messages.Comp.AddressForm exposing (Texts) import Styles as S import Util.List diff --git a/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm b/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm index 37db3a0c..10b9920e 100644 --- a/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm +++ b/modules/webapp/src/main/elm/Comp/AttachmentMeta.elm @@ -15,7 +15,7 @@ import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.AttachmentMetaComp exposing (Texts) +import Messages.Comp.AttachmentMeta exposing (Texts) import Styles as S import Util.Http import Util.Time diff --git a/modules/webapp/src/main/elm/Comp/CalEventInput.elm b/modules/webapp/src/main/elm/Comp/CalEventInput.elm index dfa1c319..a38db6be 100644 --- a/modules/webapp/src/main/elm/Comp/CalEventInput.elm +++ b/modules/webapp/src/main/elm/Comp/CalEventInput.elm @@ -17,7 +17,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) import Http -import Messages.CalEventInputComp exposing (Texts) +import Messages.Comp.CalEventInput exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm index 7f6e58de..53c9ac7a 100644 --- a/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm +++ b/modules/webapp/src/main/elm/Comp/ChangePasswordForm.elm @@ -16,7 +16,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http -import Messages.ChangePasswordFormComp exposing (Texts) +import Messages.Comp.ChangePasswordForm exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm index 0333c81a..9c7d17bc 100644 --- a/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ClassifierSettingsForm.elm @@ -24,7 +24,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Http import Markdown -import Messages.ClassifierSettingsFormComp exposing (Texts) +import Messages.Comp.ClassifierSettingsForm exposing (Texts) import Styles as S import Util.Tag diff --git a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm index 3d11b69b..9620f594 100644 --- a/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/CollectiveSettingsForm.elm @@ -23,7 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick, onInput) import Http -import Messages.CollectiveSettingsFormComp exposing (Texts) +import Messages.Comp.CollectiveSettingsForm exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index f5a6d835..30843bf3 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -25,7 +25,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) import Http -import Messages.CustomFieldFormComp exposing (Texts) +import Messages.Comp.CustomFieldForm exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm index c9e5b107..5183ac00 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldInput.elm @@ -22,7 +22,7 @@ import DatePicker exposing (DatePicker) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) -import Messages.CustomFieldInputComp exposing (Texts) +import Messages.Comp.CustomFieldInput exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm index c9fa672f..37965d9f 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldManage.elm @@ -18,7 +18,7 @@ import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.CustomFieldManageComp exposing (Texts) +import Messages.Comp.CustomFieldManage exposing (Texts) import Styles as S import Util.CustomField diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm index 9fe2dcf4..51dbf2d4 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldMultiInput.elm @@ -29,7 +29,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http -import Messages.CustomFieldMultiInputComp exposing (Texts) +import Messages.Comp.CustomFieldMultiInput exposing (Texts) import Styles as S import Util.CustomField import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm b/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm index 7e16efdc..cb51674f 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldTable.elm @@ -11,7 +11,7 @@ import Api.Model.CustomField exposing (CustomField) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) -import Messages.CustomFieldTableComp exposing (Texts) +import Messages.Comp.CustomFieldTable exposing (Texts) import Styles as S import Util.Time diff --git a/modules/webapp/src/main/elm/Comp/DetailEdit.elm b/modules/webapp/src/main/elm/Comp/DetailEdit.elm index 1ceaeadf..a57770d7 100644 --- a/modules/webapp/src/main/elm/Comp/DetailEdit.elm +++ b/modules/webapp/src/main/elm/Comp/DetailEdit.elm @@ -47,7 +47,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Http -import Messages.DetailEditComp exposing (Texts) +import Messages.Comp.DetailEdit exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/Dropzone.elm b/modules/webapp/src/main/elm/Comp/Dropzone.elm index 32c96740..527d4471 100644 --- a/modules/webapp/src/main/elm/Comp/Dropzone.elm +++ b/modules/webapp/src/main/elm/Comp/Dropzone.elm @@ -18,7 +18,7 @@ import File.Select import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) -import Messages.DropzoneComp exposing (Texts) +import Messages.Comp.Dropzone exposing (Texts) import Styles as S import Util.Html exposing (onDragEnter, onDragLeave, onDragOver, onDropFiles) diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index 96c17354..83bc04a1 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -21,7 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) -import Messages.EmailSettingsFormComp exposing (Texts) +import Messages.Comp.EmailSettingsForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm index 1452268f..4e8d0c70 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsManage.elm @@ -21,7 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.EmailSettingsManageComp exposing (Texts) +import Messages.Comp.EmailSettingsManage exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm index 52707781..40a39446 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm @@ -11,7 +11,7 @@ import Api.Model.EmailSettings exposing (EmailSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) -import Messages.EmailSettingsTableComp exposing (Texts) +import Messages.Comp.EmailSettingsTable exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm index 79461883..48448844 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm @@ -17,7 +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 Messages.Comp.EquipmentForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm index e10f8af1..67976ee9 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentManage.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentManage.elm @@ -20,7 +20,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.EquipmentManageComp exposing (Texts) +import Messages.Comp.EquipmentManage exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm index 948fc0dc..be77e921 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm @@ -12,7 +12,7 @@ import Data.EquipmentUse import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) -import Messages.EquipmentTableComp exposing (Texts) +import Messages.Comp.EquipmentTable exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index 438d53c0..1d134020 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -24,7 +24,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http -import Messages.FolderDetailComp exposing (Texts) +import Messages.Comp.FolderDetail exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/FolderManage.elm b/modules/webapp/src/main/elm/Comp/FolderManage.elm index 083b0a72..1264cb5c 100644 --- a/modules/webapp/src/main/elm/Comp/FolderManage.elm +++ b/modules/webapp/src/main/elm/Comp/FolderManage.elm @@ -20,7 +20,7 @@ import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.FolderManageComp exposing (Texts) +import Messages.Comp.FolderManage exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/FolderTable.elm b/modules/webapp/src/main/elm/Comp/FolderTable.elm index 6e620303..8b41c823 100644 --- a/modules/webapp/src/main/elm/Comp/FolderTable.elm +++ b/modules/webapp/src/main/elm/Comp/FolderTable.elm @@ -11,7 +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 Messages.Comp.FolderTable exposing (Texts) import Styles as S import Util.Time diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index a47db36c..cea5546b 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -21,7 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) -import Messages.ImapSettingsFormComp exposing (Texts) +import Messages.Comp.ImapSettingsForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm index 09ea6112..146898ef 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsManage.elm @@ -21,7 +21,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.ImapSettingsManageComp exposing (Texts) +import Messages.Comp.ImapSettingsManage exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm index 2ae6c551..436b4377 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm @@ -11,7 +11,7 @@ import Api.Model.ImapSettings exposing (ImapSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) -import Messages.ImapSettingsTableComp exposing (Texts) +import Messages.Comp.ImapSettingsTable exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/ItemCard.elm b/modules/webapp/src/main/elm/Comp/ItemCard.elm index 0e18bd73..709bdf67 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCard.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCard.elm @@ -23,7 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Markdown -import Messages.ItemCardComp exposing (Texts) +import Messages.Comp.ItemCard exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/ItemCardList.elm b/modules/webapp/src/main/elm/Comp/ItemCardList.elm index 19f8a59d..0894d711 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCardList.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCardList.elm @@ -22,7 +22,7 @@ import Data.UiSettings exposing (UiSettings) import Dict exposing (Dict) import Html exposing (..) import Html.Attributes exposing (..) -import Messages.ItemCardListComp exposing (Texts) +import Messages.Comp.ItemCardList exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.ItemDragDrop as DD diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail.elm b/modules/webapp/src/main/elm/Comp/ItemDetail.elm index f35f37ea..89f354ad 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail.elm @@ -13,7 +13,7 @@ import Data.Flags exposing (Flags) import Data.ItemNav exposing (ItemNav) import Data.UiSettings exposing (UiSettings) import Html exposing (..) -import Messages.ItemDetailComp exposing (Texts) +import Messages.Comp.ItemDetail exposing (Texts) import Page exposing (Page(..)) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm index 73cf872c..5c6e9c25 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/AddFilesForm.elm @@ -8,7 +8,7 @@ import File exposing (File) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.ItemDetail.AddFilesForm exposing (Texts) +import Messages.Comp.ItemDetail.AddFilesForm exposing (Texts) import Set import Styles as S import Util.File exposing (makeFileId) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index bed67bad..bc43f7fe 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -25,7 +25,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Markdown -import Messages.EditFormComp exposing (Texts) +import Messages.Comp.ItemDetail.EditForm exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm index 1d1ef6cd..69016724 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm @@ -15,7 +15,7 @@ import Data.Icons as Icons import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) -import Messages.ItemInfoHeaderComp exposing (Texts) +import Messages.Comp.ItemDetail.ItemInfoHeader exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index 99076884..d6972c65 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -39,7 +39,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http import Markdown -import Messages.MultiEditMenuComp exposing (Texts) +import Messages.Comp.ItemDetail.MultiEditMenu exposing (Texts) import Page exposing (Page(..)) import Set exposing (Set) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm index 48dfd20d..76ad0851 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/Notes.elm @@ -12,7 +12,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Markdown -import Messages.NotesComp exposing (Texts) +import Messages.Comp.ItemDetail.Notes exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.String diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm index e22b5f90..f9ca4e58 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm @@ -18,7 +18,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Html5.DragDrop as DD -import Messages.SingleAttachmentComp exposing (Texts) +import Messages.Comp.ItemDetail.SingleAttachment exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm index 31a3dbc7..8b1a5e77 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/View2.elm @@ -23,7 +23,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.ItemDetailComp exposing (Texts) +import Messages.Comp.ItemDetail exposing (Texts) import Page exposing (Page(..)) import Styles as S import Util.Time diff --git a/modules/webapp/src/main/elm/Comp/ItemMail.elm b/modules/webapp/src/main/elm/Comp/ItemMail.elm index a656a42e..01309ec4 100644 --- a/modules/webapp/src/main/elm/Comp/ItemMail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemMail.elm @@ -23,7 +23,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http -import Messages.ItemMailComp exposing (Texts) +import Messages.Comp.ItemMail exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/NotificationForm.elm b/modules/webapp/src/main/elm/Comp/NotificationForm.elm index 3422c17c..f73d7eca 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationForm.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationForm.elm @@ -31,7 +31,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onInput) import Http import Markdown -import Messages.NotificationFormComp exposing (Texts) +import Messages.Comp.NotificationForm exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/NotificationList.elm b/modules/webapp/src/main/elm/Comp/NotificationList.elm index 4ff25f98..48011b6b 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationList.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationList.elm @@ -11,7 +11,7 @@ import Api.Model.NotificationSettings exposing (NotificationSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) -import Messages.NotificationTableComp exposing (Texts) +import Messages.Comp.NotificationTable exposing (Texts) import Styles as S import Util.Html diff --git a/modules/webapp/src/main/elm/Comp/NotificationManage.elm b/modules/webapp/src/main/elm/Comp/NotificationManage.elm index 903d8717..4d7631ff 100644 --- a/modules/webapp/src/main/elm/Comp/NotificationManage.elm +++ b/modules/webapp/src/main/elm/Comp/NotificationManage.elm @@ -18,7 +18,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.NotificationManageComp exposing (Texts) +import Messages.Comp.NotificationManage exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Comp/OrgForm.elm index ad869984..2c77bfe1 100644 --- a/modules/webapp/src/main/elm/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Comp/OrgForm.elm @@ -20,7 +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 Messages.Comp.OrgForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/OrgManage.elm b/modules/webapp/src/main/elm/Comp/OrgManage.elm index 38c01908..44c62299 100644 --- a/modules/webapp/src/main/elm/Comp/OrgManage.elm +++ b/modules/webapp/src/main/elm/Comp/OrgManage.elm @@ -21,7 +21,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.OrgManageComp exposing (Texts) +import Messages.Comp.OrgManage exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/OrgTable.elm b/modules/webapp/src/main/elm/Comp/OrgTable.elm index 4234351c..3db5b21c 100644 --- a/modules/webapp/src/main/elm/Comp/OrgTable.elm +++ b/modules/webapp/src/main/elm/Comp/OrgTable.elm @@ -12,7 +12,7 @@ import Data.Flags exposing (Flags) import Data.OrgUse import Html exposing (..) import Html.Attributes exposing (..) -import Messages.OrgTableComp exposing (Texts) +import Messages.Comp.OrgTable exposing (Texts) import Styles as S import Util.Address import Util.Contact diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index 1503f027..f0006af5 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -22,7 +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 Messages.Comp.PersonForm exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/PersonManage.elm b/modules/webapp/src/main/elm/Comp/PersonManage.elm index 257cd2b4..c27e7d25 100644 --- a/modules/webapp/src/main/elm/Comp/PersonManage.elm +++ b/modules/webapp/src/main/elm/Comp/PersonManage.elm @@ -22,7 +22,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.PersonManageComp exposing (Texts) +import Messages.Comp.PersonManage exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/PersonTable.elm b/modules/webapp/src/main/elm/Comp/PersonTable.elm index 0cf7002b..1e7e14c8 100644 --- a/modules/webapp/src/main/elm/Comp/PersonTable.elm +++ b/modules/webapp/src/main/elm/Comp/PersonTable.elm @@ -12,7 +12,7 @@ import Data.Flags exposing (Flags) import Data.PersonUse import Html exposing (..) import Html.Attributes exposing (..) -import Messages.PersonTableComp exposing (Texts) +import Messages.Comp.PersonTable exposing (Texts) import Styles as S import Util.Contact diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm index 74236f85..244cc827 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxForm.elm @@ -39,8 +39,8 @@ import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick, onInput) import Http import Markdown -import Messages.LanguageData -import Messages.ScanMailboxFormComp exposing (Texts) +import Messages.Comp.ScanMailboxForm exposing (Texts) +import Messages.Data.Language import Set exposing (Set) import Styles as S import Util.Folder exposing (mkFolderOption) @@ -1040,7 +1040,7 @@ viewMetadata2 texts flags settings model = } languageCfg = - { display = Messages.LanguageData.gb + { display = Messages.Data.Language.gb , icon = \_ -> Nothing , style = DS.mainStyleWith "flex-grow mr-2" } diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm index 07d2b8d0..fd6d3d12 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxList.elm @@ -11,7 +11,7 @@ import Api.Model.ScanMailboxSettings exposing (ScanMailboxSettings) import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) -import Messages.ScanMailboxTableComp exposing (Texts) +import Messages.Comp.ScanMailboxTable exposing (Texts) import Styles as S import Util.Html diff --git a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm index 72000d6f..ef6d5e0a 100644 --- a/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm +++ b/modules/webapp/src/main/elm/Comp/ScanMailboxManage.elm @@ -18,7 +18,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Http -import Messages.ScanMailboxManageComp exposing (Texts) +import Messages.Comp.ScanMailboxManage exposing (Texts) import Styles as S import Util.Http diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index 7e9ac390..00176bda 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -44,7 +44,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) import Http -import Messages.SearchMenuComp exposing (Texts) +import Messages.Comp.SearchMenu exposing (Texts) import Set exposing (Set) import Styles as S import Util.Html exposing (KeyCode(..)) diff --git a/modules/webapp/src/main/elm/Comp/SearchStatsView.elm b/modules/webapp/src/main/elm/Comp/SearchStatsView.elm index 861680eb..4e2d36a8 100644 --- a/modules/webapp/src/main/elm/Comp/SearchStatsView.elm +++ b/modules/webapp/src/main/elm/Comp/SearchStatsView.elm @@ -11,7 +11,7 @@ import Data.Icons as Icons import Data.Money import Html exposing (..) import Html.Attributes exposing (..) -import Messages.SearchStatsViewComp exposing (Texts) +import Messages.Comp.SearchStatsView exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/SentMails.elm b/modules/webapp/src/main/elm/Comp/SentMails.elm index bf846162..612223f6 100644 --- a/modules/webapp/src/main/elm/Comp/SentMails.elm +++ b/modules/webapp/src/main/elm/Comp/SentMails.elm @@ -13,7 +13,7 @@ import Comp.Basic as B import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.SentMailsComp exposing (Texts) +import Messages.Comp.SentMails exposing (Texts) import Styles as S import Util.Time diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 3a63a4d9..76a31b3a 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -28,7 +28,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onInput) import Http import Markdown -import Messages.SourceFormComp exposing (Texts) +import Messages.Comp.SourceForm exposing (Texts) import Styles as S import Util.Folder exposing (mkFolderOption) import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/SourceManage.elm b/modules/webapp/src/main/elm/Comp/SourceManage.elm index e3044782..abd4ed82 100644 --- a/modules/webapp/src/main/elm/Comp/SourceManage.elm +++ b/modules/webapp/src/main/elm/Comp/SourceManage.elm @@ -21,7 +21,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.SourceManageComp exposing (Texts) +import Messages.Comp.SourceManage exposing (Texts) import Ports import QRCode import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/SourceTable.elm b/modules/webapp/src/main/elm/Comp/SourceTable.elm index 6aa4f53c..7d6dd6c9 100644 --- a/modules/webapp/src/main/elm/Comp/SourceTable.elm +++ b/modules/webapp/src/main/elm/Comp/SourceTable.elm @@ -12,7 +12,7 @@ import Data.Flags exposing (Flags) import Data.Priority import Html exposing (..) import Html.Attributes exposing (..) -import Messages.SourceTableComp exposing (Texts) +import Messages.Comp.SourceTable exposing (Texts) import Styles as S import Util.Html diff --git a/modules/webapp/src/main/elm/Comp/TagForm.elm b/modules/webapp/src/main/elm/Comp/TagForm.elm index d0f921cc..af351a9d 100644 --- a/modules/webapp/src/main/elm/Comp/TagForm.elm +++ b/modules/webapp/src/main/elm/Comp/TagForm.elm @@ -16,7 +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 Messages.Comp.TagForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/TagManage.elm b/modules/webapp/src/main/elm/Comp/TagManage.elm index 617038a0..aef1957b 100644 --- a/modules/webapp/src/main/elm/Comp/TagManage.elm +++ b/modules/webapp/src/main/elm/Comp/TagManage.elm @@ -20,7 +20,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.TagManageComp exposing (Texts) +import Messages.Comp.TagManage exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/TagSelect.elm b/modules/webapp/src/main/elm/Comp/TagSelect.elm index 579b4c6d..79bd149a 100644 --- a/modules/webapp/src/main/elm/Comp/TagSelect.elm +++ b/modules/webapp/src/main/elm/Comp/TagSelect.elm @@ -26,7 +26,7 @@ import Dict exposing (Dict) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) -import Messages.TagSelectComp exposing (Texts) +import Messages.Comp.TagSelect exposing (Texts) import Set import Simple.Fuzzy import String as S diff --git a/modules/webapp/src/main/elm/Comp/TagTable.elm b/modules/webapp/src/main/elm/Comp/TagTable.elm index b8c089a6..6a77aaac 100644 --- a/modules/webapp/src/main/elm/Comp/TagTable.elm +++ b/modules/webapp/src/main/elm/Comp/TagTable.elm @@ -11,7 +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 Messages.Comp.TagTable exposing (Texts) import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 23e9cf48..49eb7973 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -29,7 +29,7 @@ import Html.Events exposing (onClick, onInput) import Http import Markdown import Messages -import Messages.UiSettingsFormComp exposing (Texts) +import Messages.Comp.UiSettingsForm exposing (Texts) import Set exposing (Set) import Styles as S import UiLanguage exposing (UiLanguage) diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm b/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm index 1e8cfd7a..c1e60230 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsManage.elm @@ -14,7 +14,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.UiSettingsManageComp exposing (Texts) +import Messages.Comp.UiSettingsManage exposing (Texts) import Ports import Styles as S diff --git a/modules/webapp/src/main/elm/Comp/UserForm.elm b/modules/webapp/src/main/elm/Comp/UserForm.elm index 8d33f651..93351ecd 100644 --- a/modules/webapp/src/main/elm/Comp/UserForm.elm +++ b/modules/webapp/src/main/elm/Comp/UserForm.elm @@ -19,7 +19,7 @@ import Data.UserState exposing (UserState) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onInput) -import Messages.UserFormComp exposing (Texts) +import Messages.Comp.UserForm exposing (Texts) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/UserManage.elm b/modules/webapp/src/main/elm/Comp/UserManage.elm index 70519b5e..553111e1 100644 --- a/modules/webapp/src/main/elm/Comp/UserManage.elm +++ b/modules/webapp/src/main/elm/Comp/UserManage.elm @@ -21,7 +21,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onSubmit) import Http -import Messages.UserManageComp exposing (Texts) +import Messages.Comp.UserManage exposing (Texts) import Styles as S import Util.Http import Util.Maybe diff --git a/modules/webapp/src/main/elm/Comp/UserTable.elm b/modules/webapp/src/main/elm/Comp/UserTable.elm index a5209be1..b30ee285 100644 --- a/modules/webapp/src/main/elm/Comp/UserTable.elm +++ b/modules/webapp/src/main/elm/Comp/UserTable.elm @@ -11,7 +11,7 @@ import Comp.Basic as B import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) -import Messages.UserTableComp exposing (Texts) +import Messages.Comp.UserTable exposing (Texts) import Styles as S import Util.Time exposing (formatDateTime) diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index 5b9d80ba..d69c99ba 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -6,16 +6,16 @@ module Messages exposing ) import Messages.App -import Messages.CollectiveSettingsPage -import Messages.HomePage -import Messages.ItemDetailPage -import Messages.LoginPage -import Messages.ManageDataPage -import Messages.NewInvitePage -import Messages.QueuePage -import Messages.RegisterPage -import Messages.UploadPage -import Messages.UserSettingsPage +import Messages.Page.CollectiveSettings +import Messages.Page.Home +import Messages.Page.ItemDetail +import Messages.Page.Login +import Messages.Page.ManageData +import Messages.Page.NewInvite +import Messages.Page.Queue +import Messages.Page.Register +import Messages.Page.Upload +import Messages.Page.UserSettings import UiLanguage exposing (UiLanguage(..)) @@ -27,16 +27,16 @@ type alias Messages = , label : String , flagIcon : String , app : Messages.App.Texts - , collectiveSettings : Messages.CollectiveSettingsPage.Texts - , login : Messages.LoginPage.Texts - , register : Messages.RegisterPage.Texts - , newInvite : Messages.NewInvitePage.Texts - , upload : Messages.UploadPage.Texts - , itemDetail : Messages.ItemDetailPage.Texts - , queue : Messages.QueuePage.Texts - , userSettings : Messages.UserSettingsPage.Texts - , manageData : Messages.ManageDataPage.Texts - , home : Messages.HomePage.Texts + , collectiveSettings : Messages.Page.CollectiveSettings.Texts + , login : Messages.Page.Login.Texts + , register : Messages.Page.Register.Texts + , newInvite : Messages.Page.NewInvite.Texts + , upload : Messages.Page.Upload.Texts + , itemDetail : Messages.Page.ItemDetail.Texts + , queue : Messages.Page.Queue.Texts + , userSettings : Messages.Page.UserSettings.Texts + , manageData : Messages.Page.ManageData.Texts + , home : Messages.Page.Home.Texts } @@ -90,16 +90,16 @@ gb = , label = "English" , flagIcon = "flag-icon flag-icon-gb" , app = Messages.App.gb - , collectiveSettings = Messages.CollectiveSettingsPage.gb - , login = Messages.LoginPage.gb - , register = Messages.RegisterPage.gb - , newInvite = Messages.NewInvitePage.gb - , upload = Messages.UploadPage.gb - , itemDetail = Messages.ItemDetailPage.gb - , queue = Messages.QueuePage.gb - , userSettings = Messages.UserSettingsPage.gb - , manageData = Messages.ManageDataPage.gb - , home = Messages.HomePage.gb + , collectiveSettings = Messages.Page.CollectiveSettings.gb + , login = Messages.Page.Login.gb + , register = Messages.Page.Register.gb + , newInvite = Messages.Page.NewInvite.gb + , upload = Messages.Page.Upload.gb + , itemDetail = Messages.Page.ItemDetail.gb + , queue = Messages.Page.Queue.gb + , userSettings = Messages.Page.UserSettings.gb + , manageData = Messages.Page.ManageData.gb + , home = Messages.Page.Home.gb } @@ -110,14 +110,14 @@ de = , label = "Deutsch" , flagIcon = "flag-icon flag-icon-de" , app = Messages.App.de - , collectiveSettings = Messages.CollectiveSettingsPage.de - , login = Messages.LoginPage.de - , register = Messages.RegisterPage.de - , newInvite = Messages.NewInvitePage.de - , upload = Messages.UploadPage.de - , itemDetail = Messages.ItemDetailPage.de - , queue = Messages.QueuePage.de - , userSettings = Messages.UserSettingsPage.de - , manageData = Messages.ManageDataPage.de - , home = Messages.HomePage.de + , collectiveSettings = Messages.Page.CollectiveSettings.de + , login = Messages.Page.Login.de + , register = Messages.Page.Register.de + , newInvite = Messages.Page.NewInvite.de + , upload = Messages.Page.Upload.de + , itemDetail = Messages.Page.ItemDetail.de + , queue = Messages.Page.Queue.de + , userSettings = Messages.Page.UserSettings.de + , manageData = Messages.Page.ManageData.de + , home = Messages.Page.Home.de } diff --git a/modules/webapp/src/main/elm/Messages/AddressFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/AddressForm.elm similarity index 86% rename from modules/webapp/src/main/elm/Messages/AddressFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/AddressForm.elm index 60bcf5a7..42c0bf5d 100644 --- a/modules/webapp/src/main/elm/Messages/AddressFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/AddressForm.elm @@ -1,4 +1,4 @@ -module Messages.AddressFormComp exposing (..) +module Messages.Comp.AddressForm exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm b/modules/webapp/src/main/elm/Messages/Comp/AttachmentMeta.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/AttachmentMeta.elm index 73c47b01..463dab6b 100644 --- a/modules/webapp/src/main/elm/Messages/AttachmentMetaComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/AttachmentMeta.elm @@ -1,4 +1,4 @@ -module Messages.AttachmentMetaComp exposing (..) +module Messages.Comp.AttachmentMeta exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/CalEventInputComp.elm b/modules/webapp/src/main/elm/Messages/Comp/CalEventInput.elm similarity index 90% rename from modules/webapp/src/main/elm/Messages/CalEventInputComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/CalEventInput.elm index 16f67534..f648dcc2 100644 --- a/modules/webapp/src/main/elm/Messages/CalEventInputComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CalEventInput.elm @@ -1,4 +1,4 @@ -module Messages.CalEventInputComp exposing (..) +module Messages.Comp.CalEventInput exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ChangePasswordForm.elm similarity index 91% rename from modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ChangePasswordForm.elm index 3a6d9696..acbe8004 100644 --- a/modules/webapp/src/main/elm/Messages/ChangePasswordFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ChangePasswordForm.elm @@ -1,4 +1,4 @@ -module Messages.ChangePasswordFormComp exposing (..) +module Messages.Comp.ChangePasswordForm exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ClassifierSettingsForm.elm similarity index 83% rename from modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ClassifierSettingsForm.elm index b342742a..dd649bbb 100644 --- a/modules/webapp/src/main/elm/Messages/ClassifierSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ClassifierSettingsForm.elm @@ -1,10 +1,10 @@ -module Messages.ClassifierSettingsFormComp exposing (..) +module Messages.Comp.ClassifierSettingsForm exposing (..) -import Messages.CalEventInputComp +import Messages.Comp.CalEventInput type alias Texts = - { calEventInput : Messages.CalEventInputComp.Texts + { calEventInput : Messages.Comp.CalEventInput.Texts , autoTaggingText : String , blacklistOrWhitelist : String , whitelistLabel : String @@ -17,7 +17,7 @@ type alias Texts = gb : Texts gb = - { calEventInput = Messages.CalEventInputComp.gb + { calEventInput = Messages.Comp.CalEventInput.gb , autoTaggingText = """ diff --git a/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/CollectiveSettingsForm.elm similarity index 81% rename from modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/CollectiveSettingsForm.elm index a00e604e..c4e0d741 100644 --- a/modules/webapp/src/main/elm/Messages/CollectiveSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CollectiveSettingsForm.elm @@ -1,12 +1,12 @@ -module Messages.CollectiveSettingsFormComp exposing (..) +module Messages.Comp.CollectiveSettingsForm exposing (..) import Data.Language exposing (Language) -import Messages.ClassifierSettingsFormComp -import Messages.LanguageData +import Messages.Comp.ClassifierSettingsForm +import Messages.Data.Language type alias Texts = - { classifierSettingsForm : Messages.ClassifierSettingsFormComp.Texts + { classifierSettingsForm : Messages.Comp.ClassifierSettingsForm.Texts , save : String , saveSettings : String , documentLanguage : String @@ -25,7 +25,7 @@ type alias Texts = gb : Texts gb = - { classifierSettingsForm = Messages.ClassifierSettingsFormComp.gb + { classifierSettingsForm = Messages.Comp.ClassifierSettingsForm.gb , save = "Save" , saveSettings = "Save Settings" , documentLanguage = "Document Language" @@ -42,5 +42,5 @@ gb = ++ "You must type OK before clicking the button to avoid accidental re-indexing." , autoTagging = "Auto-Tagging" , startNow = "Start now" - , languageLabel = Messages.LanguageData.gb + , languageLabel = Messages.Data.Language.gb } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm similarity index 90% rename from modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm index 9d536715..27977ab3 100644 --- a/modules/webapp/src/main/elm/Messages/CustomFieldFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm @@ -1,8 +1,8 @@ -module Messages.CustomFieldFormComp exposing (..) +module Messages.Comp.CustomFieldForm exposing (..) import Data.CustomFieldType exposing (CustomFieldType) import Messages.Basics -import Messages.CustomFieldTypeData +import Messages.Data.CustomFieldType type alias Texts = @@ -25,7 +25,7 @@ gb : Texts gb = { basics = Messages.Basics.gb , reallyDeleteField = "Really delete this custom field?" - , fieldTypeLabel = Messages.CustomFieldTypeData.gb + , fieldTypeLabel = Messages.Data.CustomFieldType.gb , createCustomField = "Create a new custom field." , modifyTypeWarning = "Note that changing the format may " diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldInput.elm similarity index 87% rename from modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/CustomFieldInput.elm index 63d9982c..905c0dff 100644 --- a/modules/webapp/src/main/elm/Messages/CustomFieldInputComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldInput.elm @@ -1,4 +1,4 @@ -module Messages.CustomFieldInputComp exposing (..) +module Messages.Comp.CustomFieldInput exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/Comp/CustomFieldManage.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldManage.elm new file mode 100644 index 00000000..123b6a05 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldManage.elm @@ -0,0 +1,24 @@ +module Messages.Comp.CustomFieldManage exposing (..) + +import Messages.Basics +import Messages.Comp.CustomFieldForm +import Messages.Comp.CustomFieldTable + + +type alias Texts = + { basics : Messages.Basics.Texts + , fieldForm : Messages.Comp.CustomFieldForm.Texts + , fieldTable : Messages.Comp.CustomFieldTable.Texts + , addCustomField : String + , newCustomField : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , fieldForm = Messages.Comp.CustomFieldForm.gb + , fieldTable = Messages.Comp.CustomFieldTable.gb + , addCustomField = "Add a new custom field" + , newCustomField = "New custom field" + } diff --git a/modules/webapp/src/main/elm/Messages/Comp/CustomFieldMultiInput.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldMultiInput.elm new file mode 100644 index 00000000..59e5bc25 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldMultiInput.elm @@ -0,0 +1,14 @@ +module Messages.Comp.CustomFieldMultiInput exposing (..) + +import Messages.Comp.CustomFieldInput + + +type alias Texts = + { customFieldInput : Messages.Comp.CustomFieldInput.Texts + } + + +gb : Texts +gb = + { customFieldInput = Messages.Comp.CustomFieldInput.gb + } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldTable.elm similarity index 85% rename from modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/CustomFieldTable.elm index a3f66c68..30745c89 100644 --- a/modules/webapp/src/main/elm/Messages/CustomFieldTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldTable.elm @@ -1,4 +1,4 @@ -module Messages.CustomFieldTableComp exposing (..) +module Messages.Comp.CustomFieldTable exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/Comp/DetailEdit.elm b/modules/webapp/src/main/elm/Messages/Comp/DetailEdit.elm new file mode 100644 index 00000000..e73bd47f --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/DetailEdit.elm @@ -0,0 +1,29 @@ +module Messages.Comp.DetailEdit exposing (..) + +import Messages.Basics +import Messages.Comp.CustomFieldForm +import Messages.Comp.EquipmentForm +import Messages.Comp.OrgForm +import Messages.Comp.PersonForm +import Messages.Comp.TagForm + + +type alias Texts = + { basics : Messages.Basics.Texts + , tagForm : Messages.Comp.TagForm.Texts + , personForm : Messages.Comp.PersonForm.Texts + , orgForm : Messages.Comp.OrgForm.Texts + , equipmentForm : Messages.Comp.EquipmentForm.Texts + , customFieldForm : Messages.Comp.CustomFieldForm.Texts + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , tagForm = Messages.Comp.TagForm.gb + , personForm = Messages.Comp.PersonForm.gb + , orgForm = Messages.Comp.OrgForm.gb + , equipmentForm = Messages.Comp.EquipmentForm.gb + , customFieldForm = Messages.Comp.CustomFieldForm.gb + } diff --git a/modules/webapp/src/main/elm/Messages/DropzoneComp.elm b/modules/webapp/src/main/elm/Messages/Comp/Dropzone.elm similarity index 89% rename from modules/webapp/src/main/elm/Messages/DropzoneComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/Dropzone.elm index f7d1f9bd..d1f17580 100644 --- a/modules/webapp/src/main/elm/Messages/DropzoneComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/Dropzone.elm @@ -1,4 +1,4 @@ -module Messages.DropzoneComp exposing (..) +module Messages.Comp.Dropzone exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm similarity index 91% rename from modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm index 1b971a48..b9ad0cd7 100644 --- a/modules/webapp/src/main/elm/Messages/EmailSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm @@ -1,7 +1,7 @@ -module Messages.EmailSettingsFormComp exposing (..) +module Messages.Comp.EmailSettingsForm exposing (..) import Data.SSLType exposing (SSLType) -import Messages.SSLTypeData +import Messages.Data.SSLType type alias Texts = @@ -27,7 +27,7 @@ type alias Texts = gb : Texts gb = - { sslTypeLabel = Messages.SSLTypeData.gb + { sslTypeLabel = Messages.Data.SSLType.gb , name = "Name" , connectionPlaceholder = "Connection name, e.g. 'gmail.com'" , connectionNameInfo = "The connection name must not contain whitespace or special characters." diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsManage.elm similarity index 56% rename from modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EmailSettingsManage.elm index 2fba48f2..a72c0531 100644 --- a/modules/webapp/src/main/elm/Messages/EmailSettingsManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsManage.elm @@ -1,14 +1,14 @@ -module Messages.EmailSettingsManageComp exposing (..) +module Messages.Comp.EmailSettingsManage exposing (..) import Messages.Basics -import Messages.EmailSettingsFormComp -import Messages.EmailSettingsTableComp +import Messages.Comp.EmailSettingsForm +import Messages.Comp.EmailSettingsTable type alias Texts = { basics : Messages.Basics.Texts - , settingsForm : Messages.EmailSettingsFormComp.Texts - , settingsTable : Messages.EmailSettingsTableComp.Texts + , settingsForm : Messages.Comp.EmailSettingsForm.Texts + , settingsTable : Messages.Comp.EmailSettingsTable.Texts , newSettings : String , addNewSmtpSettings : String , reallyDeleteConnection : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , settingsForm = Messages.EmailSettingsFormComp.gb - , settingsTable = Messages.EmailSettingsTableComp.gb + , settingsForm = Messages.Comp.EmailSettingsForm.gb + , settingsTable = Messages.Comp.EmailSettingsTable.gb , newSettings = "New Settings" , addNewSmtpSettings = "Add new SMTP settings" , reallyDeleteConnection = "Really delete these connection?" diff --git a/modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm similarity index 77% rename from modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm index 49a8ef51..ca82df7b 100644 --- a/modules/webapp/src/main/elm/Messages/EmailSettingsTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm @@ -1,4 +1,4 @@ -module Messages.EmailSettingsTableComp exposing (..) +module Messages.Comp.EmailSettingsTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm similarity index 51% rename from modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm index e5df50d0..a7c7d954 100644 --- a/modules/webapp/src/main/elm/Messages/EquipmentFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm @@ -1,7 +1,7 @@ -module Messages.EquipmentFormComp exposing (..) +module Messages.Comp.EquipmentForm exposing (..) import Data.EquipmentUse exposing (EquipmentUse) -import Messages.EquipmentUseData +import Messages.Data.EquipmentUse type alias Texts = @@ -11,5 +11,5 @@ type alias Texts = gb : Texts gb = - { equipmentUseLabel = Messages.EquipmentUseData.gb + { equipmentUseLabel = Messages.Data.EquipmentUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EquipmentManage.elm similarity index 58% rename from modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EquipmentManage.elm index 75c344a2..c6aab13b 100644 --- a/modules/webapp/src/main/elm/Messages/EquipmentManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EquipmentManage.elm @@ -1,14 +1,14 @@ -module Messages.EquipmentManageComp exposing (..) +module Messages.Comp.EquipmentManage exposing (..) import Messages.Basics -import Messages.EquipmentFormComp -import Messages.EquipmentTableComp +import Messages.Comp.EquipmentForm +import Messages.Comp.EquipmentTable type alias Texts = { basics : Messages.Basics.Texts - , equipmentTable : Messages.EquipmentTableComp.Texts - , equipmentForm : Messages.EquipmentFormComp.Texts + , equipmentTable : Messages.Comp.EquipmentTable.Texts + , equipmentForm : Messages.Comp.EquipmentForm.Texts , createNewEquipment : String , newEquipment : String , reallyDeleteEquipment : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , equipmentTable = Messages.EquipmentTableComp.gb - , equipmentForm = Messages.EquipmentFormComp.gb + , equipmentTable = Messages.Comp.EquipmentTable.gb + , equipmentForm = Messages.Comp.EquipmentForm.gb , createNewEquipment = "Create a new equipment" , newEquipment = "New Equipment" , reallyDeleteEquipment = "Really delete this equipment?" diff --git a/modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm similarity index 61% rename from modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm index 83dd5288..82e64b44 100644 --- a/modules/webapp/src/main/elm/Messages/EquipmentTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm @@ -1,7 +1,7 @@ -module Messages.EquipmentTableComp exposing (..) +module Messages.Comp.EquipmentTable exposing (..) import Data.EquipmentUse exposing (EquipmentUse) -import Messages.EquipmentUseData +import Messages.Data.EquipmentUse type alias Texts = @@ -15,5 +15,5 @@ gb : Texts gb = { name = "Name" , use = "Use" - , equipmentUseLabel = Messages.EquipmentUseData.gb + , equipmentUseLabel = Messages.Data.EquipmentUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/FolderDetailComp.elm b/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm similarity index 95% rename from modules/webapp/src/main/elm/Messages/FolderDetailComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm index 4714acaf..9b5c1d2d 100644 --- a/modules/webapp/src/main/elm/Messages/FolderDetailComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm @@ -1,4 +1,4 @@ -module Messages.FolderDetailComp exposing (..) +module Messages.Comp.FolderDetail exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/FolderManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/FolderManage.elm similarity index 53% rename from modules/webapp/src/main/elm/Messages/FolderManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/FolderManage.elm index d3d43785..c1912da4 100644 --- a/modules/webapp/src/main/elm/Messages/FolderManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/FolderManage.elm @@ -1,14 +1,14 @@ -module Messages.FolderManageComp exposing (..) +module Messages.Comp.FolderManage exposing (..) import Messages.Basics -import Messages.FolderDetailComp -import Messages.FolderTableComp +import Messages.Comp.FolderDetail +import Messages.Comp.FolderTable type alias Texts = { basics : Messages.Basics.Texts - , folderDetail : Messages.FolderDetailComp.Texts - , folderTable : Messages.FolderTableComp.Texts + , folderDetail : Messages.Comp.FolderDetail.Texts + , folderTable : Messages.Comp.FolderTable.Texts , showOwningFoldersOnly : String , createNewFolder : String , newFolder : String @@ -18,8 +18,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , folderDetail = Messages.FolderDetailComp.gb - , folderTable = Messages.FolderTableComp.gb + , folderDetail = Messages.Comp.FolderDetail.gb + , folderTable = Messages.Comp.FolderTable.gb , showOwningFoldersOnly = "Show owning folders only" , createNewFolder = "Create a new folder" , newFolder = "New Folder" diff --git a/modules/webapp/src/main/elm/Messages/FolderTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm similarity index 83% rename from modules/webapp/src/main/elm/Messages/FolderTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm index e1cfc6ce..4982736f 100644 --- a/modules/webapp/src/main/elm/Messages/FolderTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm @@ -1,4 +1,4 @@ -module Messages.FolderTableComp exposing (..) +module Messages.Comp.FolderTable exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm similarity index 90% rename from modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm index 9c2ae4be..069dfcc2 100644 --- a/modules/webapp/src/main/elm/Messages/ImapSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm @@ -1,7 +1,7 @@ -module Messages.ImapSettingsFormComp exposing (..) +module Messages.Comp.ImapSettingsForm exposing (..) import Data.SSLType exposing (SSLType) -import Messages.SSLTypeData +import Messages.Data.SSLType type alias Texts = @@ -25,7 +25,7 @@ type alias Texts = gb : Texts gb = - { sslTypeLabel = Messages.SSLTypeData.gb + { sslTypeLabel = Messages.Data.SSLType.gb , name = "Name" , connectionNamePlaceholder = "Connection name, e.g. 'gmail.com'" , connectionNameInfo = "The connection name must not contain whitespace or special characters." diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsManage.elm similarity index 58% rename from modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ImapSettingsManage.elm index 77bd5cd2..296228e0 100644 --- a/modules/webapp/src/main/elm/Messages/ImapSettingsManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsManage.elm @@ -1,14 +1,14 @@ -module Messages.ImapSettingsManageComp exposing (..) +module Messages.Comp.ImapSettingsManage exposing (..) import Messages.Basics -import Messages.ImapSettingsFormComp -import Messages.ImapSettingsTableComp +import Messages.Comp.ImapSettingsForm +import Messages.Comp.ImapSettingsTable type alias Texts = { basics : Messages.Basics.Texts - , imapForm : Messages.ImapSettingsFormComp.Texts - , imapTable : Messages.ImapSettingsTableComp.Texts + , imapForm : Messages.Comp.ImapSettingsForm.Texts + , imapTable : Messages.Comp.ImapSettingsTable.Texts , addNewImapSettings : String , newSettings : String , reallyDeleteSettings : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , imapForm = Messages.ImapSettingsFormComp.gb - , imapTable = Messages.ImapSettingsTableComp.gb + , imapForm = Messages.Comp.ImapSettingsForm.gb + , imapTable = Messages.Comp.ImapSettingsTable.gb , addNewImapSettings = "Add new IMAP settings" , newSettings = "New Settings" , reallyDeleteSettings = "Really delete this mail-box connection?" diff --git a/modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm similarity index 73% rename from modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm index 4f758bb6..f2f4c4ac 100644 --- a/modules/webapp/src/main/elm/Messages/ImapSettingsTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm @@ -1,4 +1,4 @@ -module Messages.ImapSettingsTableComp exposing (..) +module Messages.Comp.ImapSettingsTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/ItemCardComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm similarity index 68% rename from modules/webapp/src/main/elm/Messages/ItemCardComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm index e83dc466..b5ba78b7 100644 --- a/modules/webapp/src/main/elm/Messages/ItemCardComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm @@ -1,4 +1,4 @@ -module Messages.ItemCardComp exposing (..) +module Messages.Comp.ItemCard exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/Comp/ItemCardList.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemCardList.elm new file mode 100644 index 00000000..9cb13cb0 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemCardList.elm @@ -0,0 +1,14 @@ +module Messages.Comp.ItemCardList exposing (..) + +import Messages.Comp.ItemCard + + +type alias Texts = + { itemCard : Messages.Comp.ItemCard.Texts + } + + +gb : Texts +gb = + { itemCard = Messages.Comp.ItemCard.gb + } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail.elm similarity index 52% rename from modules/webapp/src/main/elm/Messages/ItemDetailComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail.elm index d3e64c2c..dbd62f5d 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetailComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail.elm @@ -1,22 +1,22 @@ -module Messages.ItemDetailComp exposing (..) +module Messages.Comp.ItemDetail exposing (..) -import Messages.DetailEditComp -import Messages.ItemDetail.AddFilesForm -import Messages.ItemInfoHeaderComp -import Messages.ItemMailComp -import Messages.NotesComp -import Messages.SentMailsComp -import Messages.SingleAttachmentComp +import Messages.Comp.DetailEdit +import Messages.Comp.ItemDetail.AddFilesForm +import Messages.Comp.ItemDetail.ItemInfoHeader +import Messages.Comp.ItemDetail.Notes +import Messages.Comp.ItemDetail.SingleAttachment +import Messages.Comp.ItemMail +import Messages.Comp.SentMails type alias Texts = - { addFilesForm : Messages.ItemDetail.AddFilesForm.Texts - , itemInfoHeader : Messages.ItemInfoHeaderComp.Texts - , singleAttachment : Messages.SingleAttachmentComp.Texts - , sentMails : Messages.SentMailsComp.Texts - , notes : Messages.NotesComp.Texts - , itemMail : Messages.ItemMailComp.Texts - , detailEdit : Messages.DetailEditComp.Texts + { addFilesForm : Messages.Comp.ItemDetail.AddFilesForm.Texts + , itemInfoHeader : Messages.Comp.ItemDetail.ItemInfoHeader.Texts + , singleAttachment : Messages.Comp.ItemDetail.SingleAttachment.Texts + , sentMails : Messages.Comp.SentMails.Texts + , notes : Messages.Comp.ItemDetail.Notes.Texts + , itemMail : Messages.Comp.ItemMail.Texts + , detailEdit : Messages.Comp.DetailEdit.Texts , key : String , backToSearchResults : String , previousItem : String @@ -39,13 +39,13 @@ type alias Texts = gb : Texts gb = - { addFilesForm = Messages.ItemDetail.AddFilesForm.gb - , itemInfoHeader = Messages.ItemInfoHeaderComp.gb - , singleAttachment = Messages.SingleAttachmentComp.gb - , sentMails = Messages.SentMailsComp.gb - , notes = Messages.NotesComp.gb - , itemMail = Messages.ItemMailComp.gb - , detailEdit = Messages.DetailEditComp.gb + { addFilesForm = Messages.Comp.ItemDetail.AddFilesForm.gb + , itemInfoHeader = Messages.Comp.ItemDetail.ItemInfoHeader.gb + , singleAttachment = Messages.Comp.ItemDetail.SingleAttachment.gb + , sentMails = Messages.Comp.SentMails.gb + , notes = Messages.Comp.ItemDetail.Notes.gb + , itemMail = Messages.Comp.ItemMail.gb + , detailEdit = Messages.Comp.DetailEdit.gb , key = "Key" , backToSearchResults = "Back to search results" , previousItem = "Previous item." diff --git a/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/AddFilesForm.elm similarity index 74% rename from modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/AddFilesForm.elm index 66e18079..a1908411 100644 --- a/modules/webapp/src/main/elm/Messages/ItemDetail/AddFilesForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/AddFilesForm.elm @@ -1,11 +1,11 @@ -module Messages.ItemDetail.AddFilesForm exposing (..) +module Messages.Comp.ItemDetail.AddFilesForm exposing (..) import Messages.Basics -import Messages.DropzoneComp +import Messages.Comp.Dropzone type alias Texts = - { dropzone : Messages.DropzoneComp.Texts + { dropzone : Messages.Comp.Dropzone.Texts , basics : Messages.Basics.Texts , addMoreFilesToItem : String , reset : String @@ -16,7 +16,7 @@ type alias Texts = gb : Texts gb = - { dropzone = Messages.DropzoneComp.gb + { dropzone = Messages.Comp.Dropzone.gb , basics = Messages.Basics.gb , addMoreFilesToItem = "Add more files to this item" , reset = "Reset" diff --git a/modules/webapp/src/main/elm/Messages/EditFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm similarity index 89% rename from modules/webapp/src/main/elm/Messages/EditFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm index 9b0b085e..b215a40c 100644 --- a/modules/webapp/src/main/elm/Messages/EditFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm @@ -1,12 +1,12 @@ -module Messages.EditFormComp exposing (..) +module Messages.Comp.ItemDetail.EditForm exposing (..) import Messages.Basics -import Messages.CustomFieldMultiInputComp +import Messages.Comp.CustomFieldMultiInput type alias Texts = { basics : Messages.Basics.Texts - , customFieldInput : Messages.CustomFieldMultiInputComp.Texts + , customFieldInput : Messages.Comp.CustomFieldMultiInput.Texts , createNewCustomField : String , chooseDirection : String , selectPlaceholder : String @@ -36,7 +36,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , customFieldInput = Messages.CustomFieldMultiInputComp.gb + , customFieldInput = Messages.Comp.CustomFieldMultiInput.gb , createNewCustomField = "Create new custom field" , chooseDirection = "Choose a direction…" , selectPlaceholder = "Select…" diff --git a/modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm similarity index 86% rename from modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm index 3f09358f..b330a77d 100644 --- a/modules/webapp/src/main/elm/Messages/ItemInfoHeaderComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm @@ -1,4 +1,4 @@ -module Messages.ItemInfoHeaderComp exposing (..) +module Messages.Comp.ItemDetail.ItemInfoHeader exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm similarity index 88% rename from modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm index 38920dbc..1f9bf3c1 100644 --- a/modules/webapp/src/main/elm/Messages/MultiEditMenuComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm @@ -1,12 +1,12 @@ -module Messages.MultiEditMenuComp exposing (..) +module Messages.Comp.ItemDetail.MultiEditMenu exposing (..) import Messages.Basics -import Messages.CustomFieldMultiInputComp +import Messages.Comp.CustomFieldMultiInput type alias Texts = { basics : Messages.Basics.Texts - , customFieldMultiInput : Messages.CustomFieldMultiInputComp.Texts + , customFieldMultiInput : Messages.Comp.CustomFieldMultiInput.Texts , tagModeAddInfo : String , tagModeRemoveInfo : String , tagModeReplaceInfo : String @@ -34,7 +34,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , customFieldMultiInput = Messages.CustomFieldMultiInputComp.gb + , customFieldMultiInput = Messages.Comp.CustomFieldMultiInput.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." diff --git a/modules/webapp/src/main/elm/Messages/NotesComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/Notes.elm similarity index 85% rename from modules/webapp/src/main/elm/Messages/NotesComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/Notes.elm index 8ab60e8a..de92e57e 100644 --- a/modules/webapp/src/main/elm/Messages/NotesComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/Notes.elm @@ -1,4 +1,4 @@ -module Messages.NotesComp exposing (..) +module Messages.Comp.ItemDetail.Notes exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/SingleAttachment.elm similarity index 78% rename from modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemDetail/SingleAttachment.elm index 40aca0e9..f785b748 100644 --- a/modules/webapp/src/main/elm/Messages/SingleAttachmentComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/SingleAttachment.elm @@ -1,10 +1,10 @@ -module Messages.SingleAttachmentComp exposing (..) +module Messages.Comp.ItemDetail.SingleAttachment exposing (..) -import Messages.AttachmentMetaComp +import Messages.Comp.AttachmentMeta type alias Texts = - { attachmentMeta : Messages.AttachmentMetaComp.Texts + { attachmentMeta : Messages.Comp.AttachmentMeta.Texts , noName : String , openFileInNewTab : String , downloadFile : String @@ -20,7 +20,7 @@ type alias Texts = gb : Texts gb = - { attachmentMeta = Messages.AttachmentMetaComp.gb + { attachmentMeta = Messages.Comp.AttachmentMeta.gb , noName = "No name" , openFileInNewTab = "Open file in new tab" , downloadFile = "Download file" diff --git a/modules/webapp/src/main/elm/Messages/ItemMailComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemMail.elm similarity index 93% rename from modules/webapp/src/main/elm/Messages/ItemMailComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ItemMail.elm index 4ebfc3b0..f154aa1a 100644 --- a/modules/webapp/src/main/elm/Messages/ItemMailComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemMail.elm @@ -1,4 +1,4 @@ -module Messages.ItemMailComp exposing (..) +module Messages.Comp.ItemMail exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/NotificationForm.elm similarity index 92% rename from modules/webapp/src/main/elm/Messages/NotificationFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/NotificationForm.elm index 40360189..74894b16 100644 --- a/modules/webapp/src/main/elm/Messages/NotificationFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/NotificationForm.elm @@ -1,12 +1,12 @@ -module Messages.NotificationFormComp exposing (..) +module Messages.Comp.NotificationForm exposing (..) import Messages.Basics -import Messages.CalEventInputComp +import Messages.Comp.CalEventInput type alias Texts = { basics : Messages.Basics.Texts - , calEventInput : Messages.CalEventInputComp.Texts + , calEventInput : Messages.Comp.CalEventInput.Texts , reallyDeleteTask : String , startOnce : String , startTaskNow : String @@ -36,7 +36,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , calEventInput = Messages.CalEventInputComp.gb + , calEventInput = Messages.Comp.CalEventInput.gb , reallyDeleteTask = "Really delete this notification task?" , startOnce = "Start Once" , startTaskNow = "Start this task now" diff --git a/modules/webapp/src/main/elm/Messages/Comp/NotificationManage.elm b/modules/webapp/src/main/elm/Messages/Comp/NotificationManage.elm new file mode 100644 index 00000000..b766598d --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/NotificationManage.elm @@ -0,0 +1,24 @@ +module Messages.Comp.NotificationManage exposing (..) + +import Messages.Basics +import Messages.Comp.NotificationForm +import Messages.Comp.NotificationTable + + +type alias Texts = + { basics : Messages.Basics.Texts + , notificationForm : Messages.Comp.NotificationForm.Texts + , notificationTable : Messages.Comp.NotificationTable.Texts + , newTask : String + , createNewTask : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , notificationForm = Messages.Comp.NotificationForm.gb + , notificationTable = Messages.Comp.NotificationTable.gb + , newTask = "New Task" + , createNewTask = "Create a new notification task" + } diff --git a/modules/webapp/src/main/elm/Messages/NotificationTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/NotificationTable.elm similarity index 83% rename from modules/webapp/src/main/elm/Messages/NotificationTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/NotificationTable.elm index c6c259a8..acea92ed 100644 --- a/modules/webapp/src/main/elm/Messages/NotificationTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/NotificationTable.elm @@ -1,4 +1,4 @@ -module Messages.NotificationTableComp exposing (..) +module Messages.Comp.NotificationTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/OrgFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm similarity index 66% rename from modules/webapp/src/main/elm/Messages/OrgFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm index 72e4ec17..13d5241f 100644 --- a/modules/webapp/src/main/elm/Messages/OrgFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm @@ -1,14 +1,14 @@ -module Messages.OrgFormComp exposing (..) +module Messages.Comp.OrgForm exposing (..) import Data.ContactType exposing (ContactType) import Data.OrgUse exposing (OrgUse) -import Messages.AddressFormComp -import Messages.ContactTypeData -import Messages.OrgUseData +import Messages.Comp.AddressForm +import Messages.Data.ContactType +import Messages.Data.OrgUse type alias Texts = - { addressForm : Messages.AddressFormComp.Texts + { addressForm : Messages.Comp.AddressForm.Texts , orgUseLabel : OrgUse -> String , name : String , shortName : String @@ -24,8 +24,8 @@ type alias Texts = gb : Texts gb = - { addressForm = Messages.AddressFormComp.gb - , orgUseLabel = Messages.OrgUseData.gb + { addressForm = Messages.Comp.AddressForm.gb + , orgUseLabel = Messages.Data.OrgUse.gb , name = "Name" , shortName = "Short Name" , use = "Use" @@ -33,6 +33,6 @@ gb = , dontUseForSuggestions = "Do not use for suggestions." , address = "Address" , contacts = "Contacts" - , contactTypeLabel = Messages.ContactTypeData.gb + , contactTypeLabel = Messages.Data.ContactType.gb , notes = "Notes" } diff --git a/modules/webapp/src/main/elm/Messages/OrgManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/OrgManage.elm similarity index 63% rename from modules/webapp/src/main/elm/Messages/OrgManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/OrgManage.elm index 20c6424e..a0474c8b 100644 --- a/modules/webapp/src/main/elm/Messages/OrgManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/OrgManage.elm @@ -1,14 +1,14 @@ -module Messages.OrgManageComp exposing (..) +module Messages.Comp.OrgManage exposing (..) import Messages.Basics -import Messages.OrgFormComp -import Messages.OrgTableComp +import Messages.Comp.OrgForm +import Messages.Comp.OrgTable type alias Texts = { basics : Messages.Basics.Texts - , orgForm : Messages.OrgFormComp.Texts - , orgTable : Messages.OrgTableComp.Texts + , orgForm : Messages.Comp.OrgForm.Texts + , orgTable : Messages.Comp.OrgTable.Texts , newOrganization : String , createNewOrganization : String , reallyDeleteOrg : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , orgForm = Messages.OrgFormComp.gb - , orgTable = Messages.OrgTableComp.gb + , orgForm = Messages.Comp.OrgForm.gb + , orgTable = Messages.Comp.OrgTable.gb , newOrganization = "New Organization" , createNewOrganization = "Create a new organization" , reallyDeleteOrg = "Really delete this organization?" diff --git a/modules/webapp/src/main/elm/Messages/OrgTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm similarity index 75% rename from modules/webapp/src/main/elm/Messages/OrgTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm index 5a7fae3d..361c1903 100644 --- a/modules/webapp/src/main/elm/Messages/OrgTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm @@ -1,8 +1,8 @@ -module Messages.OrgTableComp exposing (..) +module Messages.Comp.OrgTable exposing (..) import Data.OrgUse exposing (OrgUse) import Messages.Basics -import Messages.OrgUseData +import Messages.Data.OrgUse type alias Texts = @@ -20,5 +20,5 @@ gb = , name = "Name" , address = "Address" , contact = "Contact" - , orgUseLabel = Messages.OrgUseData.gb + , orgUseLabel = Messages.Data.OrgUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/PersonFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm similarity index 74% rename from modules/webapp/src/main/elm/Messages/PersonFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm index 54f8b612..53cedf43 100644 --- a/modules/webapp/src/main/elm/Messages/PersonFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm @@ -1,14 +1,14 @@ -module Messages.PersonFormComp exposing (..) +module Messages.Comp.PersonForm exposing (..) import Data.ContactType exposing (ContactType) import Data.PersonUse exposing (PersonUse) -import Messages.AddressFormComp -import Messages.ContactTypeData -import Messages.PersonUseData +import Messages.Comp.AddressForm +import Messages.Data.ContactType +import Messages.Data.PersonUse type alias Texts = - { addressForm : Messages.AddressFormComp.Texts + { addressForm : Messages.Comp.AddressForm.Texts , personUseLabel : PersonUse -> String , name : String , useOfPerson : String @@ -27,8 +27,8 @@ type alias Texts = gb : Texts gb = - { addressForm = Messages.AddressFormComp.gb - , personUseLabel = Messages.PersonUseData.gb + { addressForm = Messages.Comp.AddressForm.gb + , personUseLabel = Messages.Data.PersonUse.gb , name = "Name" , useOfPerson = "Use of this person" , useAsConcerningOnly = "Use as concerning person only" @@ -39,6 +39,6 @@ gb = , chooseAnOrg = "Choose an organization" , address = "Address" , contacts = "Contacts" - , contactTypeLabel = Messages.ContactTypeData.gb + , contactTypeLabel = Messages.Data.ContactType.gb , notes = "Notes" } diff --git a/modules/webapp/src/main/elm/Messages/PersonManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/PersonManage.elm similarity index 58% rename from modules/webapp/src/main/elm/Messages/PersonManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/PersonManage.elm index d72a23de..f32a4540 100644 --- a/modules/webapp/src/main/elm/Messages/PersonManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/PersonManage.elm @@ -1,14 +1,14 @@ -module Messages.PersonManageComp exposing (..) +module Messages.Comp.PersonManage exposing (..) import Messages.Basics -import Messages.PersonFormComp -import Messages.PersonTableComp +import Messages.Comp.PersonForm +import Messages.Comp.PersonTable type alias Texts = { basics : Messages.Basics.Texts - , personForm : Messages.PersonFormComp.Texts - , personTable : Messages.PersonTableComp.Texts + , personForm : Messages.Comp.PersonForm.Texts + , personTable : Messages.Comp.PersonTable.Texts , newPerson : String , createNewPerson : String , reallyDeletePerson : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , personForm = Messages.PersonFormComp.gb - , personTable = Messages.PersonTableComp.gb + , personForm = Messages.Comp.PersonForm.gb + , personTable = Messages.Comp.PersonTable.gb , newPerson = "New Person" , createNewPerson = "Create a new person" , reallyDeletePerson = "Really delete this person?" diff --git a/modules/webapp/src/main/elm/Messages/PersonTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm similarity index 74% rename from modules/webapp/src/main/elm/Messages/PersonTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm index b87f5920..8d10a81d 100644 --- a/modules/webapp/src/main/elm/Messages/PersonTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm @@ -1,8 +1,8 @@ -module Messages.PersonTableComp exposing (..) +module Messages.Comp.PersonTable exposing (..) import Data.PersonUse exposing (PersonUse) import Messages.Basics -import Messages.PersonUseData +import Messages.Data.PersonUse type alias Texts = @@ -20,5 +20,5 @@ gb = , name = "Name" , address = "Address" , contact = "Contact" - , personUseLabel = Messages.PersonUseData.gb + , personUseLabel = Messages.Data.PersonUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxForm.elm similarity index 96% rename from modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ScanMailboxForm.elm index 4972896c..c5c298b1 100644 --- a/modules/webapp/src/main/elm/Messages/ScanMailboxFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxForm.elm @@ -1,12 +1,12 @@ -module Messages.ScanMailboxFormComp exposing (..) +module Messages.Comp.ScanMailboxForm exposing (..) import Messages.Basics -import Messages.CalEventInputComp +import Messages.Comp.CalEventInput type alias Texts = { basics : Messages.Basics.Texts - , calEventInput : Messages.CalEventInputComp.Texts + , calEventInput : Messages.Comp.CalEventInput.Texts , reallyDeleteTask : String , startOnce : String , startNow : String @@ -60,7 +60,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , calEventInput = Messages.CalEventInputComp.gb + , calEventInput = Messages.Comp.CalEventInput.gb , reallyDeleteTask = "Really delete this scan mailbox task?" , startOnce = "Start Once" , startNow = "Start this task now" diff --git a/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxManage.elm b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxManage.elm new file mode 100644 index 00000000..8803cc22 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxManage.elm @@ -0,0 +1,24 @@ +module Messages.Comp.ScanMailboxManage exposing (..) + +import Messages.Basics +import Messages.Comp.ScanMailboxForm +import Messages.Comp.ScanMailboxTable + + +type alias Texts = + { basics : Messages.Basics.Texts + , form : Messages.Comp.ScanMailboxForm.Texts + , table : Messages.Comp.ScanMailboxTable.Texts + , newTask : String + , createNewTask : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , form = Messages.Comp.ScanMailboxForm.gb + , table = Messages.Comp.ScanMailboxTable.gb + , newTask = "New Task" + , createNewTask = "Create a new scan mailbox task" + } diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxTable.elm similarity index 84% rename from modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/ScanMailboxTable.elm index 7fd6638c..48dd9cc2 100644 --- a/modules/webapp/src/main/elm/Messages/ScanMailboxTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ScanMailboxTable.elm @@ -1,4 +1,4 @@ -module Messages.ScanMailboxTableComp exposing (..) +module Messages.Comp.ScanMailboxTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm similarity index 86% rename from modules/webapp/src/main/elm/Messages/SearchMenuComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm index 92119a90..5eb7f4de 100644 --- a/modules/webapp/src/main/elm/Messages/SearchMenuComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm @@ -1,14 +1,14 @@ -module Messages.SearchMenuComp exposing (..) +module Messages.Comp.SearchMenu exposing (..) import Messages.Basics -import Messages.CustomFieldMultiInputComp -import Messages.TagSelectComp +import Messages.Comp.CustomFieldMultiInput +import Messages.Comp.TagSelect type alias Texts = { basics : Messages.Basics.Texts - , customFieldMultiInput : Messages.CustomFieldMultiInputComp.Texts - , tagSelect : Messages.TagSelectComp.Texts + , customFieldMultiInput : Messages.Comp.CustomFieldMultiInput.Texts + , tagSelect : Messages.Comp.TagSelect.Texts , chooseDirection : String , choosePerson : String , chooseEquipment : String @@ -45,8 +45,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , customFieldMultiInput = Messages.CustomFieldMultiInputComp.gb - , tagSelect = Messages.TagSelectComp.gb + , customFieldMultiInput = Messages.Comp.CustomFieldMultiInput.gb + , tagSelect = Messages.Comp.TagSelect.gb , chooseDirection = "Choose a direction…" , choosePerson = "Choose a person" , chooseEquipment = "Choose an equipment" diff --git a/modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SearchStatsView.elm similarity index 84% rename from modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SearchStatsView.elm index d6913f09..5810c588 100644 --- a/modules/webapp/src/main/elm/Messages/SearchStatsViewComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SearchStatsView.elm @@ -1,4 +1,4 @@ -module Messages.SearchStatsViewComp exposing (..) +module Messages.Comp.SearchStatsView exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/SentMailsComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SentMails.elm similarity index 87% rename from modules/webapp/src/main/elm/Messages/SentMailsComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SentMails.elm index 6f68bc65..1dd241fc 100644 --- a/modules/webapp/src/main/elm/Messages/SentMailsComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SentMails.elm @@ -1,4 +1,4 @@ -module Messages.SentMailsComp exposing (..) +module Messages.Comp.SentMails exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/SourceFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/SourceFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm index ab941c80..9aac062c 100644 --- a/modules/webapp/src/main/elm/Messages/SourceFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm @@ -1,8 +1,8 @@ -module Messages.SourceFormComp exposing (..) +module Messages.Comp.SourceForm exposing (..) import Data.Language exposing (Language) import Messages.Basics -import Messages.LanguageData +import Messages.Data.Language type alias Texts = @@ -62,6 +62,6 @@ Specify a file glob to filter files when uploading archives , languageInfo = "Used for text extraction and analysis. The collective's " ++ "default language is used if not specified here." - , languageLabel = Messages.LanguageData.gb + , languageLabel = Messages.Data.Language.gb , selectPlaceholder = "Select…" } diff --git a/modules/webapp/src/main/elm/Messages/SourceManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SourceManage.elm similarity index 82% rename from modules/webapp/src/main/elm/Messages/SourceManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SourceManage.elm index a6b68cf2..8b466539 100644 --- a/modules/webapp/src/main/elm/Messages/SourceManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SourceManage.elm @@ -1,14 +1,14 @@ -module Messages.SourceManageComp exposing (..) +module Messages.Comp.SourceManage exposing (..) import Messages.Basics -import Messages.SourceFormComp -import Messages.SourceTableComp +import Messages.Comp.SourceForm +import Messages.Comp.SourceTable type alias Texts = { basics : Messages.Basics.Texts - , sourceTable : Messages.SourceTableComp.Texts - , sourceForm : Messages.SourceFormComp.Texts + , sourceTable : Messages.Comp.SourceTable.Texts + , sourceForm : Messages.Comp.SourceForm.Texts , addSourceUrl : String , newSource : String , publicUploads : String @@ -28,8 +28,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , sourceTable = Messages.SourceTableComp.gb - , sourceForm = Messages.SourceFormComp.gb + , sourceTable = Messages.Comp.SourceTable.gb + , sourceForm = Messages.Comp.SourceForm.gb , addSourceUrl = "Add a source url" , newSource = "New source" , publicUploads = "Public Uploads" diff --git a/modules/webapp/src/main/elm/Messages/SourceTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/SourceTable.elm similarity index 87% rename from modules/webapp/src/main/elm/Messages/SourceTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/SourceTable.elm index 1b306995..90d6ea29 100644 --- a/modules/webapp/src/main/elm/Messages/SourceTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SourceTable.elm @@ -1,4 +1,4 @@ -module Messages.SourceTableComp exposing (..) +module Messages.Comp.SourceTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/TagFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm similarity index 84% rename from modules/webapp/src/main/elm/Messages/TagFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/TagForm.elm index 7e37f3af..7893a63f 100644 --- a/modules/webapp/src/main/elm/Messages/TagFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm @@ -1,4 +1,4 @@ -module Messages.TagFormComp exposing (..) +module Messages.Comp.TagForm exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/TagManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/TagManage.elm similarity index 59% rename from modules/webapp/src/main/elm/Messages/TagManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/TagManage.elm index c69b043c..1a05c160 100644 --- a/modules/webapp/src/main/elm/Messages/TagManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagManage.elm @@ -1,14 +1,14 @@ -module Messages.TagManageComp exposing (..) +module Messages.Comp.TagManage exposing (..) import Messages.Basics -import Messages.TagFormComp -import Messages.TagTableComp +import Messages.Comp.TagForm +import Messages.Comp.TagTable type alias Texts = { basics : Messages.Basics.Texts - , tagTable : Messages.TagTableComp.Texts - , tagForm : Messages.TagFormComp.Texts + , tagTable : Messages.Comp.TagTable.Texts + , tagForm : Messages.Comp.TagForm.Texts , createNewTag : String , newTag : String , reallyDeleteTag : String @@ -19,8 +19,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , tagTable = Messages.TagTableComp.gb - , tagForm = Messages.TagFormComp.gb + , tagTable = Messages.Comp.TagTable.gb + , tagForm = Messages.Comp.TagForm.gb , createNewTag = "Create a new tag" , newTag = "New Tag" , reallyDeleteTag = "Really delete this tag?" diff --git a/modules/webapp/src/main/elm/Messages/TagSelectComp.elm b/modules/webapp/src/main/elm/Messages/Comp/TagSelect.elm similarity index 83% rename from modules/webapp/src/main/elm/Messages/TagSelectComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/TagSelect.elm index e07949ac..ac790146 100644 --- a/modules/webapp/src/main/elm/Messages/TagSelectComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagSelect.elm @@ -1,4 +1,4 @@ -module Messages.TagSelectComp exposing (..) +module Messages.Comp.TagSelect exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/TagTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm similarity index 76% rename from modules/webapp/src/main/elm/Messages/TagTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/TagTable.elm index 611f32c1..5e0dc40b 100644 --- a/modules/webapp/src/main/elm/Messages/TagTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm @@ -1,4 +1,4 @@ -module Messages.TagTableComp exposing (..) +module Messages.Comp.TagTable exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm index 5da66fcb..920c321f 100644 --- a/modules/webapp/src/main/elm/Messages/UiSettingsFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm @@ -1,9 +1,9 @@ -module Messages.UiSettingsFormComp exposing (..) +module Messages.Comp.UiSettingsForm exposing (..) import Data.Color exposing (Color) import Data.Fields exposing (Field) -import Messages.ColorData -import Messages.FieldsData +import Messages.Data.Color +import Messages.Data.Fields type alias Texts = @@ -78,10 +78,10 @@ gb = , browserNativePdfView = "Browser-native PDF preview" , keyboardShortcutLabel = "Use keyboard shortcuts for navigation and confirm/unconfirm with open edit menu." , tagCategoryColors = "Tag Category Colors" - , colorLabel = Messages.ColorData.gb + , colorLabel = Messages.Data.Color.gb , chooseTagColorLabel = "Choose color for tag categories" , tagColorDescription = "Tags can be represented differently based on their category." , fields = "Fields" , fieldsInfo = "Choose which fields to display in search and edit menus." - , fieldLabel = Messages.FieldsData.gb + , fieldLabel = Messages.Data.Fields.gb } diff --git a/modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsManage.elm similarity index 51% rename from modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/UiSettingsManage.elm index 669e016d..3b38bcbd 100644 --- a/modules/webapp/src/main/elm/Messages/UiSettingsManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsManage.elm @@ -1,12 +1,12 @@ -module Messages.UiSettingsManageComp exposing (..) +module Messages.Comp.UiSettingsManage exposing (..) import Messages.Basics -import Messages.UiSettingsFormComp +import Messages.Comp.UiSettingsForm type alias Texts = { basics : Messages.Basics.Texts - , uiSettingsForm : Messages.UiSettingsFormComp.Texts + , uiSettingsForm : Messages.Comp.UiSettingsForm.Texts , saveSettings : String } @@ -14,6 +14,6 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , uiSettingsForm = Messages.UiSettingsFormComp.gb + , uiSettingsForm = Messages.Comp.UiSettingsForm.gb , saveSettings = "Save settings" } diff --git a/modules/webapp/src/main/elm/Messages/UserFormComp.elm b/modules/webapp/src/main/elm/Messages/Comp/UserForm.elm similarity index 84% rename from modules/webapp/src/main/elm/Messages/UserFormComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/UserForm.elm index 4616f360..f533bcd8 100644 --- a/modules/webapp/src/main/elm/Messages/UserFormComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UserForm.elm @@ -1,4 +1,4 @@ -module Messages.UserFormComp exposing (..) +module Messages.Comp.UserForm exposing (..) type alias Texts = diff --git a/modules/webapp/src/main/elm/Messages/UserManageComp.elm b/modules/webapp/src/main/elm/Messages/Comp/UserManage.elm similarity index 69% rename from modules/webapp/src/main/elm/Messages/UserManageComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/UserManage.elm index 98870683..19b927f5 100644 --- a/modules/webapp/src/main/elm/Messages/UserManageComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UserManage.elm @@ -1,13 +1,13 @@ -module Messages.UserManageComp exposing (..) +module Messages.Comp.UserManage exposing (..) import Messages.Basics -import Messages.UserFormComp -import Messages.UserTableComp +import Messages.Comp.UserForm +import Messages.Comp.UserTable type alias Texts = - { userTable : Messages.UserTableComp.Texts - , userForm : Messages.UserFormComp.Texts + { userTable : Messages.Comp.UserTable.Texts + , userForm : Messages.Comp.UserForm.Texts , users : String , newUser : String , addNewUser : String @@ -21,8 +21,8 @@ type alias Texts = gb : Texts gb = - { userTable = Messages.UserTableComp.gb - , userForm = Messages.UserFormComp.gb + { userTable = Messages.Comp.UserTable.gb + , userForm = Messages.Comp.UserForm.gb , basics = Messages.Basics.gb , users = "Users" , newUser = "New user" diff --git a/modules/webapp/src/main/elm/Messages/UserTableComp.elm b/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm similarity index 90% rename from modules/webapp/src/main/elm/Messages/UserTableComp.elm rename to modules/webapp/src/main/elm/Messages/Comp/UserTable.elm index 30939c31..e434e42f 100644 --- a/modules/webapp/src/main/elm/Messages/UserTableComp.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm @@ -1,4 +1,4 @@ -module Messages.UserTableComp exposing (..) +module Messages.Comp.UserTable exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm deleted file mode 100644 index b6449cc4..00000000 --- a/modules/webapp/src/main/elm/Messages/CustomFieldManageComp.elm +++ /dev/null @@ -1,24 +0,0 @@ -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" - } diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm b/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm deleted file mode 100644 index 96e2a209..00000000 --- a/modules/webapp/src/main/elm/Messages/CustomFieldMultiInputComp.elm +++ /dev/null @@ -1,14 +0,0 @@ -module Messages.CustomFieldMultiInputComp exposing (..) - -import Messages.CustomFieldInputComp - - -type alias Texts = - { customFieldInput : Messages.CustomFieldInputComp.Texts - } - - -gb : Texts -gb = - { customFieldInput = Messages.CustomFieldInputComp.gb - } diff --git a/modules/webapp/src/main/elm/Messages/ColorData.elm b/modules/webapp/src/main/elm/Messages/Data/Color.elm similarity index 93% rename from modules/webapp/src/main/elm/Messages/ColorData.elm rename to modules/webapp/src/main/elm/Messages/Data/Color.elm index fe495cf1..cc516943 100644 --- a/modules/webapp/src/main/elm/Messages/ColorData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/Color.elm @@ -1,4 +1,4 @@ -module Messages.ColorData exposing (..) +module Messages.Data.Color exposing (..) import Data.Color exposing (Color(..)) diff --git a/modules/webapp/src/main/elm/Messages/ContactTypeData.elm b/modules/webapp/src/main/elm/Messages/Data/ContactType.elm similarity index 87% rename from modules/webapp/src/main/elm/Messages/ContactTypeData.elm rename to modules/webapp/src/main/elm/Messages/Data/ContactType.elm index 8464d08f..06056387 100644 --- a/modules/webapp/src/main/elm/Messages/ContactTypeData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/ContactType.elm @@ -1,4 +1,4 @@ -module Messages.ContactTypeData exposing (..) +module Messages.Data.ContactType exposing (..) import Data.ContactType exposing (ContactType(..)) diff --git a/modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm b/modules/webapp/src/main/elm/Messages/Data/CustomFieldType.elm similarity index 85% rename from modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm rename to modules/webapp/src/main/elm/Messages/Data/CustomFieldType.elm index 2069725b..39fba224 100644 --- a/modules/webapp/src/main/elm/Messages/CustomFieldTypeData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/CustomFieldType.elm @@ -1,4 +1,4 @@ -module Messages.CustomFieldTypeData exposing (..) +module Messages.Data.CustomFieldType exposing (..) import Data.CustomFieldType exposing (CustomFieldType(..)) diff --git a/modules/webapp/src/main/elm/Messages/EquipmentUseData.elm b/modules/webapp/src/main/elm/Messages/Data/EquipmentUse.elm similarity index 80% rename from modules/webapp/src/main/elm/Messages/EquipmentUseData.elm rename to modules/webapp/src/main/elm/Messages/Data/EquipmentUse.elm index a10c0eee..bc3cbdca 100644 --- a/modules/webapp/src/main/elm/Messages/EquipmentUseData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/EquipmentUse.elm @@ -1,4 +1,4 @@ -module Messages.EquipmentUseData exposing (..) +module Messages.Data.EquipmentUse exposing (..) import Data.EquipmentUse exposing (EquipmentUse(..)) diff --git a/modules/webapp/src/main/elm/Messages/FieldsData.elm b/modules/webapp/src/main/elm/Messages/Data/Fields.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/FieldsData.elm rename to modules/webapp/src/main/elm/Messages/Data/Fields.elm index 1fd406fa..f9b65e23 100644 --- a/modules/webapp/src/main/elm/Messages/FieldsData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/Fields.elm @@ -1,4 +1,4 @@ -module Messages.FieldsData exposing (..) +module Messages.Data.Fields exposing (..) import Data.Fields exposing (Field(..)) diff --git a/modules/webapp/src/main/elm/Messages/LanguageData.elm b/modules/webapp/src/main/elm/Messages/Data/Language.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/LanguageData.elm rename to modules/webapp/src/main/elm/Messages/Data/Language.elm index b55a4ef0..3c21f593 100644 --- a/modules/webapp/src/main/elm/Messages/LanguageData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/Language.elm @@ -1,4 +1,4 @@ -module Messages.LanguageData exposing (..) +module Messages.Data.Language exposing (..) import Data.Language exposing (Language(..)) diff --git a/modules/webapp/src/main/elm/Messages/OrgUseData.elm b/modules/webapp/src/main/elm/Messages/Data/OrgUse.elm similarity index 81% rename from modules/webapp/src/main/elm/Messages/OrgUseData.elm rename to modules/webapp/src/main/elm/Messages/Data/OrgUse.elm index bf318146..b765b153 100644 --- a/modules/webapp/src/main/elm/Messages/OrgUseData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/OrgUse.elm @@ -1,4 +1,4 @@ -module Messages.OrgUseData exposing (..) +module Messages.Data.OrgUse exposing (..) import Data.OrgUse exposing (OrgUse(..)) diff --git a/modules/webapp/src/main/elm/Messages/PersonUseData.elm b/modules/webapp/src/main/elm/Messages/Data/PersonUse.elm similarity index 86% rename from modules/webapp/src/main/elm/Messages/PersonUseData.elm rename to modules/webapp/src/main/elm/Messages/Data/PersonUse.elm index 4db90e04..f1c46bf6 100644 --- a/modules/webapp/src/main/elm/Messages/PersonUseData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/PersonUse.elm @@ -1,4 +1,4 @@ -module Messages.PersonUseData exposing (..) +module Messages.Data.PersonUse exposing (..) import Data.PersonUse exposing (PersonUse(..)) diff --git a/modules/webapp/src/main/elm/Messages/SSLTypeData.elm b/modules/webapp/src/main/elm/Messages/Data/SSLType.elm similarity index 82% rename from modules/webapp/src/main/elm/Messages/SSLTypeData.elm rename to modules/webapp/src/main/elm/Messages/Data/SSLType.elm index 803f7ba7..6e051ae0 100644 --- a/modules/webapp/src/main/elm/Messages/SSLTypeData.elm +++ b/modules/webapp/src/main/elm/Messages/Data/SSLType.elm @@ -1,4 +1,4 @@ -module Messages.SSLTypeData exposing (..) +module Messages.Data.SSLType exposing (..) import Data.SSLType exposing (SSLType(..)) diff --git a/modules/webapp/src/main/elm/Messages/DetailEditComp.elm b/modules/webapp/src/main/elm/Messages/DetailEditComp.elm deleted file mode 100644 index 7a6ddeb9..00000000 --- a/modules/webapp/src/main/elm/Messages/DetailEditComp.elm +++ /dev/null @@ -1,29 +0,0 @@ -module Messages.DetailEditComp exposing (..) - -import Messages.Basics -import Messages.CustomFieldFormComp -import Messages.EquipmentFormComp -import Messages.OrgFormComp -import Messages.PersonFormComp -import Messages.TagFormComp - - -type alias Texts = - { basics : Messages.Basics.Texts - , tagForm : Messages.TagFormComp.Texts - , personForm : Messages.PersonFormComp.Texts - , orgForm : Messages.OrgFormComp.Texts - , equipmentForm : Messages.EquipmentFormComp.Texts - , customFieldForm : Messages.CustomFieldFormComp.Texts - } - - -gb : Texts -gb = - { basics = Messages.Basics.gb - , tagForm = Messages.TagFormComp.gb - , personForm = Messages.PersonFormComp.gb - , orgForm = Messages.OrgFormComp.gb - , equipmentForm = Messages.EquipmentFormComp.gb - , customFieldForm = Messages.CustomFieldFormComp.gb - } diff --git a/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm b/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm deleted file mode 100644 index 79a5adeb..00000000 --- a/modules/webapp/src/main/elm/Messages/ItemCardListComp.elm +++ /dev/null @@ -1,14 +0,0 @@ -module Messages.ItemCardListComp exposing (..) - -import Messages.ItemCardComp - - -type alias Texts = - { itemCard : Messages.ItemCardComp.Texts - } - - -gb : Texts -gb = - { itemCard = Messages.ItemCardComp.gb - } diff --git a/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm b/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm deleted file mode 100644 index ea1fbda3..00000000 --- a/modules/webapp/src/main/elm/Messages/ItemDetailPage.elm +++ /dev/null @@ -1,26 +0,0 @@ -module Messages.ItemDetailPage exposing (..) - -import Messages.EditFormComp -import Messages.ItemDetailComp - - -type alias Texts = - { itemDetail : Messages.ItemDetailComp.Texts - , editForm : Messages.EditFormComp.Texts - , editMetadata : String - , collapseExpand : String - } - - -gb : Texts -gb = - { itemDetail = Messages.ItemDetailComp.gb - , editForm = Messages.EditFormComp.gb - , editMetadata = "Edit Metadata" - , collapseExpand = "Collapse/Expand" - } - - -de : Texts -de = - gb diff --git a/modules/webapp/src/main/elm/Messages/ManageDataPage.elm b/modules/webapp/src/main/elm/Messages/ManageDataPage.elm deleted file mode 100644 index c416169a..00000000 --- a/modules/webapp/src/main/elm/Messages/ManageDataPage.elm +++ /dev/null @@ -1,49 +0,0 @@ -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 diff --git a/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm b/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm deleted file mode 100644 index 30b8547e..00000000 --- a/modules/webapp/src/main/elm/Messages/NotificationManageComp.elm +++ /dev/null @@ -1,24 +0,0 @@ -module Messages.NotificationManageComp exposing (..) - -import Messages.Basics -import Messages.NotificationFormComp -import Messages.NotificationTableComp - - -type alias Texts = - { basics : Messages.Basics.Texts - , notificationForm : Messages.NotificationFormComp.Texts - , notificationTable : Messages.NotificationTableComp.Texts - , newTask : String - , createNewTask : String - } - - -gb : Texts -gb = - { basics = Messages.Basics.gb - , notificationForm = Messages.NotificationFormComp.gb - , notificationTable = Messages.NotificationTableComp.gb - , newTask = "New Task" - , createNewTask = "Create a new notification task" - } diff --git a/modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm b/modules/webapp/src/main/elm/Messages/Page/CollectiveSettings.elm similarity index 53% rename from modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm rename to modules/webapp/src/main/elm/Messages/Page/CollectiveSettings.elm index 8d05c859..0e254a9f 100644 --- a/modules/webapp/src/main/elm/Messages/CollectiveSettingsPage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/CollectiveSettings.elm @@ -1,16 +1,16 @@ -module Messages.CollectiveSettingsPage exposing (..) +module Messages.Page.CollectiveSettings exposing (..) import Messages.Basics -import Messages.CollectiveSettingsFormComp -import Messages.SourceManageComp -import Messages.UserManageComp +import Messages.Comp.CollectiveSettingsForm +import Messages.Comp.SourceManage +import Messages.Comp.UserManage type alias Texts = { basics : Messages.Basics.Texts - , userManage : Messages.UserManageComp.Texts - , collectiveSettingsForm : Messages.CollectiveSettingsFormComp.Texts - , sourceManage : Messages.SourceManageComp.Texts + , userManage : Messages.Comp.UserManage.Texts + , collectiveSettingsForm : Messages.Comp.CollectiveSettingsForm.Texts + , sourceManage : Messages.Comp.SourceManage.Texts , collectiveSettings : String , insights : String , sources : String @@ -25,9 +25,9 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , userManage = Messages.UserManageComp.gb - , collectiveSettingsForm = Messages.CollectiveSettingsFormComp.gb - , sourceManage = Messages.SourceManageComp.gb + , userManage = Messages.Comp.UserManage.gb + , collectiveSettingsForm = Messages.Comp.CollectiveSettingsForm.gb + , sourceManage = Messages.Comp.SourceManage.gb , collectiveSettings = "Collective Settings" , insights = "Insights" , sources = "Sources" diff --git a/modules/webapp/src/main/elm/Messages/HomePage.elm b/modules/webapp/src/main/elm/Messages/Page/Home.elm similarity index 77% rename from modules/webapp/src/main/elm/Messages/HomePage.elm rename to modules/webapp/src/main/elm/Messages/Page/Home.elm index 575af594..1299926d 100644 --- a/modules/webapp/src/main/elm/Messages/HomePage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/Home.elm @@ -1,16 +1,16 @@ -module Messages.HomePage exposing (..) +module Messages.Page.Home exposing (..) import Messages.Basics -import Messages.HomeSideMenu -import Messages.ItemCardListComp -import Messages.SearchStatsViewComp +import Messages.Comp.ItemCardList +import Messages.Comp.SearchStatsView +import Messages.Page.HomeSideMenu type alias Texts = { basics : Messages.Basics.Texts - , sideMenu : Messages.HomeSideMenu.Texts - , itemCardList : Messages.ItemCardListComp.Texts - , searchStatsView : Messages.SearchStatsViewComp.Texts + , itemCardList : Messages.Comp.ItemCardList.Texts + , searchStatsView : Messages.Comp.SearchStatsView.Texts + , sideMenu : Messages.Page.HomeSideMenu.Texts , contentSearch : String , searchInNames : String , selectModeTitle : String @@ -32,9 +32,9 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , sideMenu = Messages.HomeSideMenu.gb - , itemCardList = Messages.ItemCardListComp.gb - , searchStatsView = Messages.SearchStatsViewComp.gb + , itemCardList = Messages.Comp.ItemCardList.gb + , searchStatsView = Messages.Comp.SearchStatsView.gb + , sideMenu = Messages.Page.HomeSideMenu.gb , contentSearch = "Content search…" , searchInNames = "Search in names…" , selectModeTitle = "Select Mode" diff --git a/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm b/modules/webapp/src/main/elm/Messages/Page/HomeSideMenu.elm similarity index 54% rename from modules/webapp/src/main/elm/Messages/HomeSideMenu.elm rename to modules/webapp/src/main/elm/Messages/Page/HomeSideMenu.elm index 0517f6cf..6701a8cd 100644 --- a/modules/webapp/src/main/elm/Messages/HomeSideMenu.elm +++ b/modules/webapp/src/main/elm/Messages/Page/HomeSideMenu.elm @@ -1,12 +1,12 @@ -module Messages.HomeSideMenu exposing (..) +module Messages.Page.HomeSideMenu exposing (..) -import Messages.MultiEditMenuComp -import Messages.SearchMenuComp +import Messages.Comp.ItemDetail.MultiEditMenu +import Messages.Comp.SearchMenu type alias Texts = - { searchMenu : Messages.SearchMenuComp.Texts - , multiEdit : Messages.MultiEditMenuComp.Texts + { searchMenu : Messages.Comp.SearchMenu.Texts + , multiEdit : Messages.Comp.ItemDetail.MultiEditMenu.Texts , editMode : String , resetSearchForm : String , multiEditHeader : String @@ -17,8 +17,8 @@ type alias Texts = gb : Texts gb = - { searchMenu = Messages.SearchMenuComp.gb - , multiEdit = Messages.MultiEditMenuComp.gb + { searchMenu = Messages.Comp.SearchMenu.gb + , multiEdit = Messages.Comp.ItemDetail.MultiEditMenu.gb , editMode = "Edit Mode" , resetSearchForm = "Reset search form" , multiEditHeader = "Multi-Edit" diff --git a/modules/webapp/src/main/elm/Messages/Page/ItemDetail.elm b/modules/webapp/src/main/elm/Messages/Page/ItemDetail.elm new file mode 100644 index 00000000..5bd48731 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Page/ItemDetail.elm @@ -0,0 +1,26 @@ +module Messages.Page.ItemDetail exposing (..) + +import Messages.Comp.ItemDetail +import Messages.Comp.ItemDetail.EditForm + + +type alias Texts = + { itemDetail : Messages.Comp.ItemDetail.Texts + , editForm : Messages.Comp.ItemDetail.EditForm.Texts + , editMetadata : String + , collapseExpand : String + } + + +gb : Texts +gb = + { itemDetail = Messages.Comp.ItemDetail.gb + , editForm = Messages.Comp.ItemDetail.EditForm.gb + , editMetadata = "Edit Metadata" + , collapseExpand = "Collapse/Expand" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/LoginPage.elm b/modules/webapp/src/main/elm/Messages/Page/Login.elm similarity index 97% rename from modules/webapp/src/main/elm/Messages/LoginPage.elm rename to modules/webapp/src/main/elm/Messages/Page/Login.elm index 94d2b2d5..00322cd9 100644 --- a/modules/webapp/src/main/elm/Messages/LoginPage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/Login.elm @@ -1,4 +1,4 @@ -module Messages.LoginPage exposing +module Messages.Page.Login exposing ( Texts , de , gb diff --git a/modules/webapp/src/main/elm/Messages/Page/ManageData.elm b/modules/webapp/src/main/elm/Messages/Page/ManageData.elm new file mode 100644 index 00000000..b2051ed6 --- /dev/null +++ b/modules/webapp/src/main/elm/Messages/Page/ManageData.elm @@ -0,0 +1,49 @@ +module Messages.Page.ManageData exposing (..) + +import Messages.Basics +import Messages.Comp.CustomFieldManage +import Messages.Comp.EquipmentManage +import Messages.Comp.FolderManage +import Messages.Comp.OrgManage +import Messages.Comp.PersonManage +import Messages.Comp.TagManage + + +type alias Texts = + { basics : Messages.Basics.Texts + , tagManage : Messages.Comp.TagManage.Texts + , equipmentManage : Messages.Comp.EquipmentManage.Texts + , orgManage : Messages.Comp.OrgManage.Texts + , personManage : Messages.Comp.PersonManage.Texts + , folderManage : Messages.Comp.FolderManage.Texts + , customFieldManage : Messages.Comp.CustomFieldManage.Texts + , manageData : String + , equipment : String + , organization : String + , person : String + , folder : String + , customFields : String + } + + +gb : Texts +gb = + { basics = Messages.Basics.gb + , tagManage = Messages.Comp.TagManage.gb + , equipmentManage = Messages.Comp.EquipmentManage.gb + , orgManage = Messages.Comp.OrgManage.gb + , personManage = Messages.Comp.PersonManage.gb + , folderManage = Messages.Comp.FolderManage.gb + , customFieldManage = Messages.Comp.CustomFieldManage.gb + , manageData = "Manage Data" + , equipment = "Equipment" + , organization = "Organization" + , person = "Person" + , folder = "Folder" + , customFields = "Custom Fields" + } + + +de : Texts +de = + gb diff --git a/modules/webapp/src/main/elm/Messages/NewInvitePage.elm b/modules/webapp/src/main/elm/Messages/Page/NewInvite.elm similarity index 94% rename from modules/webapp/src/main/elm/Messages/NewInvitePage.elm rename to modules/webapp/src/main/elm/Messages/Page/NewInvite.elm index 1a8e1eb0..0654c75b 100644 --- a/modules/webapp/src/main/elm/Messages/NewInvitePage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/NewInvite.elm @@ -1,4 +1,4 @@ -module Messages.NewInvitePage exposing (..) +module Messages.Page.NewInvite exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/QueuePage.elm b/modules/webapp/src/main/elm/Messages/Page/Queue.elm similarity index 96% rename from modules/webapp/src/main/elm/Messages/QueuePage.elm rename to modules/webapp/src/main/elm/Messages/Page/Queue.elm index 2d43501d..689eb045 100644 --- a/modules/webapp/src/main/elm/Messages/QueuePage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/Queue.elm @@ -1,4 +1,4 @@ -module Messages.QueuePage exposing (..) +module Messages.Page.Queue exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/RegisterPage.elm b/modules/webapp/src/main/elm/Messages/Page/Register.elm similarity index 95% rename from modules/webapp/src/main/elm/Messages/RegisterPage.elm rename to modules/webapp/src/main/elm/Messages/Page/Register.elm index 6b0dba5f..ac6f3543 100644 --- a/modules/webapp/src/main/elm/Messages/RegisterPage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/Register.elm @@ -1,4 +1,4 @@ -module Messages.RegisterPage exposing (..) +module Messages.Page.Register exposing (..) import Messages.Basics diff --git a/modules/webapp/src/main/elm/Messages/UploadPage.elm b/modules/webapp/src/main/elm/Messages/Page/Upload.elm similarity index 87% rename from modules/webapp/src/main/elm/Messages/UploadPage.elm rename to modules/webapp/src/main/elm/Messages/Page/Upload.elm index 08524567..8effba94 100644 --- a/modules/webapp/src/main/elm/Messages/UploadPage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/Upload.elm @@ -1,14 +1,14 @@ -module Messages.UploadPage exposing (..) +module Messages.Page.Upload exposing (..) import Data.Language exposing (Language) import Messages.Basics -import Messages.DropzoneComp -import Messages.LanguageData +import Messages.Comp.Dropzone +import Messages.Data.Language type alias Texts = { basics : Messages.Basics.Texts - , dropzone : Messages.DropzoneComp.Texts + , dropzone : Messages.Comp.Dropzone.Texts , reset : String , allFilesOneItem : String , skipExistingFiles : String @@ -34,7 +34,7 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , dropzone = Messages.DropzoneComp.gb + , dropzone = Messages.Comp.Dropzone.gb , reset = "Reset" , allFilesOneItem = "All files are one single item" , skipExistingFiles = "Skip files already present in docspell" @@ -57,7 +57,7 @@ gb = , resetLine2 = " to upload more files." } , selectedFiles = "Selected Files" - , languageLabel = Messages.LanguageData.gb + , languageLabel = Messages.Data.Language.gb } diff --git a/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm b/modules/webapp/src/main/elm/Messages/Page/UserSettings.elm similarity index 65% rename from modules/webapp/src/main/elm/Messages/UserSettingsPage.elm rename to modules/webapp/src/main/elm/Messages/Page/UserSettings.elm index ad4d5aea..4b44fc5a 100644 --- a/modules/webapp/src/main/elm/Messages/UserSettingsPage.elm +++ b/modules/webapp/src/main/elm/Messages/Page/UserSettings.elm @@ -1,20 +1,20 @@ -module Messages.UserSettingsPage exposing (..) +module Messages.Page.UserSettings exposing (..) -import Messages.ChangePasswordFormComp -import Messages.EmailSettingsManageComp -import Messages.ImapSettingsManageComp -import Messages.NotificationManageComp -import Messages.ScanMailboxManageComp -import Messages.UiSettingsManageComp +import Messages.Comp.ChangePasswordForm +import Messages.Comp.EmailSettingsManage +import Messages.Comp.ImapSettingsManage +import Messages.Comp.NotificationManage +import Messages.Comp.ScanMailboxManage +import Messages.Comp.UiSettingsManage type alias Texts = - { changePasswordForm : Messages.ChangePasswordFormComp.Texts - , uiSettingsManage : Messages.UiSettingsManageComp.Texts - , emailSettingsManage : Messages.EmailSettingsManageComp.Texts - , imapSettingsManage : Messages.ImapSettingsManageComp.Texts - , notificationManage : Messages.NotificationManageComp.Texts - , scanMailboxManage : Messages.ScanMailboxManageComp.Texts + { changePasswordForm : Messages.Comp.ChangePasswordForm.Texts + , uiSettingsManage : Messages.Comp.UiSettingsManage.Texts + , emailSettingsManage : Messages.Comp.EmailSettingsManage.Texts + , imapSettingsManage : Messages.Comp.ImapSettingsManage.Texts + , notificationManage : Messages.Comp.NotificationManage.Texts + , scanMailboxManage : Messages.Comp.ScanMailboxManage.Texts , userSettings : String , uiSettings : String , notifications : String @@ -32,12 +32,12 @@ type alias Texts = gb : Texts gb = - { changePasswordForm = Messages.ChangePasswordFormComp.gb - , uiSettingsManage = Messages.UiSettingsManageComp.gb - , emailSettingsManage = Messages.EmailSettingsManageComp.gb - , imapSettingsManage = Messages.ImapSettingsManageComp.gb - , notificationManage = Messages.NotificationManageComp.gb - , scanMailboxManage = Messages.ScanMailboxManageComp.gb + { changePasswordForm = Messages.Comp.ChangePasswordForm.gb + , uiSettingsManage = Messages.Comp.UiSettingsManage.gb + , emailSettingsManage = Messages.Comp.EmailSettingsManage.gb + , imapSettingsManage = Messages.Comp.ImapSettingsManage.gb + , notificationManage = Messages.Comp.NotificationManage.gb + , scanMailboxManage = Messages.Comp.ScanMailboxManage.gb , userSettings = "User Settings" , uiSettings = "UI Settings" , notifications = "Notifications" diff --git a/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm b/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm deleted file mode 100644 index 2d0b7c24..00000000 --- a/modules/webapp/src/main/elm/Messages/ScanMailboxManageComp.elm +++ /dev/null @@ -1,24 +0,0 @@ -module Messages.ScanMailboxManageComp exposing (..) - -import Messages.Basics -import Messages.ScanMailboxFormComp -import Messages.ScanMailboxTableComp - - -type alias Texts = - { basics : Messages.Basics.Texts - , form : Messages.ScanMailboxFormComp.Texts - , table : Messages.ScanMailboxTableComp.Texts - , newTask : String - , createNewTask : String - } - - -gb : Texts -gb = - { basics = Messages.Basics.gb - , form = Messages.ScanMailboxFormComp.gb - , table = Messages.ScanMailboxTableComp.gb - , newTask = "New Task" - , createNewTask = "Create a new scan mailbox task" - } diff --git a/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm b/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm index 33c89996..54fecf9c 100644 --- a/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/CollectiveSettings/View2.elm @@ -11,7 +11,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.CollectiveSettingsPage exposing (Texts) +import Messages.Page.CollectiveSettings exposing (Texts) import Page.CollectiveSettings.Data exposing (..) import Styles as S import Util.Maybe diff --git a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm index f09c84e9..79433f0a 100644 --- a/modules/webapp/src/main/elm/Page/Home/SideMenu.elm +++ b/modules/webapp/src/main/elm/Page/Home/SideMenu.elm @@ -9,7 +9,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.HomeSideMenu exposing (Texts) +import Messages.Page.HomeSideMenu exposing (Texts) import Page.Home.Data exposing (..) import Set import Styles as S diff --git a/modules/webapp/src/main/elm/Page/Home/View2.elm b/modules/webapp/src/main/elm/Page/Home/View2.elm index a1e223e4..e31f5545 100644 --- a/modules/webapp/src/main/elm/Page/Home/View2.elm +++ b/modules/webapp/src/main/elm/Page/Home/View2.elm @@ -13,7 +13,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput) -import Messages.HomePage exposing (Texts) +import Messages.Page.Home exposing (Texts) import Page exposing (Page(..)) import Page.Home.Data exposing (..) import Page.Home.SideMenu diff --git a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm index e3d4b3d9..17c61fe6 100644 --- a/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm +++ b/modules/webapp/src/main/elm/Page/ItemDetail/View2.elm @@ -11,7 +11,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.ItemDetailPage exposing (Texts) +import Messages.Page.ItemDetail exposing (Texts) import Page.ItemDetail.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/Login/View2.elm b/modules/webapp/src/main/elm/Page/Login/View2.elm index 1289132c..c3a2d972 100644 --- a/modules/webapp/src/main/elm/Page/Login/View2.elm +++ b/modules/webapp/src/main/elm/Page/Login/View2.elm @@ -6,7 +6,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onInput, onSubmit) -import Messages.LoginPage exposing (Texts) +import Messages.Page.Login exposing (Texts) import Page exposing (Page(..)) import Page.Login.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/ManageData/View2.elm b/modules/webapp/src/main/elm/Page/ManageData/View2.elm index 437f49b7..0749a0ce 100644 --- a/modules/webapp/src/main/elm/Page/ManageData/View2.elm +++ b/modules/webapp/src/main/elm/Page/ManageData/View2.elm @@ -13,7 +13,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.ManageDataPage exposing (Texts) +import Messages.Page.ManageData exposing (Texts) import Page.ManageData.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/NewInvite/View2.elm b/modules/webapp/src/main/elm/Page/NewInvite/View2.elm index f81666e9..5b0368ba 100644 --- a/modules/webapp/src/main/elm/Page/NewInvite/View2.elm +++ b/modules/webapp/src/main/elm/Page/NewInvite/View2.elm @@ -6,7 +6,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput, onSubmit) import Markdown -import Messages.NewInvitePage exposing (Texts) +import Messages.Page.NewInvite exposing (Texts) import Page.NewInvite.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/Queue/View2.elm b/modules/webapp/src/main/elm/Page/Queue/View2.elm index 1fd14053..f1f62704 100644 --- a/modules/webapp/src/main/elm/Page/Queue/View2.elm +++ b/modules/webapp/src/main/elm/Page/Queue/View2.elm @@ -10,7 +10,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import Messages.QueuePage exposing (Texts) +import Messages.Page.Queue exposing (Texts) import Page.Queue.Data exposing (..) import Styles as S import Util.Time exposing (formatDateTime, formatIsoDateTime) diff --git a/modules/webapp/src/main/elm/Page/Register/View2.elm b/modules/webapp/src/main/elm/Page/Register/View2.elm index 9da3a1c2..d71cb3d8 100644 --- a/modules/webapp/src/main/elm/Page/Register/View2.elm +++ b/modules/webapp/src/main/elm/Page/Register/View2.elm @@ -6,7 +6,7 @@ import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick, onInput, onSubmit) -import Messages.RegisterPage exposing (Texts) +import Messages.Page.Register exposing (Texts) import Page exposing (Page(..)) import Page.Register.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/Upload/View2.elm b/modules/webapp/src/main/elm/Page/Upload/View2.elm index 0cc8cb35..7abc6006 100644 --- a/modules/webapp/src/main/elm/Page/Upload/View2.elm +++ b/modules/webapp/src/main/elm/Page/Upload/View2.elm @@ -5,14 +5,13 @@ import Comp.FixedDropdown import Comp.Progress import Data.DropdownStyle as DS import Data.Flags exposing (Flags) -import Data.Language import Data.UiSettings exposing (UiSettings) import Dict import File exposing (File) import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onCheck, onClick) -import Messages.UploadPage exposing (Texts) +import Messages.Page.Upload exposing (Texts) import Page exposing (Page(..)) import Page.Upload.Data exposing (..) import Styles as S diff --git a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm index 0756cbfb..a29a37bf 100644 --- a/modules/webapp/src/main/elm/Page/UserSettings/View2.elm +++ b/modules/webapp/src/main/elm/Page/UserSettings/View2.elm @@ -12,7 +12,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Markdown -import Messages.UserSettingsPage exposing (Texts) +import Messages.Page.UserSettings exposing (Texts) import Page.UserSettings.Data exposing (..) import Styles as S From e063a106630c8a5d7dd0c8546719146ce5f56dba Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 10 Apr 2021 12:40:18 +0200 Subject: [PATCH 22/25] Update tailwind --- package-lock.json | 352 +++++++++++++++++++++++++++++----------------- package.json | 8 +- 2 files changed, 228 insertions(+), 132 deletions(-) diff --git a/package-lock.json b/package-lock.json index 770872b9..b39dbf8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -184,9 +184,9 @@ } }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "binary-extensions": { "version": "2.2.0", @@ -216,15 +216,15 @@ } }, "browserslist": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.1.tgz", - "integrity": "sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA==", + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.3.tgz", + "integrity": "sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==", "requires": { - "caniuse-lite": "^1.0.30001173", + "caniuse-lite": "^1.0.30001181", "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.634", + "electron-to-chromium": "^1.3.649", "escalade": "^3.1.1", - "node-releases": "^1.1.69" + "node-releases": "^1.1.70" } }, "bytes": { @@ -279,9 +279,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001181", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001181.tgz", - "integrity": "sha512-m5ul/ARCX50JB8BSNM+oiPmQrR5UmngaQ3QThTTp5HcIIQGP/nPBs82BYLE+tigzm3VW+F4BJIhUyaVtEweelQ==" + "version": "1.0.30001208", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", + "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==" }, "chalk": { "version": "2.4.2", @@ -361,9 +361,9 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "color-string": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.4.tgz", - "integrity": "sha512-57yF5yt8Xa3czSEW1jfQDE79Idk0+AkN/4KWad6tbdxUmAs3MvjxlWSWD4deYytcRfoZ9nhKyFl1kj5tBvidbw==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz", + "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==", "requires": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -462,12 +462,12 @@ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==" }, "cssnano": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", - "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.11.tgz", + "integrity": "sha512-6gZm2htn7xIPJOHY824ERgj8cNPgPxyCSnkXc4v7YvNW+TdVfzgngHcEhy/8D11kUWRUMbke+tC+AUcUsnMz2g==", "requires": { "cosmiconfig": "^5.0.0", - "cssnano-preset-default": "^4.0.7", + "cssnano-preset-default": "^4.0.8", "is-resolvable": "^1.0.0", "postcss": "^7.0.0" }, @@ -485,9 +485,9 @@ } }, "cssnano-preset-default": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", - "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.8.tgz", + "integrity": "sha512-LdAyHuq+VRyeVREFmuxUZR1TXjQm8QQU/ktoo/x7bz+SdOge1YKc5eMN6pRW7YWBmyq59CqYba1dJ5cUukEjLQ==", "requires": { "css-declaration-sorter": "^4.0.1", "cssnano-util-raw-cache": "^4.0.1", @@ -517,7 +517,7 @@ "postcss-ordered-values": "^4.1.2", "postcss-reduce-initial": "^4.0.3", "postcss-reduce-transforms": "^4.0.2", - "postcss-svgo": "^4.0.2", + "postcss-svgo": "^4.0.3", "postcss-unique-selectors": "^4.0.1" }, "dependencies": { @@ -577,9 +577,9 @@ }, "dependencies": { "css-tree": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", - "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", "requires": { "mdn-data": "2.0.14", "source-map": "^0.6.1" @@ -633,6 +633,11 @@ "path-type": "^4.0.0" } }, + "dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -643,9 +648,9 @@ }, "dependencies": { "domelementtype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", - "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" } } }, @@ -695,24 +700,26 @@ } }, "es-abstract": { - "version": "1.18.0-next.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", - "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", + "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2", + "get-intrinsic": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.1", + "is-regex": "^1.1.2", + "is-string": "^1.0.5", "object-inspect": "^1.9.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.3", - "string.prototype.trimstart": "^1.0.3" + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.0" } }, "es-to-primitive": { @@ -812,9 +819,9 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-intrinsic": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.0.tgz", - "integrity": "sha512-M11rgtQp5GZMZzDL7jLTNxbDfurpzuau5uqRWDPvlHjfvg3TdScAZo96GLvhMjImrmR8uAt0FS2RLoMrfWGKlg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -839,6 +846,38 @@ "path-is-absolute": "^1.0.0" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "glob-parent": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", @@ -873,15 +912,20 @@ "function-bind": "^1.1.1" } }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==" + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" }, "hex-color-regex": { "version": "1.1.0", @@ -898,11 +942,6 @@ "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=" }, - "html-comment-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", - "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" - }, "html-tags": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", @@ -974,6 +1013,11 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, + "is-bigint": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", + "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==" + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -982,10 +1026,18 @@ "binary-extensions": "^2.0.0" } }, + "is-boolean-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", + "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "requires": { + "call-bind": "^1.0.0" + } + }, "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==" }, "is-color-stop": { "version": "1.1.0", @@ -1018,6 +1070,11 @@ "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1046,16 +1103,22 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, + "is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==" + }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", "requires": { + "call-bind": "^1.0.2", "has-symbols": "^1.0.1" } }, @@ -1064,13 +1127,10 @@ "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" }, - "is-svg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", - "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", - "requires": { - "html-comment-regex": "^1.1.0" - } + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" }, "is-symbol": { "version": "1.0.3", @@ -1158,6 +1218,11 @@ "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" }, + "lodash.topath": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", + "integrity": "sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak=" + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -1286,23 +1351,23 @@ } }, "object.getownpropertydescriptors": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz", - "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", + "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==", "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" + "es-abstract": "^1.18.0-next.2" } }, "object.values": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", - "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", + "es-abstract": "^1.18.0-next.2", "has": "^1.0.3" } }, @@ -1329,6 +1394,32 @@ } } }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -1364,12 +1455,12 @@ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" }, "postcss": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.8.tgz", - "integrity": "sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz", + "integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==", "requires": { "colorette": "^1.2.2", - "nanoid": "^3.1.20", + "nanoid": "^3.1.22", "source-map": "^0.6.1" }, "dependencies": { @@ -1638,9 +1729,9 @@ } }, "postcss-import": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.0.0.tgz", - "integrity": "sha512-gFDDzXhqr9ELmnLHgCC3TbGfA6Dm/YMb/UN8/f7Uuq4fL7VTk2vOIj6hwINEwbokEmp123bLD7a5m+E+KIetRg==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.0.1.tgz", + "integrity": "sha512-Xn2+z++vWObbEPhiiKO1a78JiyhqipyrXHBb3AHpv0ks7Cdg+GxQQJ24ODNMTanldf7197gSP3axppO9yaG0lA==", "requires": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", @@ -2233,11 +2324,10 @@ } }, "postcss-svgo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", - "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.3.tgz", + "integrity": "sha512-NoRbrcMWTtUghzuKSoIm6XV+sJdvZ7GZSc3wdBN0W19FTtp2ko8NqLsgoh/m9CzNhU3KLPvQmjIwtaNFkaFTvw==", "requires": { - "is-svg": "^3.0.0", "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0", "svgo": "^1.0.0" @@ -2308,6 +2398,11 @@ "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" + }, "read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -2346,11 +2441,11 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "requires": { - "is-core-module": "^2.1.0", + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -2430,20 +2525,20 @@ } }, "string.prototype.trimend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", - "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3" } }, "string.prototype.trimstart": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", - "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", "requires": { - "call-bind": "^1.0.0", + "call-bind": "^1.0.2", "define-properties": "^1.1.3" } }, @@ -2516,28 +2611,35 @@ } }, "tailwindcss": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.0.4.tgz", - "integrity": "sha512-WhgR0oiBxGOZ9jY0yVfaJCHnckR7U74Fs/BMsYxGdwGJQ5Hd/HlaKD26bEJFZOvYScJo0QcUj2ImldzedsG7Bw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.1.tgz", + "integrity": "sha512-zZ6axGqpSZOCBS7wITm/WNHkBzDt5CIZlDlx0eCVldwTxFPELCVGbgh7Xpb3/kZp3cUxOmK7bZUjqhuMrbN6xQ==", "requires": { "@fullhuman/postcss-purgecss": "^3.1.3", "bytes": "^3.0.0", "chalk": "^4.1.0", + "chokidar": "^3.5.1", "color": "^3.1.3", "detective": "^5.2.0", "didyoumean": "^1.2.1", + "dlv": "^1.1.3", + "fast-glob": "^3.2.5", "fs-extra": "^9.1.0", "html-tags": "^3.1.0", "lodash": "^4.17.21", + "lodash.topath": "^4.5.2", "modern-normalize": "^1.0.0", "node-emoji": "^1.8.1", + "normalize-path": "^3.0.0", "object-hash": "^2.1.1", + "parse-glob": "^3.0.4", "postcss-functions": "^3", "postcss-js": "^3.0.3", - "postcss-nested": "^5.0.5", + "postcss-nested": "5.0.5", "postcss-selector-parser": "^6.0.4", "postcss-value-parser": "^4.1.0", "pretty-hrtime": "^1.0.3", + "quick-lru": "^5.1.1", "reduce-css-calc": "^2.1.8", "resolve": "^1.20.0" }, @@ -2577,15 +2679,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2609,6 +2702,17 @@ "is-number": "^7.0.0" } }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + } + }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -2643,26 +2747,6 @@ "es-abstract": "^1.17.2", "has-symbols": "^1.0.1", "object.getownpropertydescriptors": "^2.1.0" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "vendors": { @@ -2670,6 +2754,18 @@ "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", "integrity": "sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==" }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 2a30eba9..3ea8ba06 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "@fortawesome/fontawesome-free": "^5.15.3", "@tailwindcss/forms": "^0.2.1", "autoprefixer": "^10.2.5", - "cssnano": "^4.1.10", + "cssnano": "^4.1.11", "flag-icon-css": "^3.5.0", - "postcss": "^8.2.8", + "postcss": "^8.2.9", "postcss-cli": "^8.3.1", - "postcss-import": "^14.0.0", - "tailwindcss": "^2.0.4" + "postcss-import": "^14.0.1", + "tailwindcss": "^2.1.1" } } From 92ae22a68d1cdc100b8672f0a0c0774cb57c95b6 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 10 Apr 2021 16:02:34 +0200 Subject: [PATCH 23/25] Externalize more strings missed before --- .../webapp/src/main/elm/Comp/ColorTagger.elm | 8 +++-- .../src/main/elm/Comp/CustomFieldForm.elm | 2 +- .../src/main/elm/Comp/EmailSettingsForm.elm | 2 +- .../src/main/elm/Comp/EmailSettingsTable.elm | 2 +- .../src/main/elm/Comp/EquipmentForm.elm | 12 +++---- .../src/main/elm/Comp/EquipmentTable.elm | 2 +- .../webapp/src/main/elm/Comp/FolderDetail.elm | 2 +- .../webapp/src/main/elm/Comp/FolderTable.elm | 2 +- .../src/main/elm/Comp/ImapSettingsForm.elm | 2 +- .../src/main/elm/Comp/ImapSettingsTable.elm | 2 +- modules/webapp/src/main/elm/Comp/ItemCard.elm | 22 ++++++------- .../src/main/elm/Comp/ItemDetail/EditForm.elm | 22 ++++++------- .../elm/Comp/ItemDetail/ItemInfoHeader.elm | 6 ++-- .../elm/Comp/ItemDetail/MultiEditMenu.elm | 22 ++++++------- modules/webapp/src/main/elm/Comp/OrgForm.elm | 4 +-- modules/webapp/src/main/elm/Comp/OrgTable.elm | 2 +- .../webapp/src/main/elm/Comp/PersonForm.elm | 6 ++-- .../webapp/src/main/elm/Comp/PersonTable.elm | 8 ++--- .../webapp/src/main/elm/Comp/SearchMenu.elm | 20 ++++++------ .../webapp/src/main/elm/Comp/SourceForm.elm | 6 ++-- modules/webapp/src/main/elm/Comp/TagForm.elm | 4 +-- modules/webapp/src/main/elm/Comp/TagTable.elm | 2 +- .../src/main/elm/Comp/UiSettingsForm.elm | 3 +- .../webapp/src/main/elm/Data/Direction.elm | 8 ----- .../webapp/src/main/elm/Data/ItemTemplate.elm | 32 ------------------- .../webapp/src/main/elm/Messages/Basics.elm | 20 ++++++++++++ .../elm/Messages/Comp/CustomFieldForm.elm | 2 -- .../elm/Messages/Comp/EmailSettingsForm.elm | 9 +++--- .../elm/Messages/Comp/EmailSettingsTable.elm | 6 ++-- .../main/elm/Messages/Comp/EquipmentForm.elm | 15 +++++++-- .../main/elm/Messages/Comp/EquipmentTable.elm | 5 +-- .../main/elm/Messages/Comp/FolderDetail.elm | 2 -- .../main/elm/Messages/Comp/FolderTable.elm | 2 -- .../elm/Messages/Comp/ImapSettingsForm.elm | 9 +++--- .../elm/Messages/Comp/ImapSettingsTable.elm | 6 ++-- .../src/main/elm/Messages/Comp/ItemCard.elm | 16 ++++++++-- .../elm/Messages/Comp/ItemDetail/EditForm.elm | 16 ---------- .../Comp/ItemDetail/ItemInfoHeader.elm | 14 ++++---- .../Comp/ItemDetail/MultiEditMenu.elm | 20 ------------ .../src/main/elm/Messages/Comp/OrgForm.elm | 9 +++--- .../src/main/elm/Messages/Comp/OrgTable.elm | 2 -- .../src/main/elm/Messages/Comp/PersonForm.elm | 11 +++---- .../main/elm/Messages/Comp/PersonTable.elm | 4 +-- .../src/main/elm/Messages/Comp/SearchMenu.elm | 18 ----------- .../src/main/elm/Messages/Comp/SourceForm.elm | 4 --- .../src/main/elm/Messages/Comp/TagForm.elm | 10 +++--- .../src/main/elm/Messages/Comp/TagTable.elm | 6 ++-- .../main/elm/Messages/Comp/UiSettingsForm.elm | 29 +++++++++++++++++ .../src/main/elm/Messages/Comp/UserTable.elm | 2 -- .../src/main/elm/Messages/Data/Color.elm | 2 +- .../src/main/elm/Messages/Page/ManageData.elm | 10 ------ .../src/main/elm/Page/ManageData/View2.elm | 20 ++++++------ 52 files changed, 219 insertions(+), 253 deletions(-) diff --git a/modules/webapp/src/main/elm/Comp/ColorTagger.elm b/modules/webapp/src/main/elm/Comp/ColorTagger.elm index d9097abc..3fa42a20 100644 --- a/modules/webapp/src/main/elm/Comp/ColorTagger.elm +++ b/modules/webapp/src/main/elm/Comp/ColorTagger.elm @@ -90,6 +90,7 @@ update msg model = type alias ViewOpts = { renderItem : ( String, Color ) -> Html Msg + , colorLabel : Color -> String , label : String , description : Maybe String } @@ -116,6 +117,7 @@ view2 data opts model = ) , div [ class "field" ] [ chooseColor2 + opts.colorLabel (AddPair data) Data.Color.all Nothing @@ -169,8 +171,8 @@ renderFormData2 opts data = (List.map valueItem values) -chooseColor2 : (Color -> msg) -> List Color -> Maybe String -> Html msg -chooseColor2 tagger colors mtext = +chooseColor2 : (Color -> String) -> (Color -> msg) -> List Color -> Maybe String -> Html msg +chooseColor2 colorLabel tagger colors mtext = let renderLabel color = a @@ -180,7 +182,7 @@ chooseColor2 tagger colors mtext = , onClick (tagger color) ] [ Maybe.withDefault - (Data.Color.toString color) + (colorLabel color) mtext |> text ] diff --git a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm index 30843bf3..ff6f783f 100644 --- a/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Comp/CustomFieldForm.elm @@ -253,7 +253,7 @@ view2 texts viewSettings model = [ class S.inputLabel , for "fieldname" ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm index 83bc04a1..11d2f975 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsForm.elm @@ -190,7 +190,7 @@ view2 texts settings model = [ label [ class S.inputLabel ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input diff --git a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm index 40a39446..44748906 100644 --- a/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/EmailSettingsTable.elm @@ -54,7 +54,7 @@ view2 texts model = [ thead [] [ tr [] [ th [ class "" ] [] - , th [ class "text-left mr-2" ] [ text texts.name ] + , th [ class "text-left mr-2" ] [ text texts.basics.name ] , th [ class "text-left mr-2" ] [ text texts.hostPort ] , th [ class "text-left mr-2 hidden sm:table-cell" ] [ text texts.from ] ] diff --git a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm index 48448844..12764637 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentForm.elm @@ -115,13 +115,13 @@ view2 texts model = [ for "equipname" , class S.inputLabel ] - [ text "Name" + [ text texts.basics.name , B.inputRequired ] , input [ type_ "text" , onInput SetName - , placeholder "Name" + , placeholder texts.basics.name , value model.name , name "equipname" , class S.textInput @@ -137,21 +137,21 @@ view2 texts model = [ label [ class S.inputLabel ] - [ text "Use" ] + [ text texts.use ] , Html.map UseDropdownMsg (Comp.FixedDropdown.viewStyled2 equipUseCfg False (Just model.use) model.useModel) , span [ class "opacity-50 text-sm" ] [ case model.use of Data.EquipmentUse.Concerning -> - text "Use as concerning equipment" + text texts.useAsConcerning Data.EquipmentUse.Disabled -> - text "Do not use for suggestions." + text texts.useNotSuggestions ] ] , div [ class "mb-4" ] [ h3 [ class S.header3 ] - [ text "Notes" + [ text texts.notes ] , div [ class "" ] [ textarea diff --git a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm index be77e921..7162025a 100644 --- a/modules/webapp/src/main/elm/Comp/EquipmentTable.elm +++ b/modules/webapp/src/main/elm/Comp/EquipmentTable.elm @@ -61,7 +61,7 @@ view2 texts model = , th [ class "text-left pr-1 md:px-2 w-20" ] [ text texts.use ] - , th [ class "text-left" ] [ text texts.name ] + , th [ class "text-left" ] [ text texts.basics.name ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Comp/FolderDetail.elm index 1d134020..7c8f4cd8 100644 --- a/modules/webapp/src/main/elm/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Comp/FolderDetail.elm @@ -321,7 +321,7 @@ view2 texts flags model = [ class S.inputLabel , for "folder-name" ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , div [ class "flex flex-row space-x-2" ] diff --git a/modules/webapp/src/main/elm/Comp/FolderTable.elm b/modules/webapp/src/main/elm/Comp/FolderTable.elm index 8b41c823..f598cf71 100644 --- a/modules/webapp/src/main/elm/Comp/FolderTable.elm +++ b/modules/webapp/src/main/elm/Comp/FolderTable.elm @@ -52,7 +52,7 @@ view2 texts _ items = [ tr [] [ th [ class "w-px whitespace-nowrap pr-1 md:pr-3" ] [] , th [ class "text-left" ] - [ text texts.name + [ text texts.basics.name ] , th [ class "text-left hidden sm:table-cell" ] [ text "Owner" ] , th [ class "text-center" ] diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm index cea5546b..3b7b6a73 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsForm.elm @@ -181,7 +181,7 @@ view2 texts settings model = [ class "grid grid-cols-4 gap-y-4 gap-x-2" ] [ div [ class "col-span-4" ] [ label [ class S.inputLabel ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input diff --git a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm index 436b4377..d0070578 100644 --- a/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm +++ b/modules/webapp/src/main/elm/Comp/ImapSettingsTable.elm @@ -54,7 +54,7 @@ view2 texts model = [ thead [] [ tr [] [ th [] [] - , th [ class "text-left mr-2" ] [ text texts.name ] + , th [ class "text-left mr-2" ] [ text texts.basics.name ] , th [ class "text-left mr-2" ] [ text texts.hostPort ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/ItemCard.elm b/modules/webapp/src/main/elm/Comp/ItemCard.elm index 709bdf67..175ef0e6 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCard.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCard.elm @@ -204,7 +204,7 @@ view2 texts cfg settings model item = , metaDataContent2 texts settings item , notesContent2 settings item , fulltextResultsContent2 item - , previewMenu2 settings model item (currentAttachment model item) + , previewMenu2 texts settings model item (currentAttachment model item) , selectedDimmer ] ) @@ -234,7 +234,7 @@ metaDataContent2 texts settings item = [ ( "hidden", fieldHidden Data.Fields.Folder ) ] , class "hover:opacity-60" - , title texts.folder + , title texts.basics.folder ] [ Icons.folderIcon2 "mr-2" , Comp.LinkTarget.makeFolderLink item @@ -311,7 +311,7 @@ mainContent2 texts cardAction cardColor isConfirmed settings _ item = && fieldHidden Data.Fields.CorrPerson ) ] - , title "Correspondent" + , title texts.basics.correspondent ] (Icons.correspondentIcon2 "mr-2 w-4 text-center" :: Comp.LinkTarget.makeCorrLink item [ ( "hover:opacity-75", True ) ] SetLinkTarget @@ -323,7 +323,7 @@ mainContent2 texts cardAction cardColor isConfirmed settings _ item = && fieldHidden Data.Fields.ConcEquip ) ] - , title "Concerning" + , title texts.basics.concerning ] (Icons.concernedIcon2 "mr-2 w-4 text-center" :: Comp.LinkTarget.makeConcLink item [ ( "hover:opacity-75", True ) ] SetLinkTarget @@ -340,7 +340,7 @@ mainContent2 texts cardAction cardColor isConfirmed settings _ item = , ( cardColor, True ) , ( "hidden", isConfirmed ) ] - , title "New" + , title texts.new ] [ i [ class "ml-2 fa fa-exclamation-circle" ] [] ] @@ -440,8 +440,8 @@ previewImage2 settings cardAction model item = ] -previewMenu2 : UiSettings -> Model -> ItemLight -> Maybe AttachmentLight -> Html Msg -previewMenu2 settings model item mainAttach = +previewMenu2 : Texts -> UiSettings -> Model -> ItemLight -> Maybe AttachmentLight -> Html Msg +previewMenu2 texts settings model item mainAttach = let pageCount = Maybe.andThen .pageCount mainAttach @@ -478,7 +478,7 @@ previewMenu2 settings model item mainAttach = ) ] , class "label font-semibold text-sm border-gray-300 dark:border-bluegray-600" - , title ("Due on " ++ dueDate) + , title (texts.dueOn ++ " " ++ dueDate) ] [ Icons.dueDateIcon2 "mr-2" , text (" " ++ dueDate) @@ -490,7 +490,7 @@ previewMenu2 settings model item mainAttach = , class "px-2 py-1 border rounded " , href attachUrl , target "_self" - , title "Open attachment file" + , title texts.openAttachmentFile ] [ i [ class "fa fa-eye" ] [] ] @@ -498,7 +498,7 @@ previewMenu2 settings model item mainAttach = [ class S.secondaryBasicButtonPlain , class "px-2 py-1 border rounded ml-2" , Page.href (ItemDetailPage item.id) - , title "Go to detail view" + , title texts.gotoDetail ] [ i [ class "fa fa-edit" ] [] ] @@ -518,7 +518,7 @@ previewMenu2 settings model item mainAttach = [ a [ class S.secondaryBasicButtonPlain , class "px-2 py-1 border rounded-l block" - , title "Cycle attachments" + , title texts.cycleAttachments , href "#" , onClick (CyclePreview item) ] diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm index bc43f7fe..cae38fcd 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/EditForm.elm @@ -147,7 +147,7 @@ formTabs texts flags settings model = } in [ { name = FTabState.tabName TabName - , title = texts.nameTab + , title = texts.basics.name , titleRight = [] , info = Nothing , body = @@ -174,7 +174,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabDate - , title = texts.dateTab + , title = texts.basics.date , titleRight = [] , info = Nothing , body = @@ -224,7 +224,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabFolder - , title = texts.folderTab + , title = texts.basics.folder , titleRight = [] , info = Nothing , body = @@ -247,7 +247,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabCustomFields - , title = texts.customFieldsTab + , title = texts.basics.customFields , titleRight = [] , info = Nothing , body = @@ -288,7 +288,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabCorrespondent - , title = texts.correspondentTab + , title = texts.basics.correspondent , titleRight = [] , info = Nothing , body = @@ -296,7 +296,7 @@ formTabs texts flags settings model = div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.organizationIcon2 "mr-2" - , text texts.organization + , text texts.basics.organization , addIconLink texts.addNewOrg StartCorrOrgModal , editIconLink texts.editOrg model.corrOrgModel StartEditCorrOrgModal ] @@ -312,7 +312,7 @@ formTabs texts flags settings model = div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.personIcon2 "mr-2" - , text "Person" + , text texts.basics.person , addIconLink texts.addNewCorrespondentPerson StartCorrPersonModal , editIconLink texts.editPerson model.corrPersonModel @@ -338,7 +338,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabConcerning - , title = texts.concerningTab + , title = texts.basics.concerning , titleRight = [] , info = Nothing , body = @@ -346,7 +346,7 @@ formTabs texts flags settings model = div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.personIcon2 "mr-2" - , text "Person" + , text texts.basics.person , addIconLink texts.addNewConcerningPerson StartConcPersonModal , editIconLink texts.editPerson model.concPersonModel @@ -364,7 +364,7 @@ formTabs texts flags settings model = div [ class "mb-4" ] [ label [ class S.inputLabel ] [ Icons.equipmentIcon2 "mr-2" - , text "Equipment" + , text texts.basics.equipment , addIconLink texts.addNewEquipment StartEquipModal , editIconLink texts.editEquipment model.concEquipModel @@ -381,7 +381,7 @@ formTabs texts flags settings model = ] } , { name = FTabState.tabName TabDirection - , title = texts.directionTab + , title = texts.basics.direction , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm index 69016724..08142a41 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/ItemInfoHeader.elm @@ -62,7 +62,7 @@ view texts settings model = corr = ( div [ class itemStyle - , title texts.correspondent + , title texts.basics.correspondent ] (Icons.correspondentIcon2 "mr-2" :: Comp.LinkTarget.makeCorrLink model.item @@ -76,7 +76,7 @@ view texts settings model = conc = ( div [ class itemStyle - , title texts.concerning + , title texts.basics.concerning ] (Icons.concernedIcon2 "mr-2" :: Comp.LinkTarget.makeConcLink model.item @@ -90,7 +90,7 @@ view texts settings model = itemfolder = ( div [ class itemStyle - , title texts.folder + , title texts.basics.folder ] [ Icons.folderIcon2 "mr-2" , Comp.LinkTarget.makeFolderLink model.item diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm index d6972c65..3a8d6279 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/MultiEditMenu.elm @@ -753,7 +753,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabFolder - , title = texts.folderTab + , title = texts.basics.folder , titleRight = [] , info = Nothing , body = @@ -769,7 +769,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabCustomFields - , title = texts.customFieldsTab + , title = texts.basics.customFields , titleRight = [] , info = Nothing , body = @@ -782,7 +782,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabDate - , title = texts.dateTab + , title = texts.basics.date , titleRight = [] , info = Nothing , body = @@ -828,7 +828,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabCorrespondent - , title = texts.correspondentTab + , title = texts.basics.correspondent , titleRight = [] , info = Nothing , body = @@ -837,7 +837,7 @@ renderEditForm2 texts flags cfg settings model = [ label [ class S.inputLabel ] [ Icons.organizationIcon2 "" , span [ class "ml-2" ] - [ text texts.organization + [ text texts.basics.organization ] ] , Html.map OrgDropdownMsg @@ -852,7 +852,7 @@ renderEditForm2 texts flags cfg settings model = [ label [ class S.inputLabel ] [ Icons.personIcon2 "" , span [ class "ml-2" ] - [ text texts.person + [ text texts.basics.person ] ] , Html.map CorrPersonMsg @@ -865,7 +865,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabConcerning - , title = texts.concerningTab + , title = texts.basics.concerning , titleRight = [] , info = Nothing , body = @@ -874,7 +874,7 @@ renderEditForm2 texts flags cfg settings model = [ label [ class S.inputLabel ] [ Icons.personIcon2 "" , span [ class "ml-2" ] - [ text texts.person ] + [ text texts.basics.person ] ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 idNameCfg settings model.concPersonModel) ] @@ -883,7 +883,7 @@ renderEditForm2 texts flags cfg settings model = [ label [ class S.inputLabel ] [ Icons.equipmentIcon2 "" , span [ class "ml-2" ] - [ text texts.equipment ] + [ text texts.basics.equipment ] ] , Html.map ConcEquipMsg (Comp.Dropdown.view2 idNameCfg @@ -894,7 +894,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabDirection - , title = texts.directionTab + , title = texts.basics.direction , titleRight = [] , info = Nothing , body = @@ -902,7 +902,7 @@ renderEditForm2 texts flags cfg settings model = ] } , { name = tabName TabName - , title = texts.nameTab + , title = texts.basics.name , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Comp/OrgForm.elm index 2c77bfe1..63916044 100644 --- a/modules/webapp/src/main/elm/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Comp/OrgForm.elm @@ -168,13 +168,13 @@ view2 texts mobile settings model = [ for "orgname" , class S.inputLabel ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input [ type_ "text" , onInput SetName - , placeholder texts.name + , placeholder texts.basics.name , value model.name , name "orgname" , class S.textInput diff --git a/modules/webapp/src/main/elm/Comp/OrgTable.elm b/modules/webapp/src/main/elm/Comp/OrgTable.elm index 3db5b21c..68e377d4 100644 --- a/modules/webapp/src/main/elm/Comp/OrgTable.elm +++ b/modules/webapp/src/main/elm/Comp/OrgTable.elm @@ -64,7 +64,7 @@ view2 texts model = [ text "Use" ] , th [ class "text-left" ] - [ text texts.name + [ text texts.basics.name ] , th [ class "text-left hidden md:table-cell" ] [ text texts.address diff --git a/modules/webapp/src/main/elm/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Comp/PersonForm.elm index f0006af5..9ada6a32 100644 --- a/modules/webapp/src/main/elm/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Comp/PersonForm.elm @@ -201,13 +201,13 @@ view2 texts mobile settings model = [ class S.inputLabel , for "personname" ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input [ type_ "text" , onInput SetName - , placeholder texts.name + , placeholder texts.basics.name , value model.name , class S.textInput , classList @@ -244,7 +244,7 @@ view2 texts mobile settings model = [ label [ class S.inputLabel ] - [ text texts.organization + [ text texts.basics.organization ] , Html.map OrgDropdownMsg (Comp.Dropdown.view2 diff --git a/modules/webapp/src/main/elm/Comp/PersonTable.elm b/modules/webapp/src/main/elm/Comp/PersonTable.elm index 1e7e14c8..9afb1acb 100644 --- a/modules/webapp/src/main/elm/Comp/PersonTable.elm +++ b/modules/webapp/src/main/elm/Comp/PersonTable.elm @@ -60,11 +60,11 @@ view2 texts model = [ tr [] [ th [ class "w-px whitespace-nowrap" ] [] , th [ class "text-left pr-1 md:px-2" ] - [ text "Use" + [ text texts.use ] - , th [ class "text-left" ] [ text "Name" ] - , th [ class "text-left hidden sm:table-cell" ] [ text "Organization" ] - , th [ class "text-left hidden md:table-cell" ] [ text "Contact" ] + , th [ class "text-left" ] [ text texts.basics.name ] + , th [ class "text-left hidden sm:table-cell" ] [ text texts.basics.organization ] + , th [ class "text-left hidden md:table-cell" ] [ text texts.contact ] ] ] , tbody [] diff --git a/modules/webapp/src/main/elm/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Comp/SearchMenu.elm index 00176bda..b0355286 100644 --- a/modules/webapp/src/main/elm/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Comp/SearchMenu.elm @@ -1223,7 +1223,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabFolder - , title = texts.folderTab + , title = texts.basics.folder , titleRight = [] , info = Nothing , body = @@ -1235,7 +1235,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabCorrespondent - , title = texts.correspondentTab + , title = texts.basics.correspondent , titleRight = [] , info = Nothing , body = @@ -1244,7 +1244,7 @@ searchTabs texts ddd flags settings model = , classList [ ( "hidden", isHidden Data.Fields.CorrOrg ) ] ] [ label [ class S.inputLabel ] - [ text texts.organization ] + [ text texts.basics.organization ] , Html.map OrgMsg (Comp.Dropdown.view2 (Comp.Dropdown.orgFormViewSettings texts.chooseOrganization DS.sidebarStyle) @@ -1256,7 +1256,7 @@ searchTabs texts ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.CorrPerson ) ] ] - [ label [ class S.inputLabel ] [ text texts.person ] + [ label [ class S.inputLabel ] [ text texts.basics.person ] , Html.map CorrPersonMsg (Comp.Dropdown.view2 personCfg @@ -1267,7 +1267,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabConcerning - , title = texts.concerningTab + , title = texts.basics.concerning , titleRight = [] , info = Nothing , body = @@ -1275,7 +1275,7 @@ searchTabs texts ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.ConcPerson ) ] ] - [ label [ class S.inputLabel ] [ text texts.person ] + [ label [ class S.inputLabel ] [ text texts.basics.person ] , Html.map ConcPersonMsg (Comp.Dropdown.view2 personCfg @@ -1287,7 +1287,7 @@ searchTabs texts ddd flags settings model = [ class "mb-4" , classList [ ( "hidden", isHidden Data.Fields.ConcEquip ) ] ] - [ label [ class S.inputLabel ] [ text texts.equipment ] + [ label [ class S.inputLabel ] [ text texts.basics.equipment ] , Html.map ConcEquipmentMsg (Comp.Dropdown.view2 concEquipCfg @@ -1298,7 +1298,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabCustomFields - , title = texts.customFieldsTab + , title = texts.basics.customFields , titleRight = [] , info = Nothing , body = @@ -1316,7 +1316,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabDate - , title = texts.dateTab + , title = texts.basics.date , titleRight = [] , info = Nothing , body = @@ -1418,7 +1418,7 @@ searchTabs texts ddd flags settings model = ] } , { name = tabName TabDirection - , title = texts.directionTab + , title = texts.basics.direction , titleRight = [] , info = Nothing , body = diff --git a/modules/webapp/src/main/elm/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Comp/SourceForm.elm index 76a31b3a..8f402588 100644 --- a/modules/webapp/src/main/elm/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Comp/SourceForm.elm @@ -347,14 +347,14 @@ view2 flags texts settings model = [ for "source-abbrev" , class S.inputLabel ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input [ type_ "text" , id "source-abbrev" , onInput SetAbbrev - , placeholder texts.name + , placeholder texts.basics.name , value model.abbrev , class S.textInput , classList [ ( S.inputErrorBorder, not (isValid model) ) ] @@ -424,7 +424,7 @@ view2 flags texts settings model = ] , div [ class "mb-4" ] [ label [ class S.inputLabel ] - [ text texts.folder + [ text texts.basics.folder ] , Html.map FolderDropdownMsg (Comp.Dropdown.view2 diff --git a/modules/webapp/src/main/elm/Comp/TagForm.elm b/modules/webapp/src/main/elm/Comp/TagForm.elm index af351a9d..c176f862 100644 --- a/modules/webapp/src/main/elm/Comp/TagForm.elm +++ b/modules/webapp/src/main/elm/Comp/TagForm.elm @@ -136,13 +136,13 @@ view2 texts model = [ for "tagname" , class S.inputLabel ] - [ text texts.name + [ text texts.basics.name , B.inputRequired ] , input [ type_ "text" , onInput SetName - , placeholder texts.name + , placeholder texts.basics.name , value model.name , id "tagname" , class S.textInput diff --git a/modules/webapp/src/main/elm/Comp/TagTable.elm b/modules/webapp/src/main/elm/Comp/TagTable.elm index 6a77aaac..3e0ad3ac 100644 --- a/modules/webapp/src/main/elm/Comp/TagTable.elm +++ b/modules/webapp/src/main/elm/Comp/TagTable.elm @@ -57,7 +57,7 @@ view2 texts model = [ thead [] [ tr [] [ th [ class "" ] [] - , th [ class "text-left" ] [ text texts.name ] + , th [ class "text-left" ] [ text texts.basics.name ] , th [ class "text-left" ] [ text texts.category ] ] ] diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index 49eb7973..d7f8c6a0 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -466,6 +466,7 @@ tagColorViewOpts2 texts = \( _, v ) -> span [ class (" label " ++ Data.Color.toString2 v) ] [ text (texts.colorLabel v) ] + , colorLabel = texts.colorLabel , label = texts.chooseTagColorLabel , description = Just texts.tagColorDescription } @@ -626,7 +627,7 @@ settingFormTabs texts flags _ model = , ( "hidden", not model.showPatternHelp ) ] ] - IT.helpMessage + texts.templateHelpMessage ] } , { name = "search-menu" diff --git a/modules/webapp/src/main/elm/Data/Direction.elm b/modules/webapp/src/main/elm/Data/Direction.elm index 648f183f..b7230f6f 100644 --- a/modules/webapp/src/main/elm/Data/Direction.elm +++ b/modules/webapp/src/main/elm/Data/Direction.elm @@ -8,7 +8,6 @@ module Data.Direction exposing , iconFromMaybe2 , iconFromString , iconFromString2 - , labelFromMaybe , toString ) @@ -102,10 +101,3 @@ iconFromMaybe2 : Maybe String -> String iconFromMaybe2 ms = Maybe.map iconFromString2 ms |> Maybe.withDefault unknownIcon2 - - -labelFromMaybe : Maybe String -> String -labelFromMaybe ms = - Maybe.andThen fromString ms - |> Maybe.map toString - |> Maybe.withDefault "Direction" diff --git a/modules/webapp/src/main/elm/Data/ItemTemplate.elm b/modules/webapp/src/main/elm/Data/ItemTemplate.elm index 30fbf43d..8924ad8e 100644 --- a/modules/webapp/src/main/elm/Data/ItemTemplate.elm +++ b/modules/webapp/src/main/elm/Data/ItemTemplate.elm @@ -17,7 +17,6 @@ module Data.ItemTemplate exposing , folder , from , fromMaybe - , helpMessage , isEmpty , literal , map @@ -240,37 +239,6 @@ getName = --- Parse pattern -helpMessage : String -helpMessage = - """ -A pattern allows to customize the title and subtitle of each card. -Variables expressions are enclosed in `{{` and `}}`, other text is -used as-is. The following variables are available: - -- `{{name}}` the item name -- `{{source}}` the source the item was created from -- `{{folder}}` the items folder -- `{{corrOrg}}` the correspondent organization -- `{{corrPerson}}` the correspondent person -- `{{correspondent}}` both organization and person separated by a comma -- `{{concPerson}}` the concerning person -- `{{concEquip}}` the concerning equipment -- `{{concerning}}` both person and equipment separated by a comma -- `{{fileCount}}` the number of attachments of this item -- `{{dateLong}}` the item date as full formatted date -- `{{dateShort}}` the item date as short formatted date (yyyy/mm/dd) -- `{{dueDateLong}}` the item due date as full formatted date -- `{{dueDateShort}}` the item due date as short formatted date (yyyy/mm/dd) -- `{{direction}}` the items direction values as string - -If some variable is not present, an empty string is rendered. You can -combine multiple variables with `|` to use the first non-empty one, -for example `{{corrOrg|corrPerson|-}}` would render the organization -and if that is not present the person. If both are absent a dash `-` -is rendered. -""" - - knownPattern : String -> Maybe ItemTemplate knownPattern str = case str of diff --git a/modules/webapp/src/main/elm/Messages/Basics.elm b/modules/webapp/src/main/elm/Messages/Basics.elm index 3cf515da..9c9616fb 100644 --- a/modules/webapp/src/main/elm/Messages/Basics.elm +++ b/modules/webapp/src/main/elm/Messages/Basics.elm @@ -21,6 +21,16 @@ type alias Texts = , no : String , chooseTag : String , loading : String + , name : String + , organization : String + , person : String + , equipment : String + , folder : String + , date : String + , correspondent : String + , concerning : String + , customFields : String + , direction : String } @@ -45,6 +55,16 @@ gb = , no = "No" , chooseTag = "Choose a tag…" , loading = "Loading…" + , name = "Name" + , organization = "Organization" + , person = "Person" + , equipment = "Equipment" + , folder = "Folder" + , date = "Date" + , correspondent = "Correspondent" + , concerning = "Concerning" + , customFields = "Custom Fields" + , direction = "Direction" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm index 27977ab3..69abed71 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/CustomFieldForm.elm @@ -11,7 +11,6 @@ type alias Texts = , fieldTypeLabel : CustomFieldType -> String , createCustomField : String , modifyTypeWarning : String - , name : String , nameInfo : String , fieldFormat : String , fieldFormatInfo : String @@ -30,7 +29,6 @@ gb = , 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." diff --git a/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm index b9ad0cd7..917d9986 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsForm.elm @@ -1,12 +1,13 @@ module Messages.Comp.EmailSettingsForm exposing (..) import Data.SSLType exposing (SSLType) +import Messages.Basics import Messages.Data.SSLType type alias Texts = - { sslTypeLabel : SSLType -> String - , name : String + { basics : Messages.Basics.Texts + , sslTypeLabel : SSLType -> String , connectionPlaceholder : String , connectionNameInfo : String , smtpHost : String @@ -27,8 +28,8 @@ type alias Texts = gb : Texts gb = - { sslTypeLabel = Messages.Data.SSLType.gb - , name = "Name" + { basics = Messages.Basics.gb + , sslTypeLabel = Messages.Data.SSLType.gb , connectionPlaceholder = "Connection name, e.g. 'gmail.com'" , connectionNameInfo = "The connection name must not contain whitespace or special characters." , smtpHost = "SMTP Host" diff --git a/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm index ca82df7b..a39c11ff 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EmailSettingsTable.elm @@ -1,8 +1,10 @@ module Messages.Comp.EmailSettingsTable exposing (..) +import Messages.Basics + type alias Texts = - { name : String + { basics : Messages.Basics.Texts , hostPort : String , from : String } @@ -10,7 +12,7 @@ type alias Texts = gb : Texts gb = - { name = "Name" + { basics = Messages.Basics.gb , hostPort = "Host/Port" , from = "From" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm b/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm index a7c7d954..779f2fff 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EquipmentForm.elm @@ -1,15 +1,26 @@ module Messages.Comp.EquipmentForm exposing (..) import Data.EquipmentUse exposing (EquipmentUse) +import Messages.Basics import Messages.Data.EquipmentUse type alias Texts = - { equipmentUseLabel : EquipmentUse -> String + { basics : Messages.Basics.Texts + , use : String + , useAsConcerning : String + , useNotSuggestions : String + , equipmentUseLabel : EquipmentUse -> String + , notes : String } gb : Texts gb = - { equipmentUseLabel = Messages.Data.EquipmentUse.gb + { basics = Messages.Basics.gb + , use = "Use" + , useAsConcerning = "Use as concerning equipment" + , useNotSuggestions = "Do not use for suggestions." + , equipmentUseLabel = Messages.Data.EquipmentUse.gb + , notes = "Notes" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm b/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm index 82e64b44..5039e589 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/EquipmentTable.elm @@ -1,11 +1,12 @@ module Messages.Comp.EquipmentTable exposing (..) import Data.EquipmentUse exposing (EquipmentUse) +import Messages.Basics import Messages.Data.EquipmentUse type alias Texts = - { name : String + { basics : Messages.Basics.Texts , use : String , equipmentUseLabel : EquipmentUse -> String } @@ -13,7 +14,7 @@ type alias Texts = gb : Texts gb = - { name = "Name" + { basics = Messages.Basics.gb , use = "Use" , equipmentUseLabel = Messages.Data.EquipmentUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm b/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm index 9b5c1d2d..3c45cb34 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/FolderDetail.elm @@ -9,7 +9,6 @@ type alias Texts = , autoOwnerInfo : String , modifyInfo : String , notOwnerInfo : String - , name : String , members : String , addMember : String , add : String @@ -25,7 +24,6 @@ gb = , 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" diff --git a/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm b/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm index 4982736f..18f404fc 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/FolderTable.elm @@ -5,7 +5,6 @@ import Messages.Basics type alias Texts = { basics : Messages.Basics.Texts - , name : String , memberCount : String } @@ -13,6 +12,5 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , name = "Name" , memberCount = "#Member" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm index 069dfcc2..c5c1f204 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsForm.elm @@ -1,12 +1,13 @@ module Messages.Comp.ImapSettingsForm exposing (..) import Data.SSLType exposing (SSLType) +import Messages.Basics import Messages.Data.SSLType type alias Texts = - { sslTypeLabel : SSLType -> String - , name : String + { basics : Messages.Basics.Texts + , sslTypeLabel : SSLType -> String , connectionNamePlaceholder : String , connectionNameInfo : String , imapHost : String @@ -25,8 +26,8 @@ type alias Texts = gb : Texts gb = - { sslTypeLabel = Messages.Data.SSLType.gb - , name = "Name" + { basics = Messages.Basics.gb + , sslTypeLabel = Messages.Data.SSLType.gb , connectionNamePlaceholder = "Connection name, e.g. 'gmail.com'" , connectionNameInfo = "The connection name must not contain whitespace or special characters." , imapHost = "IMAP Host" diff --git a/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm index f2f4c4ac..2fdef3e0 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ImapSettingsTable.elm @@ -1,14 +1,16 @@ module Messages.Comp.ImapSettingsTable exposing (..) +import Messages.Basics + type alias Texts = - { name : String + { basics : Messages.Basics.Texts , hostPort : String } gb : Texts gb = - { name = "Name" + { basics = Messages.Basics.gb , hostPort = "Host/Port" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm index b5ba78b7..56941360 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemCard.elm @@ -1,12 +1,24 @@ module Messages.Comp.ItemCard exposing (..) +import Messages.Basics + type alias Texts = - { folder : String + { basics : Messages.Basics.Texts + , dueOn : String + , new : String + , openAttachmentFile : String + , gotoDetail : String + , cycleAttachments : String } gb : Texts gb = - { folder = "Folder" + { basics = Messages.Basics.gb + , dueOn = "Due on" + , new = "New" + , openAttachmentFile = "Open attachment file" + , gotoDetail = "Go to detail view" + , cycleAttachments = "Cycle attachments" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm index b215a40c..eefe9be8 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/EditForm.elm @@ -10,25 +10,17 @@ type alias Texts = , createNewCustomField : String , chooseDirection : String , selectPlaceholder : String - , nameTab : String - , dateTab : String - , folderTab : String , folderNotOwnerWarning : String - , customFieldsTab : String , dueDateTab : String - , correspondentTab : String - , organization : String , addNewOrg : String , editOrg : String , chooseOrg : String , addNewCorrespondentPerson : String , editPerson : String , personOrgInfo : String - , concerningTab : String , addNewConcerningPerson : String , addNewEquipment : String , editEquipment : String - , directionTab : String , suggestions : String } @@ -40,29 +32,21 @@ gb = , createNewCustomField = "Create new custom field" , chooseDirection = "Choose a direction…" , selectPlaceholder = "Select…" - , nameTab = "Name" - , dateTab = "Date" - , folderTab = "Folder" , folderNotOwnerWarning = """ You are **not a member** of this folder. This item will be **hidden** from any search now. Use a folder where you are a member of to make this item visible. This message will disappear then. """ - , customFieldsTab = "Custom Fields" , dueDateTab = "Due Date" - , correspondentTab = "Correspondent" - , organization = "Organization" , addNewOrg = "Add new organization" , editOrg = "Edit organization" , chooseOrg = "Choose an organization" , addNewCorrespondentPerson = "Add new correspondent person" , editPerson = "Edit person" , personOrgInfo = "The selected person doesn't belong to the selected organization." - , concerningTab = "Concerning" , addNewConcerningPerson = "Add new concerning person" , addNewEquipment = "Add new equipment" , editEquipment = "Edit equipment" - , directionTab = "Direction" , suggestions = "Suggestions" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm index b330a77d..aef26dae 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/ItemInfoHeader.elm @@ -1,12 +1,12 @@ module Messages.Comp.ItemDetail.ItemInfoHeader exposing (..) +import Messages.Basics + type alias Texts = - { itemDate : String + { basics : Messages.Basics.Texts + , itemDate : String , dueDate : String - , correspondent : String - , concerning : String - , folder : String , source : String , new : String } @@ -14,11 +14,9 @@ type alias Texts = gb : Texts gb = - { itemDate = "Item Date" + { basics = Messages.Basics.gb + , itemDate = "Item Date" , dueDate = "Due Date" - , correspondent = "Correspondent" - , concerning = "Concerning" - , folder = "Folder" , source = "Source" , new = "New" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm index 1f9bf3c1..1ed6d2c2 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/ItemDetail/MultiEditMenu.elm @@ -16,18 +16,8 @@ type alias Texts = , confirm : String , unconfirm : String , changeTagMode : String - , folderTab : String , folderNotOwnerWarning : String - , customFieldsTab : String - , dateTab : String , dueDateTab : String - , correspondentTab : String - , organization : String - , person : String - , concerningTab : String - , equipment : String - , directionTab : String - , nameTab : String } @@ -44,21 +34,11 @@ gb = , confirm = "Confirm" , unconfirm = "Unconfirm" , changeTagMode = "Change tag edit mode" - , folderTab = "Folder" , folderNotOwnerWarning = """ You are **not a member** of this folder. This item will be **hidden** from any search now. Use a folder where you are a member of to make this item visible. This message will disappear then. """ - , customFieldsTab = "Custom Fields" - , dateTab = "Date" , dueDateTab = "Due Date" - , correspondentTab = "Correspondent" - , organization = "Organization" - , person = "Person" - , concerningTab = "Concerning" - , equipment = "Equipment" - , directionTab = "Direction" - , nameTab = "Name" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm b/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm index 13d5241f..b22139d2 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/OrgForm.elm @@ -2,15 +2,16 @@ module Messages.Comp.OrgForm exposing (..) import Data.ContactType exposing (ContactType) import Data.OrgUse exposing (OrgUse) +import Messages.Basics import Messages.Comp.AddressForm import Messages.Data.ContactType import Messages.Data.OrgUse type alias Texts = - { addressForm : Messages.Comp.AddressForm.Texts + { basics : Messages.Basics.Texts + , addressForm : Messages.Comp.AddressForm.Texts , orgUseLabel : OrgUse -> String - , name : String , shortName : String , use : String , useAsCorrespondent : String @@ -24,9 +25,9 @@ type alias Texts = gb : Texts gb = - { addressForm = Messages.Comp.AddressForm.gb + { basics = Messages.Basics.gb + , addressForm = Messages.Comp.AddressForm.gb , orgUseLabel = Messages.Data.OrgUse.gb - , name = "Name" , shortName = "Short Name" , use = "Use" , useAsCorrespondent = "Use as correspondent" diff --git a/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm b/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm index 361c1903..867ff913 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/OrgTable.elm @@ -7,7 +7,6 @@ import Messages.Data.OrgUse type alias Texts = { basics : Messages.Basics.Texts - , name : String , address : String , contact : String , orgUseLabel : OrgUse -> String @@ -17,7 +16,6 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , name = "Name" , address = "Address" , contact = "Contact" , orgUseLabel = Messages.Data.OrgUse.gb diff --git a/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm b/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm index 53cedf43..fcb9bae3 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/PersonForm.elm @@ -2,21 +2,21 @@ module Messages.Comp.PersonForm exposing (..) import Data.ContactType exposing (ContactType) import Data.PersonUse exposing (PersonUse) +import Messages.Basics import Messages.Comp.AddressForm import Messages.Data.ContactType import Messages.Data.PersonUse type alias Texts = - { addressForm : Messages.Comp.AddressForm.Texts + { basics : Messages.Basics.Texts + , addressForm : Messages.Comp.AddressForm.Texts , personUseLabel : PersonUse -> String - , name : String , useOfPerson : String , useAsConcerningOnly : String , useAsCorrespondentOnly : String , useAsBoth : String , dontUseForSuggestions : String - , organization : String , chooseAnOrg : String , address : String , contacts : String @@ -27,15 +27,14 @@ type alias Texts = gb : Texts gb = - { addressForm = Messages.Comp.AddressForm.gb + { basics = Messages.Basics.gb + , addressForm = Messages.Comp.AddressForm.gb , personUseLabel = Messages.Data.PersonUse.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" diff --git a/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm b/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm index 8d10a81d..2e81db34 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/PersonTable.elm @@ -7,9 +7,9 @@ import Messages.Data.PersonUse type alias Texts = { basics : Messages.Basics.Texts - , name : String , address : String , contact : String + , use : String , personUseLabel : PersonUse -> String } @@ -17,8 +17,8 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , name = "Name" , address = "Address" , contact = "Contact" + , use = "Use" , personUseLabel = Messages.Data.PersonUse.gb } diff --git a/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm b/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm index 5eb7f4de..9e693e63 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SearchMenu.elm @@ -21,16 +21,8 @@ type alias Texts = , fulltextSearchInfo : String , nameSearchInfo : String , tagCategoryTab : String - , folderTab : String - , correspondentTab : String - , organization : String , chooseOrganization : String - , person : String - , concerningTab : String - , equipment : String - , customFieldsTab : String , createCustomFieldTitle : String - , dateTab : String , from : String , to : String , dueDateTab : String @@ -38,7 +30,6 @@ type alias Texts = , dueTo : String , sourceTab : String , searchInItemSource : String - , directionTab : String } @@ -59,16 +50,8 @@ gb = , fulltextSearchInfo = "Fulltext search in document contents and notes." , nameSearchInfo = "Looks in correspondents, concerned entities, item name and notes." , tagCategoryTab = "Tag Categories" - , folderTab = "Folder" - , correspondentTab = "Correspondent" - , organization = "Organization" , chooseOrganization = "Choose an organization" - , person = "Person" - , concerningTab = "Concerning" - , equipment = "Equipment" - , customFieldsTab = "Custom Fields" , createCustomFieldTitle = "Create a new custom field" - , dateTab = "Date" , from = "From" , to = "To" , dueDateTab = "Due Date" @@ -76,5 +59,4 @@ gb = , dueTo = "Due To" , sourceTab = "Source" , searchInItemSource = "Search in item source…" - , directionTab = "Direction" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm b/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm index 9aac062c..93e83f98 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/SourceForm.elm @@ -7,14 +7,12 @@ import Messages.Data.Language type alias Texts = { basics : Messages.Basics.Texts - , name : String , description : String , enabled : String , priority : String , priorityInfo : String , metadata : String , metadataInfoText : String - , folder : String , folderInfo : String , folderForbiddenText : String , tagsInfo : String @@ -30,7 +28,6 @@ type alias Texts = gb : Texts gb = { basics = Messages.Basics.gb - , name = "Name" , description = "Description" , enabled = "Enabled" , priority = "Priority" @@ -40,7 +37,6 @@ gb = "Metadata specified here is automatically attached to each item uploaded " ++ "through this source, unless it is overriden in the upload request meta data. " ++ "Tags from the request are added to those defined here." - , folder = "Folder" , folderInfo = "Choose a folder to automatically put items into." , folderForbiddenText = """ diff --git a/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm b/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm index 7893a63f..9e80ed64 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagForm.elm @@ -1,16 +1,18 @@ module Messages.Comp.TagForm exposing (..) +import Messages.Basics + type alias Texts = - { selectDefineCategory : String - , name : String + { basics : Messages.Basics.Texts + , selectDefineCategory : String , category : String } gb : Texts gb = - { selectDefineCategory = "Select or define category..." - , name = "Name" + { basics = Messages.Basics.gb + , selectDefineCategory = "Select or define category..." , category = "Category" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm b/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm index 5e0dc40b..f60dbca3 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/TagTable.elm @@ -1,14 +1,16 @@ module Messages.Comp.TagTable exposing (..) +import Messages.Basics + type alias Texts = - { name : String + { basics : Messages.Basics.Texts , category : String } gb : Texts gb = - { name = "Name" + { basics = Messages.Basics.gb , category = "Category" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm index 920c321f..50991728 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UiSettingsForm.elm @@ -39,6 +39,7 @@ type alias Texts = , fields : String , fieldsInfo : String , fieldLabel : Field -> String + , templateHelpMessage : String } @@ -84,4 +85,32 @@ gb = , fields = "Fields" , fieldsInfo = "Choose which fields to display in search and edit menus." , fieldLabel = Messages.Data.Fields.gb + , templateHelpMessage = + """ +A pattern allows to customize the title and subtitle of each card. +Variables expressions are enclosed in `{{` and `}}`, other text is +used as-is. The following variables are available: + +- `{{name}}` the item name +- `{{source}}` the source the item was created from +- `{{folder}}` the items folder +- `{{corrOrg}}` the correspondent organization +- `{{corrPerson}}` the correspondent person +- `{{correspondent}}` both organization and person separated by a comma +- `{{concPerson}}` the concerning person +- `{{concEquip}}` the concerning equipment +- `{{concerning}}` both person and equipment separated by a comma +- `{{fileCount}}` the number of attachments of this item +- `{{dateLong}}` the item date as full formatted date +- `{{dateShort}}` the item date as short formatted date (yyyy/mm/dd) +- `{{dueDateLong}}` the item due date as full formatted date +- `{{dueDateShort}}` the item due date as short formatted date (yyyy/mm/dd) +- `{{direction}}` the items direction values as string + +If some variable is not present, an empty string is rendered. You can +combine multiple variables with `|` to use the first non-empty one, +for example `{{corrOrg|corrPerson|-}}` would render the organization +and if that is not present the person. If both are absent a dash `-` +is rendered. +""" } diff --git a/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm b/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm index e434e42f..c5729b50 100644 --- a/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm +++ b/modules/webapp/src/main/elm/Messages/Comp/UserTable.elm @@ -10,7 +10,6 @@ type alias Texts = , email : String , logins : String , lastLogin : String - , created : String } @@ -22,5 +21,4 @@ gb = , email = "E-Mail" , logins = "Logins" , lastLogin = "Last Login" - , created = "Created" } diff --git a/modules/webapp/src/main/elm/Messages/Data/Color.elm b/modules/webapp/src/main/elm/Messages/Data/Color.elm index cc516943..560e45fe 100644 --- a/modules/webapp/src/main/elm/Messages/Data/Color.elm +++ b/modules/webapp/src/main/elm/Messages/Data/Color.elm @@ -7,7 +7,7 @@ gb : Color -> String gb color = case color of Red -> - "Rot" + "Red" Orange -> "Orange" diff --git a/modules/webapp/src/main/elm/Messages/Page/ManageData.elm b/modules/webapp/src/main/elm/Messages/Page/ManageData.elm index b2051ed6..93713e1f 100644 --- a/modules/webapp/src/main/elm/Messages/Page/ManageData.elm +++ b/modules/webapp/src/main/elm/Messages/Page/ManageData.elm @@ -18,11 +18,6 @@ type alias Texts = , folderManage : Messages.Comp.FolderManage.Texts , customFieldManage : Messages.Comp.CustomFieldManage.Texts , manageData : String - , equipment : String - , organization : String - , person : String - , folder : String - , customFields : String } @@ -36,11 +31,6 @@ gb = , folderManage = Messages.Comp.FolderManage.gb , customFieldManage = Messages.Comp.CustomFieldManage.gb , manageData = "Manage Data" - , equipment = "Equipment" - , organization = "Organization" - , person = "Person" - , folder = "Folder" - , customFields = "Custom Fields" } diff --git a/modules/webapp/src/main/elm/Page/ManageData/View2.elm b/modules/webapp/src/main/elm/Page/ManageData/View2.elm index 0749a0ce..70ec2102 100644 --- a/modules/webapp/src/main/elm/Page/ManageData/View2.elm +++ b/modules/webapp/src/main/elm/Page/ManageData/View2.elm @@ -53,7 +53,7 @@ viewSidebar texts visible _ settings model = [ Icons.equipmentIcon2 "" , span [ class "ml-3" ] - [ text texts.equipment + [ text texts.basics.equipment ] ] , a @@ -65,7 +65,7 @@ viewSidebar texts visible _ settings model = [ Icons.organizationIcon2 "" , span [ class "ml-3" ] - [ text texts.organization + [ text texts.basics.organization ] ] , a @@ -77,7 +77,7 @@ viewSidebar texts visible _ settings model = [ Icons.personIcon2 "" , span [ class "ml-3" ] - [ text texts.person + [ text texts.basics.person ] ] , a @@ -94,7 +94,7 @@ viewSidebar texts visible _ settings model = [ Icons.folderIcon2 "" , span [ class "ml-3" ] - [ text texts.folder + [ text texts.basics.folder ] ] , a @@ -111,7 +111,7 @@ viewSidebar texts visible _ settings model = [ Icons.customFieldIcon2 "" , span [ class "ml-3" ] - [ text texts.customFields + [ text texts.basics.customFields ] ] ] @@ -184,7 +184,7 @@ viewEquip texts model = ] [ Icons.equipmentIcon2 "" , div [ class "ml-2" ] - [ text texts.equipment + [ text texts.basics.equipment ] ] , Html.map EquipManageMsg @@ -202,7 +202,7 @@ viewOrg texts settings model = ] [ Icons.organizationIcon2 "" , div [ class "ml-2" ] - [ text "Organizations" + [ text texts.basics.organization ] ] , Html.map OrgManageMsg @@ -221,7 +221,7 @@ viewPerson texts settings model = ] [ Icons.personIcon2 "" , div [ class "ml-2" ] - [ text "Person" + [ text texts.basics.person ] ] , Html.map PersonManageMsg @@ -242,7 +242,7 @@ viewFolder texts flags _ model = , div [ class "ml-2" ] - [ text texts.folder + [ text texts.basics.folder ] ] , Html.map FolderMsg @@ -258,7 +258,7 @@ viewCustomFields texts flags _ model = ] [ Icons.customFieldIcon2 "" , div [ class "ml-2" ] - [ text texts.customFields + [ text texts.basics.customFields ] ] , Html.map CustomFieldMsg From e630786104e78e78bde1298d3688aed43a174e0e Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 10 Apr 2021 16:13:49 +0200 Subject: [PATCH 24/25] Move ui language into messages --- modules/webapp/src/main/elm/App/Data.elm | 6 +++--- modules/webapp/src/main/elm/App/View2.elm | 4 ++-- modules/webapp/src/main/elm/Comp/UiSettingsForm.elm | 4 ++-- modules/webapp/src/main/elm/Data/UiSettings.elm | 6 +++--- modules/webapp/src/main/elm/Messages.elm | 6 ++++-- modules/webapp/src/main/elm/{ => Messages}/UiLanguage.elm | 5 ++++- 6 files changed, 18 insertions(+), 13 deletions(-) rename modules/webapp/src/main/elm/{ => Messages}/UiLanguage.elm (58%) diff --git a/modules/webapp/src/main/elm/App/Data.elm b/modules/webapp/src/main/elm/App/Data.elm index 4c3a4c6c..845a9555 100644 --- a/modules/webapp/src/main/elm/App/Data.elm +++ b/modules/webapp/src/main/elm/App/Data.elm @@ -14,6 +14,7 @@ import Data.Flags exposing (Flags) import Data.UiSettings exposing (UiSettings) import Data.UiTheme exposing (UiTheme) import Http +import Messages.UiLanguage exposing (UiLanguage) import Page exposing (Page(..)) import Page.CollectiveSettings.Data import Page.Home.Data @@ -25,7 +26,6 @@ import Page.Queue.Data import Page.Register.Data import Page.Upload.Data import Page.UserSettings.Data -import UiLanguage exposing (UiLanguage) import Url exposing (Url) @@ -101,7 +101,7 @@ init key url flags_ settings = , uiSettings = settings , sidebarVisible = settings.sideMenuVisible , anonymousTheme = Data.UiTheme.Light - , anonymousUiLang = UiLanguage.English + , anonymousUiLang = Messages.UiLanguage.English , langMenuOpen = False } , Cmd.batch @@ -163,7 +163,7 @@ type Msg defaultPage : Flags -> Page -defaultPage flags = +defaultPage _ = HomePage diff --git a/modules/webapp/src/main/elm/App/View2.elm b/modules/webapp/src/main/elm/App/View2.elm index 0cf078cf..c8afa599 100644 --- a/modules/webapp/src/main/elm/App/View2.elm +++ b/modules/webapp/src/main/elm/App/View2.elm @@ -9,6 +9,7 @@ import Html.Attributes exposing (..) import Html.Events exposing (onClick) import Messages exposing (Messages) import Messages.App exposing (Texts) +import Messages.UiLanguage import Page exposing (Page(..)) import Page.CollectiveSettings.View2 as CollectiveSettings import Page.Home.Data @@ -22,7 +23,6 @@ import Page.Register.View2 as Register import Page.Upload.View2 as Upload import Page.UserSettings.View2 as UserSettings import Styles as S -import UiLanguage view : Model -> List (Html Msg) @@ -198,7 +198,7 @@ langMenu model = [ class dropdownMenu , classList [ ( "hidden", not model.langMenuOpen ) ] ] - (List.map langItem UiLanguage.all) + (List.map langItem Messages.UiLanguage.all) ] diff --git a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm index d7f8c6a0..4162917c 100644 --- a/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm +++ b/modules/webapp/src/main/elm/Comp/UiSettingsForm.elm @@ -30,9 +30,9 @@ import Http import Markdown import Messages import Messages.Comp.UiSettingsForm exposing (Texts) +import Messages.UiLanguage exposing (UiLanguage) import Set exposing (Set) import Styles as S -import UiLanguage exposing (UiLanguage) import Util.Maybe import Util.Tag @@ -150,7 +150,7 @@ init flags settings = , powerSearchEnabled = settings.powerSearchEnabled , uiLang = settings.uiLang , uiLangModel = - Comp.FixedDropdown.init UiLanguage.all + Comp.FixedDropdown.init Messages.UiLanguage.all , openTabs = Set.empty } , Api.getTags flags "" GetTagsResp diff --git a/modules/webapp/src/main/elm/Data/UiSettings.elm b/modules/webapp/src/main/elm/Data/UiSettings.elm index 1a69438b..8e1e3cd0 100644 --- a/modules/webapp/src/main/elm/Data/UiSettings.elm +++ b/modules/webapp/src/main/elm/Data/UiSettings.elm @@ -31,7 +31,7 @@ import Dict exposing (Dict) import Html exposing (Attribute) import Html.Attributes as HA import Messages -import UiLanguage exposing (UiLanguage) +import Messages.UiLanguage exposing (UiLanguage) {-| Settings for the web ui. All fields should be optional, since it @@ -167,7 +167,7 @@ defaults = , uiTheme = Data.UiTheme.Light , sideMenuVisible = True , powerSearchEnabled = False - , uiLang = UiLanguage.English + , uiLang = Messages.UiLanguage.English } @@ -222,7 +222,7 @@ merge given fallback = , powerSearchEnabled = given.powerSearchEnabled , uiLang = Maybe.map Messages.fromIso2 given.uiLang - |> Maybe.withDefault UiLanguage.English + |> Maybe.withDefault Messages.UiLanguage.English } diff --git a/modules/webapp/src/main/elm/Messages.elm b/modules/webapp/src/main/elm/Messages.elm index d69c99ba..06857527 100644 --- a/modules/webapp/src/main/elm/Messages.elm +++ b/modules/webapp/src/main/elm/Messages.elm @@ -16,7 +16,7 @@ import Messages.Page.Queue import Messages.Page.Register import Messages.Page.Upload import Messages.Page.UserSettings -import UiLanguage exposing (UiLanguage(..)) +import Messages.UiLanguage exposing (UiLanguage(..)) {-| The messages record contains all strings used in the application. @@ -66,7 +66,7 @@ readIso2 iso = isIso lang = iso == toIso2 lang in - List.filter isIso UiLanguage.all + List.filter isIso Messages.UiLanguage.all |> List.head @@ -81,6 +81,8 @@ fromIso2 iso = --- Messages Definitions +-- for flag icons, see https://github.com/lipis/flag-icon-css +-- use two classes: flag-icon flag-icon-xx where xx is the two-letter country code gb : Messages diff --git a/modules/webapp/src/main/elm/UiLanguage.elm b/modules/webapp/src/main/elm/Messages/UiLanguage.elm similarity index 58% rename from modules/webapp/src/main/elm/UiLanguage.elm rename to modules/webapp/src/main/elm/Messages/UiLanguage.elm index 05a46f61..57446cec 100644 --- a/modules/webapp/src/main/elm/UiLanguage.elm +++ b/modules/webapp/src/main/elm/Messages/UiLanguage.elm @@ -1,8 +1,11 @@ -module UiLanguage exposing +module Messages.UiLanguage exposing ( UiLanguage(..) , all ) +{-| This module defines the languages supported in the web app. +-} + type UiLanguage = English From e1bbc2edf5ef4d2ca5ff99da1709db4ee5a87b33 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sat, 10 Apr 2021 16:31:58 +0200 Subject: [PATCH 25/25] Apply autoformat --- build.sbt | 8 ++++--- .../StanfordTextClassifierSuite.scala | 18 ++++++++------ .../contact/ContactAnnotateSpec.scala | 1 + .../docspell/analysis/date/DateFindSpec.scala | 8 ++++--- .../analysis/nlp/BaseCRFAnnotatorSuite.scala | 5 ++-- .../nlp/StanfordNerAnnotatorSuite.scala | 6 +++-- .../test/scala/docspell/common/GlobTest.scala | 3 ++- .../docspell/common/LenientUriTest.scala | 1 + .../common/MetaProposalListTest.scala | 4 +++- .../docspell/convert/ConversionTest.scala | 6 +++-- .../scala/docspell/convert/FileChecks.scala | 1 + .../convert/extern/ExternConvTest.scala | 4 +++- .../extract/ocr/TextExtractionSuite.scala | 2 ++ .../docspell/extract/odf/OdfExtractTest.scala | 2 ++ .../extract/pdfbox/PdfboxExtractTest.scala | 2 ++ .../extract/pdfbox/PdfboxPreviewTest.scala | 9 ++++--- .../docspell/extract/poi/PoiExtractTest.scala | 2 ++ .../docspell/extract/rtf/RtfExtractTest.scala | 1 + .../scala/docspell/files/ImageSizeTest.scala | 9 +++---- .../test/scala/docspell/files/Playing.scala | 7 +++--- .../test/scala/docspell/files/TestFiles.scala | 4 ++-- .../test/scala/docspell/files/ZipTest.scala | 7 ++++-- .../docspell/joex/analysis/NerFileTest.scala | 6 +++-- .../joex/scheduler/CountingSchemeSpec.scala | 1 + .../docspell/query/FulltextExtractTest.scala | 4 +++- .../query/internal/AttrParserTest.scala | 1 + .../query/internal/BasicParserTest.scala | 4 +++- .../query/internal/DateParserTest.scala | 6 +++-- .../query/internal/ExprParserTest.scala | 6 +++-- .../query/internal/ItemQueryParserTest.scala | 5 ++-- .../query/internal/MacroParserTest.scala | 4 ++-- .../query/internal/OperatorParserTest.scala | 3 ++- .../query/internal/SimpleExprParserTest.scala | 11 +++++---- .../docspell/query/internal/ValueHelper.scala | 3 ++- .../scala/docspell/store/StoreFixture.scala | 6 +++-- .../generator/ItemQueryGeneratorTest.scala | 7 +++--- .../docspell/store/qb/QueryBuilderTest.scala | 5 ++-- .../store/qb/impl/ConditionBuilderTest.scala | 5 ++-- .../docspell/store/qb/impl/DSLTest.scala | 5 ++-- .../store/qb/impl/SelectBuilderTest.scala | 5 ++-- .../store/qb/model/CourseRecord.scala | 1 + .../store/qb/model/PersonRecord.scala | 3 ++- project/Dependencies.scala | 8 +++---- project/ZolaPlugin.scala | 4 ++-- project/plugins.sbt | 24 +++++++++---------- 45 files changed, 151 insertions(+), 86 deletions(-) diff --git a/build.sbt b/build.sbt index 4188df7a..2e43f5c9 100644 --- a/build.sbt +++ b/build.sbt @@ -92,11 +92,11 @@ def webjarSettings(queryJS: Project) = Seq( }.taskValue, Compile / resourceGenerators += Def.task { val logger = streams.value.log - val out = (queryJS/Compile/fullOptJS).value + val out = (queryJS / Compile / fullOptJS).value logger.info(s"Produced query js file: ${out.data}") copyWebjarResources( Seq(out.data), - (Compile/resourceManaged).value, + (Compile / resourceManaged).value, name.value, version.value, logger @@ -218,7 +218,9 @@ val openapiScalaSettings = Seq( field.copy(typeDef = TypeDef("OrgUse", Imports("docspell.common.OrgUse"))) case "equipmentuse" => field => - field.copy(typeDef = TypeDef("EquipmentUse", Imports("docspell.common.EquipmentUse"))) + field.copy(typeDef = + TypeDef("EquipmentUse", Imports("docspell.common.EquipmentUse")) + ) })) ) diff --git a/modules/analysis/src/test/scala/docspell/analysis/classifier/StanfordTextClassifierSuite.scala b/modules/analysis/src/test/scala/docspell/analysis/classifier/StanfordTextClassifierSuite.scala index 1fcf5e81..2e483b2a 100644 --- a/modules/analysis/src/test/scala/docspell/analysis/classifier/StanfordTextClassifierSuite.scala +++ b/modules/analysis/src/test/scala/docspell/analysis/classifier/StanfordTextClassifierSuite.scala @@ -1,14 +1,18 @@ package docspell.analysis.classifier -import munit._ -import cats.effect._ -import scala.concurrent.ExecutionContext import java.nio.file.Paths -import cats.data.NonEmptyList -import docspell.common._ -import fs2.Stream + +import scala.concurrent.ExecutionContext + import cats.data.Kleisli -import TextClassifier.Data +import cats.data.NonEmptyList +import cats.effect._ +import fs2.Stream + +import docspell.analysis.classifier.TextClassifier.Data +import docspell.common._ + +import munit._ class StanfordTextClassifierSuite extends FunSuite { val logger = Logger.log4s[IO](org.log4s.getLogger) diff --git a/modules/analysis/src/test/scala/docspell/analysis/contact/ContactAnnotateSpec.scala b/modules/analysis/src/test/scala/docspell/analysis/contact/ContactAnnotateSpec.scala index 106dad9e..f9f5d9e4 100644 --- a/modules/analysis/src/test/scala/docspell/analysis/contact/ContactAnnotateSpec.scala +++ b/modules/analysis/src/test/scala/docspell/analysis/contact/ContactAnnotateSpec.scala @@ -1,6 +1,7 @@ package docspell.analysis.contact import docspell.common.{NerLabel, NerTag} + import munit._ class ContactAnnotateSpec extends FunSuite { diff --git a/modules/analysis/src/test/scala/docspell/analysis/date/DateFindSpec.scala b/modules/analysis/src/test/scala/docspell/analysis/date/DateFindSpec.scala index 3711434f..6d014868 100644 --- a/modules/analysis/src/test/scala/docspell/analysis/date/DateFindSpec.scala +++ b/modules/analysis/src/test/scala/docspell/analysis/date/DateFindSpec.scala @@ -1,10 +1,12 @@ package docspell.analysis.date -import docspell.files.TestFiles -import munit._ -import docspell.common._ import java.time._ +import docspell.common._ +import docspell.files.TestFiles + +import munit._ + class DateFindSpec extends FunSuite { test("find simple dates") { diff --git a/modules/analysis/src/test/scala/docspell/analysis/nlp/BaseCRFAnnotatorSuite.scala b/modules/analysis/src/test/scala/docspell/analysis/nlp/BaseCRFAnnotatorSuite.scala index 340359e1..e760532f 100644 --- a/modules/analysis/src/test/scala/docspell/analysis/nlp/BaseCRFAnnotatorSuite.scala +++ b/modules/analysis/src/test/scala/docspell/analysis/nlp/BaseCRFAnnotatorSuite.scala @@ -2,9 +2,10 @@ package docspell.analysis.nlp import docspell.analysis.Env import docspell.common.Language.NLPLanguage -import munit._ -import docspell.files.TestFiles import docspell.common._ +import docspell.files.TestFiles + +import munit._ class BaseCRFAnnotatorSuite extends FunSuite { diff --git a/modules/analysis/src/test/scala/docspell/analysis/nlp/StanfordNerAnnotatorSuite.scala b/modules/analysis/src/test/scala/docspell/analysis/nlp/StanfordNerAnnotatorSuite.scala index 46bcb841..4938c45b 100644 --- a/modules/analysis/src/test/scala/docspell/analysis/nlp/StanfordNerAnnotatorSuite.scala +++ b/modules/analysis/src/test/scala/docspell/analysis/nlp/StanfordNerAnnotatorSuite.scala @@ -3,12 +3,14 @@ package docspell.analysis.nlp import java.nio.file.Paths import cats.effect.IO + import docspell.analysis.Env -import munit._ -import docspell.files.TestFiles import docspell.common._ import docspell.common.syntax.FileSyntax._ +import docspell.files.TestFiles + import edu.stanford.nlp.pipeline.StanfordCoreNLP +import munit._ class StanfordNerAnnotatorSuite extends FunSuite { lazy val germanClassifier = diff --git a/modules/common/src/test/scala/docspell/common/GlobTest.scala b/modules/common/src/test/scala/docspell/common/GlobTest.scala index be20b9ba..90408ceb 100644 --- a/modules/common/src/test/scala/docspell/common/GlobTest.scala +++ b/modules/common/src/test/scala/docspell/common/GlobTest.scala @@ -1,7 +1,8 @@ package docspell.common +import docspell.common.Glob._ + import munit._ -import Glob._ class GlobTest extends FunSuite { diff --git a/modules/common/src/test/scala/docspell/common/LenientUriTest.scala b/modules/common/src/test/scala/docspell/common/LenientUriTest.scala index 1d814791..5e3e0c97 100644 --- a/modules/common/src/test/scala/docspell/common/LenientUriTest.scala +++ b/modules/common/src/test/scala/docspell/common/LenientUriTest.scala @@ -1,6 +1,7 @@ package docspell.common import cats.implicits._ + import munit._ class LenientUriTest extends FunSuite { diff --git a/modules/common/src/test/scala/docspell/common/MetaProposalListTest.scala b/modules/common/src/test/scala/docspell/common/MetaProposalListTest.scala index fd705510..fdee5937 100644 --- a/modules/common/src/test/scala/docspell/common/MetaProposalListTest.scala +++ b/modules/common/src/test/scala/docspell/common/MetaProposalListTest.scala @@ -1,9 +1,11 @@ package docspell.common -import munit._ import cats.data.NonEmptyList + import docspell.common.MetaProposal.Candidate +import munit._ + class MetaProposalListTest extends FunSuite { test("flatten retains order of candidates") { diff --git a/modules/convert/src/test/scala/docspell/convert/ConversionTest.scala b/modules/convert/src/test/scala/docspell/convert/ConversionTest.scala index f0ce80a4..8528d25f 100644 --- a/modules/convert/src/test/scala/docspell/convert/ConversionTest.scala +++ b/modules/convert/src/test/scala/docspell/convert/ConversionTest.scala @@ -3,16 +3,18 @@ package docspell.convert import java.nio.file.Paths import cats.data.Kleisli -import cats.implicits._ import cats.effect.IO +import cats.implicits._ import fs2.Stream + import docspell.common._ import docspell.convert.ConversionResult.Handler +import docspell.convert.extern.OcrMyPdfConfig import docspell.convert.extern.{TesseractConfig, UnoconvConfig, WkHtmlPdfConfig} import docspell.convert.flexmark.MarkdownConfig import docspell.files.{ExampleFiles, TestFiles} + import munit._ -import docspell.convert.extern.OcrMyPdfConfig class ConversionTest extends FunSuite with FileChecks { val blocker = TestFiles.blocker diff --git a/modules/convert/src/test/scala/docspell/convert/FileChecks.scala b/modules/convert/src/test/scala/docspell/convert/FileChecks.scala index 0f6f17d8..fe340b6c 100644 --- a/modules/convert/src/test/scala/docspell/convert/FileChecks.scala +++ b/modules/convert/src/test/scala/docspell/convert/FileChecks.scala @@ -6,6 +6,7 @@ import java.nio.file.{Files, Path} import cats.data.Kleisli import cats.effect.IO import fs2.{Pipe, Stream} + import docspell.common.MimeType import docspell.convert.ConversionResult.Handler import docspell.files.TikaMimetype diff --git a/modules/convert/src/test/scala/docspell/convert/extern/ExternConvTest.scala b/modules/convert/src/test/scala/docspell/convert/extern/ExternConvTest.scala index 87cb3d33..305fc2c1 100644 --- a/modules/convert/src/test/scala/docspell/convert/extern/ExternConvTest.scala +++ b/modules/convert/src/test/scala/docspell/convert/extern/ExternConvTest.scala @@ -1,13 +1,15 @@ package docspell.convert.extern +import java.nio.charset.StandardCharsets import java.nio.file.{Path, Paths} import cats.effect._ + import docspell.common._ import docspell.convert._ import docspell.files.{ExampleFiles, TestFiles} + import munit._ -import java.nio.charset.StandardCharsets class ExternConvTest extends FunSuite with FileChecks { val blocker = TestFiles.blocker diff --git a/modules/extract/src/test/scala/docspell/extract/ocr/TextExtractionSuite.scala b/modules/extract/src/test/scala/docspell/extract/ocr/TextExtractionSuite.scala index c880ad6c..c074a02d 100644 --- a/modules/extract/src/test/scala/docspell/extract/ocr/TextExtractionSuite.scala +++ b/modules/extract/src/test/scala/docspell/extract/ocr/TextExtractionSuite.scala @@ -1,8 +1,10 @@ package docspell.extract.ocr import cats.effect.IO + import docspell.common.Logger import docspell.files.TestFiles + import munit._ class TextExtractionSuite extends FunSuite { diff --git a/modules/extract/src/test/scala/docspell/extract/odf/OdfExtractTest.scala b/modules/extract/src/test/scala/docspell/extract/odf/OdfExtractTest.scala index ea1d8a49..7d3a172f 100644 --- a/modules/extract/src/test/scala/docspell/extract/odf/OdfExtractTest.scala +++ b/modules/extract/src/test/scala/docspell/extract/odf/OdfExtractTest.scala @@ -1,7 +1,9 @@ package docspell.extract.odf import cats.effect._ + import docspell.files.{ExampleFiles, TestFiles} + import munit._ class OdfExtractTest extends FunSuite { diff --git a/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxExtractTest.scala b/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxExtractTest.scala index d39ef1c2..fa37ec4a 100644 --- a/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxExtractTest.scala +++ b/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxExtractTest.scala @@ -1,7 +1,9 @@ package docspell.extract.pdfbox import cats.effect._ + import docspell.files.{ExampleFiles, TestFiles} + import munit._ class PdfboxExtractTest extends FunSuite { diff --git a/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxPreviewTest.scala b/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxPreviewTest.scala index f4a1fd9b..d1594de6 100644 --- a/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxPreviewTest.scala +++ b/modules/extract/src/test/scala/docspell/extract/pdfbox/PdfboxPreviewTest.scala @@ -1,11 +1,14 @@ package docspell.extract.pdfbox -import cats.effect._ -import docspell.files.{ExampleFiles, TestFiles} -import munit._ import java.nio.file.Path + +import cats.effect._ import fs2.Stream +import docspell.files.{ExampleFiles, TestFiles} + +import munit._ + class PdfboxPreviewTest extends FunSuite { val blocker = TestFiles.blocker implicit val CS = TestFiles.CS diff --git a/modules/extract/src/test/scala/docspell/extract/poi/PoiExtractTest.scala b/modules/extract/src/test/scala/docspell/extract/poi/PoiExtractTest.scala index d89d2c84..336f54d4 100644 --- a/modules/extract/src/test/scala/docspell/extract/poi/PoiExtractTest.scala +++ b/modules/extract/src/test/scala/docspell/extract/poi/PoiExtractTest.scala @@ -1,8 +1,10 @@ package docspell.extract.poi import cats.effect._ + import docspell.common.MimeTypeHint import docspell.files.{ExampleFiles, TestFiles} + import munit._ class PoiExtractTest extends FunSuite { diff --git a/modules/extract/src/test/scala/docspell/extract/rtf/RtfExtractTest.scala b/modules/extract/src/test/scala/docspell/extract/rtf/RtfExtractTest.scala index 6736c0cd..9f513ba4 100644 --- a/modules/extract/src/test/scala/docspell/extract/rtf/RtfExtractTest.scala +++ b/modules/extract/src/test/scala/docspell/extract/rtf/RtfExtractTest.scala @@ -1,6 +1,7 @@ package docspell.extract.rtf import docspell.files.ExampleFiles + import munit._ class RtfExtractTest extends FunSuite { diff --git a/modules/files/src/test/scala/docspell/files/ImageSizeTest.scala b/modules/files/src/test/scala/docspell/files/ImageSizeTest.scala index 8cbc02c9..e82b0ce2 100644 --- a/modules/files/src/test/scala/docspell/files/ImageSizeTest.scala +++ b/modules/files/src/test/scala/docspell/files/ImageSizeTest.scala @@ -1,12 +1,13 @@ package docspell.files -import cats.implicits._ -import cats.effect.{Blocker, IO} -import munit._ - import scala.concurrent.ExecutionContext import scala.util.Using +import cats.effect.{Blocker, IO} +import cats.implicits._ + +import munit._ + class ImageSizeTest extends FunSuite { val blocker = Blocker.liftExecutionContext(ExecutionContext.global) implicit val CS = IO.contextShift(ExecutionContext.global) diff --git a/modules/files/src/test/scala/docspell/files/Playing.scala b/modules/files/src/test/scala/docspell/files/Playing.scala index 0f4f2423..ecddf526 100644 --- a/modules/files/src/test/scala/docspell/files/Playing.scala +++ b/modules/files/src/test/scala/docspell/files/Playing.scala @@ -1,10 +1,11 @@ package docspell.files -import cats.effect.{Blocker, ExitCode, IO, IOApp} -import docspell.common.MimeTypeHint - import scala.concurrent.ExecutionContext +import cats.effect._ + +import docspell.common.MimeTypeHint + object Playing extends IOApp { val blocker = Blocker.liftExecutionContext(ExecutionContext.global) diff --git a/modules/files/src/test/scala/docspell/files/TestFiles.scala b/modules/files/src/test/scala/docspell/files/TestFiles.scala index b415de1c..283734cf 100644 --- a/modules/files/src/test/scala/docspell/files/TestFiles.scala +++ b/modules/files/src/test/scala/docspell/files/TestFiles.scala @@ -1,10 +1,10 @@ package docspell.files +import scala.concurrent.ExecutionContext + import cats.effect.{Blocker, IO} import fs2.Stream -import scala.concurrent.ExecutionContext - object TestFiles { val blocker = Blocker.liftExecutionContext(ExecutionContext.global) implicit val CS = IO.contextShift(ExecutionContext.global) diff --git a/modules/files/src/test/scala/docspell/files/ZipTest.scala b/modules/files/src/test/scala/docspell/files/ZipTest.scala index 51dbb50a..8ca1e991 100644 --- a/modules/files/src/test/scala/docspell/files/ZipTest.scala +++ b/modules/files/src/test/scala/docspell/files/ZipTest.scala @@ -1,11 +1,14 @@ package docspell.files -import munit._ +import scala.concurrent.ExecutionContext + import cats.effect._ import cats.implicits._ -import scala.concurrent.ExecutionContext + import docspell.common.Glob +import munit._ + class ZipTest extends FunSuite { val blocker = Blocker.liftExecutionContext(ExecutionContext.global) diff --git a/modules/joex/src/test/scala/docspell/joex/analysis/NerFileTest.scala b/modules/joex/src/test/scala/docspell/joex/analysis/NerFileTest.scala index fa8412a4..b5c83f5f 100644 --- a/modules/joex/src/test/scala/docspell/joex/analysis/NerFileTest.scala +++ b/modules/joex/src/test/scala/docspell/joex/analysis/NerFileTest.scala @@ -1,9 +1,11 @@ package docspell.joex.analysis -import munit._ -import NerFile.Pattern import java.{util => ju} +import docspell.joex.analysis.NerFile.Pattern + +import munit._ + class NerFileTest extends FunSuite { test("create valid case insensitive patterns") { diff --git a/modules/joex/src/test/scala/docspell/joex/scheduler/CountingSchemeSpec.scala b/modules/joex/src/test/scala/docspell/joex/scheduler/CountingSchemeSpec.scala index 56a5352d..fca5bff5 100644 --- a/modules/joex/src/test/scala/docspell/joex/scheduler/CountingSchemeSpec.scala +++ b/modules/joex/src/test/scala/docspell/joex/scheduler/CountingSchemeSpec.scala @@ -1,6 +1,7 @@ package docspell.joex.scheduler import docspell.common.Priority + import munit._ class CountingSchemeSpec extends FunSuite { diff --git a/modules/query/shared/src/test/scala/docspell/query/FulltextExtractTest.scala b/modules/query/shared/src/test/scala/docspell/query/FulltextExtractTest.scala index 755ea121..b34ab89c 100644 --- a/modules/query/shared/src/test/scala/docspell/query/FulltextExtractTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/FulltextExtractTest.scala @@ -1,9 +1,11 @@ package docspell.query import cats.implicits._ -import munit._ + import docspell.query.FulltextExtract.Result +import munit._ + class FulltextExtractTest extends FunSuite { def findFts(q: String): Result = { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/AttrParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/AttrParserTest.scala index 34c2270f..9330fc3d 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/AttrParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/AttrParserTest.scala @@ -2,6 +2,7 @@ package docspell.query.internal import docspell.query.ItemQuery.Attr import docspell.query.internal.AttrParser + import munit._ class AttrParserTest extends FunSuite { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/BasicParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/BasicParserTest.scala index e397ce9b..fe185454 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/BasicParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/BasicParserTest.scala @@ -1,9 +1,11 @@ package docspell.query.internal -import munit._ import cats.data.{NonEmptyList => Nel} + import docspell.query.internal.BasicParser +import munit._ + class BasicParserTest extends FunSuite { test("single string values") { val p = BasicParser.singleString diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/DateParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/DateParserTest.scala index ec836ced..3bd1cbca 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/DateParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/DateParserTest.scala @@ -1,9 +1,11 @@ package docspell.query.internal -import munit._ -import docspell.query.Date import java.time.Period +import docspell.query.Date + +import munit._ + class DateParserTest extends FunSuite with ValueHelper { test("local date string") { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/ExprParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/ExprParserTest.scala index 07e14e9b..276ea00d 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/ExprParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/ExprParserTest.scala @@ -1,9 +1,11 @@ package docspell.query.internal -import docspell.query.ItemQuery._ -import munit._ import cats.data.{NonEmptyList => Nel} +import docspell.query.ItemQuery._ + +import munit._ + class ExprParserTest extends FunSuite with ValueHelper { test("simple expr") { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/ItemQueryParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/ItemQueryParserTest.scala index 52e35fc4..1e4b0c3a 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/ItemQueryParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/ItemQueryParserTest.scala @@ -2,9 +2,10 @@ package docspell.query.internal import cats.implicits._ -import munit._ -import docspell.query.ItemQueryParser import docspell.query.ItemQuery +import docspell.query.ItemQueryParser + +import munit._ class ItemQueryParserTest extends FunSuite { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/MacroParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/MacroParserTest.scala index 15855916..8f587fe6 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/MacroParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/MacroParserTest.scala @@ -1,9 +1,9 @@ package docspell.query.internal -import munit._ -//import cats.parse.{Parser => P} import docspell.query.ItemQuery.Expr +import munit._ + class MacroParserTest extends FunSuite { test("recognize names shortcut") { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/OperatorParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/OperatorParserTest.scala index 1a5a8af0..a60aa228 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/OperatorParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/OperatorParserTest.scala @@ -1,9 +1,10 @@ package docspell.query.internal -import munit._ import docspell.query.ItemQuery.{Operator, TagOperator} import docspell.query.internal.OperatorParser +import munit._ + class OperatorParserTest extends FunSuite { test("operator values") { val p = OperatorParser.op diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/SimpleExprParserTest.scala b/modules/query/shared/src/test/scala/docspell/query/internal/SimpleExprParserTest.scala index 35660dfa..58d4fe5b 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/SimpleExprParserTest.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/SimpleExprParserTest.scala @@ -1,11 +1,14 @@ package docspell.query.internal -import cats.data.{NonEmptyList => Nel} -import docspell.query.ItemQuery._ -import munit._ -import docspell.query.Date import java.time.Period +import cats.data.{NonEmptyList => Nel} + +import docspell.query.Date +import docspell.query.ItemQuery._ + +import munit._ + class SimpleExprParserTest extends FunSuite with ValueHelper { test("string expr") { diff --git a/modules/query/shared/src/test/scala/docspell/query/internal/ValueHelper.scala b/modules/query/shared/src/test/scala/docspell/query/internal/ValueHelper.scala index f2729f18..34f22f6d 100644 --- a/modules/query/shared/src/test/scala/docspell/query/internal/ValueHelper.scala +++ b/modules/query/shared/src/test/scala/docspell/query/internal/ValueHelper.scala @@ -1,8 +1,9 @@ package docspell.query.internal +import java.time.Period + import docspell.query.Date import docspell.query.ItemQuery._ -import java.time.Period trait ValueHelper { diff --git a/modules/store/src/test/scala/docspell/store/StoreFixture.scala b/modules/store/src/test/scala/docspell/store/StoreFixture.scala index 35b5ae68..acd59963 100644 --- a/modules/store/src/test/scala/docspell/store/StoreFixture.scala +++ b/modules/store/src/test/scala/docspell/store/StoreFixture.scala @@ -1,13 +1,15 @@ package docspell.store +import scala.concurrent.ExecutionContext + import cats.effect._ + import docspell.common.LenientUri import docspell.store.impl.StoreImpl + import doobie._ import org.h2.jdbcx.JdbcConnectionPool -import scala.concurrent.ExecutionContext - trait StoreFixture { def withStore(db: String)(code: Store[IO] => IO[Unit]): Unit = { //StoreFixture.store(StoreFixture.memoryDB(db)).use(code).unsafeRunSync() diff --git a/modules/store/src/test/scala/docspell/store/generator/ItemQueryGeneratorTest.scala b/modules/store/src/test/scala/docspell/store/generator/ItemQueryGeneratorTest.scala index 74612153..2182cf56 100644 --- a/modules/store/src/test/scala/docspell/store/generator/ItemQueryGeneratorTest.scala +++ b/modules/store/src/test/scala/docspell/store/generator/ItemQueryGeneratorTest.scala @@ -2,13 +2,14 @@ package docspell.store.generator import java.time.LocalDate -import docspell.store.records._ -import munit._ import docspell.common._ import docspell.query.ItemQueryParser -import docspell.store.queries.AttachCountTable import docspell.store.qb.DSL._ import docspell.store.qb.generator.{ItemQueryGenerator, Tables} +import docspell.store.queries.AttachCountTable +import docspell.store.records._ + +import munit._ class ItemQueryGeneratorTest extends FunSuite { import docspell.store.impl.DoobieMeta._ diff --git a/modules/store/src/test/scala/docspell/store/qb/QueryBuilderTest.scala b/modules/store/src/test/scala/docspell/store/qb/QueryBuilderTest.scala index f7d8b990..c355a7cb 100644 --- a/modules/store/src/test/scala/docspell/store/qb/QueryBuilderTest.scala +++ b/modules/store/src/test/scala/docspell/store/qb/QueryBuilderTest.scala @@ -1,8 +1,9 @@ package docspell.store.qb -import munit._ -import docspell.store.qb.model._ import docspell.store.qb.DSL._ +import docspell.store.qb.model._ + +import munit._ class QueryBuilderTest extends FunSuite { diff --git a/modules/store/src/test/scala/docspell/store/qb/impl/ConditionBuilderTest.scala b/modules/store/src/test/scala/docspell/store/qb/impl/ConditionBuilderTest.scala index 0d8bc32f..ebab052c 100644 --- a/modules/store/src/test/scala/docspell/store/qb/impl/ConditionBuilderTest.scala +++ b/modules/store/src/test/scala/docspell/store/qb/impl/ConditionBuilderTest.scala @@ -1,10 +1,11 @@ package docspell.store.qb.impl -import munit._ -import docspell.store.qb._ import docspell.store.qb.DSL._ +import docspell.store.qb._ import docspell.store.qb.model.{CourseRecord, PersonRecord} +import munit._ + class ConditionBuilderTest extends FunSuite { val c = CourseRecord.as("c") diff --git a/modules/store/src/test/scala/docspell/store/qb/impl/DSLTest.scala b/modules/store/src/test/scala/docspell/store/qb/impl/DSLTest.scala index 8a8872d1..e5b0b5be 100644 --- a/modules/store/src/test/scala/docspell/store/qb/impl/DSLTest.scala +++ b/modules/store/src/test/scala/docspell/store/qb/impl/DSLTest.scala @@ -1,10 +1,11 @@ package docspell.store.qb.impl -import munit._ -import docspell.store.qb._ import docspell.store.qb.DSL._ +import docspell.store.qb._ import docspell.store.qb.model.{CourseRecord, PersonRecord} +import munit._ + class DSLTest extends FunSuite { val course = CourseRecord.as("c") diff --git a/modules/store/src/test/scala/docspell/store/qb/impl/SelectBuilderTest.scala b/modules/store/src/test/scala/docspell/store/qb/impl/SelectBuilderTest.scala index 976cf4de..f8b07595 100644 --- a/modules/store/src/test/scala/docspell/store/qb/impl/SelectBuilderTest.scala +++ b/modules/store/src/test/scala/docspell/store/qb/impl/SelectBuilderTest.scala @@ -1,9 +1,10 @@ package docspell.store.qb.impl -import munit._ +import docspell.store.qb.DSL._ import docspell.store.qb._ import docspell.store.qb.model._ -import docspell.store.qb.DSL._ + +import munit._ class SelectBuilderTest extends FunSuite { diff --git a/modules/store/src/test/scala/docspell/store/qb/model/CourseRecord.scala b/modules/store/src/test/scala/docspell/store/qb/model/CourseRecord.scala index 6b53fdfb..31ee4859 100644 --- a/modules/store/src/test/scala/docspell/store/qb/model/CourseRecord.scala +++ b/modules/store/src/test/scala/docspell/store/qb/model/CourseRecord.scala @@ -1,6 +1,7 @@ package docspell.store.qb.model import cats.data.NonEmptyList + import docspell.store.qb._ case class CourseRecord( diff --git a/modules/store/src/test/scala/docspell/store/qb/model/PersonRecord.scala b/modules/store/src/test/scala/docspell/store/qb/model/PersonRecord.scala index 5ea5b653..2080541b 100644 --- a/modules/store/src/test/scala/docspell/store/qb/model/PersonRecord.scala +++ b/modules/store/src/test/scala/docspell/store/qb/model/PersonRecord.scala @@ -1,8 +1,9 @@ package docspell.store.qb.model import cats.data.NonEmptyList -import docspell.store.qb._ + import docspell.common._ +import docspell.store.qb._ case class PersonRecord(id: Long, name: String, created: Timestamp) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 447aa81e..c1862b94 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -272,7 +272,7 @@ object Dependencies { ).map(_ % Test) val munit = Seq( - "org.scalameta" %% "munit" % MUnitVersion, + "org.scalameta" %% "munit" % MUnitVersion, "org.scalameta" %% "munit-scalacheck" % MUnitVersion ) @@ -280,9 +280,9 @@ object Dependencies { val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % BetterMonadicForVersion val webjars = Seq( - "org.webjars" % "swagger-ui" % SwaggerUIVersion, - "org.webjars" % "viewerjs" % ViewerJSVersion, - "org.webjars" % "clipboard.js" % ClipboardJsVersion + "org.webjars" % "swagger-ui" % SwaggerUIVersion, + "org.webjars" % "viewerjs" % ViewerJSVersion, + "org.webjars" % "clipboard.js" % ClipboardJsVersion ) val icu4j = Seq( diff --git a/project/ZolaPlugin.scala b/project/ZolaPlugin.scala index b2a559b5..fab7c076 100644 --- a/project/ZolaPlugin.scala +++ b/project/ZolaPlugin.scala @@ -35,7 +35,7 @@ object ZolaPlugin extends AutoPlugin { zolaBuild := { val logger = streams.value.log logger.info("Building web site using zola ...") - (Compile/resources).value + (Compile / resources).value buildSite(zolaCommand.value, zolaRootDir.value, zolaOutputDir.value, None, logger) logger.info("Website built") }, @@ -43,7 +43,7 @@ object ZolaPlugin extends AutoPlugin { val logger = streams.value.log val baseurl = zolaTestBaseUrl.value logger.info("Building web site (test) using zola ...") - (Compile/resources).value + (Compile / resources).value buildSite( zolaCommand.value, zolaRootDir.value, diff --git a/project/plugins.sbt b/project/plugins.sbt index 20d5d4f8..fa86567b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,13 +1,13 @@ -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.27") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.7.1") -addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") -addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.27") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.7.1") +addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15") +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") +addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") +addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")