{% set page = app.request.get('page') %} {% set query = app.request.get('s') %} {% set tags = app.request.get('tags') %} {% set allBlogs = getBlogs({'page': page, 'query': query, 'tags': tags}, app.request) %} {% set mainBlog = allBlogs["mainBlog"] %} {% set blogs = allBlogs["blogs"] %} {% set pageCount = allBlogs["pageCount"] %} {% set search = app.request.get('s') %} {% set filterTags = app.request.get('tags') %} {% set blogTags = getBlogTags(app.request) %}
{% if (mainBlog is not defined or not mainBlog) and (blogs|length) == 0 %} {{"blog_not_found"|trans|capitalize}} {% else %} {% if mainBlog is defined and mainBlog %} {% include 'components/_blog-item.html.twig' with {type: "main", blog: mainBlog} %} {% endif %} {% for blog in blogs %} {% include 'components/_blog-item.html.twig' with {blog: blog} %} {% endfor %} {% endif %}
{% if (mainBlog) or (blogs|length > 0) %}
{% set navCount = 2 %} {% if not page %}{% set page = 1 %}{% endif %} {% set page = page|number_format %} {{"back"|trans|title}} {% for i in (1..(navCount))|reverse %} {% if page > i %} 0{{page-i}} {% endif %} {% endfor %}
0{{page}}
{% for i in ((page + 1)..(page + navCount)) %} {% if i - 1 < pageCount %} 0{{i}} {% endif %} {% endfor %} = pageCount %} style="opacity: 0;pointer-events:none;"{% endif %} href="{{path('blog', {'s': search, 'tags': filterTags, 'page': page+1})}}" class="next-button">{{"next"|trans|title}}
{% endif %}