Initial commit

This commit is contained in:
2025-07-15 23:39:10 +02:00
parent 1d3986a901
commit fb14214612
181 changed files with 31070 additions and 50 deletions

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('bo_item_delete', {'itemCategoryId': itemCategory.id, 'id': item.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,40 @@
{{ form_start(form, {'attr': {'class': 'sp_form__xhr'}}) }}
<div class="sp_form-row__text">
{{ form_label(form.name) }}
{{ form_widget(form.name) }}
</div>
<div class="sp_form-row__text">
{{ form_label(form.slug) }}
{{ form_widget(form.slug) }}
</div>
<div class="sp_form-row__textarea">
{{ form_label(form.description) }}
{{ form_widget(form.description) }}
</div>
<div class="sp_form-row__file">
{{ form_label(form.icon) }}
<input name="file-path" type="text" disabled>
<span class="sp_input__file-preview">
<img id="item-icon-preview" src="{{ asset(item.icon ? assets.item.upload_path ~ item.icon : assets.img._blank_xs) }}" alt>
</span>
{{ form_widget(form.icon, {'attr': {'data-file-preview-target': 'item-icon-preview'}}) }}
</div>
<div class="sp_form-row__select">
{{ form_label(form.version) }}
{{ form_widget(form.version) }}
</div>
{% if route|end_with('_edit') %}
<div>
{{ form_label(form.removeFile) }}
{{ form_widget(form.removeFile) }}
</div>
{% endif %}
<div class="sp_form-row__button">
<a class="sp_button" href="{{ path('bo_item_index', {'itemCategoryId': itemCategory.id}) }}" data-type="cancel">
<span>Cancel</span>
</a>
<button class="sp_button" data-type="validate" type="submit">
<span>Save</span>
</button>
</div>
{{ form_end(form) }}

View File

@ -0,0 +1,11 @@
{% extends '_dashboard/base.html.twig' %}
{% block page_content %}
<h1>Edit Item</h1>
{{ include('_dashboard/item/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('bo_item_index', {'itemCategoryId': itemCategory.id}) }}">back to list</a>
{{ include('_dashboard/item/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends '_dashboard/base.html.twig' %}
{% block page_content %}
{% if is_granted('ROLE_SENIOR') %}
<p>
<a href="{{ path('bo_item_new', {'itemCategoryId': itemCategory.id}) }}">Create new</a>
</p>
{% endif %}
<table class="table">
<thead>
<tr>
{#<th>Id</th>#}
<th>Name</th>
<th>Slug</th>
<th>Description</th>
{#<th>Icon</th>#}
<th>Version</th>
{% if is_granted('ROLE_ADMIN') %}
<th>actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
{#<td>{{ item.id }}</td>#}
<td><img {% if item.icon %}data-src="{{ asset(assets.item.upload_path ~ item.icon) }}"{% endif %} src="{{ asset(assets.img._black_xs) }}" alt="{{ item.name }}" style="height: 48px; width: auto;"> {{ item.name }}</td>
<td>{{ item.slug }}</td>
<td>{{ item.description }}</td>
{#<td>{{ item.icon }}</td>#}
<td>{{ item.version }}</td>
{% if is_granted('ROLE_SENIOR') %}
<td>
<a href="{{ path('bo_item_edit', {'itemCategoryId': itemCategory.id, 'id': item.id}) }}">edit</a>
</td>
{% endif %}
</tr>
{% else %}
<tr>
<td colspan="{{ is_granted('ROLE_SENIOR') ? '4' : '3' }}">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends '_dashboard/base.html.twig' %}
{% block page_content %}
<h1>Create new Item</h1>
{{ include('_dashboard/item/_form.html.twig') }}
{% endblock %}