{% extends 'base.html.twig' %}
{% block title %}Items!{% endblock %}
{% block body %}
{% block header %}
{% set menu = 'foo' %}
{{ parent() }}
{% endblock %}
{% block content %}
<div id="main" role="main" class="container-fluid">
<!-- contained-->
<div class="contained">
{% block aside %}
{% include 'aside.html.twig' %}
{% endblock %}
{% block principal %}
<div id="page-content">
<div class="container-fluid clearfix">
<div id="contenedor"> <!-- contenedor flex -->
{% if items is defined %}
{% for item in items %}
<div class="item">
<div class="contenido">
<div>
<img src="{{ asset('build/iconos/Sombra Wishlist.png') }}">
</div>
<div>
<img src="{{ rutaimg }}{{ item.filename }}.png" alt="" style="max-width: 128px"/>
</div>
</div>
<div class="details">
<span><input type="checkbox" name="{{ typeName }}[{{ item.id }}]" value="{{ item.internalid }}">{{ translateItem(item.internalid, type)|title }}</span><br>
{% if item.buy is defined %}<img src="{{ asset('build/iconos/baya.png') }}">{{ item.buy }} {% endif %}
</div>
</div>
{% endfor %}
{% endif %}
<div class="clearfix"></div>
</div>
{% if maxPages is defined %}
<div class="paginate">
{% if maxPages > 1 %}
{%if thisPage > 1 %}
{% if category is defined %}
<a href="{{ path('items_type_category', {type: typeName, currentPage: thisPage-1 < 1 ? 1 : thisPage-1, category: category}) }}"><i class="fas fa-angle-left"></i></a>
{% else %}
<a href="{{ path('items_type', {type: typeName, currentPage: thisPage-1 < 1 ? 1 : thisPage-1}) }}"><i class="fas fa-angle-left"></i></a>
{% endif %}
{% endif %}
{# Render each page number #}
{% for i in 1..maxPages %}
{% if i==thisPage %}
<a class="currentpage">{{ i }}</a>
{% else %}
{% if (maxPages>10 and i < thisPage+6 and i > thisPage-6) or (i < 9 and thisPage<9) %}
{% if category is defined %}
<a href="{{ path('items_type_category', { type: typeName, currentPage: i, category: category}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('items_type', {type: typeName, currentPage: i}) }}">{{ i }}</a>
{% endif %}
{% else %}
{% endif %}
{% endif %}
{% endfor %}
{# `ยป` arrow #}
{%if thisPage < maxPages %}
{% if category is defined %}
<a href="{{ path('items_type_category', {type: typeName, currentPage: thisPage+1 <= maxPages ? thisPage+1 : thisPage, category: category}) }}"><i class="fas fa-angle-right"></i></a>
{% else %}
<a href="{{ path('items_type', { type: typeName, currentPage: thisPage+1 <= maxPages ? thisPage+1 : thisPage}) }}"><i class="fas fa-angle-right"></i></a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
{% endblock %}