<div data-control="toolbar">
    <a
        href="<?= Backend::url('indikator/news/posts/create') ?>"
        class="btn btn-primary oc-icon-plus">
        <?= e(trans('indikator.news::lang.new.posts')) ?>
    </a>
    <?php if (Indikator\News\Models\Posts::count() > 0): ?>
        <?php if ($this->user->role->code !== "role_reporter"): ?>
        <div class="btn-group">
            <button
                class="btn btn-default oc-icon-check"
                disabled="disabled"
                onclick="$(this).data('request-data', {
                    checked: $('.control-list').listWidget('getChecked')
                })"
                data-request="onActivatePosts"
                data-trigger-action="enable"
                data-trigger=".control-list input[type=checkbox]"
                data-trigger-condition="checked"
                data-stripe-load-indicator>
                <?= e(trans('indikator.news::lang.button.activate')) ?>
            </button>
            <button
                class="btn btn-default oc-icon-eye-slash"
                disabled="disabled"
                onclick="$(this).data('request-data', {
                    checked: $('.control-list').listWidget('getChecked')
                })"
                data-request="onDeactivatePosts"
                data-trigger-action="enable"
                data-trigger=".control-list input[type=checkbox]"
                data-trigger-condition="checked"
                data-stripe-load-indicator>
                <?= e(trans('indikator.news::lang.button.deactivate')) ?>
            </button>
            <button
                class="btn btn-default oc-icon-pencil"
                disabled="disabled"
                onclick="$(this).data('request-data', {
                    checked: $('.control-list').listWidget('getChecked')
                })"
                data-request="onDraftPosts"
                data-trigger-action="enable"
                data-trigger=".control-list input[type=checkbox]"
                data-trigger-condition="checked"
                data-stripe-load-indicator>
                <?= e(trans('indikator.news::lang.form.status_draft')) ?>
            </button>
        </div>
        <button
            class="btn btn-danger oc-icon-trash-o"
            disabled="disabled"
            onclick="$(this).data('request-data', {
                checked: $('.control-list').listWidget('getChecked')
            })"
            data-request="onRemovePosts"
            data-request-confirm="<?= e(trans('indikator.news::lang.flash.delete')) ?>"
            data-trigger-action="enable"
            data-trigger=".control-list input[type=checkbox]"
            data-trigger-condition="checked"
            data-stripe-load-indicator>
            <?= e(trans('system::lang.plugins.remove')) ?>
        </button>
        <?php endif ?>
    <?php endif ?>
    <?php if ($this->user->hasAccess('indikator.news.import_export')): ?>
    <div class="btn-group">
        <a
            href="<?= Backend::url('indikator/news/posts/export') ?>"
            class="btn btn-default oc-icon-download">
            <?= e(trans('indikator.news::lang.button.export')) ?>
        </a>
        <a
            href="<?= Backend::url('indikator/news/posts/import') ?>"
            class="btn btn-default oc-icon-upload">
            <?= e(trans('indikator.news::lang.button.import')) ?>
        </a>
    </div>
    <?php endif ?>
</div>
