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_worldmark_delete', {'worldmarkCategoryId': worldmarkCategory.id, 'id': worldmark.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ worldmark.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,82 @@
<div class="sp_form-row__select" {{ route|end_with('_edit') ? 'hidden' }}>
<label for="worldmark__content-filter">Worldmark type</label>
<select id="worldmark__content-filter">
<option value></option>
<option value="item" {{ worldmark.id is not null and worldmark.item is not null ? 'selected' : '' }}>Item</option>
<option value="monster" {{ worldmark.id is not null and worldmark.monster is not null ? 'selected' : '' }}>Monster</option>
<option value="custom" {{ worldmark.id is not null and worldmark.item is null and worldmark.monster is null ? 'selected' : '' }}>Custom</option>
</select>
</div>
{{ form_start(form, {'attr': {'id': 'form__worldmark', 'class': 'sp_form__xhr', 'data-content-for': 'worldmark__content-filter', 'data-filter-values': ['item','monster', 'custom']|json_encode, 'hidden': true}}) }}
<div class="sp_form-row__select" data-content-for="worldmark__content-filter" data-filter-values="item" hidden>
{{ form_label(form.item) }}
{{ form_widget(form.item) }}
</div>
<div class="sp_form-row__select" data-content-for="worldmark__content-filter" data-filter-values="monster" hidden>
{{ form_label(form.monster) }}
{{ form_widget(form.monster) }}
</div>
<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" data-content-for="worldmark__content-filter" data-filter-values="custom" hidden>
{{ form_label(form.description) }}
{{ form_widget(form.description) }}
</div>
<div class="sp_form-row__text">
{{ form_label(form.defaultQuantityValue) }}
{{ form_widget(form.defaultQuantityValue) }}
</div>
<div class="sp_form-row__text">
{{ form_label(form.defaultPrimogemValue) }}
{{ form_widget(form.defaultPrimogemValue) }}
</div>
<div class="sp_form-row__file" data-content-for="worldmark__content-filter" data-filter-values="custom" hidden>
{{ form_label(form.icon) }}
<input name="file-path" type="text" disabled>
<span class="sp_input__file-preview">
<img id="worldmark-icon-preview" src="{{ asset(worldmark.icon ? assets.worldmark.upload_path ~ worldmark.icon : assets.img._blank_xs) }}" alt>
</span>
{{ form_widget(form.icon, {'attr': {'data-file-preview-target': 'worldmark-icon-preview'}}) }}
</div>
<div class="sp_form-row__radio sp_radio__layout-grid-b sp_radio__style-text">
{{ form_label(form.regions, null, {'label_attr': {'class': 'sp_radio__main-label'}}) }}
<div class="sp_radio__container">
{% for key, choice in form.regions %}
<label class="sp_radio__input-wrapper" title="{{ choice.vars.label }}">
{#<span class="sp_radio__input-icon"></span>#}
<span class="sp_radio__input-mark"></span>
<span class="sp_radio__input-label">{{ choice.vars.label }}</span>
<input name="{{ choice.vars.full_name }}" type="{{ choice.parent.vars.multiple ? 'checkbox' : 'radio' }}" value="{{ choice.vars.value }}" {% if key == 0 and choice.vars.required %}required{% endif%} {% if choice.vars.checked %}checked{% endif %}>
</label>
{% endfor %}
{% do form.regions.setRendered %}
</div>
</div>
<br>
{{ form_row(form.canBeHidden) }}
<br>
<div class="sp_form-row__select">
{{ form_label(form.version) }}
{{ form_widget(form.version) }}
</div>
<div class="sp_form-row__text">
{{ form_label(form.sortOrder) }}
{{ form_widget(form.sortOrder) }}
</div>
<div class="sp_form-row__button">
<a class="sp_button" href="{{ path('bo_worldmark_index', {'worldmarkCategoryId': worldmarkCategory.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,7 @@
{% extends '_dashboard/base.html.twig' %}
{% block page_content %}
{{ include('_dashboard/worldmark/_form.html.twig', {'button_label': 'Update'}) }}
{{ include('_dashboard/worldmark/_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_worldmark_new', {'worldmarkCategoryId': worldmarkCategory.id}) }}">Create new</a>
</p>
{% endif %}
<table class="table">
<thead>
<tr>
{#<th>Id</th>#}
<th>Name</th>
<th>Slug</th>
<th>Description</th>
<th>SortOrder</th>
<th>Version</th>
{% if is_granted('ROLE_ADMIN') %}
<th>actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for worldmark in worldmarks %}
<tr>
{#<td>{{ worldmark.id }}</td>#}
<td><img {% if worldmark.icon %}data-src="{{ asset(assets.worldmark.upload_path ~ worldmark.icon) }}"{% endif %} src="{{ asset(assets.img._black_xs) }}" alt="{{ worldmark.name }}" style="height: 48px; width: auto;"> {{ worldmark.name }}</td>
<td>{{ worldmark.slug }}</td>
<td>{{ worldmark.description }}</td>
<td>{{ worldmark.sortOrder }}</td>
<td>{{ worldmark.version }}</td>
{% if is_granted('ROLE_SENIOR') %}
<td>
<a href="{{ path('bo_worldmark_edit', {'worldmarkCategoryId': worldmarkCategory.id, 'id': worldmark.id}) }}">edit</a>
</td>
{% endif %}
</tr>
{% else %}
<tr>
<td colspan="{{ is_granted('ROLE_SENIOR') ? '5' : '6' }}">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends '_dashboard/base.html.twig' %}
{% block page_content %}
{{ include('_dashboard/worldmark/_form.html.twig') }}
{% endblock %}