title = "Habarlar"
url = "/habarlar/:page?"
layout = "default"
is_hidden = 0

[viewBag]
localeTitle[en] = "News"
localeTitle[ru] = "Новости"
localeUrl[en] = "/news/:page?"
localeUrl[ru] = "/novosti/:page?"

[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 6
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = "news_post"
==
{% set posts = blogPosts.posts %}

<!--News ============================================================= -->
<section class="news news_page">
    <div class="auto_container">
        <div class="news_wrap">
            <h3 class="main_title">
                {{ 'site.news'|_ }}
            </h3>

            <div class="news_box">
                {% for post in posts %}
                <div class="news_box-item wow fadeInUp" data-wow-duration=".5s"
                    {% if loop.index > 4 %}
                        {% if loop.index - 3 < 10 %}
                            data-wow-delay=".{{ loop.index - 3 }}s"
                        {% else %}
                            data-wow-delay="{{ (loop.index - 3) / 10 }}s"
                        {% endif %}
                    {% else %}
                        {% if loop.index < 10 %}
                            data-wow-delay=".{{ loop.index }}s"
                        {% else %}
                            data-wow-delay="{{ loop.index / 10 }}s"
                        {% endif %}
                    {% endif %}
                >
                    <div class="news_box-item-photo">
                        <img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="news-photo">

                        <a href="{{ post.url }}" class="news_link">
                            <img src="{{ 'assets/images/svg/news_arrow.svg'|theme }}" alt="arrow-icon">
                        </a>
                    </div>

                    <a href="{{ post.url }}" class="news_box-item-title">
                        {{ post.title }}
                    </a>
                    <p class="news_box-item-date">
                        {{ post.published_at|date('d.m.Y') }}
                    </p>
                    <p class="news_box-item-txt">
                        {{ post.excerpt }}
                    </p>
                </div>
                {% endfor %}
            </div>

            {% if posts.lastPage > 1 %}
                <div class="cat_end">
                    {% if posts.currentPage > 1 %}
                        <a href="{{ this.page.baseFileName|page({ (blogPosts.pageParam): (posts.currentPage-1) }) }}" class="cat_arrow left">
                            <img src="{{ 'assets/images/svg/arrow-right.svg'|theme }}" alt="">
                        </a>
                    {% endif %}
                    <form action="#" class="cat_form">
                        <input type="text" placeholder="{{ posts.currentPage }}">
                    </form>
                    {% if posts.lastPage > posts.currentPage %}
                        <a href="{{ this.page.baseFileName|page({ (blogPosts.pageParam): (posts.currentPage+1) }) }}" class="cat_arrow ">
                            <img src="{{ 'assets/images/svg/arrow-right.svg'|theme }}" alt="">
                        </a>
                    {% endif %}
                    <div class="cat_page">
                        {{ posts.lastPage }} {{ 'page.pages'|_ }}
                    </div>
                </div>
            {% endif %}
        </div>
    </div>
</section>
<!--News end ========================================================= -->