mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
162 lines
No EOL
10 KiB
Twig
162 lines
No EOL
10 KiB
Twig
<tr>
|
|
<td class="{{ commerce.hasAddress() ? 'filled' : '' }}">
|
|
<a href="{{ path('app_admin_commerce', {'id': commerce.id}) }}">
|
|
{% if commerce.name is empty %}
|
|
<span class="no-name">
|
|
(sans nom)
|
|
</span>
|
|
{% else %}
|
|
{{ commerce.name }}
|
|
{% endif %}
|
|
</a>
|
|
</td>
|
|
<td>
|
|
<a href="{{ path('app_admin_make_email_for_place', {'id': commerce.id}) }}">
|
|
voir email
|
|
<i class="bi bi-envelope-fill"></i>
|
|
</a>
|
|
</td>
|
|
<td class="text-right completion-cell"
|
|
style="background : rgba(0,255,0,{{ commerce.getCompletionPercentage() / 100 }})"
|
|
data-bs-toggle="popover"
|
|
data-bs-trigger="hover"
|
|
data-bs-html="true"
|
|
data-bs-content="
|
|
<div class='p-2'>
|
|
<h6>Informations manquantes :</h6>
|
|
<ul class='list-unstyled mb-0'>
|
|
{% if not commerce.name %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Nom du commerce</li>
|
|
{% endif %}
|
|
{% if not commerce.hasAddress() %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Adresse complète</li>
|
|
{% endif %}
|
|
{% if not commerce.hasOpeningHours() %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Horaires d'ouverture</li>
|
|
{% endif %}
|
|
{% if not commerce.hasWebsite() %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Site web</li>
|
|
{% endif %}
|
|
{# {% if not commerce.phone %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Téléphone</li>
|
|
{% endif %} #}
|
|
{% if not commerce.hasWheelchair() %}
|
|
<li><i class='bi bi-x-circle text-danger'></i> Accessibilité PMR</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
"
|
|
>
|
|
{{ commerce.getCompletionPercentage() }}
|
|
</td>
|
|
<td class="{{ commerce.mainTag ? 'filled' : '' }}">
|
|
|
|
{% if commerce.mainTag == 'amenity=restaurant' or commerce.mainTag == 'amenity=bar' or commerce.mainTag == 'amenity=cafe' %}
|
|
<i class="bi bi-fork-knife"></i>
|
|
|
|
{% elseif commerce.mainTag == 'amenity=townhall' or commerce.mainTag == 'amenity=community_centre' %}
|
|
<i class="bi bi-building"></i>
|
|
{% elseif commerce.mainTag == 'amenity=bank' or commerce.mainTag == 'amenity=atm' %}
|
|
<i class="bi bi-bank"></i>
|
|
{% elseif commerce.mainTag == 'amenity=pharmacy' or commerce.mainTag == 'amenity=hospital' or commerce.mainTag == 'amenity=clinic' %}
|
|
<i class="bi bi-hospital"></i>
|
|
{% elseif commerce.mainTag == 'amenity=school' or commerce.mainTag == 'amenity=kindergarten' or commerce.mainTag == 'amenity=university' %}
|
|
<i class="bi bi-school"></i>
|
|
{% elseif commerce.mainTag == 'amenity=library' or commerce.mainTag == 'amenity=museum' or commerce.mainTag == 'amenity=artwork' %}
|
|
<i class="bi bi-book"></i>
|
|
{% elseif commerce.mainTag == 'shop=car_repair' or commerce.mainTag == 'shop=car_parts' or commerce.mainTag == 'shop=car_wash' %}
|
|
<i class="bi bi-car-front"></i>
|
|
|
|
{% elseif commerce.mainTag == 'amenity=post_office' %}
|
|
<i class="bi bi-envelope"></i>
|
|
{% elseif commerce.mainTag == 'shop=convenience' %}
|
|
<i class="bi bi-shop"></i>
|
|
{% elseif commerce.mainTag == 'shop=supermarket' %}
|
|
<i class="bi bi-shop"></i>
|
|
{% elseif commerce.mainTag == 'shop=clothes' %}
|
|
<i class="bi bi-shop"></i>
|
|
{% else %}
|
|
<i class="bi bi-tag"></i>
|
|
{% endif %}
|
|
|
|
<a href="https://wiki.openstreetmap.org/wiki/FR:Tag:{{ commerce.mainTag }}">
|
|
{{ commerce.mainTag }}
|
|
</a>
|
|
</td>
|
|
<td class="{{ commerce.hasAddress() ? 'filled' : '' }}">{{ commerce.address }} </td>
|
|
<td class="{{ commerce.hasAddress() ? 'filled' : '' }}">{{ commerce.housenumber }}</td>
|
|
<td class="{{ commerce.hasAddress() ? 'filled' : '' }}">{{ commerce.street }}</td>
|
|
<td class="{{ commerce.hasWebsite() ? 'filled' : '' }}">{{ commerce.website }}</td>
|
|
<td class="{{ commerce.hasWheelchair() ? 'filled' : '' }}">{{ commerce.wheelchair }}</td>
|
|
<td class="{{ commerce.hasNote() ? 'filled' : '' }}">{{ commerce.note }}</td>
|
|
<td class="{{ commerce.noteContent ? 'filled' : '' }}">{{ commerce.noteContent }}</td>
|
|
<td class="{{ commerce.siret ? 'filled' : '' }}">
|
|
|
|
{% if commerce.siret %}
|
|
{% set sirets = commerce.siret|split(';')|map(siret => siret|trim)|filter(siret => siret) %}
|
|
{% for siret in sirets %}
|
|
{% if not loop.first %}, {% endif %}
|
|
<a href="https://annuaire-entreprises.data.gouv.fr/etablissement/{{ siret }}" >{{ siret }}</a>
|
|
{% endfor %}
|
|
{% else %}
|
|
<a href="https://annuaire-entreprises.data.gouv.fr/etablissement/{{ commerce.siret }}" >
|
|
{% endif %}
|
|
|
|
|
|
<td>
|
|
{# (si siret clos) #}
|
|
</td>
|
|
<td>
|
|
{% if commerce.osmDataDate %}
|
|
{% set now = "now"|date("U") %}
|
|
{% set osmDate = commerce.osmDataDate|date("U") %}
|
|
{% set diff = now - osmDate %}
|
|
{% set years = (diff / 31536000)|round(0, 'floor') %}
|
|
{% set months = ((diff % 31536000) / 2592000)|round(0, 'floor') %}
|
|
{% set days = ((diff % 2592000) / 86400)|round(0, 'floor') %}
|
|
|
|
<div class="small osm-modification-info">
|
|
<div>
|
|
<i class="bi bi-calendar"></i>
|
|
{{ commerce.osmDataDate|date('d/m/Y H:i') }}
|
|
</div>
|
|
{% if commerce.osmUser %}
|
|
<div>
|
|
<i class="bi bi-person"></i>
|
|
<a href="https://www.openstreetmap.org/user/{{ commerce.osmUser }}" target="_blank" title="Voir le profil OSM">
|
|
{{ commerce.osmUser }}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
<div class="text-muted">
|
|
<small>
|
|
{% if diff < 86400 %}
|
|
Aujourd'hui
|
|
{% elseif years > 0 %}
|
|
{{ years }} an{{ years > 1 ? 's' : '' }}
|
|
{% if months > 0 %}, {{ months }} mois{% endif %}
|
|
{% elseif months > 0 %}
|
|
{{ months }} mois
|
|
{% if days > 0 %}, {{ days }} jour{{ days > 1 ? 's' : '' }}{% endif %}
|
|
{% elseif days > 0 %}
|
|
{{ days }} jour{{ days > 1 ? 's' : '' }}
|
|
{% else %}
|
|
Aujourd'hui
|
|
{% endif %}
|
|
</small>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<span class="text-muted">Non disponible</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<a href="https://www.openstreetmap.org/{{ commerce.osmKind }}/{{ commerce.osmId }}" title="{{ commerce.osmKind }} - {{ commerce.osmId }} " >
|
|
<i class="bi bi-globe"></i>
|
|
|
|
</a>
|
|
</td>
|
|
<td>
|
|
{{ commerce.osmKind }}
|
|
</td>
|
|
</tr> |