Admin Panel Improvements:
- Updated custom admin controllers to EasyAdmin AdminRoutes. - Added Admin error page. - Various fixes and improvements.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{# templates/admin/adminEdit.html.twig #}
|
||||
{% extends '@EasyAdmin/page/content.html.twig' %}
|
||||
|
||||
{% block body_class 'error' %}
|
||||
{% block page_title %}{{ error.title }}{% endblock %}
|
||||
{% block content_title error.title %}
|
||||
|
||||
{% block content_header_wrapper '' %}
|
||||
{% block content_footer_wrapper '' %}
|
||||
{% block main %}
|
||||
<div class="error-message">
|
||||
<h1>
|
||||
<twig:ea:Icon name="internal:circle-exclamation" /> {{ block('page_title') }}
|
||||
</h1>
|
||||
{{ error.message }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -4,25 +4,39 @@
|
||||
{% block content_title 'Photo Manager' %}
|
||||
{% block main %}
|
||||
|
||||
<a class="btn btn-primary m-3" href="{{ ea_url().setRoute('admin_photos_upload') }}">
|
||||
Add new
|
||||
</a>
|
||||
<a class="btn btn-primary m-3" href="{{ path('admin_photos_upload') }}">
|
||||
Add new
|
||||
</a>
|
||||
|
||||
<div style="display: flex; flex-direction: row; flex-wrap: wrap; gap: 18px;">
|
||||
{% for photo in photoList %}
|
||||
<div class="card text-center" style="width: 40%;">
|
||||
<p>{{photo.filename}}</p>
|
||||
<img src="{{ asset(photo.url) }}" style="max-width: 80%;"/>
|
||||
<br>
|
||||
<a class="btn btn-outline-primary m-2">
|
||||
<i class="fas fa-clipboard"> Copy!</i>
|
||||
</a>
|
||||
<a class="btn btn-primary m-2 mt-1" href="{{ ea_url().setRoute('admin_photos_remove', { filename: photo.filename }) }}">
|
||||
Delete
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div style="display: flex; flex-direction: row; flex-wrap: wrap; gap: 18px;">
|
||||
{% for photo in photoList %}
|
||||
<div class="card text-center" style="width: 40%;">
|
||||
<p>{{photo.filename}}</p>
|
||||
<img src="{{ asset(photo.url) }}" style="max-width: 80%;" />
|
||||
<br>
|
||||
<a class="btn btn-outline-primary m-2"
|
||||
href="javascript:CopyImageLinkToClipboard('{{absolute_url(photo.url)}}')">
|
||||
<i class="fas fa-clipboard"> Copy!</i>
|
||||
</a>
|
||||
<a class="btn btn-danger m-2 mt-1" href="{{ path('admin_photos_remove', { filename: photo.filename }) }}">
|
||||
Delete
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block body_javascript %}
|
||||
|
||||
<script>
|
||||
async function CopyImageLinkToClipboard(imgLink) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(imgLink);
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock body_javascript %}
|
||||
@@ -1,10 +1,10 @@
|
||||
{# templates/admin/room_availability/availability_day_edit.html.twig #}
|
||||
{% extends '@EasyAdmin/page/content.html.twig' %}
|
||||
|
||||
{% block content_title 'Category - Room Availability - Edit' %}
|
||||
{% block content_title 'Category - Room Availability - Bulk Edit' %}
|
||||
{% block main %}
|
||||
<div>
|
||||
<h3>{{categoryId}}</h3>
|
||||
<h3>{{category.name}}</h3>
|
||||
</div>
|
||||
{{ form(form) }}
|
||||
{% endblock %}
|
||||
@@ -6,11 +6,12 @@
|
||||
<div>
|
||||
<h3>{{categoryData.name}}</h3>
|
||||
</div>
|
||||
<table class="datagrid">
|
||||
<table class="table datagrid {{ availabilityList is empty ? 'datagrid-empty' }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Day</td>
|
||||
<td>Amount</td>
|
||||
<td>Actions</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -19,7 +20,8 @@
|
||||
<td>{{availability.day |date('d-m-Y')}}</td>
|
||||
<td>{{availability.numAvailable}}</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomAvailability_category_update', { day: availability.day |date('Y-m-d'), categoryId: categoryData.id }) }}">
|
||||
<a class="btn btn-secondary"
|
||||
href="{{ path('admin_roomAvailability_category_update', { day: availability.day |date('Y-m-d'), categoryId: categoryData.id }) }}">
|
||||
Edit
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{# templates/admin/room_availability/index.html.twig #}
|
||||
{% extends '@EasyAdmin/page/content.html.twig' %}
|
||||
|
||||
{% block content_title 'Room Availability' %}
|
||||
{% block main %}
|
||||
<table class="datagrid">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Category</td>
|
||||
<td>Details</td>
|
||||
<td>Period update</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in roomCategoryList %}
|
||||
<tr>
|
||||
<td>{{category.id}}</td>
|
||||
<td>{{category.name}}</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomAvailability_category', { categoryId: category.id }) }}">
|
||||
View Details
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomAvailability_category_bulkupdate', { categoryId: category.id }) }}">
|
||||
Update Period
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
@@ -1,21 +1,25 @@
|
||||
{# templates/admin/room_category_bed_type_admin/category_view.html.twig #}
|
||||
{% extends '@EasyAdmin/page/content.html.twig' %}
|
||||
|
||||
{% block content_title 'Room Availability' %}
|
||||
{% block content_title 'Room Bed Types' %}
|
||||
{% block main %}
|
||||
<div>
|
||||
<h3>{{categoryData.name}}</h3>
|
||||
<div class="row justify-content-between mb-4">
|
||||
<div class="col">
|
||||
<h3>{{categoryData.name}}</h3>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="btn btn-primary"
|
||||
href="{{ path('admin_roomCategoryBedType_category_create', { categoryId: categoryData.id }) }}">
|
||||
Add BedType
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ ea_url().setRoute('admin_roomCategoryBedType_category_create', { categoryId: categoryData.id }) }}">
|
||||
Add BedType
|
||||
</a>
|
||||
</div>
|
||||
<table class="datagrid">
|
||||
<table class="table datagrid {{ bedTypeList is empty ? 'datagrid-empty' }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>BedType</td>
|
||||
<td>Amount</td>
|
||||
<td>Actions</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -24,12 +28,12 @@
|
||||
<td>{{bedType.bedType}}</td>
|
||||
<td>{{bedType.amount}}</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomCategoryBedType_category_update', { bedTypeId: bedType.bedType.id, categoryId: bedType.roomCategory.id }) }}">
|
||||
<a class="btn btn-secondary"
|
||||
href="{{ path('admin_roomCategoryBedType_category_update', { bedTypeId: bedType.bedType.id, categoryId: bedType.roomCategory.id }) }}">
|
||||
Edit
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomCategoryBedType_category_remove', { bedTypeId: bedType.bedType.id, categoryId: bedType.roomCategory.id }) }}">
|
||||
<a class="btn btn-danger"
|
||||
href="{{ path('admin_roomCategoryBedType_category_remove', { bedTypeId: bedType.bedType.id, categoryId: bedType.roomCategory.id }) }}">
|
||||
Remove
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{# templates/admin/room_category_bed_type_admin/index.html.twig #}
|
||||
{% extends '@EasyAdmin/page/content.html.twig' %}
|
||||
|
||||
{% block content_title 'Category Bed Type' %}
|
||||
{% block main %}
|
||||
<table class="datagrid">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>RoomCategory</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in roomCategoryList %}
|
||||
<tr>
|
||||
<td>{{category.id}}</td>
|
||||
<td>{{category.name}}</td>
|
||||
<td>
|
||||
<a href="{{ ea_url().setRoute('admin_roomCategoryBedType_category', { categoryId: category.id }) }}">
|
||||
View Details
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user