blob: 2309262fc8eba74f38538b1433686c9a6b3d90a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
{% extends "ishtar/sheet.html" %}
{% load i18n window_tables window_header window_ope_tables window_field from_dict %}
{% block head_title %}<strong>{% trans "Operation" %}</strong> - {{item.short_label}}{% if item.common_name %} - {{item.common_name}}{% endif %}{% endblock %}
{% block toolbar %}
{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next 1 %}
{% endblock %}
{% block content %}
<div class="row">
<div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12">
<div class="card">
{% include "ishtar/blocks/window_image.html" %}
<div class="card-body">
<div class="row">
<div class="col main">
{% if item.year or item.operation_code %}
{{item.year|default:''}}-{{item.operation_code|default:''}}{% endif %}<br>
{% if item.code_patriarche %}OA{{item.code_patriarche}}{% endif %}
</div>
<div class="col text-muted">
{% include "ishtar/blocks/sheet_external_id.html" %}
</div>
</div>
<p class="card-text">
<p class='window-refs' title="{% trans 'Name' %}">{{item.common_name|default:''}}</p>
<p class='window-refs' title="{% trans 'Address' %}">{{item.address|default:''}}</p>
</p>
</div>
</div>
</div>
</div>
<h3>{% trans "General"%}</h3>
<div class="row">
{% field_flex "Old code" item.old_code %}
{% include "ishtar/blocks/sheet_creation_section.html" %}
{% trans "Begining date" as begining_date_label %}
{% field_flex begining_date_label item.start_date|date:"DATE_FORMAT" %}
{% field_flex "Excavation end date" item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %}
{% field_flex_detail "Head scientist" item.scientist %}
{% field_flex_detail "In charge" item.in_charge %}
{% field_flex_multiple "Collaborators" item.collaborators %}
{% field_flex_detail "Operator" item.operator %}
<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
<dt class="col-5">{%trans "State"%}</dt>
<dd class='col-7'>
{% if item.is_active %}{%trans "Active file"%}
{% else %}{%trans "Closed operation"%}{% endif %}
</dd>
</div>
{% if item.closing.date %}
<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
<dt class="col-5">{%trans "Closing date"%}</dt>
<dd class='col-7'>
{{ item.closing.date }} <strong>{%trans "by" %}</strong> {{ item.closing.user }}
</dd>
</div>
{% endif %}
{% field_flex "Type" item.operation_type %}
{% if item.surface %}
<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
<dt class="col-5">{%trans "Surface"%}</dt>
<dd class='col-7'>
{{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha)
</dd>
</div>
{% endif %}
{% if item.cost %}
<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
<dt class="col-5">{%trans "Cost" %}</dt>
<dd class='col-7'>
{{ item.cost }} €{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} €/m<sup>2</sup>){%endif%}
</dd>
</div>
{%endif%}
{% if item.duration %}
<div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
<dt class="col-5">{%trans "Duration"%}</dt>
<dd class='col-7'>
{{ item.duration }} {% trans "days" %}
</dd>
</div>
{%endif%}
{% field_flex_multiple "Remains" item.remains %}
{% field_flex_multiple "Periods" item.periods %}
{% if item.QUALITY_DICT %}{% field_flex "Record quality" item.record_quality|from_dict:item.QUALITY_DICT %}{% endif %}
{% if item.history_object and item.history_object.QUALITY_DICT %}{% field_flex "Record quality" item.record_quality|from_dict:item.history_object.QUALITY_DICT %}{% endif %}
{% field_flex "Report delivery date" item.report_delivery_date %}
{% field_flex "Report processing" item.report_processing %}
{% field_flex "Deadline for submission of the documentation" item.documentation_deadline %}
{% field_flex "Documentation received" item.documentation_received %}
{% field_flex "Deadline for submission of the finds" item.finds_deadline %}
{% field_flex "Finds received" item.finds_received %}
{% field_flex_detail "Associated file" item.associated_file %}
{% field_flex "Responsible for planning service" item.associated_file.responsible_town_planning_service.full_address %}
{% if item.associated_file.town_planning_service %}
{% field_flex "Planning service organization" item.associated_file.town_planning_service.full_address %}
{% else %}
{% field_flex "Planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %}
{% endif %}
{% field_flex "Permit type" item.associated_file.permit_type %}
{% field_flex "Permit reference" item.associated_file.permit_reference %}
{% field_flex "General contractor" item.associated_file.general_contractor.full_address %}
{% if item.associated_file.corporation_general_contractor %}
{% field_flex "General contractor organization" item.associated_file.corporation_general_contractor.full_address %}
{% else%}
{% field_flex "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %}
{% endif %}
</div>
<div class="row">
{% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
{% field_flex_full "Abstract" item.abstract "<pre>" "</pre>" %}
{% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "<pre>" "</pre>" %}
{% include "ishtar/blocks/sheet_json.html" %}
</div>
{% if item.virtual_operation %}
<div class="alert alert-warning" role="alert">
{% trans "This operation is virtual." %}
</div>
{% endif %}
{% if not item.code_patriarche %}
<div class="alert alert-warning" role="alert">
{% trans "Patriarche OA code not yet recorded!"%}
</div>
{% endif %}
{% if not next %}
{% if item.towns.count %}
<h3>{% trans "Localisation"%}</h3>
<div class="row">
{% field_flex_full "Towns" item.towns_codes|join:" ; " %}
{% field_flex "Main address" item.associated_file.address %}
{% field_flex "Complement" item.associated_file.address_complement %}
{% field_flex "Postal code" item.associated_file.postal_code %}
</div>
{% endif %}
{% if item.right_relations.count %}
<h3>{% trans "Relations"%}</h3>
{% for rel in item.right_relations.all %}
{% ifchanged rel.relation_type %}
<h4>{{rel.relation_type}}</h4>
<div class="row">{% endifchanged %}
<div class="col-12">
<a href="#" onclick="load_window('/show-operation/{{rel.right_record.pk}}/');" class="display_details">
<i class="fa fa-info-circle" aria-hidden="true"></i>
</a> {{rel.right_record}}
</div>
{% if forloop.last %}
</div>{% endif %}
{% endfor %}
{% endif %}
{% if item.archaeological_sites.count %}
{% trans "Archaeological sites" as archaeologicalsites_label %}
{% table_archaeologicalsites archaeologicalsites_label item.archaeological_sites.all %}
{% endif %}
{% trans "Associated parcels" as parcels_label %}
{% include "ishtar/blocks/window_tables/parcels.html" %}
{% if item.administrative_act %}
<h3>{% trans "Administrative acts" %}</h3>
{% table_administrativact "" item.administrative_act.all %}
{% endif %}
{% trans "Document from this operation" as operation_docs %}
{% if item.source.count %}
{% dynamic_table_document operation_docs 'operation_docs' 'operation' item.pk '' output %}
{% endif %}
{% if item.context_record.count %}
{% trans "Context records" as cr_lab %}
{% dynamic_table_document cr_lab 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% if item.context_record_relations_q.count %}
{% trans "Context record relations" as cr_rels %}
{% dynamic_table_document cr_rels 'context_records_relations_detail' 'left_record__operation' item.pk '' output %}
{% endif %}
{% if item.context_record_docs_q.count %}
{% trans "Documents from associated context records" as cr_docs %}
{% dynamic_table_document cr_docs 'context_records_docs' 'context_record__operation' item.pk '' output %}
{% endif %}
{% if item.finds %}
{% trans "Finds" as finds %}
{% dynamic_table_document finds 'finds_for_ope' 'base_finds__context_record__operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% if item.find_docs_q.count %}
{% trans "Documents from associated finds" as finds_docs %}
{% dynamic_table_document finds_docs 'finds_docs' 'find__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
{% if item.containers_q.count %}
{% trans "Associated containers" as containers_lbl %}
{% dynamic_table_document containers_lbl 'containers' 'finds__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
<h3>{% trans "Statistics" %}</h3>
<small class="centered"><em>{% trans "These numbers are updated hourly" %}</em></small>
<h4>{% trans "Administrative acts" %}</h4>
<div class='row'>
{% field_flex_2 "Number of administrative acts" item.nb_acts %}
{% field_flex_2 "Number of indexed administrative acts" item.nb_indexed_acts %}
</div>
<h4>{% trans "Parcels" %}</h4>
<div class='row'>
{% field_flex_2 "Number of parcels" item.nb_parcels %}
</div>
<h4>{% trans "Context records" %}</h4>
<div class='row'>
{% field_flex_2 "Number of context records" item.nb_context_records %}
</div>
<div class='row'>
{% if item.nb_context_records_by_type %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_context_records_by_type %}
<tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if item.nb_context_records_by_periods %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_context_records_by_periods %}
<tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
</div>
<h4>{% trans "Finds" %}</h4>
<div class='row'>
{% field_flex_2 "Number of finds" item.nb_finds %}
</div>
<div class='row'>
{% if item.nb_finds_by_material_type %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Material type" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_finds_by_material_type %}
<tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if item.nb_finds_by_types %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Object type" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_finds_by_types %}
<tr><td>{{label}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if item.nb_finds_by_periods %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_finds_by_periods %}
<tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
</div>
<h4>{% trans "Sources" %}</h4>
<div class='row'>
{% field_flex "Number of sources" item.nb_documents %}
</div>
<div class='row'>
{% if item.nb_documents_by_types %}
<div class="col-12 col-md-6 col-lg-4">
<table class="table table-striped">
<tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr>
{% for label, nb in item.nb_documents_by_types %}
<tr><td>{{label}}</td><td>{{nb}}</td></tr>
{% endfor %}
</table>
</div>
{% endif %}
</div>
{% if item.nb_stats_finds_by_ue %}
<h4>{% trans "Finds by context records" %}</h4>
<div class='row'>
{% field_flex_2 "Mean" item.nb_stats_finds_by_ue.mean %}
{% field_flex_2 "Min" item.nb_stats_finds_by_ue.min %}
{% field_flex_2 "Max" item.nb_stats_finds_by_ue.max %}
{% field_flex_2 "Mode" item.nb_stats_finds_by_ue.mode %}
</div>
{% endif %}
{% endif %}
{% endblock %}
|