<div class="content-main">

    {% if account is not empty %}
    {% if account.permissions.publications is defined and account.permissions.publications == 1 %}
    <div class="add-new unselectable">

        <input type="text" placeholder="Заголовок" name="title" id="title">
        <textarea type="text" placeholder="Напишите что-нибудь.." name="content" id="content"></textarea>

        <div class="new-btn">

            <div class="custom-file-upload">

                <input type="file" id="file-input" class="file-input" name="publications[]"
                    accept=".png,.gif,.jpeg,.jpg">
                <label for="file-input" class="custom-file-button">
                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path fill-rule="evenodd" clip-rule="evenodd"
                            d="M7 7C5.34315 7 4 8.34315 4 10C4 11.6569 5.34315 13 7 13C8.65685 13 10 11.6569 10 10C10 8.34315 8.65685 7 7 7ZM6 10C6 9.44772 6.44772 9 7 9C7.55228 9 8 9.44772 8 10C8 10.5523 7.55228 11 7 11C6.44772 11 6 10.5523 6 10Z"
                            fill="currentColor" />
                        <path fill-rule="evenodd" clip-rule="evenodd"
                            d="M3 3C1.34315 3 0 4.34315 0 6V18C0 19.6569 1.34315 21 3 21H21C22.6569 21 24 19.6569 24 18V6C24 4.34315 22.6569 3 21 3H3ZM21 5H3C2.44772 5 2 5.44772 2 6V18C2 18.5523 2.44772 19 3 19H7.31374L14.1924 12.1214C15.364 10.9498 17.2635 10.9498 18.435 12.1214L22 15.6863V6C22 5.44772 21.5523 5 21 5ZM21 19H10.1422L15.6066 13.5356C15.9971 13.145 16.6303 13.145 17.0208 13.5356L21.907 18.4217C21.7479 18.7633 21.4016 19 21 19Z"
                            fill="currentColor" />
                    </svg>
                </label>

            </div>

            <button onclick="create()" name="account">Сохранить</button>
        </div>
    </div>
    {%endif%}
    {%endif%}

    <div class="content-news" id="publications">

        {% for publication in publications %}

        {% include '/themes/test/publication.html' %}

        {% endfor %}

    </div>

    {% if errors is not empty %}
    {% if errors.account is not empty %}
    <ul class="errors">

        {% for error in errors.account %}
        <li>{{ error }}</li>
        {% endfor %}

    </ul>
    {% endif %}
    {% endif %}
    {% if account.permissions.publications is defined and account.permissions.publications == 1 %}
    <script type="text/javascript" src="/js/publication/trash.js"></script>
    <script type="text/javascript" src="/js/publication/update.js"></script>
    <script type="text/javascript" src="/js/publication/create.js"></script>
    {%endif%}

</div>