family: update family infos template (#16181)

In order to allow better styling.
This commit is contained in:
Serghei Mihai 2017-08-11 18:44:02 +02:00
parent f5db13e7ec
commit 5758be6863
2 changed files with 45 additions and 20 deletions

View File

@ -24,22 +24,26 @@
</div>
{% with data=family.data %}
{% if data.adults %}
{% if data.adults %}
<div id="family_adults">
<h3>{% trans "Adults" %}</h3>
<ul>
{% for adult in data.adults %}
<li>{% include 'family/person.html' with person=adult %}</li>
{% endfor %}
</ul>
{% endif %}
{% for adult in data.adults %}
<div>
{% include 'family/person.html' with person=adult %}
</div>
{% endfor %}
</div>
{% endif %}
{% if data.children %}
{% if data.children %}
<div id="family_children">
<h3>{% trans "Children" %}</h3>
<ul>
{% for child in data.children %}
<li>{% include 'family/person.html' with person=child %}</li>
{% endfor %}
</ul>
{% for child in data.children %}
<div>
{% include 'family/person.html' with person=child %}
</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% endif %}

View File

@ -1,15 +1,36 @@
{% load i18n %}
<p class="name"><span>{{ person.first_name }} {{ person.last_name }}</span></p>
{% if person.birthdate %}
<p class="birthdate">
<span>{% trans "Born on" %}</span> {{ person.birthdate }}
<span class="label">{% trans "Born on" %}</span>
<span class="value">{{ person.birthdate }}</span>
</p>
{% endif %}
<h4>{% trans "Address" %}</h4>
<p class="address"><span>{% trans "Address:" %}</span> {{ person.address }}</p>
<div class="address">
<h4>{% trans "Address" %}</h4>
<p>{{ person.address }}</p>
</div>
{% if person.phone or person.cellphone or person.email %}
<h4>{% trans "Contact" %}</h4>
{% if person.phone %}<p class='phone'><span>{% trans "Phone:" %}</span> {{ person.phone }}</p>{% endif %}
{% if person.cellphone %}<p class='cellphone'><span>{% trans "Cellphone:" %}</span> {{ person.cellphone }}</p>{% endif %}
{% if person.email %}<p class='email'><span>{% trans "Email:" %}</span> {{ person.email }}</p>{% endif %}
<div class="contact">
{% if person.phone %}
<p class="phone">
<span class="label">{% trans "Phone:" %}</span>
<span class="value">{{ person.phone }}</span>
</p>
{% endif %}
{% if person.cellphone %}
<p class="cellphone">
<span class="label">{% trans "Cellphone:" %}</span>
<span class="value">{{ person.cellphone }}</span>
</p>
{% endif %}
{% if person.email %}
<p class="email">
<span class="label">{% trans "Email:" %}</span>
<span class="value"{{ person.email }}</span>
</p>
{% endif %}
</div>
{% endif %}