summaryrefslogtreecommitdiff
path: root/ishtar/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-06-16 18:39:42 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-06-16 18:39:42 +0200
commit7f871c7698c56dce6f398e850a08d5619cebd243 (patch)
treeaed266494a442ca241137370e7df7dc965febf5f /ishtar/templates
parent48691eebe6c933ffb3a9d41ba0ee09ff7d574a2d (diff)
downloadIshtar-7f871c7698c56dce6f398e850a08d5619cebd243.tar.bz2
Ishtar-7f871c7698c56dce6f398e850a08d5619cebd243.zip
Correct the database link between context records and operations (closes #482)
Diffstat (limited to 'ishtar/templates')
-rw-r--r--ishtar/templates/sheet_contextrecord.html36
-rw-r--r--ishtar/templates/sheet_operation.html8
2 files changed, 20 insertions, 24 deletions
diff --git a/ishtar/templates/sheet_contextrecord.html b/ishtar/templates/sheet_contextrecord.html
index 13c11bd5b..13fd786a3 100644
--- a/ishtar/templates/sheet_contextrecord.html
+++ b/ishtar/templates/sheet_contextrecord.html
@@ -5,7 +5,7 @@
<h3>{% trans "Context Record"%}</h3>
-{% if item.parcel.operation.code_patriarche %}
+{% if item.operation.code_patriarche %}
<p><label>{%trans "Complete ID:"%}</label>
{% else %}
<p class='alert'><label>{%trans "Patriarche OA code not yet recorded!"%}</label></p>
@@ -44,35 +44,35 @@
{% if item.tpq_estimated %}<p><label>{% trans "TPQ estimated:" %}</label> <span class='value'>{{ item.tpq_estimated }}</span></p>{%endif%}
{%endif%}
-{% if item.parcel.operation %}
+{% if item.operation %}
<h3>{% trans "Operation resume"%}</h3>
-<p><label>{%trans "Year:"%}</label> <span class='value'>{{ item.parcel.operation.year }}</span></p>
-<p><label>{%trans "Numerical reference:"%}</label> <span class='value'>{{ item.parcel.operation.numeric_reference }}</span></p>
-{% if item.parcel.operation.code_patriarche %}
+<p><label>{%trans "Year:"%}</label> <span class='value'>{{ item.operation.year }}</span></p>
+<p><label>{%trans "Numerical reference:"%}</label> <span class='value'>{{ item.operation.numeric_reference }}</span></p>
+{% if item.operation.code_patriarche %}
<p><label>{%trans "Patriarche OA code:"%}</label>
-<span class='value'>{{ item.parcel.operation.code_patriarche }}</span></p>
+<span class='value'>{{ item.operation.code_patriarche }}</span></p>
{% else %}<p class='alert'><label>{%trans "Patriarche OA code not yet recorded!"%}</label></p>
{%endif%}
<p><label>{%trans "Operation's name:"%}</label>
-<span class='value'>{{ item.parcel.operation.internal_reference }}</span></p>
+<span class='value'>{{ item.operation.internal_reference }}</span></p>
<p><label>{%trans "Head scientist:"%}</label>
-<span class='value'>{{ item.parcel.operation.in_charge.full_label }}</span></p>
+<span class='value'>{{ item.operation.in_charge.full_label }}</span></p>
<p><label>{%trans "State:"%}</label>
-{% if item.parcel.operation.is_active %}
+{% if item.operation.is_active %}
<span class='value'>{%trans "Active file"%}</span></p>
{% else %}
<span class='value'>{%trans "Closed operation"%}</span></p>
-<p><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.parcel.operation.closing.date }}
-<strong>{%trans "by" %}</strong> {{ item.parcel.operation.closing.user }}</span></p>
+<p><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.operation.closing.date }}
+<strong>{%trans "by" %}</strong> {{ item.operation.closing.user }}</span></p>
{% endif %}
-<p><label>{%trans "Type:"%}</label> <span class='value'>{{ item.parcel.operation.operation_type }}</span></p>
-<p><label>{%trans "Remains:"%}</label> <span class='value'>{{ item.parcel.operation.remains.all|join:", " }}</span></p>
-<p><label>{%trans "Periods:"%}</label> <span class='value'>{{ item.parcel.operation.periods.all|join:", " }}</span></p>
-{% if item.parcel.operation.comment %}<p><label>{%trans "Comment:"%}</label> <span class='value'>{{ item.parcel.operation.comment }}</span></p>{%endif%}
+<p><label>{%trans "Type:"%}</label> <span class='value'>{{ item.operation.operation_type }}</span></p>
+<p><label>{%trans "Remains:"%}</label> <span class='value'>{{ item.operation.remains.all|join:", " }}</span></p>
+<p><label>{%trans "Periods:"%}</label> <span class='value'>{{ item.operation.periods.all|join:", " }}</span></p>
+{% if item.operation.comment %}<p><label>{%trans "Comment:"%}</label> <span class='value'>{{ item.operation.comment }}</span></p>{%endif%}
<h3>{% trans "Localisation"%}</h3>
-<p><label>{%trans "Towns:"%}</label> <span class='value'>{{ item.parcel.operation.towns.all|join:", " }}</span></p>
+<p><label>{%trans "Towns:"%}</label> <span class='value'>{{ item.operation.towns.all|join:", " }}</span></p>
<p><label>{%trans "Related operation:"%}</label>
-<span class='value'><a href="#" onclick='load_window("{% url show-operation item.parcel.operation.pk ''%}");'>{{ item.parcel.operation }}</a></span></p>
+<span class='value'><a href="#" onclick='load_window("{% url show-operation item.operation.pk ''%}");'>{{ item.operation }}</a></span></p>
{# TODO: Displayed as Year/index/Commune/Common_name This should be a link to the file sheet of the related operation #}
{% else %}<p class='alert'><label>{%trans "No operation linked to this context unit!"%}</label></p>
{% endif %}
@@ -85,7 +85,7 @@
<th>{% trans "Authors" %}</th>
<th>{% trans "Localisation" %}</th>
</tr>
- {% for doc in item.parcel.operation.documents.all %}
+ {% for doc in item.operation.documents.all %}
<tr>
<td>{{ doc.title }}</td>
<td class='string'>{{doc.type}}</td>
diff --git a/ishtar/templates/sheet_operation.html b/ishtar/templates/sheet_operation.html
index b4c251197..db9d22cee 100644
--- a/ishtar/templates/sheet_operation.html
+++ b/ishtar/templates/sheet_operation.html
@@ -129,7 +129,7 @@
<th class='link'>&nbsp;</th>
</tr>
{% for parcel in item.parcels.all %}
- {% for context_record in parcel.context_record.all %}
+ {% for context_record in item.context_record.all %}
<tr>
<td>{{ context_record.label }}</td>
<td class='string'>{{context_record.unit}}</td>
@@ -159,8 +159,7 @@
<th>{% trans "Parcel" %}</th>
<th class='link'>&nbsp;</th>
</tr>
- {% for parcel in item.parcels.all %}
- {% for context_record in parcel.context_record.all %}
+ {% for context_record in item.context_record.all %}
{% for find in context_record.base_items.all %}
<tr>
<td>{{ find.full_label }}</td>
@@ -185,9 +184,6 @@
{% empty %}
<tr><td colspan="9" class='no_items'>{% trans "No find associated to parcel" %} {{parcel.short_label}} {% trans "(no context record)" %}</td></tr>
{% endfor %}
- {% empty %}
- <tr><td colspan="9" class='no_items'>{% trans "No find associated to this operation (no parcel)" %}</td></tr>
- {% endfor %}
</table>