From ed0a40d9517757686302307480c09855119bdbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Thu, 2 May 2024 08:41:10 +0200 Subject: [PATCH] [mod] loc --- source/data/localization/deu.loc.json | 6 ++++++ source/data/localization/eng.loc.json | 6 ++++++ source/logic/main.ts | 2 +- source/pages/create/logic.ts | 6 +++++- source/pages/create/structure.html | 4 ++++ source/pages/list/logic.ts | 7 ++++++- source/pages/list/structure.html | 5 ++++- source/pages/login/logic.ts | 10 +++++---- source/pages/login/structure.html | 7 ++----- source/pages/view/logic.ts | 30 +++++++++++++-------------- source/structure/index.html.tpl | 1 + source/style/style.css | 11 +++++++++- 12 files changed, 66 insertions(+), 29 deletions(-) diff --git a/source/data/localization/deu.loc.json b/source/data/localization/deu.loc.json index b557a45..486bdc2 100644 --- a/source/data/localization/deu.loc.json +++ b/source/data/localization/deu.loc.json @@ -4,6 +4,12 @@ }, "tree": { "common.not_used": "nicht verwendet", + "page.login.title": "Anmelden", + "page.login.name": "Name", + "page.login.password": "Passwort", + "page.login.submit": "Anmelden", + "page.create.title": "Mitglied anlegen", + "page.list.title": "Mitglieder-Liste", "page.view.title": "Mitglied", "page.view.form.field.membership_number.label": "Mitgliedsnummer", "page.view.form.field.name_real_value.label": "Echter Name", diff --git a/source/data/localization/eng.loc.json b/source/data/localization/eng.loc.json index bc79a45..8078795 100644 --- a/source/data/localization/eng.loc.json +++ b/source/data/localization/eng.loc.json @@ -4,6 +4,12 @@ }, "tree": { "common.not_used": "not used", + "page.login.title": "Login", + "page.login.name": "name", + "page.login.password": "password", + "page.login.submit": "login", + "page.create.title": "Create member", + "page.list.title": "Member list", "page.view.title": "Member", "page.view.form.field.membership_number.label": "membership number", "page.view.form.field.name_real_value.label": "real name", diff --git a/source/logic/main.ts b/source/logic/main.ts index 9fbc27b..8435c6e 100644 --- a/source/logic/main.ts +++ b/source/logic/main.ts @@ -65,11 +65,11 @@ function setup_nav( entries.forEach( entry => { let dom_li : HTMLElement = document.createElement("li"); + entry.classes.forEach(class_ => {dom_li.classList.add(class_);}); { let dom_a : HTMLElement = document.createElement("a"); dom_a.textContent = entry.label; dom_a.setAttribute("href", lib_plankton.zoo_page.encode(entry.location)); - entry.classes.forEach(class_ => {dom_a.classList.add(class_);}); dom_li.appendChild(dom_a); } dom_ul.appendChild(dom_li); diff --git a/source/pages/create/logic.ts b/source/pages/create/logic.ts index 5d65009..40c5a38 100644 --- a/source/pages/create/logic.ts +++ b/source/pages/create/logic.ts @@ -1,6 +1,10 @@ lib_plankton.zoo_page.register( "create", (parameters, target_element) => { + target_element.appendChild(template_request("create")); + + target_element.querySelector(".create-title").textContent = lib_plankton.translate.get("page.create.title"); + const form = new lib_plankton.zoo_form.class_form< { membership_number : string; @@ -53,6 +57,6 @@ lib_plankton.zoo_page.register( } ] ); - form.setup(target_element as HTMLElement); + form.setup(target_element.querySelector(".create-form") as HTMLElement); } ); diff --git a/source/pages/create/structure.html b/source/pages/create/structure.html index e69de29..ba8ed82 100644 --- a/source/pages/create/structure.html +++ b/source/pages/create/structure.html @@ -0,0 +1,4 @@ + diff --git a/source/pages/list/logic.ts b/source/pages/list/logic.ts index 639a608..e799989 100644 --- a/source/pages/list/logic.ts +++ b/source/pages/list/logic.ts @@ -10,6 +10,11 @@ lib_plankton.zoo_page.register( }; }; const term : (null | string) = (parameters["term"] ?? ""); + + target_element.appendChild(template_request("list")); + + target_element.querySelector(".list-title").textContent = lib_plankton.translate.get("page.list.title"); + const search : lib_plankton.zoo_search.type_search = lib_plankton.zoo_search.make( (term) => _espe.backend.member_list(term), { @@ -57,7 +62,7 @@ lib_plankton.zoo_page.register( ); lib_plankton.zoo_search.render( search, - target_element, + target_element.querySelector(".list-search"), { "state": { "term": term, diff --git a/source/pages/list/structure.html b/source/pages/list/structure.html index 8b13789..bbfaab8 100644 --- a/source/pages/list/structure.html +++ b/source/pages/list/structure.html @@ -1 +1,4 @@ - + diff --git a/source/pages/login/logic.ts b/source/pages/login/logic.ts index 1ee326d..f37edfa 100644 --- a/source/pages/login/logic.ts +++ b/source/pages/login/logic.ts @@ -2,6 +2,8 @@ lib_plankton.zoo_page.register( "login", (parameters, target_element) => { target_element.appendChild(template_request("login")); + + target_element.querySelector(".login-title").textContent = lib_plankton.translate.get("page.login.title"); const form = new lib_plankton.zoo_form.class_form< { @@ -20,18 +22,18 @@ lib_plankton.zoo_page.register( { "name": "name", "input": new lib_plankton.zoo_input.class_input_text(), - "label": "Name", + "label": lib_plankton.translate.get("page.login.name"), }, { "name": "password", "input": new lib_plankton.zoo_input.class_input_password(), - "label": "Passwort", + "label": lib_plankton.translate.get("page.login.password"), }, ] ), [ { - "label": "Anmelden", + "label": lib_plankton.translate.get("page.login.submit"), "procedure": async (get_value, get_representation) => { const value = await get_value(); ( @@ -57,6 +59,6 @@ lib_plankton.zoo_page.register( } ] ); - form.setup(target_element.querySelector(".login-form") as HTMLElement); + form.setup(target_element.querySelector(".login-form") as HTMLElement); } ); diff --git a/source/pages/login/structure.html b/source/pages/login/structure.html index b3f019f..92619ad 100644 --- a/source/pages/login/structure.html +++ b/source/pages/login/structure.html @@ -1,7 +1,4 @@ diff --git a/source/pages/view/logic.ts b/source/pages/view/logic.ts index c6e5b38..e2f347d 100644 --- a/source/pages/view/logic.ts +++ b/source/pages/view/logic.ts @@ -43,11 +43,6 @@ lib_plankton.zoo_page.register( representation => representation, new lib_plankton.zoo_input.class_input_group( [ - { - "name": "membership_number", - "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), - "label": lib_plankton.translate.get("page.view.form.field.membership_number.label"), - }, { "name": "name_real_value", "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), @@ -58,6 +53,11 @@ lib_plankton.zoo_page.register( "input": new lib_plankton.zoo_input.class_input_number({"read_only": true}), "label": lib_plankton.translate.get("page.view.form.field.name_real_index.label"), }, + { + "name": "membership_number", + "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), + "label": lib_plankton.translate.get("page.view.form.field.membership_number.label"), + }, { "name": "enabled", "input": new lib_plankton.zoo_input.class_input_checkbox(), @@ -68,6 +68,16 @@ lib_plankton.zoo_page.register( "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), "label": lib_plankton.translate.get("page.view.form.field.registered.label"), }, + { + "name": "name_login", + "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), + "label": lib_plankton.translate.get("page.view.form.field.name_login.label"), + }, + { + "name": "password_set", + "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), + "label": lib_plankton.translate.get("page.view.form.field.password_set.label"), + }, { "name": "email_address_private", "input": new lib_plankton.zoo_input.class_input_text(), @@ -93,16 +103,6 @@ lib_plankton.zoo_page.register( "input": new lib_plankton.zoo_input.class_input_checkbox(), "label": lib_plankton.translate.get("page.view.form.field.email_allow_sending.label"), }, - { - "name": "name_login", - "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), - "label": lib_plankton.translate.get("page.view.form.field.name_login.label"), - }, - { - "name": "password_set", - "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), - "label": lib_plankton.translate.get("page.view.form.field.password_set.label"), - }, ] ), ( diff --git a/source/structure/index.html.tpl b/source/structure/index.html.tpl index 5496c09..332f891 100644 --- a/source/structure/index.html.tpl +++ b/source/structure/index.html.tpl @@ -18,6 +18,7 @@
+
diff --git a/source/style/style.css b/source/style/style.css index abd6712..af3b148 100644 --- a/source/style/style.css +++ b/source/style/style.css @@ -63,7 +63,9 @@ input[type="password"] border: 1px solid hsl(var(--hue), 0%, 50%); - min-width: 320px; + min-width: 300px; + + font-size: 1.125em; } input[type="text"]:not([disabled="disabled"]) @@ -96,8 +98,10 @@ input[type="password"][disabled="disabled"] nav { + /* border-bottom: 1px solid hsl(var(--hue), 0%, 100%); margin-bottom: 16px; + */ } nav > ul @@ -211,3 +215,8 @@ nav > ul > li:hover::after { margin-left: 16px; } + +.plankton_search_item +{ + margin-bottom: 8px; +}