Initial commit
This commit is contained in:
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 %}
|
||||
Reference in New Issue
Block a user