<?php $__env->startSection('section', admin_trans('Blog')); ?>
<?php $__env->startSection('title', $active . ' | ' . admin_trans('Blog Articles')); ?>
<?php $__env->startSection('link', route('admin.blog.articles.create')); ?>
<?php $__env->startSection('language', true); ?>
<?php $__env->startSection('content'); ?>
    <div class="card">
        <table id="datatable" class="table w-100">
            <thead>
                <tr>
                    <th class="tb-w-2x"><?php echo e(admin_trans('#')); ?></th>
                    <th class="tb-w-3x"><?php echo e(admin_trans('Language')); ?></th>
                    <th class="tb-w-20x"><?php echo e(admin_trans('Article')); ?></th>
                    <th class="tb-w-7x"><?php echo e(admin_trans('Author')); ?></th>
                    <th class="tb-w-7x"><?php echo e(admin_trans('Category')); ?></th>
                    <th class="tb-w-3x"><?php echo e(admin_trans('Comments')); ?></th>
                    <th class="tb-w-3x"><?php echo e(admin_trans('Views')); ?></th>
                    <th class="tb-w-7x"><?php echo e(admin_trans('Published date')); ?></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $articles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $article): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr class="item">
                        <td><?php echo e($article->id); ?></td>
                        <td><a href="<?php echo e(route('admin.settings.languages.translates', $article->lang)); ?>"><i
                                    class="fas fa-language me-2"></i><?php echo e($article->language->name); ?></a>
                        </td>
                        <td>
                            <div class="vironeer-content-box">
                                <a class="vironeer-content-image"
                                    href="<?php echo e(route('admin.blog.articles.edit', $article->id)); ?>">
                                    <img src="<?php echo e(asset($article->image)); ?>">
                                </a>
                                <div>
                                    <a class="text-reset"
                                        href="<?php echo e(route('admin.blog.articles.edit', $article->id)); ?>"><?php echo e(shortertext($article->title, 30)); ?></a>
                                    <p class="text-muted mb-0"><?php echo e(shortertext($article->short_description, 40)); ?></p>
                                </div>
                            </div>
                        </td>
                        <td>
                            <?php if(auth()->guard('admin')->user()->id == $article->admin->id): ?>
                                <?php echo e($article->admin->firstname . ' ' . $article->admin->lastname); ?>

                            <?php else: ?>
                                <a
                                    href="<?php echo e(route('admin.members.admins.edit', $article->admin->id)); ?>"><?php echo e($article->admin->firstname . ' ' . $article->admin->lastname); ?></a>
                            <?php endif; ?>
                        </td>
                        <td><span class="badge bg-lg-1"><?php echo e($article->blogCategory->name); ?></span></td>
                        <td><span class="badge bg-dark"><?php echo e($article->comments_count); ?></span></td>
                        <td><span class="badge bg-dark"><?php echo e($article->views); ?></span></td>
                        <td><?php echo e(dateFormat($article->created_at)); ?></td>
                        <td>
                            <div class="text-end">
                                <button type="button" class="btn btn-sm rounded-3" data-bs-toggle="dropdown"
                                    aria-expanded="true">
                                    <i class="fa fa-ellipsis-v fa-sm text-muted"></i>
                                </button>
                                <ul class="dropdown-menu dropdown-menu-sm-end" data-popper-placement="bottom-end">
                                    <li>
                                        <a class="dropdown-item" href="<?php echo e(route('blog.article', $article->slug)); ?>"
                                            target="_blank"><i class="fa fa-eye me-2"></i><?php echo e(admin_trans('View')); ?></a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item"
                                            href="<?php echo e(route('admin.blog.comments.index') . '?article_id=' . $article->id); ?>"><i
                                                class="fa fa-comments me-2"></i><?php echo e(admin_trans('Comments')); ?></a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item"
                                            href="<?php echo e(route('admin.blog.articles.edit', $article->id)); ?>"><i
                                                class="fa fa-edit me-2"></i><?php echo e(admin_trans('Edit')); ?></a>
                                    </li>
                                    <li>
                                        <hr class="dropdown-divider" />
                                    </li>
                                    <li>
                                        <form action="<?php echo e(route('admin.blog.articles.destroy', $article->id)); ?>"
                                            method="POST">
                                            <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                            <button class="vironeer-able-to-delete dropdown-item text-danger"><i
                                                    class="far fa-trash-alt me-2"></i><?php echo e(admin_trans('Delete')); ?></button>
                                        </form>
                                    </li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layouts.grid', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/neofiles.codenine.biz.id/resources/views/backend/blog/articles/index.blade.php ENDPATH**/ ?>