{#
/*
 * Copyright © ProgramCMS. All rights reserved.
 * See COPYING.txt for license details.
 *
 * Developed by Mohamed EL QUCHIRI <elquchiri@gmail.com>
 */
#}
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
        data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
        aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" style="z-index: 1030; margin-top: -30px;"
     id="navbarSupportedContent">

    {% if is_granted('IS_AUTHENTICATED_FULLY') %}
        <a class="btn btn-light fw-bold me-4" href="" data-bs-toggle="tooltip" data-bs-placement="left"
           title="Add New Post">
            <i class="bi bi-plus-circle-fill text-success me-1"></i>
            New
        </a>
    {% endif %}

    {% if is_granted('edit', block.getPost()) or is_granted('ProgramCmsPostBundle_post_edit_categories', block.getCategory()) %}
        <div class="btn-group me-2">
            <a href="{{ block.getEditPostUrl() }}" class="btn btn-light fw-bold">
                <i class="bi bi-pencil-square pe-1"></i>
                Edit
            </a>
            <button type="button" class="btn btn-light pe-3 dropdown-toggle" data-bs-toggle="dropdown"
                    aria-expanded="false">
                <span class="visually-hidden">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu dropdown-menu-end z-3">
                <li><a class="dropdown-item" href="{{ block.getLockUrl() }}">
                        <i class="bi bi-eye-slash-fill me-1"></i>
                        Disable Post
                    </a></li>
                <li><a class="dropdown-item" href="{{ block.getLockUrl() }}">
                        <i class="bi bi-database-fill-lock me-1"></i>
                        Lock Post
                    </a></li>
                <div class="dropdown-divider"></div>
                <li><a class="dropdown-item text-danger" href="#">
                        <i class="bi bi-trash3-fill me-1"></i>
                        Delete Post
                    </a></li>
            </ul>
        </div>
    {% endif %}

    {% if is_granted('ProgramCmsPostBundle_post_edit_categories', block.getCategory()) %}
        <div class="dropdown me-2">
            <button class="btn btn-light dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                <img src="{{ asset('bundles/programcmspost/images/manage.png') }}"/>

            </button>
            <ul class="dropdown-menu dropdown-menu-end z-3">
                <p class="text-muted m-0 p-2 ps-3 fw-bold"><small>Moderation</small></p>
                <li><a class="dropdown-item" href="{{ block.getPinUrl() }}">
                        <i class="bi bi-pin-angle-fill me-1"></i>
                        Pin Post
                    </a></li>
                <li><a class="dropdown-item" href="{{ block.getDisableUrl() }}">
                        <i class="bi bi-eye-slash-fill me-1"></i>
                        Disable Post
                    </a></li>
                <li><a class="dropdown-item" href="{{ block.getLockUrl() }}">
                        <i class="bi bi-database-fill-lock me-1"></i>
                        Lock Post
                    </a></li>
                <li><a class="dropdown-item" href="{{ block.getLockUrl() }}">
                        <i class="bi bi-archive-fill me-1"></i>
                        Archivate
                    </a></li>
                <div class="dropdown-divider"></div>
                <li><a class="dropdown-item text-danger" href="#">
                        <i class="bi bi-trash3-fill me-1"></i>
                        Delete Post
                    </a></li>
            </ul>
        </div>
    {% endif %}

    <div class="dropdown">
        <button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown"
                aria-expanded="false">
            <img src="{{ asset('bundles/programcmspost/images/more.png') }}"/>
        </button>
        <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuButton1">
            {% if block.isPostInFavorite() == false %}
                <li><a class="dropdown-item" href="{{ block.getAddToFavoriteUrl() }}">
                        <i class="bi bi-heart-half me-1"></i>
                        Add to favorite
                    </a></li>
            {% endif %}
            <p class="text-muted m-0 p-2 ps-3 fw-bold"><small>Export</small></p>
            <li><a class="dropdown-item" href="#">
                    <i class="bi bi-file-earmark-pdf-fill me-1"></i>
                    Export as PDF
                </a></li>
            <li><a class="dropdown-item" href="#">
                    <i class="bi bi-qr-code me-1"></i>
                    Generate QR Code
                </a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item" href="#">
                    <i class="bi bi-flag-fill me-1"></i>
                    Report
                </a></li>
        </ul>
    </div>

</div>