119 lines
4.4 KiB
HTML
119 lines
4.4 KiB
HTML
{% extends "passerelle/manage.html" %}
|
|
{% load i18n passerelle gadjo staticfiles %}
|
|
|
|
{% comment %}
|
|
This file is part of passerelle-atreal-openads - a Publik connector to openADS
|
|
|
|
Copyright (C) 2019 Atreal
|
|
|
|
This program is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU Affero General Public License as published
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
{% endcomment %}
|
|
|
|
{% block extrascripts %}
|
|
{{ block.super }}
|
|
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/atreal_openads.css" %}?{% start_timestamp %}"/>
|
|
{% endblock %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
{% if connecteur %}<a href="{{connecteur.get_absolute_url}}">{{ connecteur.slug }}</a>{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2>{{ view.model.get_verbose_name_plural }}</h2>
|
|
<span class="actions">
|
|
{% if collectivite_add_url %}
|
|
<a rel="popup" href="{{ collectivite_add_url }}?back-to=list-collectivites">{% trans "Add a Collectivite" %}</a>
|
|
{% endif %}
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<table id="list-collectivite">
|
|
{% block list %}
|
|
{% if object_list %}
|
|
<thead>
|
|
<tr>
|
|
<th class="actions">{% trans "Actions" %}</th>
|
|
{% for field in view.model.get_fields %}
|
|
{% if field.name != "connecteur" %}
|
|
<th class="{{field.name}}">
|
|
{% if field.name == "guichet" %}{% trans "Guichet" %}
|
|
{% elif field.name == "forward_file" %}{% trans "Forward Files" %}
|
|
{% else %}{% trans field.verbose_name %}
|
|
{% endif %}
|
|
</th>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for col in object_list %}
|
|
<tr>
|
|
<td class="actions">
|
|
<span class="edit-link" ><a rel="popup" href="{{col.get_edit_url}}?back-to=list-collectivites" >{% trans "edit" %}</a></span>
|
|
<span class="delete-link"><a rel="popup" href="{{col.get_delete_url}}?back-to=list-collectivites">{% trans "delete" %}</a></span>
|
|
</td>
|
|
{% for field, value in col.get_fields_kv %}
|
|
{% if field.name != "connecteur" %}
|
|
<td class="{{field.name}}">
|
|
{% if field.name != "guichet" and field.name != "name" and field.name != "forward_file" %}
|
|
{{value}}
|
|
{% elif field.name == "name" %}
|
|
<a href="{{col.get_absolute_url}}">{{value}}</a>
|
|
{% elif field.name == "guichet" %}
|
|
{% if value %}<a href="{{value.get_absolute_url}}">{{value}}</a>{% else %}{% trans "None" %}{% endif %}
|
|
{% elif field.name == "forward_file" %}
|
|
{% if value %}<a href="{{ col.get_absolute_url }}/list-forward-files">{{ value.count }} {% trans "forward file(s)" %}</a>{% else %}{% trans "None" %}{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
{% if is_paginated %}
|
|
<tfoot>
|
|
<tr>
|
|
<td class="pagination" colspan="{{ view.model.get_fields|length }}">
|
|
<span class="step-links">
|
|
{% if page_obj.has_previous %}
|
|
<a href="?page=1">« {% trans "first" %}</a>
|
|
<a href="?page={{ contacts.previous_page_number }}">{% trans "previous" %}</a>
|
|
{% endif %}
|
|
|
|
<span class="current">
|
|
{% trans "Page" %} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
|
|
</span>
|
|
|
|
{% if page_obj.has_next %}
|
|
<a href="?page={{ page_obj.next_page_number }}">{% trans "next" %}</a>
|
|
<a href="?page={{ page_obj.paginator.num_pages }}">{% trans "last" %} »</a>
|
|
{% endif %}
|
|
</span>
|
|
<td>
|
|
</tr>
|
|
</tfoot>
|
|
{% endif %}
|
|
{% else %}
|
|
<tr class="nodata">
|
|
<td>{% trans "No data" %}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endblock %}
|
|
</table>
|
|
|
|
{% endblock %}
|