From b312629b4bf08d3baa9ee9301eb133edf57767c8 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:04:04 +0200 Subject: [PATCH 1/9] fix: responsiveness of address and contact list --- .../frappe/form/templates/address_list.html | 23 +++++++++++-------- .../frappe/form/templates/contact_list.html | 14 +++++------ frappe/public/scss/common/controls.scss | 6 +++++ 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/frappe/public/js/frappe/form/templates/address_list.html b/frappe/public/js/frappe/form/templates/address_list.html index 0e533ed2ea..e67bb26fd3 100644 --- a/frappe/public/js/frappe/form/templates/address_list.html +++ b/frappe/public/js/frappe/form/templates/address_list.html @@ -1,19 +1,22 @@
{% for(var i=0, l=addr_list.length; i- {%= i+1 %}. {%= addr_list[i].address_title %}{% if(addr_list[i].address_type!="Other") { %} - ({%= __(addr_list[i].address_type) %}){% } %} + + {%= __("Edit") %} +
+ {%= i+1 %}. {%= addr_list[i].address_title %} + {% if(addr_list[i].address_type!="Other") { %} + · {%= __(addr_list[i].address_type) %} + {% } %} {% if(addr_list[i].is_primary_address) { %} - ({%= __("Primary") %}){% } %} + · {%= __("Primary") %} + {% } %} {% if(addr_list[i].is_shipping_address) { %} - ({%= __("Shipping") %}){% } %} + · {%= __("Shipping") %} + {% } %} {% if(addr_list[i].disabled) { %} - ({%= __("Disabled") %}){% } %} - - - {%= __("Edit") %} + · {%= __("Disabled") %} + {% } %}
{%= addr_list[i].display %}
diff --git a/frappe/public/js/frappe/form/templates/contact_list.html b/frappe/public/js/frappe/form/templates/contact_list.html index c4cc08a549..874d67d7b7 100644 --- a/frappe/public/js/frappe/form/templates/contact_list.html +++ b/frappe/public/js/frappe/form/templates/contact_list.html @@ -1,18 +1,18 @@ {% for(const contact of contact_list) { %}{%= contact.first_name %} {%= contact.last_name %} {% if(contact.is_primary_contact) { %} - ({%= __("Primary") %}) + · {%= __("Primary Contact") %} {% } %} {% if(contact.designation){ %} - – {%= contact.designation %} + · {%= contact.designation %} {% } %} - - {%= __("Edit") %} -
{% if (contact.phone || contact.mobile_no || contact.phone_nos.length > 0) { %}diff --git a/frappe/public/scss/common/controls.scss b/frappe/public/scss/common/controls.scss index 9fe5f82a35..676bf22aa2 100644 --- a/frappe/public/scss/common/controls.scss +++ b/frappe/public/scss/common/controls.scss @@ -149,9 +149,15 @@ select.form-control { border-radius: var(--border-radius); font-size: var(--text-sm); word-wrap: break-word; + position: relative; p:last-child { margin-bottom: 0; } + .edit-btn { + position: absolute; + top: 5px; + right: 5px; + } } .action-btn { position: absolute; From 3ca1bb0ea0085660fbfe1085eeb24f8d299795c8 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:43:18 +0200 Subject: [PATCH 2/9] feat: edit icon instead of text --- .../public/js/frappe/form/templates/address_list.html | 11 +++++++++-- .../public/js/frappe/form/templates/contact_list.html | 11 ++++++++--- frappe/public/scss/common/controls.scss | 4 ++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/form/templates/address_list.html b/frappe/public/js/frappe/form/templates/address_list.html index e67bb26fd3..a5cfb3de8d 100644 --- a/frappe/public/js/frappe/form/templates/address_list.html +++ b/frappe/public/js/frappe/form/templates/address_list.html @@ -1,8 +1,15 @@
{% for(var i=0, l=addr_list.length; i{%= i+1 %}. {%= addr_list[i].address_title %} {% if(addr_list[i].address_type!="Other") { %} diff --git a/frappe/public/js/frappe/form/templates/contact_list.html b/frappe/public/js/frappe/form/templates/contact_list.html index 874d67d7b7..7713b31d46 100644 --- a/frappe/public/js/frappe/form/templates/contact_list.html +++ b/frappe/public/js/frappe/form/templates/contact_list.html @@ -1,9 +1,14 @@
{% for(const contact of contact_list) { %}{%= contact.first_name %} {%= contact.last_name %} diff --git a/frappe/public/scss/common/controls.scss b/frappe/public/scss/common/controls.scss index 676bf22aa2..77e104098d 100644 --- a/frappe/public/scss/common/controls.scss +++ b/frappe/public/scss/common/controls.scss @@ -157,6 +157,10 @@ select.form-control { position: absolute; top: 5px; right: 5px; + display: flex; + justify-content: center; + align-items: center; + padding: var(--padding-sm); } } .action-btn { From 9511b5a6c577b522db7020c73da4093dba2daf5c Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:56:00 +0200 Subject: [PATCH 3/9] fix: spacing in address and contact list --- .../public/js/frappe/form/templates/address_list.html | 10 +++++----- .../public/js/frappe/form/templates/contact_list.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frappe/public/js/frappe/form/templates/address_list.html b/frappe/public/js/frappe/form/templates/address_list.html index a5cfb3de8d..c0054a2af6 100644 --- a/frappe/public/js/frappe/form/templates/address_list.html +++ b/frappe/public/js/frappe/form/templates/address_list.html @@ -11,18 +11,18 @@
- {%= i+1 %}. {%= addr_list[i].address_title %} + {%= i+1 %}. {%= addr_list[i].address_title %} {% if(addr_list[i].address_type!="Other") { %} - · {%= __(addr_list[i].address_type) %} + · {%= __(addr_list[i].address_type) %} {% } %} {% if(addr_list[i].is_primary_address) { %} - · {%= __("Primary") %} + · {%= __("Primary") %} {% } %} {% if(addr_list[i].is_shipping_address) { %} - · {%= __("Shipping") %} + · {%= __("Shipping") %} {% } %} {% if(addr_list[i].disabled) { %} - · {%= __("Disabled") %} + · {%= __("Disabled") %} {% } %}
{%= addr_list[i].display %}
diff --git a/frappe/public/js/frappe/form/templates/contact_list.html b/frappe/public/js/frappe/form/templates/contact_list.html index 7713b31d46..841dd9da28 100644 --- a/frappe/public/js/frappe/form/templates/contact_list.html +++ b/frappe/public/js/frappe/form/templates/contact_list.html @@ -11,12 +11,12 @@- {%= contact.first_name %} {%= contact.last_name %} + {%= contact.first_name %} {%= contact.last_name %} {% if(contact.is_primary_contact) { %} - · {%= __("Primary Contact") %} + · {%= __("Primary Contact") %} {% } %} {% if(contact.designation){ %} - · {%= contact.designation %} + · {%= contact.designation %} {% } %}
{% if (contact.phone || contact.mobile_no || contact.phone_nos.length > 0) { %} From 740f4165723eb190c9658d4de111507299dd2e26 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:32:30 +0200 Subject: [PATCH 4/9] refactor: use `frappe.utils.get_form_link` --- frappe/public/js/frappe/form/templates/address_list.html | 2 +- frappe/public/js/frappe/form/templates/contact_list.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/templates/address_list.html b/frappe/public/js/frappe/form/templates/address_list.html index c0054a2af6..596dfe65f6 100644 --- a/frappe/public/js/frappe/form/templates/address_list.html +++ b/frappe/public/js/frappe/form/templates/address_list.html @@ -2,7 +2,7 @@ {% for(var i=0, l=addr_list.length; i- {%= i+1 %}. {%= addr_list[i].address_title %} - {% if(addr_list[i].address_type!="Other") { %} - · {%= __(addr_list[i].address_type) %} + {%= addr.address_title %} + {% if(addr.address_type!="Other") { %} + · {%= __(addr.address_type) %} {% } %} - {% if(addr_list[i].is_primary_address) { %} + {% if(addr.is_primary_address) { %} · {%= __("Primary") %} {% } %} - {% if(addr_list[i].is_shipping_address) { %} + {% if(addr.is_shipping_address) { %} · {%= __("Shipping") %} {% } %} - {% if(addr_list[i].disabled) { %} + {% if(addr.disabled) { %} · {%= __("Disabled") %} {% } %}
-{%= addr_list[i].display %}
+{%= addr.display %}
- {%= addr.address_title %} - {% if(addr.address_type!="Other") { %} - · {%= __(addr.address_type) %} - {% } %} - {% if(addr.is_primary_address) { %} - · {%= __("Primary") %} - {% } %} - {% if(addr.is_shipping_address) { %} - · {%= __("Shipping") %} - {% } %} - {% if(addr.disabled) { %} - · {%= __("Disabled") %} - {% } %} -
-{%= addr.display %}
-+ {%= addr.address_title %} + {% if (addr.address_type !== "Other") { %} + · + {%= __(addr.address_type) %} + {% } %} + {% if (addr.is_primary_address) { %} + · + {%= __("Primary") %} + {% } %} + {% if (addr.is_shipping_address) { %} + · + {%= __("Shipping") %} + {% } %} + {% if (addr.disabled) { %} + · + {%= __("Disabled") %} + {% } %} +
+{%= addr.display %}
+{%= __("No address added yet.") %}
+ +{% if (!addr_list.length) { %} +{%= __("No address added yet.") %}
{% } %} - \ No newline at end of file + ++ +
diff --git a/frappe/public/js/frappe/form/templates/contact_list.html b/frappe/public/js/frappe/form/templates/contact_list.html index f293f1f35e..a581c4a66a 100644 --- a/frappe/public/js/frappe/form/templates/contact_list.html +++ b/frappe/public/js/frappe/form/templates/contact_list.html @@ -1,5 +1,5 @@ -{% for(const contact of contact_list) { %} +{% for (const contact of contact_list) { %}{%= contact.first_name %} {%= contact.last_name %} - {% if(contact.is_primary_contact) { %} - · {%= __("Primary Contact") %} + {% if (contact.is_primary_contact) { %} + · + {%= __("Primary Contact") %} {% } %} - {% if(contact.designation){ %} - · {%= contact.designation %} + {% if (contact.designation){ %} + · + {%= contact.designation %} {% } %}
{% if (contact.phone || contact.mobile_no || contact.phone_nos.length > 0) { %}
- {% if(contact.phone) { %}
- {%= frappe.utils.escape_html(contact.phone) %} · {%= __("Primary Phone") %}
+ {% if (contact.phone) { %}
+
+ {%= frappe.utils.escape_html(contact.phone) %}
+
+ ·
+ {%= __("Primary Phone") %}
+
{% endif %}
- {% if(contact.mobile_no) { %}
- {%= frappe.utils.escape_html(contact.mobile_no) %} · {%= __("Primary Mobile") %}
+ {% if (contact.mobile_no) { %}
+
+ {%= frappe.utils.escape_html(contact.mobile_no) %}
+
+ ·
+ {%= __("Primary Mobile") %}
+
{% endif %}
- {% if(contact.phone_nos) { %}
- {% for(const phone_no of contact.phone_nos) { %}
- {%= frappe.utils.escape_html(phone_no.phone) %}
+ {% if (contact.phone_nos) { %}
+ {% for (const phone_no of contact.phone_nos) { %}
+
+ {%= frappe.utils.escape_html(phone_no.phone) %}
+
+
{% } %}
{% endif %}
- {% if(contact.email_id) { %}
- {%= frappe.utils.escape_html(contact.email_id) %} · {%= __("Primary Email") %}
+ {% if (contact.email_id) { %}
+
+ {%= frappe.utils.escape_html(contact.email_id) %}
+
+ ·
+ {%= __("Primary Email") %}
+
{% endif %}
- {% if(contact.email_ids) { %}
- {% for(const email_id of contact.email_ids) { %}
- {%= frappe.utils.escape_html(email_id.email_id) %}
+ {% if (contact.email_ids) { %}
+ {% for (const email_id of contact.email_ids) { %}
+
+ {%= frappe.utils.escape_html(email_id.email_id) %}
+
+
{% } %}
{% endif %}
{%= __("No contacts added yet.") %}
+ +{% if (!contact_list.length) { %} +{%= __("No contacts added yet.") %}
{% } %} -+ +
+
From b36a64ad474332f96f8eed2c4e9ff5cdff56d1d1 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:14:04 +0200 Subject: [PATCH 7/9] fix: disabiguate address labels --- frappe/public/js/frappe/form/templates/address_list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/templates/address_list.html b/frappe/public/js/frappe/form/templates/address_list.html index c70babc06f..490ab07b8d 100644 --- a/frappe/public/js/frappe/form/templates/address_list.html +++ b/frappe/public/js/frappe/form/templates/address_list.html @@ -18,11 +18,11 @@ {% } %} {% if (addr.is_primary_address) { %} · - {%= __("Primary") %} + {%= __("Primary Address") %} {% } %} {% if (addr.is_shipping_address) { %} · - {%= __("Shipping") %} + {%= __("Shipping Address") %} {% } %} {% if (addr.disabled) { %} · From c6222ca7611f944631618132118e03f10a313eb5 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:14:32 +0200 Subject: [PATCH 8/9] fix: add contact label "Billing Contact" --- frappe/public/js/frappe/form/templates/contact_list.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/public/js/frappe/form/templates/contact_list.html b/frappe/public/js/frappe/form/templates/contact_list.html index a581c4a66a..ef11831f3f 100644 --- a/frappe/public/js/frappe/form/templates/contact_list.html +++ b/frappe/public/js/frappe/form/templates/contact_list.html @@ -16,6 +16,10 @@ · {%= __("Primary Contact") %} {% } %} + {% if (contact.is_billing_contact) { %} + · + {%= __("Billing Contact") %} + {% } %} {% if (contact.designation){ %} · {%= contact.designation %} From f94f3ad0a9528d9b48929531f9d444077b82b02a Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:22:11 +0200 Subject: [PATCH 9/9] fix: german translations For address and contact list --- frappe/translations/de.csv | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/translations/de.csv b/frappe/translations/de.csv index cf27bbe449..a6d84ba8e1 100644 --- a/frappe/translations/de.csv +++ b/frappe/translations/de.csv @@ -1384,7 +1384,7 @@ Is Globally Pinned,Wird global gepinnt, Is Home Folder,Ist Ordner für Startseite, Is Mandatory Field,Ist Pflichtfeld, Is Pinned,Ist angeheftet, -Is Primary Contact,Ist primärer Ansprechpartner, +Is Primary Contact,Ist Hauptkontakt, Is Private,Ist Privat, Is Published Field,Ist Veröffentlicht Feld, Is Published Field must be a valid fieldname,Ist Veröffentlicht Feld muss eine gültige Feldname sein, @@ -1940,6 +1940,11 @@ Preview Message,Vorschau Nachricht, Previous,Vorhergehende, Previous Hash,Vorheriger Hash, Primary Color,Primärfarbe, +Primary Address,Hauptadresse, +Primary Contact,Hauptkontakt, +Primary Email,Haupt-E-Mail, +Primary Mobile,Haupt-Mobiltelefon, +Primary Phone,Haupttelefon, Print Documents,Dokumente drucken, Print Format Builder,Programm zum Erstellen von Druckformaten, Print Format Help,Hilfe zu Druckformaten, @@ -4851,6 +4856,7 @@ Anonymous,Anonym, Author,Autor, Basic,Grundeinkommen, Billing,Abrechnung, +Billing Contact,Abrechnungskontakt, Contact Details,Kontakt-Details, Datetime,Datum und Uhrzeit, Enable,ermöglichen, @@ -4879,6 +4885,7 @@ Saved,Gespeichert, Series {0} already used in {1},Serie {0} bereits verwendet in {1}, Set as Default,Als Standard festlegen, Shipping,Versand, +Shipping Address,Lieferadresse, Standard,Standard, Test,Test, Traceback,Zurück verfolgen,