aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/errors_display.html
blob: 0c9a2127581e4fb53377627c2498193fc2b581b5 (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
{%macro errors_display(errors, no_error_msg, error_message)%}

{%if errors | length == 0 %}
<span class="alert-success">{{no_error_msg}}</span>
{%else %}
<p class="alert-error">{{error_message}}</p>

<table class="reports-table">
  <thead>
    <tr>
      <th>line number</th>
      <th>column(s)</th>
      <th>error</th>
      <th>error message</th>
    </tr>
  </thead>

  <tbody>
    {%for error in errors%}
    <tr>
      <td>{{error["line"]}}</td>
      <td>
	{%if isinvalidvalue(error):%}
	{{error.column}}
	{%else: %}
	{{error.columns}}
	{%endif %}
      </td>
      <td>
	{%if isinvalidvalue(error):%}
	Invalid Value
	{%else: %}
	Duplicate Header
	{%endif %}
      </td>
      <td>{{error["message"]}}</td>
    </tr>
    {%endfor%}
  </tbody>
</table>
{%endif%}

{%endmacro%}