summaryrefslogtreecommitdiff
path: root/archaeological_files/templates/ishtar/sheet_file.html
blob: 955dbc32ad8ef43671f1a3653c171d792dc48e31 (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
{% extends "ishtar/sheet.html" %}
{% load i18n ishtar_helpers window_ope_tables window_field window_header window_tables %}

{% block head_title %}<strong>{% trans "Archaeological file" %}</strong> - {{item.full_internal_ref|default:''}}{% endblock %}

{% block toolbar %}
{% if can_add_operation %}
{% window_file_nav item window_id previous next %}
{% else %}
{% window_nav item window_id 'show-file' 'file_modify' 'show-historized-file' 'revert-file' previous next 1 %}
{% endif %}

{% endblock %}

{% block content %}
{% with can_view_documents=permission_view_own_document|or_:permission_view_document %}
{% with has_documents=item.documents.count %}
{% with display_documents=can_view_documents|and_:has_documents %}

<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="card-text">
            {% if item.complete_identifier %}<p class="window-refs"
                    title="{% trans 'Complete identifier' %}">
            <strong>{{ item.complete_identifier }}</strong></p>{% endif %}
            <p class='window-refs'>{{item.full_internal_ref|default:''}}</p>
            <p class='window-refs'>{{item.internal_reference|default:''}}</p>
            <p class='window-refs'>{{item.name|default:''}}</p>
            {% include "ishtar/blocks/sheet_external_id.html" %}
        </div>
      </div>
    </div>
  </div>
</div>


<h3>{% trans "General"%}</h3>

<div class="row">
    {% field_flex "Reception date" item.reception_date|date:"DATE_FORMAT" %}
    {% include "ishtar/blocks/sheet_creation_section.html" %}

{% comment %}
{% if item.deadline_date and not item.acts %}
    <p><label>{%trans "Deadline"%}</label> <span class='value'>{% item.deadline_date %}</span></p> <!-- calculated deadline for some preventive files , see saisine_type, not displayed if an act as been send -->
{% endif %}
{% endcomment %}

    {% field_flex_detail "In charge" item.in_charge %}
    <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 file"%}{% endif %}
    </dd>
    </div>
    {% if item.closing %}
    <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.full_label }}
    </dd>
    </div>
    {% endif %}
    {% field_flex "Type" item.file_type %}
    {% field_flex_detail "Related file" item.related_file %}
    {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
</div>

{% include "ishtar/blocks/sheet_json.html" %}

<h3>{% trans "Localisation"%}</h3>
<div class="row">
    {% field_flex_multiple_obj "Towns" item 'towns' %}
    {% field_flex_multiple_obj "Departments" item 'departments' %}
    {% field_flex "Main address" item.address %}
    {% field_flex "Complement" item.address_complement %}
    {% field_flex "Postal code" item.postal_code %}
    {% if item.total_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.total_surface }} m<sup>2</sup> ({{ item.total_surface_ha }} ha)
        </dd>
    </div>
    {% endif %}
</div>

{% if item.is_preventive %}

<h3>{% trans "Preventive archaeological file"%}</h3>
<div class="row">

    {% if item.total_developed_surface %}
    <div class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row">
        <dt class="col-5">{%trans "Developed surface"%}</dt>
        <dd class='col-7'>
        {{ item.total_developed_surface }} m<sup>2</sup> ({{ item.total_developed_surface_ha }} ha)</span></li>
        </dd>
    </div>
    {% endif %}

    {% field_flex "Saisine type" item.saisine_type %}

    {% field_flex_detail "Responsible for planning service" item.responsible_town_planning_service %}
    {% field_flex "Responsible for planning service address" item.responsible_town_planning_service.full_address %}
    {% if item.town_planning_service %}
      {% field_flex "Planning service organization" item.town_planning_service.full_address %}
    {% else %}
      {% field_flex "Planning service organization" item.responsible_town_planning_service.attached_to.full_address %}
    {% endif %}

    {% field_flex "Permit type" item.permit_type %}
    {% field_flex "Permit reference" item.permit_reference %}

    {% field_flex "General contractor" item.general_contractor.full_address %}
    {% if item.corporation_general_contractor %}
      {% field_flex "General contractor organization" item.corporation_general_contractor.full_address %}
    {% else%}
      {% field_flex "General contractor organization" item.general_contractor.attached_to.full_address %}
    {% endif %}

