summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-04-19 18:33:16 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-04-19 18:33:16 +0200
commiteb471a13710be88ca249f30a68bd056aa8c5a292 (patch)
treef2596427b81ad0df9e3a0b1b97201372b9fcc9cc /ishtar_common/templates
parent983662e505adca020492e0672968a19c0abb6ec2 (diff)
parentfc1c422e6c5e0c57ddb6209b609b2335f9cb4dde (diff)
downloadIshtar-eb471a13710be88ca249f30a68bd056aa8c5a292.tar.bz2
Ishtar-eb471a13710be88ca249f30a68bd056aa8c5a292.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/blocks/table_field.html4
-rw-r--r--ishtar_common/templates/ishtar/blocks/modify_toolbar.html1
-rw-r--r--ishtar_common/templates/ishtar/sheet.html1
-rw-r--r--ishtar_common/templates/ishtar/sheet_person.html49
-rw-r--r--ishtar_common/templates/ishtar/sheet_toolbar.html2
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html2
-rw-r--r--ishtar_common/templates/ishtar/wizard/wizard_person.html59
7 files changed, 110 insertions, 8 deletions
diff --git a/ishtar_common/templates/blocks/table_field.html b/ishtar_common/templates/blocks/table_field.html
new file mode 100644
index 000000000..97d63ef46
--- /dev/null
+++ b/ishtar_common/templates/blocks/table_field.html
@@ -0,0 +1,4 @@
+ <tr{% if required %} class='required'{% endif %}>
+ <th>{% if label %}{{label}}{% else %}{{ field.label_tag }}{% endif %}</th>
+ <td> {{ field.errors }}{{field|safe}}</td>
+ </tr>
diff --git a/ishtar_common/templates/ishtar/blocks/modify_toolbar.html b/ishtar_common/templates/ishtar/blocks/modify_toolbar.html
new file mode 100644
index 000000000..6f8cc7584
--- /dev/null
+++ b/ishtar_common/templates/ishtar/blocks/modify_toolbar.html
@@ -0,0 +1 @@
+{% load i18n link_to_window %}{% if item %}<div class='tool modify'><a href='{{item|link_to_modify}}'>{% trans "Modify" %}</a></div>{% endif %}
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html
index 1302e4637..714bfa762 100644
--- a/ishtar_common/templates/ishtar/sheet.html
+++ b/ishtar_common/templates/ishtar/sheet.html
@@ -44,6 +44,7 @@ jQuery(document).ready(function(){
});
</script>
{% endblock %}
+{% block header_title %}{% endblock %}
<div class="body">
{% block toolbar %}{% endblock %}
{% block content %}
diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html
index 796fe2c4a..f63bbc588 100644
--- a/ishtar_common/templates/ishtar/sheet_person.html
+++ b/ishtar_common/templates/ishtar/sheet_person.html
@@ -1,13 +1,11 @@
{% extends "ishtar/sheet.html" %}
{% load i18n window_field window_tables %}
-{% block head_sheet %}
-{{block.super}}
-<h1>{% trans "Person"%}</h1>
-{% endblock %}
+{% block header_title %}<h1>{% trans "Person"%}</h1>{% endblock %}
+{% block toolbar %}{% include "ishtar/sheet_toolbar.html" %}{% endblock %}
{% block content %}
-<div class='tool'>{%trans "Export as:"%} <a href='{% url show-person item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-person item.pk "pdf" %}'>{%trans "PDF file"%}</a></div>
+<h3>{% trans "Identity" %}</h3>
{% field "Name" item.name %}
{% field "Surname" item.surname %}
@@ -15,12 +13,49 @@
{% field "Created by" item.history_creator.ishtaruser.full_label %}
{% field "Email" item.email %}
{% field "Type(s)" item.person_types_list %}
+
+{% if item.phone or item.phone2 or item.phone3 or item.mobile_phone %}
+<table class='formset table-form'>
+ <caption>{% trans "Phone" %}</caption>
+ <tr>
+ <th>{% trans "Phone type" %}</th>
+ <th>{% trans "Number" %}</th>
+ </tr>
+ {% if item.phone or item.phone_desc %}<tr>
+ <td>{% if item.phone_desc %}{{item.phone_desc}}{% else %}&ndash;{% endif %}</td>
+ <td>{% if item.phone %}{{item.phone}}{% else %}&ndash;{% endif %}</td>
+ </tr>{% endif %}
+ {% if item.phone2 or item.phone_desc2 %}<tr>
+ <td>{% if item.phone_desc2 %}{{item.phone_desc2}}{% else %}&ndash;{% endif %}</td>
+ <td>{% if item.phone2 %}{{item.phone2}}{% else %}&ndash;{% endif %}</td>
+ </tr>{% endif %}
+ {% if item.phone3 or item.phone_desc3 %}<tr>
+ <td>{% if item.phone_desc3 %}{{item.phone_desc3}}{% else %}&ndash;{% endif %}</td>
+ <td>{% if item.phone3 %}{{item.phone3}}{% else %}&ndash;{% endif %}</td>
+ </tr>{% endif %}
+ {% if item.mobile_phone %}<tr>
+ <td>{% trans "Mobile phone" %}</td>
+ <td>{{item.mobile_phone}}</td>
+ </tr>{% endif %}
+</table>
+{% endif %}
+
+{% if item.address or item.postal_code or item.town %}
+<h3>{% trans "Business address" %}</h3>
{% field "Address" item.address %}
{% field "Address complement" item.address_complement %}
{% field "Postal code" item.postal_code %}
{% field "Town" item.town %}
-{% field "Phone" item.phone %}
-{% field "Mobile phone" item.mobile_phone %}
+{% endif %}
+
+{% if item.alt_address or item.alt_postal_code or item.alt_town %}
+<h3>{% trans "Other address" %}</h3>
+{% field "Address" item.alt_address %}
+{% field "Address complement" item.alt_address_complement %}
+{% field "Postal code" item.alt_postal_code %}
+{% field "Town" item.alt_town %}
+{% endif %}
+
{% if item.attached_to %}<h3>{% trans "Associated organization"%}</h3>
{% field "Name" item.attached_to %}
diff --git a/ishtar_common/templates/ishtar/sheet_toolbar.html b/ishtar_common/templates/ishtar/sheet_toolbar.html
index 2e059781e..7e2c1659a 100644
--- a/ishtar_common/templates/ishtar/sheet_toolbar.html
+++ b/ishtar_common/templates/ishtar/sheet_toolbar.html
@@ -1,2 +1,2 @@
{% load i18n link_to_window %}<div class='tool'>{%trans "Export as:"%} <a href='{{item|link_to_odt}}'>{%trans "OpenOffice.org file"%}</a>, <a href='{{item|link_to_pdf}}'>{%trans "PDF file"%}</a></div>
-
+{% modify_toolbar item "person_modification" %}
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html
index 1a17cf32b..6491b7a0f 100644
--- a/ishtar_common/templates/ishtar/wizard/default_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html
@@ -24,6 +24,7 @@
<div class='form'>
{{ wizard.form.media }}
{{ wizard.management_form }}
+{% block form_detail %}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
@@ -39,6 +40,7 @@
{% table_form wizard.form %}
{% if not is_search %}</table>{% endif %}
{% endif %}
+{% endblock %}
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
{% block "validation_bar" %}
diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person.html b/ishtar_common/templates/ishtar/wizard/wizard_person.html
new file mode 100644
index 000000000..85bbfc75e
--- /dev/null
+++ b/ishtar_common/templates/ishtar/wizard/wizard_person.html
@@ -0,0 +1,59 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block form_detail %}
+
+<table class='formset'>
+ <caption>{% trans "Identity" %}</caption>
+ {% table_field wizard.form.title %}
+ {% table_field wizard.form.surname 1 %}
+ {% table_field wizard.form.name 1 %}
+ {% table_field wizard.form.raw_name %}
+ {% table_field wizard.form.email %}
+ {% table_field wizard.form.attached_to %}
+</table>
+
+<hr class='spacer'/>
+<table class='formset table-form'>
+ <caption>{% trans "Phone" %}</caption>
+ <tr>
+ <th>{% trans "Phone type" %}</th>
+ <th>{% trans "Number" %}</th>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc.errors }}{{wizard.form.phone_desc|safe}}</td>
+ <td>{{ wizard.form.phone.errors }}{{wizard.form.phone|safe}}</td>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc2.errors }}{{wizard.form.phone_desc2|safe}}</td>
+ <td>{{ wizard.form.phone2.errors }}{{wizard.form.phone2|safe}}</td>
+ </tr>
+ <tr>
+ <td>{{ wizard.form.phone_desc3.errors }}{{wizard.form.phone_desc3|safe}}</td>
+ <td>{{ wizard.form.phone3.errors }}{{wizard.form.phone3|safe}}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Mobile phone" %}</td>
+ <td>{{ wizard.form.mobile_phone.errors }}{{wizard.form.mobile_phone|safe}}</td>
+ </tr>
+</table>
+<hr class='spacer'/>
+
+<table class='formset'>
+ <caption>{% trans "Business address" %}</caption>
+ {% table_field wizard.form.address %}
+ {% table_field wizard.form.address_complement %}
+ {% table_field wizard.form.postal_code %}
+ {% table_field wizard.form.town %}
+ {% table_field wizard.form.country %}
+</table>
+<hr class='spacer'/>
+<table class='formset'>
+ <caption>{% trans "Other address" %}</caption>
+ {% table_field wizard.form.alt_address 0 'Address' %}
+ {% table_field wizard.form.alt_address_complement 0 'Address complement' %}
+ {% table_field wizard.form.alt_postal_code 0 'Postal code' %}
+ {% table_field wizard.form.alt_town 0 'Town' %}
+ {% table_field wizard.form.alt_country 0 'Country' %}
+</table>
+
+{% endblock %}