Initial commit
This commit is contained in:
5
templates/_dashboard/grid/._delete_form.html.twig
Normal file
5
templates/_dashboard/grid/._delete_form.html.twig
Normal file
@ -0,0 +1,5 @@
|
||||
<form method="post" action="{{ path('bo_region_grid_delete', {'regionId': region.id, 'id': grid.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ grid.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
9
templates/_dashboard/grid/.new.html.twig
Normal file
9
templates/_dashboard/grid/.new.html.twig
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Grid</h1>
|
||||
|
||||
{{ include('_dashboard/grid/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id}) }}">back to list</a>
|
||||
{% endblock %}
|
||||
28
templates/_dashboard/grid/.show.html.twig
Normal file
28
templates/_dashboard/grid/.show.html.twig
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Grid</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ grid.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Row</th>
|
||||
<td>{{ grid.row }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Col</th>
|
||||
<td>{{ grid.col }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id}) }}">back to list</a>
|
||||
|
||||
<a href="{{ path('bo_region_grid_edit', {'regionId': region.id, 'id': grid.id}) }}">edit</a>
|
||||
|
||||
{{ include('_dashboard/grid/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
28
templates/_dashboard/grid/_form.html.twig
Normal file
28
templates/_dashboard/grid/_form.html.twig
Normal file
@ -0,0 +1,28 @@
|
||||
{% for _log in logs %}
|
||||
<div>{{ _log }}</div>
|
||||
{% endfor %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class="sp_form-row__radio sp_radio__layout-grid-b sp_radio__style-text">
|
||||
{{ form_label(form.positions, null, {'label_attr': {'class': 'sp_radio__main-label'}}) }}
|
||||
<div class="sp_radio__container">
|
||||
{% for key, choice in form.positions %}
|
||||
<label class="sp_radio__input-wrapper" title="{{ choice.vars.label }}">
|
||||
<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.positions.setRendered %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sp_form-row__button">
|
||||
<a class="sp_button" href="{{ path('bo_region_index') }}" 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/grid/edit.html.twig
Normal file
11
templates/_dashboard/grid/edit.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>Edit {{ region.name }}'s Grid</h1>
|
||||
|
||||
{{ include('_dashboard/grid/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id}) }}">back to list</a>
|
||||
|
||||
{# {{ include('_dashboard/grid/_delete_form.html.twig') }}#}
|
||||
{% endblock %}
|
||||
46
templates/_dashboard/grid/index.html.twig
Normal file
46
templates/_dashboard/grid/index.html.twig
Normal file
@ -0,0 +1,46 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
{% set previousVersion = null %}
|
||||
{% set nextVersion = null %}
|
||||
|
||||
{% for _gameVersion in supportedGameVersion %}
|
||||
{% if _gameVersion < version %}
|
||||
{% set previousVersion = _gameVersion %}
|
||||
{% endif %}
|
||||
|
||||
{% if nextVersion is null and _gameVersion > version %}
|
||||
{% set nextVersion = _gameVersion %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div id="map-editor">
|
||||
<div class="sp_map_editor__header_container">
|
||||
{% if version > supportedGameVersion|first %}
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id, 'v': previousVersion}) }}"><img src="{{ asset(assets.img.ui~'back.png') }}" alt></a>
|
||||
{% else %}
|
||||
<div class="sp_grayscale"><img src="{{ asset(assets.img.ui~'back.png') }}" alt></div>
|
||||
{% endif %}
|
||||
|
||||
<div>Game version : {{ version }}</div>
|
||||
{% if version < supportedGameVersion|last %}
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id, 'v': nextVersion}) }}"><img src="{{ asset(assets.img.ui~'forward.png') }}" alt></a>
|
||||
{% else %}
|
||||
<div class="sp_grayscale"><img src="{{ asset(assets.img.ui~'forward.png') }}" alt></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="sp_grid__container sp_map_editor__grid_container" data-region-width="{{ region.gridWidth }}" data-region-height="{{ region.gridHeight }}">
|
||||
{% for row in 1..region.gridHeight %}
|
||||
{% for col in 1..region.gridWidth %}
|
||||
<div class="sp_grid__cell">
|
||||
{% set idHash = '_g' ~ grid[row][col]['id'] ~ '_v' ~ version %}
|
||||
|
||||
<img id="{{ 'map' ~ idHash }}" class="sp_grid__map" {% if grid[row][col]['map_data']['map'].id is not null %}data-src="{{ asset(assets.map.upload_path ~ grid[row][col]['map_data']['map'].file) }}"{% endif%} src="{{ asset(assets.img._black) }}" alt="{{ region.name }}" draggable="false">
|
||||
|
||||
{% include '_dashboard/map/_form.html.twig' with {'form': grid[row][col]['map_data']['form'], 'idHash': idHash} %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
50
templates/_dashboard/grid/index.html.twig.bak
Normal file
50
templates/_dashboard/grid/index.html.twig.bak
Normal file
@ -0,0 +1,50 @@
|
||||
{% extends '_dashboard/base.html.twig' %}
|
||||
|
||||
{% block page_content %}
|
||||
{% set previousVersion = null %}
|
||||
{% set nextVersion = null %}
|
||||
|
||||
{% for _gameVersion in supportedGameVersion %}
|
||||
{% if _gameVersion < version %}
|
||||
{% set previousVersion = _gameVersion %}
|
||||
{% endif %}
|
||||
|
||||
{% if nextVersion is null and _gameVersion > version %}
|
||||
{% set nextVersion = _gameVersion %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div id="map-editor">
|
||||
<div class="sp_map_editor__header_container">
|
||||
{% if version > supportedGameVersion|first %}
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id, 'v': previousVersion}) }}"><img src="{{ asset(assets.img.ui~'back.png') }}" alt></a>
|
||||
{% else %}
|
||||
<div class="sp_grayscale"><img src="{{ asset(assets.img.ui~'back.png') }}" alt></div>
|
||||
{% endif %}
|
||||
|
||||
<div>Game version : {{ version }}</div>
|
||||
{% if version < supportedGameVersion|last %}
|
||||
<a href="{{ path('bo_region_grid_index', {'regionId': region.id, 'v': nextVersion}) }}"><img src="{{ asset(assets.img.ui~'forward.png') }}" alt></a>
|
||||
{% else %}
|
||||
<div class="sp_grayscale"><img src="{{ asset(assets.img.ui~'forward.png') }}" alt></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="sp_map_editor__grid_container">
|
||||
<div class="sp_grid__container">
|
||||
{% for row in 1..region.gridHeight %}
|
||||
<div class="sp_grid__row">
|
||||
{% for col in 1..region.gridWidth %}
|
||||
<div class="sp_grid__column">
|
||||
{% set idHash = '_g' ~ grid[row][col]['id'] ~ '_v' ~ version %}
|
||||
|
||||
<img id="{{ 'map' ~ idHash }}" class="sp_grid__map" {% if grid[row][col]['map_data']['map'].id is not null %}data-src="{{ asset(assets.map.upload_path ~ grid[row][col]['map_data']['map'].file) }}"{% endif%} src="{{ asset(assets.img._black) }}" alt="{{ region.name }}" draggable="false">
|
||||
|
||||
{% include '_dashboard/map/_form.html.twig' with {'form': grid[row][col]['map_data']['form'], 'idHash': idHash} %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user