MonScoDocEssai/app/templates/entreprises/entreprises.html

133 lines
6.5 KiB
HTML
Raw Normal View History

2021-12-29 14:41:33 +01:00
{# -*- mode: jinja-html -*- #}
2021-12-23 19:28:25 +01:00
{% extends 'base.html' %}
2022-02-17 20:11:20 +01:00
{% block styles %}
{{super()}}
<script src="/ScoDoc/static/jQuery/jquery-1.12.4.min.js"></script>
2022-03-23 12:39:52 +01:00
<link rel="stylesheet" type="text/css" href="/ScoDoc/static/DataTables/datatables.min.css">
<script type="text/javascript" charset="utf8" src="/ScoDoc/static/DataTables/datatables.min.js"></script>
2022-02-17 20:11:20 +01:00
{% endblock %}
2021-12-23 19:28:25 +01:00
{% block app_content %}
{% include 'entreprises/nav.html' %}
2021-12-23 19:28:25 +01:00
{% if logs %}
<div class="container">
2022-01-31 18:22:54 +01:00
<h3>Dernières opérations <a href="{{ url_for('entreprises.logs') }}">Voir tout</a></h3>
2021-12-23 19:28:25 +01:00
<ul>
{% for log in logs %}
2022-02-10 21:17:22 +01:00
<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>
2021-12-23 19:28:25 +01:00
{% endfor %}
</ul>
</div>
{% endif %}
2022-01-31 18:22:54 +01:00
2022-02-03 16:53:59 +01:00
<div class="container boutons">
2022-02-01 18:35:48 +01:00
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
<a class="btn btn-default" href="{{ url_for('entreprises.add_entreprise') }}">Ajouter une entreprise</a>
{% endif %}
2022-02-07 18:39:32 +01:00
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesExport, None) %}
<a class="btn btn-default" href="{{ url_for('entreprises.import_donnees') }}">Importer des données</a>
2022-02-07 18:39:32 +01:00
{% endif %}
2022-02-17 20:11:20 +01:00
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesExport, None) and entreprises %}
<a class="btn btn-default" href="{{ url_for('entreprises.export_donnees') }}">Exporter des données</a>
2022-02-01 18:35:48 +01:00
{% endif %}
</div>
2022-02-25 09:45:14 +01:00
<div class="container" style="margin-bottom: 10px;">
2021-12-23 19:28:25 +01:00
<h1>Liste des entreprises</h1>
{% if form %}
2022-05-06 18:50:12 +02:00
<form id="form-entreprise-filter" method="POST" action="">
{{ form.hidden_tag() }}
2022-05-06 18:50:12 +02:00
<input id="active" name="active" type="checkbox" onChange="form.submit()" {% if checked[0] %} checked {% endif %}> {{ form.active.label }}
<input id="association" name="association" type="checkbox" onChange="form.submit()" {% if checked[1] %} checked {% endif %}> {{ form.association.label }}
<input id="siret_provisoire" name="siret_provisoire" type="checkbox" onChange="form.submit()" {% if checked[2] %} checked {% endif %}> {{ form.siret_provisoire.label }}
</form>
{% endif %}
2022-02-17 20:11:20 +01:00
<table id="table-entreprises">
<thead>
2021-12-23 19:28:25 +01:00
<tr>
2022-02-17 20:11:20 +01:00
<td data-priority="2">SIRET</td>
<td data-priority="1">Nom</td>
<td data-priority="4">Adresse</td>
<td data-priority="6">Code postal</td>
<td data-priority="5">Ville</td>
<td data-priority="7">Pays</td>
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
2022-02-17 20:11:20 +01:00
<td data-priority="3">Action</td>
{% endif %}
2021-12-23 19:28:25 +01:00
</tr>
2022-02-17 20:11:20 +01:00
</thead>
<tbody>
{% for entreprise in entreprises %}
<tr>
2022-07-11 16:06:38 +02:00
<td><a href="{{ url_for('entreprises.fiche_entreprise', entreprise_id=entreprise.id) }}" {% if not entreprise.active %} style="color:red" {% endif %}>{{ entreprise.siret }}</a></td>
2022-02-17 20:11:20 +01:00
<td>{{ entreprise.nom }}</td>
<td>{{ entreprise.adresse }}</td>
<td>{{ entreprise.codepostal }}</td>
<td>{{ entreprise.ville }}</td>
<td>{{ entreprise.pays }}</td>
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
2022-02-17 20:11:20 +01:00
<td>
2021-12-23 19:28:25 +01:00
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">Action
<span class="caret"></span>
</a>
2022-02-17 20:11:20 +01:00
<ul class="dropdown-menu pull-left">
2022-07-11 16:06:38 +02:00
<li><a href="{{ url_for('entreprises.edit_entreprise', entreprise_id=entreprise.id) }}">Modifier</a></li>
{% if entreprise.active %}
2022-07-11 16:06:38 +02:00
<li><a href="{{ url_for('entreprises.fiche_entreprise_desactiver', entreprise_id=entreprise.id)}}" style="color:red">Désactiver</a></li>
{% else %}
2022-07-11 16:06:38 +02:00
<li><a href="{{ url_for('entreprises.fiche_entreprise_activer', entreprise_id=entreprise.id)}}" style="color:lightgreen">Activer</a></li>
{% endif %}
2021-12-23 19:28:25 +01:00
</ul>
</div>
2022-02-17 20:11:20 +01:00
</td>
{% endif %}
2021-12-23 19:28:25 +01:00
</tr>
{% endfor %}
2022-02-17 20:11:20 +01:00
</tbody>
<tfoot>
<tr>
<td>SIRET</td>
<td>Nom</td>
<td>Adresse</td>
<td>Code postal</td>
<td>Ville</td>
<td>Pays</td>
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
<td>Action</td>
2022-02-03 16:53:59 +01:00
{% endif %}
2022-02-17 20:11:20 +01:00
</tr>
</tfoot>
</table>
2021-12-23 19:28:25 +01:00
</div>
2022-02-17 20:11:20 +01:00
<script>
document.addEventListener('DOMContentLoaded', function () {
let table = new DataTable('#table-entreprises',
{
"autoWidth": false,
"responsive": {
"details": true
},
"pageLength": 10,
"language": {
"emptyTable": "Aucune donnée disponible dans le tableau",
"info": "Affichage de _START_ à _END_ sur _TOTAL_ entrées",
"infoEmpty": "Affichage de 0 à 0 sur 0 entrées",
"infoFiltered": "(filtrées depuis un total de _MAX_ entrées)",
"lengthMenu": "Afficher _MENU_ entrées",
"loadingRecords": "Chargement...",
"processing": "Traitement...",
"search": "Rechercher:",
"zeroRecords": "Aucune entrée correspondante trouvée",
"paginate": {
"next": "Suivante",
"previous": "Précédente"
}
}
});
});
</script>
2021-12-23 19:28:25 +01:00
{% endblock %}