mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
labourage avec davantage d'objets
This commit is contained in:
parent
2965841e81
commit
a412cb977a
11 changed files with 197 additions and 81 deletions
|
@ -1,6 +1,6 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello AdminController!{% endblock %}
|
||||
{% block title %}Résultats du labourage sur la zone {{ zone }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
|
@ -24,17 +24,8 @@ commerces existants disposant d'un moyen de contact mail: {{ commerces|length }}
|
|||
{# {{ dump(commerces[0]) }} #}
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Adresse</th>
|
||||
<th>Email</th>
|
||||
<th>Site web</th>
|
||||
<th>Horaires</th>
|
||||
<th>Note</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% include 'admin/stats/table-head.html.twig' %}
|
||||
|
||||
<tbody>
|
||||
{% for commerce in commerces %}
|
||||
<tr>
|
||||
|
|
|
@ -33,30 +33,10 @@
|
|||
<div class="card mt-4">
|
||||
<h1 class="card-title">Tableau des lieux</h1>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom ({{ stats.getPlacesCount() }})</th>
|
||||
<th>Type</th>
|
||||
<th>Adresse ({{ stats.getAvecAdresse() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Site web ({{ stats.getAvecSite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Accessibilité ({{ stats.getAvecAccessibilite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Note ({{ stats.getAvecNote() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Note ({{ stats.getAvecNote() }} / {{ stats.getPlacesCount() }})</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% include 'admin/stats/table-head.html.twig' %}
|
||||
<tbody>
|
||||
{% for commerce in stats.places %}
|
||||
<tr>
|
||||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">
|
||||
<a href="{{ path('app_admin_commerce', {'id': commerce.id}) }}">{{ commerce.name }}</a>
|
||||
</td>
|
||||
<td style="background-color: {{ commerce.mainTag ? 'yellowgreen' : 'transparent' }};">{{ commerce.mainTag }}</td>
|
||||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">{{ commerce.address }}</td>
|
||||
<td style="background-color: {{ commerce.hasWebsite() ? 'yellowgreen' : 'transparent' }};">{{ commerce.website }}</td>
|
||||
<td style="background-color: {{ commerce.hasWheelchair() ? 'yellowgreen' : 'transparent' }};">{{ commerce.wheelchair }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.note }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.noteContent }}</td>
|
||||
</tr>
|
||||
{% include 'admin/stats/row.html.twig' %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
11
templates/admin/stats/row.html.twig
Normal file
11
templates/admin/stats/row.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
<tr>
|
||||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">
|
||||
<a href="{{ path('app_admin_commerce', {'id': commerce.id}) }}">{{ commerce.name }}</a>
|
||||
</td>
|
||||
<td style="background-color: {{ commerce.mainTag ? 'yellowgreen' : 'transparent' }};">{{ commerce.mainTag }}</td>
|
||||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">{{ commerce.address }}</td>
|
||||
<td style="background-color: {{ commerce.hasWebsite() ? 'yellowgreen' : 'transparent' }};">{{ commerce.website }}</td>
|
||||
<td style="background-color: {{ commerce.hasWheelchair() ? 'yellowgreen' : 'transparent' }};">{{ commerce.wheelchair }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.note }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.noteContent }}</td>
|
||||
</tr>
|
28
templates/admin/stats/table-head.html.twig
Normal file
28
templates/admin/stats/table-head.html.twig
Normal file
|
@ -0,0 +1,28 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Nom ({{ stats.getPlacesCount() }})</th>
|
||||
<th>
|
||||
<i class="bi bi-tags"></i>
|
||||
Type
|
||||
</th>
|
||||
<th>
|
||||
<i class="bi bi-geo-alt"></i>
|
||||
Adresse ({{ stats.getAvecAdresse() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>
|
||||
<i class="bi bi-globe"></i>
|
||||
Site web ({{ stats.getAvecSite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>
|
||||
<i class="bi bi-wheelchair"></i>
|
||||
<i class="bi bi-person-fill-slash"></i>
|
||||
Accès
|
||||
|
||||
PMR
|
||||
({{ stats.getAvecAccessibilite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>
|
||||
<i class="bi bi-pencil-square"></i>
|
||||
Note ? ({{ stats.getAvecNote() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>
|
||||
<i class="bi bi-pencil-square"></i>
|
||||
Texte de la note</th>
|
||||
</tr>
|
||||
</thead>
|
|
@ -5,7 +5,10 @@
|
|||
{% block body %}
|
||||
<h1>Dernières modifications</h1>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 ">
|
||||
<h2>Lieux modifiés</h2>
|
||||
<table class="table table-striped table-hover table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -21,35 +24,35 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for place in places %}
|
||||
<tr>
|
||||
|
||||
<td>{% if place.name %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': place.name|url_encode, 'uuid': place.uuidForUrl}) }}">{{ place.name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': '?', 'uuid': place.uuidForUrl}) }}"><i class="bi bi-question-circle"></i></a>
|
||||
{% endif %} </td>
|
||||
<td>{{ place.mainTag }}</td>
|
||||
<td>{{ place.email }}</td>
|
||||
<td>{{ place.modifiedDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.lastContactAttemptDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.modifiedDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.zipCode }}</td>
|
||||
<td>
|
||||
<a href="https://www.openstreetmap.org/{{place.osmKind}}/{{ place.osmId }}" target="_blank"><i class="bi bi-globe"></i></a>
|
||||
|
||||
{% if place.name %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': place.name|url_encode, 'uuid': place.uuidForUrl}) }}"><i class="bi bi-pencil"></i></a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': '?', 'uuid': place.uuidForUrl}) }}"><i class="bi bi-pencil"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_admin_delete', {'id': place.id}) }}" onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce lieu ?')"><i class="bi bi-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% for place in places_modified %}
|
||||
{% include 'public/place/row.html.twig' %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-12 col-md-6 ">
|
||||
<h2>Lieux affichés</h2>
|
||||
<table class="table table-striped table-hover table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Tag</th>
|
||||
<th>Email</th>
|
||||
<th>Date de dernière modification</th>
|
||||
<th>Date de dernier contact</th>
|
||||
<th>Date de dernière modification</th>
|
||||
<th>Code postal</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for place in places_displayed %}
|
||||
{% include 'public/place/row.html.twig' %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
25
templates/public/place/row.html.twig
Normal file
25
templates/public/place/row.html.twig
Normal file
|
@ -0,0 +1,25 @@
|
|||
<tr>
|
||||
|
||||
<td>{% if place.name %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': place.name|url_encode, 'uuid': place.uuidForUrl}) }}">{{ place.name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': '?', 'uuid': place.uuidForUrl}) }}"><i class="bi bi-question-circle"></i></a>
|
||||
{% endif %} </td>
|
||||
<td>{{ place.mainTag }}</td>
|
||||
<td>{{ place.email }}</td>
|
||||
<td>{{ place.modifiedDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.lastContactAttemptDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.modifiedDate | date('Y-m-d H:i:s') }}</td>
|
||||
<td>{{ place.zipCode }}</td>
|
||||
<td>
|
||||
<a href="https://www.openstreetmap.org/{{place.osmKind}}/{{ place.osmId }}" target="_blank"><i class="bi bi-globe"></i></a>
|
||||
|
||||
{% if place.name %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': place.name|url_encode, 'uuid': place.uuidForUrl}) }}"><i class="bi bi-pencil"></i></a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': '?', 'uuid': place.uuidForUrl}) }}"><i class="bi bi-pencil"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_admin_delete', {'id': place.id}) }}" onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce lieu ?')"><i class="bi bi-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
Loading…
Add table
Add a link
Reference in a new issue