Initial commit
This commit is contained in:
4
templates/_dashboard/monster/_delete_form.html.twig
Normal file
4
templates/_dashboard/monster/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('bo_monster_delete', {'monsterCategoryId': monsterCategory.id, 'id': monster.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ monster.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
40
templates/_dashboard/monster/_form.html.twig
Normal file
40
templates/_dashboard/monster/_form.html.twig
Normal 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(monster.icon ? assets.monster.upload_path ~ monster.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_monster_index', {'monsterCategoryId': monsterCategory.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) }}
|
||||
11
templates/_dashboard/monster/edit.html.twig
Normal file
11
templates/_dashboard/monster/edit.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>Edit Monster</h1>
|
||||
|
||||
{{ include('_dashboard/monster/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('bo_monster_index', {'monsterCategoryId': monsterCategory.id}) }}">back to list</a>
|
||||
|
||||
{{ include('_dashboard/monster/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
46
templates/_dashboard/monster/index.html.twig
Normal file
46
templates/_dashboard/monster/index.html.twig
Normal file
@ -0,0 +1,46 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
{% if is_granted('ROLE_SENIOR') %}
|
||||
<p>
|
||||
<a href="{{ path('bo_monster_new', {'monsterCategoryId': monsterCategory.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 monster in monsters %}
|
||||
<tr>
|
||||
{#<td>{{ monster.id }}</td>#}
|
||||
<td><img {% if monster.icon %}data-src="{{ asset(assets.monster.upload_path ~ monster.icon) }}"{% endif %} src="{{ asset(assets.img._black_xs) }}" alt="{{ monster.name }}" style="height: 48px; width: auto;"> {{ monster.name }}</td>
|
||||
<td>{{ monster.slug }}</td>
|
||||
<td>{{ monster.description }}</td>
|
||||
{#<td>{{ monster.icon }}</td>#}
|
||||
<td>{{ monster.version }}</td>
|
||||
{% if is_granted('ROLE_SENIOR') %}
|
||||
<td>
|
||||
<a href="{{ path('bo_monster_edit', {'monsterCategoryId': monsterCategory.id, 'id': monster.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 %}
|
||||
7
templates/_dashboard/monster/new.html.twig
Normal file
7
templates/_dashboard/monster/new.html.twig
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>Create new Monster</h1>
|
||||
|
||||
{{ include('_dashboard/monster/_form.html.twig') }}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user