1
0
forked from ScoDoc/ScoDoc
ScoDoc-Front/app/templates/entreprises/contacts.html

81 lines
3.5 KiB
HTML

{# -*- mode: jinja-html -*- #}
{% extends 'base.html' %}
{% block app_content %}
{% include 'entreprises/nav.html' %}
{% if logs %}
<div class="container">
<h3>Dernières opérations <a href="{{ url_for('entreprises.logs') }}">Voir tout</a></h3>
<ul>
{% for log in logs %}
<li><span style="margin-right: 10px;">{{ log.date.strftime('%d %b %Hh%M') }}</span><span>{{ log.text|safe }} par {{ log.authenticated_user|get_nomcomplet_by_username }}</span></li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="container boutons">
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesExport, None) %}
<a class="btn btn-default" href="{{ url_for('entreprises.import_contacts') }}">Importer des contacts</a>
{% endif %}
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesExport, None) and contacts.items %}
<a class="btn btn-default" href="{{ url_for('entreprises.export_contacts') }}">Exporter la liste des contacts</a>
{% endif %}
</div>
<div class="container">
<h1>Liste des contacts</h1>
{% if contacts.items %}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<tr>
<th>Nom</th>
<th>Prenom</th>
<th>Telephone</th>
<th>Mail</th>
<th>Poste</th>
<th>Service</th>
<th>Entreprise</th>
</tr>
{% for contact in contacts.items %}
<tr class="table-row active">
<th>{{ contact[0].nom }}</th>
<th>{{ contact[0].prenom }}</th>
<th>{{ contact[0].telephone }}</th>
<th>{{ contact[0].mail }}</th>
<th>{{ contact[0].poste}}</th>
<th>{{ contact[0].service}}</th>
<th><a href="{{ url_for('entreprises.fiche_entreprise', id=contact[1].id) }}">{{ contact[1].nom }}</a></th>
</tr>
{% endfor %}
</table>
</div>
<div class="text-center">
<a href="{{ url_for('entreprises.contacts', page=contacts.prev_num) }}" class="btn btn-default {% if contacts.page == 1 %}disabled{% endif %}">
&laquo;
</a>
{% for page_num in contacts.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %}
{% if page_num %}
{% if contacts.page == page_num %}
<a href="{{ url_for('entreprises.contacts', page=page_num) }}" class="btn btn-inverse">{{ page_num }}</a>
{% else %}
<a href="{{ url_for('entreprises.contacts', page=page_num) }}" class="btn btn-default">{{ page_num }}</a>
{% endif %}
{% else %}
...
{% endif %}
{% endfor %}
<a href="{{ url_for('entreprises.contacts', page=contacts.next_num) }}" class="btn btn-default {% if contacts.page == contacts.pages %}disabled{% endif %}">
&raquo;
</a>
</div>
<p class="text-center">
Page {{ contacts.page }} sur {{ contacts.pages }}
</p>
{% else %}
<div>Aucun contact présent dans la base</div>
{% endif %}
</div>
{% endblock %}