</div>
{% else %}

<h3>{% trans "Research archaeology"%}</h3>
<div class="row">
    {% field_flex_detail "Head scientist" item.scientist %}
    {% field_flex "Requested operation type" item.requested_operation_type %}
    {% field_flex_detail "Organization" item.organization %}

    {% if item.cira_advised != None %}
    {% field_flex "Passage en CIRA" item.cira_advised|yesno %}
    {% endif %}

    {% if item.mh_register != None %}
    {% field_flex "Sur Monument Historique classé" item.mh_register|yesno %}
    {% endif %}

    {% if item.mh_listing != None %}
    {% field_flex "Sur Monument Historique inscrit" item.mh_listing|yesno %}
    {% endif %}

    {% if item.classified_area  != None %}
    {% field_flex "Classified area" item.classified_area|yesno %}
    {% endif %}

    {% if item.protected_area  != None %}
    {% field_flex "Protected area" item.protected_area|yesno %}
    {% endif %}

    {% field_flex_full "Comment" item.research_comment "<pre>" "</pre>" %}
</div>

{% endif %}

{% if not next %}

{% trans "Associated parcels" as parcels_label %}
{% include "ishtar/blocks/window_tables/parcels.html" %}

{% trans "Administrative acts" as administrativeacts_label %}
{% table_administrativact administrativeacts_label item.administrative_act.all %}

<h3>{%trans "Associated operations"%}</h3>
<table class="table table-striped">
  <tr>
    <th>{% trans "Ref." %}</th>
    <th>Code Patriarche</th>
    <th>{% trans "Type" %}</th>
    <th>{% trans "In charge" %}</th>
    <th>{% trans "Start date" %}</th>
    <th>{% trans "Excavation end date" %}</th>
    <th class='link'>&nbsp;</th>
  </tr>
  {% for operation in item.operations.all %}
  <tr>
    <td>{{operation.year_index}}</td>
    <td>{{operation.full_code_patriarche|default:""}}</td>
    <td class='string'>{{operation.operation_type}}</td>
    <td class='string'>{{operation.in_charge|default:""}}</td>
    <td>{{operation.start_date|default:""}}</td>
    <td>{{operation.excavation_end_date|default:""}}</td>
    <td class='link'><a href="#" class='display_details'
                        onclick='load_window("{% url "show-operation" operation.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td>
  </tr>
  {% empty %}
  <tr><td colspan="8" class='no_items'>{% trans "No operation associated to this archaeological file" %}</td></tr>
  {% endfor %}
</table>

<h3>{%trans "Admninistrative acts linked to associated operations"%}</h3>
<table class="table table-striped">
  <tr>
    <th>{% trans "Year" %}</th>
    <th>{% trans "Ref." %}</th>
    <th>{% trans "Type" %}</th>
    <th>{% trans "Date" %}</th>
  </tr>
  {% for act in item.operation_acts %}
  <tr>
    <td>{{act.signature_date.year}}</td>
    <td>{{act.ref_sra}}</td>
    <td class='string'>{{act.act_type}}</td>
    <td>{{act.signature_date}}</td>
  </tr>
  {% empty %}
  <tr><td colspan="4" class='no_items'>{% trans "No administrative act linked to operations" %}</td></tr>
  {% endfor %}
</table>

{% endif %}

{% trans "Document for this archaeological file" as fle_docs %}
{% if permission_view_own_document or permission_view_document %}
{% if item.documents.count %}
{% dynamic_table_document fle_docs 'documents' 'files' item.pk '' output %}
{% endif %}
{% endif %}


{% endwith %} {% endwith %} {% endwith %}
{% endblock %}