summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/sheet_import_gen.html
blob: 8cb75a7f24932a3ad51ef4fb30ee3ddbc8b81ca0 (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
{% load i18n link_to_window window_header window_field window_tables %}
{% trans "Source" as source_label %}
{% trans "Media" as media_label %}
{% trans "Result" as result_label %}
{% trans "Error" as error_label %}
{% trans "Match" as match_label %}

{% with current_import=item %}{% with object=item %}
{% with imported_list=object.get_all_imported %}
{% with updated_list=object.get_all_updated %}

{% if output != "ODT" and output != "PDF" %}
<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist">
  <li class="nav-item">
    <a class="nav-link active" id="{{window_id}}-general-tab"
       data-toggle="tab" href="#{{window_id}}-general" role="tab"
       aria-controls="{{window_id}}-general" aria-selected="false">
      {% trans "General" %}
    </a>
  </li>
  {% if imported_list %}<li class="nav-item">
    <a class="nav-link" id="{{window_id}}-created-tab"
       data-toggle="tab" href="#{{window_id}}-created" role="tab"
       aria-controls="{{window_id}}-general" aria-selected="false">
      {% trans "Created" %}
    </a>
  </li>{% endif %}
  {% if updated_list %}<li class="nav-item">
    <a class="nav-link" id="{{window_id}}-updated-tab"
       data-toggle="tab" href="#{{window_id}}-updated" role="tab"
       aria-controls="{{window_id}}-updated" aria-selected="false">
      {% trans "Updated" %}
    </a>
  </li>{% endif %}
</ul>
{% endif %}

<div class="tab-content" id="{{window_id}}-tab-content">
  <div class="tab-pane fade show active" id="{{window_id}}-general"
       role="tabpanel" aria-labelledby="{{window_id}}-general-tab">
    <div class="row mb-3">
      {% field_flex "Name" item.name %}
      {% field_flex "Type" item.importer_type %}

      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        <i class="fa fa-fw fa-user" aria-hidden="true"></i>&nbsp; {{item.user}}
      </div>
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        <i class="fa fa-hourglass-start" aria-hidden="true"></i>&nbsp; {{item.creation_date|date:"DATE_FORMAT"}} {{item.creation_date|time:"H:i"}}
        {% if item.end_date %}<br><i class="fa fa-hourglass-end" aria-hidden="true"></i>&nbsp; {{item.end_date|date:"DATE_FORMAT"}} {{item.end_date|time:"H:i"}}{% endif %}
      </div>
      {% field_flex_detail "Import group" item.group %}

      {% if item.imported_file %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        {% with file_label=source_label logo='fa fa-fw fa-file-text-o' file_type='source' file=item.imported_file %}
        {% include "ishtar/blocks/import_table_buttons_view.html" %}
        {% endwith %}
      </div>

      {% if item.get_imported_images %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        {% with file_label=media_label logo='fa fa-fw fa-file-image-o' file_type='' file=item.get_imported_images %}
        {% include "ishtar/blocks/import_table_buttons_view.html" %}
        {% endwith %}
      </div>{% endif %}
      {% elif item.archive_file %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        <i class="fa fa-fw fa-file-archive-o" aria-hidden="true"></i> <a href='{{item.archive_file.url}}'>{% trans "Archive" context "name" %}</a>
      </div>{% endif %}

      {% if item.error_file %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        {% with file_label=error_label logo='text-danger fa fa-fw fa-exclamation-triangle' file_type='error' file=item.error_file %}
        {% include "ishtar/blocks/import_table_buttons_view.html" %}
        {% endwith %}
      </div>
      {% endif %}

      {% if item.result_file %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        {% with file_label=result_label logo='fa fa-fw fa-th' file_type='result' file=item.result_file %}
        {% include "ishtar/blocks/import_table_buttons_view.html" %}
        {% endwith %}
      </div>
      {% endif %}

      {% if item.match_file %}
      <div class="col-12 col-md-6 col-lg-3 flex-wrap">
        {% with file_label=match_label logo='fa fa-fw fa-arrows-h' file_type='match' file=item.match_file %}
        {% include "ishtar/blocks/import_table_buttons_view.html" %}
        {% endwith %}
      </div>
      {% endif %}
      {% with import_list=item.import_list %}{% if import_list %}
      <hr class="col-12">
      <dl class="col-12 flex-wrap">
        <dt>{% trans "Associated imports" %}</dt>
        <dd>{% for import in import_list %}{{import|simple_link_to_window}} {{import}}<br>{% endfor %}</dd>
      </dl>
      {% endif %}{% endwith %}
      {% field_flex _("Number of header lines") item.skip_lines %}
    </div>


    {% with pre_import_items=item.pre_import_items %}{% if pre_import_items %}
    <h3>{% trans "Pre-import values "%}</h3>
    <div class="row mb-3">{% for k, v in pre_import_items %}
      <dl class="col-12 col-md-6 col-lg-3 flex-wrap">
        <dt>
          {{k}}
        </dt>
        <dd>
          {{v}}
        </dd>
      </dl>{% endfor %}
    </div>
    {% endif %}{% endwith %}
  </div>
  {% if imported_list %}
  <div class="tab-pane fade" id="{{window_id}}-created"
       role="tabpanel" aria-labelledby="{{window_id}}-created-tab">
    <div class="row">
      {% for accessor, imported in imported_list %}
      {% include "ishtar/import_associated_item.html" %}
      {% endfor %}
      {% comment %}<div><div>{% endcomment %}
        </div>
      </div>
    </div>
  </div>{% endif %}
  {% if updated_list %}
  <div class="tab-pane fade" id="{{window_id}}-updated"
       role="tabpanel" aria-labelledby="{{window_id}}-updated-tab">
    <div class="row">
      {% for accessor, imported in updated_list %}
      {% include "ishtar/import_associated_item.html" %}
      {% endfor %}
      {% comment %}<div><div>{% endcomment %}
        </div>
      </div>
    </div>
  </div>{% endif %}
</div>

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