Merge pull request #22270 from barredterra/responsive-address-contact-list
This commit is contained in:
commit
865e99929f
4 changed files with 122 additions and 49 deletions
|
|
@ -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") { %}
|
||||
·
|
||||
<span class="text-muted">{%= __(addr.address_type) %}</span>
|
||||
{% } %}
|
||||
{% if (addr.is_primary_address) { %}
|
||||
·
|
||||
<span class="text-muted">{%= __("Primary Address") %}</span>
|
||||
{% } %}
|
||||
{% if (addr.is_shipping_address) { %}
|
||||
·
|
||||
<span class="text-muted">{%= __("Shipping Address") %}</span>
|
||||
{% } %}
|
||||
{% if (addr.disabled) { %}
|
||||
·
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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"> ({%= __("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) { %}
|
||||
·
|
||||
<span class="text-muted">{%= __("Primary Contact") %}</span>
|
||||
{% } %}
|
||||
{% if(contact.designation){ %}
|
||||
<span class="text-muted">– {%= contact.designation %}</span>
|
||||
{% if (contact.is_billing_contact) { %}
|
||||
·
|
||||
<span class="text-muted">{%= __("Billing Contact") %}</span>
|
||||
{% } %}
|
||||
{% if (contact.designation){ %}
|
||||
·
|
||||
<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> · <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>
|
||||
·
|
||||
<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> · <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>
|
||||
·
|
||||
<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> · <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>
|
||||
·
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
Loading…
Add table
Reference in a new issue