blob: ae180dd5efe8666d6bf15f9d937a8e11da7c0b93 (
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
|
{% extends "ishtar/sheet.html" %}
{% load i18n l10n ishtar_helpers window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %}
{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item.cached_label|default:"" }}{% endblock %}
{% block toolbar %}
{% window_nav item window_id 'show-treatment' 'treatment_modify' 'show-historized-treatment' 'revert-treatment' previous next 1 %}
{% endblock %}
{% block content %}
{# trick to set to null non existing variable #}
{% with permission_view_document=permission_view_document %}
{% with permission_view_own_document=permission_view_own_document %}
{% with can_view_documents=permission_view_own_document|or_:permission_view_document %}
{% with has_documents=item|safe_or:"documents.count|documents_list"|safe_and_not:"documents_not_available" %}
{% with display_documents=can_view_documents|and_:has_documents %}
<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="{{window_id}}-treatment-tab"
data-toggle="tab" href="#{{window_id}}-treatment" role="tab"
aria-controls="{{window_id}}-treatment" aria-selected="true">
{% trans "Treatment" %}
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="{{window_id}}-find-tab"
data-toggle="tab" href="#{{window_id}}-find" role="tab"
aria-controls="{{window_id}}-find" aria-selected="true">
{% trans "Finds" %}
</a>
</li>
{% if display_documents %}
<li class="nav-item">
<a class="nav-link" id="{{window_id}}-documents-tab"
data-toggle="tab" href="#{{window_id}}-documents" role="tab"
aria-controls="{{window_id}}-documents" aria-selected="true">
{% trans "Documents" %}
</a>
</li>
{% endif %}
{% if item.administrative_act.count %}
<li class="nav-item">
<a class="nav-link" id="{{window_id}}-admin-tab"
data-toggle="tab" href="#{{window_id}}-admin" role="tab"
aria-controls="{{window_id}}-admin" aria-selected="true">
{% trans "Administrative acts" %}
</a>
</li>
{% endif %}
</ul>
{% with has_image=item.images_number %}
<div class="tab-content" id="{{window_id}}-tab-content">
<div class="tab-pane fade show active" id="{{window_id}}-treatment"
role="tabpanel" aria-labelledby="{{window_id}}-treatment-tab">
{% if has_image %}
<div class="clearfix">
<div class="card float-left col-12 col-md-6 col-lg-4">
{% include "ishtar/blocks/window_image.html" %}
{% else %}
<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">
{% endif %}
<div class="card-body">
<div class="card-text">
<p class="window-refs">{{ item.label|default:"" }}</p>
{% if item.reference %}
<p class="window-refs">{{ item.reference }}</p>{% endif %}
<p class="window-refs">{{ item.year|unlocalize }} - {{ item.index|unlocalize }}</p>
{% if item.external_id %}
<p class="window-refs">{{ item.external_id }}</p>{% endif %}
</div>
</div>
</div>
{% if not has_image %}</div></div>{% endif %}
<div class="row">
{% field_flex_multiple_obj "Treatment type" item 'treatment_types' %}
{% field_flex _("Status") item.treatment_status %}
{% field_flex_detail "Associated request" item.file %}
{% field_flex_detail "Location" item.location %}
{% field_flex_detail "Container" item.container %}
{% field_flex_detail "Scientific monitoring manager" item.scientific_monitoring_manager %}
{% field_flex_detail _("Responsible of the treatment") item.person %}
{% field_flex_detail "Organization" item.organization %}
{% field_flex "Start date" item.start_date|date:"DATE_FORMAT" %}
{% field_flex _("End date") item.end_date|date:"DATE_FORMAT" %}
{% field_flex "Estimated cost" item.estimated_cost|intcomma '' " "|add:CURRENCY %}
{% field_flex "Quoted cost" item.quoted_cost|intcomma '' " "|add:CURRENCY %}
{% field_flex "Realized cost" item.realized_cost|intcomma '' " "|add:CURRENCY %}
{% field_flex "Insurance cost" item.insurance_cost|intcomma '' " "|add:CURRENCY %}
{% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
{% field_flex_full "Description" item.description "<pre>" "</pre>" %}
{% field_flex_full "Goal" item.goal "<pre>" "</pre>" %}
{% include "ishtar/blocks/sheet_json.html" %}
</div>
{% if not is_external %}
{% if item.history_creator or item.last_edition_date or item.created %}
<h3>{% trans "Sheet"%}</h3>
<div class="row">
{% field_flex _("Input status") item.input_status %}
{% include "ishtar/blocks/sheet_creation_section.html" %}
</div>
{% endif %}
{% endif %}
{% if has_image %}</div>{% endif %}
</div>
<div class="tab-pane fade" id="{{window_id}}-find"
role="tabpanel" aria-labelledby="{{window_id}}-find-tab">
{% trans "Related finds" as finds %}
{% if item.finds.count %}
{% dynamic_table_document finds 'finds_for_treatment' 'treatments' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% trans "Upstream finds" as finds %}
{% if item.upstream.count %}
{% dynamic_table_document finds 'finds_for_treatment' 'downstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% trans "Downstream finds" as finds %}
{% if item.downstream.count %}
{% dynamic_table_document finds 'finds_for_treatment' 'upstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% comment %}
{% trans "Related operations" as related_operations %}
{% dynamic_table_document related_operations 'operations' 'related_treatment' item.pk 'TABLE_COLS' output %}
{% endcomment %}
</div>
{% if display_documents %}
<div class="tab-pane fade" id="{{window_id}}-documents"
role="tabpanel" aria-labelledby="{{window_id}}-documents-tab">
{% with permission_change_item=item|can_edit_item:request %}
{% include "ishtar/blocks/sheet_document_list.html" %}
{% endwith %}
</div>
{% endif %}
{% if item.administrative_act.count %}
<div class="tab-pane fade" id="{{window_id}}-admin"
role="tabpanel" aria-labelledby="{{window_id}}-admin-tab">
{% trans "Administrative acts" as admact_lbl %}
{% table_administrativact admact_lbl item.administrative_act.all %}
</div>
{% endif %}
</div>
{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}
{% endblock %}
|