Public:
- /escape-rooms: Leaflet + OpenStreetMap map with marker clustering and a
searchable list, both built from a cached slim JSON feed
- /escape-rooms/{id}-{slug}: room detail with a mini-map and user reviews
(rating + title + body, login required)
- /escape-rooms/suggest: visitor submission form with click-to-drop-pin map
and reCAPTCHA v3; new rooms land as pending
Data:
- EscapeRoom / EscapeRoomReview entities (soft-delete), migration
- app:escaperooms:import-osm console command pulls leisure=escape_game from
the Overpass API, upserts by (osmType, osmId), skips locked rows;
--tiled / --area / --bbox options
Admin (new "Website Admin" area, separate from Game Admin):
- src/Website/Controller/AdminEscapeRoomController.php at /admin/escape-rooms:
status-filtered list, new/edit, publish/hide/reject, delete, review removal
- game admin sidebar extracted into a block and cross-linked
Assets: leaflet + leaflet.markercluster; escaperoom-map and escaperoom-detail
Encore entries.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
94 lines
6.2 KiB
Twig
94 lines
6.2 KiB
Twig
{% extends 'website/admin/base.html.twig' %}
|
|
|
|
{% block title %}Escape Rooms — Website Admin{% endblock %}
|
|
|
|
{% block admin_body %}
|
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;">
|
|
<h1 style="margin: 0; font-size: 1.5rem; color: #0f172a;">Escape Rooms</h1>
|
|
<a href="{{ path('website_admin_escaperoom_new') }}" class="er-btn">+ New room</a>
|
|
</div>
|
|
|
|
{% set tabs = {
|
|
'': 'All (' ~ counts.all ~ ')',
|
|
'pending': 'Pending (' ~ counts.pending ~ ')',
|
|
'published': 'Published (' ~ counts.published ~ ')',
|
|
'hidden': 'Hidden (' ~ counts.hidden ~ ')',
|
|
'rejected': 'Rejected (' ~ counts.rejected ~ ')',
|
|
} %}
|
|
<div style="margin-bottom: 1rem; display: flex; gap: 0.4rem; flex-wrap: wrap;">
|
|
{% for value, label in tabs %}
|
|
{% set active = (filter is null and value == '') or (filter and filter.value == value) %}
|
|
<a href="{{ path('website_admin_escaperooms', value ? {status: value} : {}) }}"
|
|
style="padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.82rem; text-decoration: none;
|
|
background: {{ active ? '#3b82f6' : '#e2e8f0' }}; color: {{ active ? '#fff' : '#475569' }};">
|
|
{{ label }}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div style="background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.07); overflow: hidden;">
|
|
<table class="admin-datatable" style="width: 100%; min-width: 900px; border-collapse: collapse; font-size: 0.88rem;">
|
|
<thead>
|
|
<tr style="background: #f1f5f9; border-bottom: 1px solid #e2e8f0;">
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Name</th>
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">City</th>
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Country</th>
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Source</th>
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Status</th>
|
|
<th style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Reviews</th>
|
|
<th data-sortable="false" style="padding: 0.7rem 0.9rem; text-align: left; color: #475569;">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for room in rooms %}
|
|
<tr style="border-bottom: 1px solid #f1f5f9;">
|
|
<td style="padding: 0.7rem 0.9rem; font-weight: 500; color: #0f172a;">
|
|
{% if room.status.isPubliclyVisible %}
|
|
<a href="{{ path('website_escaperoom_show', {id: room.id, slug: room.slug}) }}" target="_blank" rel="noopener" style="color: #0f172a;">{{ room.name }}</a>
|
|
{% else %}
|
|
{{ room.name }}
|
|
{% endif %}
|
|
</td>
|
|
<td style="padding: 0.7rem 0.9rem; color: #475569;">{{ room.city }}</td>
|
|
<td style="padding: 0.7rem 0.9rem; color: #475569;">{{ room.country }}</td>
|
|
<td style="padding: 0.7rem 0.9rem; color: #475569;">{{ room.source.value }}</td>
|
|
<td style="padding: 0.7rem 0.9rem;">
|
|
<span class="er-badge er-badge--{{ room.status.value }}">{{ room.status.label }}</span>
|
|
</td>
|
|
<td style="padding: 0.7rem 0.9rem; color: #475569;">{{ reviewCounts[room.id]|default(0) }}</td>
|
|
<td style="padding: 0.7rem 0.9rem;" class="er-actions">
|
|
<a href="{{ path('website_admin_escaperoom_edit', {id: room.id}) }}">Edit</a>
|
|
{% if not room.status.isPubliclyVisible %}
|
|
<form method="post" action="{{ path('website_admin_escaperoom_moderate', {id: room.id, status: 'published'}) }}">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('moderate_room_' ~ room.id) }}">
|
|
<input type="hidden" name="return_to" value="{{ filter ? filter.value : '' }}">
|
|
<button type="submit">Publish</button>
|
|
</form>
|
|
{% else %}
|
|
<form method="post" action="{{ path('website_admin_escaperoom_moderate', {id: room.id, status: 'hidden'}) }}">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('moderate_room_' ~ room.id) }}">
|
|
<input type="hidden" name="return_to" value="{{ filter ? filter.value : '' }}">
|
|
<button type="submit">Hide</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if room.status.value != 'rejected' %}
|
|
<form method="post" action="{{ path('website_admin_escaperoom_moderate', {id: room.id, status: 'rejected'}) }}">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('moderate_room_' ~ room.id) }}">
|
|
<input type="hidden" name="return_to" value="{{ filter ? filter.value : '' }}">
|
|
<button type="submit">Reject</button>
|
|
</form>
|
|
{% endif %}
|
|
<form method="post" action="{{ path('website_admin_escaperoom_delete', {id: room.id}) }}" onsubmit="return confirm('Delete {{ room.name|e('js') }}?')">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('delete_room_' ~ room.id) }}">
|
|
<button type="submit" class="er-danger">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="7" style="padding: 2rem; text-align: center; color: #94a3b8;">No rooms.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|