Merge pull request #22270 from barredterra/responsive-address-contact-list

This commit is contained in:
Shariq Ansari 2023-09-15 17:05:02 +05:30 committed by GitHub
commit 865e99929f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 122 additions and 49 deletions

View file

@ -1,24 +1,44 @@
<div class="clearfix"></div>
{% for(var i=0, l=addr_list.length; i<l; i++) { %}
<div class="address-box">
<p class="h6">
{%= i+1 %}. {%= addr_list[i].address_title %}{% if(addr_list[i].address_type!="Other") { %}
<span class="text-muted">({%= __(addr_list[i].address_type) %})</span>{% } %}
{% if(addr_list[i].is_primary_address) { %}
<span class="text-muted">({%= __("Primary") %})</span>{% } %}
{% if(addr_list[i].is_shipping_address) { %}
<span class="text-muted">({%= __("Shipping") %})</span>{% } %}
{% if(addr_list[i].disabled) { %}
<span class="text-muted">({%= __("Disabled") %})</span>{% } %}
{% for (const addr of addr_list) { %}
<div class="address-box">
<a
href="{%= frappe.utils.get_form_link('Address', addr.name) %}"
class="btn btn-xs btn-default edit-btn"
title="{%= __('Edit') %}"
>
<svg class="icon icon-xs">
<use href="#icon-edit"></use>
</svg>
</a>
<p class="h6 flex flex-wrap">
<span>{%= addr.address_title %}</span>
{% if (addr.address_type !== "Other") { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __(addr.address_type) %}</span>
{% } %}
{% if (addr.is_primary_address) { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __("Primary Address") %}</span>
{% } %}
{% if (addr.is_shipping_address) { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __("Shipping Address") %}</span>
{% } %}
{% if (addr.disabled) { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __("Disabled") %}</span>
{% } %}
</p>
<p>{%= addr.display %}</p>
</div>
{% } %}
<a href="/app/Form/Address/{%= encodeURIComponent(addr_list[i].name) %}" class="btn btn-default btn-xs pull-right"
style="margin-top:-3px; margin-right: -5px;">
{%= __("Edit") %}</a>
</p>
<p>{%= addr_list[i].display %}</p>
</div>
{% if (!addr_list.length) { %}
<p class="text-muted small">{%= __("No address added yet.") %}</p>
{% } %}
{% if(!addr_list.length) { %}
<p class="text-muted small">{%= __("No address added yet.") %}</p>
{% } %}
<p><button class="btn btn-xs btn-default btn-address">{{ __("New Address") }}</button></p>
<p>
<button class="btn btn-xs btn-default btn-address">
{{ __("New Address") }}
</button>
</p>

View file

@ -1,42 +1,74 @@
<div class="clearfix"></div>
{% for(const contact of contact_list) { %}
{% for (const contact of contact_list) { %}
<div class="address-box">
<p class="h6 flex align-center">
{%= contact.first_name %} {%= contact.last_name %}
{% if(contact.is_primary_contact) { %}
<span class="text-muted">&nbsp;({%= __("Primary") %})</span>
<a
href="{%= frappe.utils.get_form_link('Contact', contact.name) %}"
class="btn btn-xs btn-default edit-btn"
title="{%= __('Edit') %}"
>
<svg class="icon icon-xs">
<use href="#icon-edit"></use>
</svg>
</a>
<p class="h6 flex flex-wrap">
<span>{%= contact.first_name %} {%= contact.last_name %}</span>
{% if (contact.is_primary_contact) { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __("Primary Contact") %}</span>
{% } %}
{% if(contact.designation){ %}
<span class="text-muted">&ndash; {%= contact.designation %}</span>
{% if (contact.is_billing_contact) { %}
&nbsp;&#183;&nbsp;
<span class="text-muted">{%= __("Billing Contact") %}</span>
{% } %}
{% if (contact.designation){ %}
&nbsp;&#183;&nbsp;
<span class="text-muted"> {%= contact.designation %}</span>
{% } %}
<a href="/app/Form/Contact/{%= encodeURIComponent(contact.name) %}"
class="btn btn-xs btn-default ml-auto">
{%= __("Edit") %}
</a>
</p>
{% if (contact.phone || contact.mobile_no || contact.phone_nos.length > 0) { %}
<p>
{% if(contact.phone) { %}
<a href="tel:{%= frappe.utils.escape_html(contact.phone) %}">{%= frappe.utils.escape_html(contact.phone) %}</a> &#183; <span class="text-muted">{%= __("Primary Phone") %}</span><br>
{% if (contact.phone) { %}
<a href="tel:{%= frappe.utils.escape_html(contact.phone) %}">
{%= frappe.utils.escape_html(contact.phone) %}
</a>
&#183;
<span class="text-muted">{%= __("Primary Phone") %}</span>
<br>
{% endif %}
{% if(contact.mobile_no) { %}
<a href="tel:{%= frappe.utils.escape_html(contact.mobile_no) %}">{%= frappe.utils.escape_html(contact.mobile_no) %}</a> &#183; <span class="text-muted">{%= __("Primary Mobile") %}</span><br>
{% if (contact.mobile_no) { %}
<a href="tel:{%= frappe.utils.escape_html(contact.mobile_no) %}">
{%= frappe.utils.escape_html(contact.mobile_no) %}
</a>
&#183;
<span class="text-muted">{%= __("Primary Mobile") %}</span>
<br>
{% endif %}
{% if(contact.phone_nos) { %}
{% for(const phone_no of contact.phone_nos) { %}
<a href="tel:{%= frappe.utils.escape_html(phone_no.phone) %}">{%= frappe.utils.escape_html(phone_no.phone) %}</a><br>
{% if (contact.phone_nos) { %}
{% for (const phone_no of contact.phone_nos) { %}
<a href="tel:{%= frappe.utils.escape_html(phone_no.phone) %}">
{%= frappe.utils.escape_html(phone_no.phone) %}
</a>
<br>
{% } %}
{% endif %}
</p>
{% endif %}
{% if (contact.email_id || contact.email_ids.length > 0) { %}
<p>
{% if(contact.email_id) { %}
<a href="mailto:{%= frappe.utils.escape_html(contact.email_id) %}">{%= frappe.utils.escape_html(contact.email_id) %}</a> &#183; <span class="text-muted">{%= __("Primary Email") %}</span><br>
{% if (contact.email_id) { %}
<a href="mailto:{%= frappe.utils.escape_html(contact.email_id) %}">
{%= frappe.utils.escape_html(contact.email_id) %}
</a>
&#183;
<span class="text-muted">{%= __("Primary Email") %}</span>
<br>
{% endif %}
{% if(contact.email_ids) { %}
{% for(const email_id of contact.email_ids) { %}
<a href="mailto:{%= frappe.utils.escape_html(email_id.email_id) %}">{%= frappe.utils.escape_html(email_id.email_id) %}</a><br>
{% if (contact.email_ids) { %}
{% for (const email_id of contact.email_ids) { %}
<a href="mailto:{%= frappe.utils.escape_html(email_id.email_id) %}">
{%= frappe.utils.escape_html(email_id.email_id) %}
</a>
<br>
{% } %}
{% endif %}
</p>
@ -48,9 +80,13 @@
{% endif %}
</div>
{% } %}
{% if(!contact_list.length) { %}
<p class="text-muted small">{%= __("No contacts added yet.") %}</p>
{% if (!contact_list.length) { %}
<p class="text-muted small">{%= __("No contacts added yet.") %}</p>
{% } %}
<p><button class="btn btn-xs btn-default btn-contact">
{{ __("New Contact") }}</button>
<p>
<button class="btn btn-xs btn-default btn-contact">
{{ __("New Contact") }}
</button>
</p>

View file

@ -149,9 +149,19 @@ 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;
display: flex;
justify-content: center;
align-items: center;
padding: var(--padding-sm);
}
}
.action-btn {
position: absolute;

View file

@ -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,

1 A4 A4
1384 Is Home Folder Ist Ordner für Startseite
1385 Is Mandatory Field Ist Pflichtfeld
1386 Is Pinned Ist angeheftet
1387 Is Primary Contact Ist primärer Ansprechpartner Ist Hauptkontakt
1388 Is Private Ist Privat
1389 Is Published Field Ist Veröffentlicht Feld
1390 Is Published Field must be a valid fieldname Ist Veröffentlicht Feld muss eine gültige Feldname sein
1940 Previous Vorhergehende
1941 Previous Hash Vorheriger Hash
1942 Primary Color Primärfarbe
1943 Primary Address Hauptadresse
1944 Primary Contact Hauptkontakt
1945 Primary Email Haupt-E-Mail
1946 Primary Mobile Haupt-Mobiltelefon
1947 Primary Phone Haupttelefon
1948 Print Documents Dokumente drucken
1949 Print Format Builder Programm zum Erstellen von Druckformaten
1950 Print Format Help Hilfe zu Druckformaten
4856 Author Autor
4857 Basic Grundeinkommen
4858 Billing Abrechnung
4859 Billing Contact Abrechnungskontakt
4860 Contact Details Kontakt-Details
4861 Datetime Datum und Uhrzeit
4862 Enable ermöglichen
4885 Series {0} already used in {1} Serie {0} bereits verwendet in {1}
4886 Set as Default Als Standard festlegen
4887 Shipping Versand
4888 Shipping Address Lieferadresse
4889 Standard Standard
4890 Test Test
4891 Traceback Zurück verfolgen