authentic/src/authentic2/manager/templates/authentic2/manager/user_import_report.html

136 lines
5.0 KiB
HTML

{% extends "authentic2/manager/base.html" %}
{% load i18n gadjo staticfiles %}
{% block page-title %}{{ block.super }} - {% trans "Import Users" %}{% endblock %}
{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static "authentic2/manager/css/user_import.css" %}">
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'a2-manager-users' %}">{% trans 'Users' %}</a>
<a href="{% url 'a2-manager-users-imports' %}">{% trans 'Imports' %}</a>
<a href="{% url 'a2-manager-users-import' uuid=user_import.uuid %}">{% trans "Users Import" %} {{ user_import.created }}</a>
<a href="{% url 'a2-manager-users-import-report' import_uuid=user_import.uuid report_uuid=report.uuid%}">{{ report_title }} {{ report.created }}</a>
{% endblock %}
{% block sidebar %}
<aside id="sidebar">
<h3>{% trans "Legend" %}</h3>
<table>
<tr>
<td><span class="header-flag-key"></span></td>
<td>{% trans "value is a key" %}</td>
</tr>
<tr>
<td><span class="header-flag-unique"></span></td>
<td>{% trans "value must be unique" %}</td>
</tr>
<tr>
<td><span class="header-flag-create"></span></td>
<td>{% trans "used on creation" %}</td>
</tr>
<tr>
<td><span class="header-flag-update"></span></td>
<td>{% trans "used on update" %}</td>
</tr>
<tr>
<td><span class="header-flag-verified"></span></td>
<td>{% trans "value is verified" %}</td>
</tr>
<tr>
<td class="legend-row-valid"></td>
<td>{% trans "row is valid" %}</td>
</tr>
<tr>
<td class="legend-cell-action-updated"></td>
<td>{% trans "value will be written" %}</td>
</tr>
<tr>
<td class="legend-row-invalid"></td>
<td>{% trans "row is invalid" %}</td>
</tr>
<tr>
<td class="legend-cell-errors"></td>
<td>{% trans "value has errors" %}</td>
</tr>
</table>
</aside>
{% endblock %}
{% block main %}
<h2>{{ report_title }} - {{ report.created }} - {{ report.state }}</h2>
{% if report.exception %}
<p>{% trans "Exception:" %} {{ report.exception}}</p>
{% endif %}
{% if report.importer %}
{% with importer=report.importer %}
{% if importer.errors %}
<h4>{% trans "Errors" %}</h4>
<ul class="errors">
{% for error in importer.errors %}
<li data-code="{{ error.code }}">{% firstof error.description error.code %}</li>
{% endfor %}
</ul>
{% endif %}
<h3>{% trans "Abstract" %}</h3>
<ul>
<li>{{ importer.rows|length }} {% trans "rows" %}</li>
<li>{{ importer.created }} {% trans "user(s) created" %}</li>
<li>{{ importer.updated }} {% trans "user(s) updated" %}</li>
<li>{{ importer.rows_with_errors }} {% trans "rows have errors" %}</li>
<li>{% blocktrans with duration=report.duration %}import took {{ duration }}{% endblocktrans %}</li>
</ul>
<h3>{% trans "Details" %}</h3>
{% if importer.rows %}
<table id="import-report-table" class="main">
<thead>
<tr>
<td>{% trans "Line" %}</td>
{% for header in importer.headers %}
<td
{% if header.flags %}
title="flags: {% for flag in header.flags %}{{ flag }} {% endfor %}"
{% endif %}
>
{{ header.name }}
{% for flag in header.flags %}
<span class="header-flag-{{ flag }}"></span>
{% endfor %}
</td>
{% endfor %}
<td>{% trans "Action" %}</td>
</tr>
</thead>
<tbody>
{% for row in importer.rows %}
<tr
class="{% if row.is_valid %}row-valid{% else %}row-invalid{% endif %} row-action-{{ row.action }}"
{% if not row.is_valid %}title="{% for error in row.errors %}{% firstof error.description error.code %}
{% endfor %}{% for cell in row %}{% for error in cell.errors %}
{{ cell.header.name }}: {% firstof error.description error.code %}{% endfor %}{% endfor %}"{% endif %}
>
<td class="row-line">{{ row.line }}</td>
{% for cell in row %}
<td
class="{% if cell.errors %}cell-errors{% endif %} {% if cell.action %}cell-action-{{ cell.action }}{% endif %}"
{% if cell.errors %}title="{% for error in cell.errors %}{% firstof error.description error.code %}
{% endfor %}"{% endif %}
>
{{ cell.value }}
</td>
{% endfor %}
<td class="row-action">{% firstof row.action "-" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "No row analysed." %}</p>
{% endif %}
{% endwith %}
{% endif %}
{% endblock %}