ajout recherche par nom

This commit is contained in:
Tykayn 2025-05-28 16:24:34 +02:00 committed by tykayn
parent 3a73c1adad
commit ccab916286
11 changed files with 345 additions and 204 deletions

View file

@ -43,7 +43,10 @@
<tbody>
{% for commerce in stats.places %}
<tr>
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">{{ commerce.name }}</td>
<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.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>
@ -54,139 +57,22 @@
</table>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const headers = document.querySelectorAll('th');
headers.forEach(header => {
const text = header.textContent;
const match = text.match(/\((\d+)\s*\/\s*(\d+)\)/);
if (match) {
const [_, completed, total] = match;
const ratio = completed / total;
const alpha = ratio.toFixed(2);
header.style.backgroundColor = `rgba(154, 205, 50, ${alpha})`;
}
});
});
<style>
/* Styles spécifiques pour la page stats */
.stats-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
.stat-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem;
background-color: var(--light-gray);
border-radius: 4px;
}
.stat-label {
font-weight: 500;
color: var(--primary-color);
}
.stat-value {
font-size: 1.25rem;
font-weight: bold;
color: var(--secondary-color);
}
.modifications-list {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.modification-item {
padding: 0.75rem;
background-color: var(--light-gray);
border-radius: 4px;
}
.modification-header {
margin-bottom: 0.25rem;
}
.modification-date {
font-size: 0.875rem;
color: var(--text-color);
opacity: 0.8;
}
.modification-details {
display: flex;
justify-content: space-between;
align-items: center;
}
.modification-type {
font-weight: 500;
color: var(--primary-color);
}
.shop-types-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.shop-type-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem;
background-color: var(--light-gray);
border-radius: 4px;
}
.shop-type-name {
font-weight: 500;
}
.shop-type-count {
background-color: var(--secondary-color);
color: white;
padding: 0.25rem 0.5rem;
border-radius: 12px;
font-size: 0.875rem;
}
.places-table-container {
overflow-x: auto;
}
.places-table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
}
.places-table th,
.places-table td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.places-table th {
background-color: var(--light-gray);
font-weight: 500;
color: var(--primary-color);
}
.places-table tr:hover {
background-color: var(--light-gray);
}
.btn-sm {
padding: 0.25rem 0.75rem;
font-size: 0.875rem;
}
@media (max-width: 768px) {
.grid-3 {
grid-template-columns: 1fr;
}
.places-table {
font-size: 0.875rem;
}
.btn-sm {
padding: 0.25rem 0.5rem;
}
}
</script>
<style>
</style>
{% endblock %}