summaryrefslogtreecommitdiff
path: root/archaeological_finds/templates/ishtar/sheet_treatment.html
blob: b5025b3fefc216d3bc5bb0e2bdfb86f1d7492864 (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
{% extends "ishtar/sheet.html" %}
{% load i18n window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %}

{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item|default:"" }}{% endblock %}

{% block toolbar %}
{% window_nav item window_id 'show-treatment' 'treatment_modify' 'show-historized-treatment' 'revert-treatment' previous next 1 %}
{% endblock %}

{% block content %}

<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 item.documents.count %}
    <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.other_reference %}
                            <p class="window-refs">{{ item.other_reference }}</p>{% endif %}
                            <p class="window-refs">{{ item.year }} - {{ item.index }}</p>
                            {% if item.external_id %}
                            <p class="window-refs">{{ item.external_id }}</p>{% endif %}
                            {% if item.end_date %}
                            <p class="window-refs">{% trans "Closed" context "Treatment" %} ({{item.end_date}})</p>
                            {% else %}
                            <p class="window-refs">{% trans "Active" context "Treatment" %}</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 "State" item.treatment_state %}
            {% 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" item.person %}
            {% field_flex_detail "Organization" item.organization %}
            {% field_flex "Start date" item.start_date|date:"DATE_FORMAT" %}
            {% field_flex "Closing 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 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 item.documents.count %}
    <div class="tab-pane fade" id="{{window_id}}-documents"
         role="tabpanel" aria-labelledby="{{window_id}}-documents-tab">
        {% trans "Associated documents" as treat_docs %}
        {% dynamic_table_document treat_docs 'documents' 'treatments' item.pk '' output %}
    </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 %}
{% endblock %}