

<?php $__env->startSection('title'); ?>
<?php echo e($category->name); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container">
    <?php if(!$category->admin_only): ?>
            <div class="mb-2">
                <a class="btn btn-success" href="<?php echo e(route('forum.createthread', $category->id)); ?>"><i class="fas fa-plus" aria-hidden="true"></i> New Post</a>
            </div>
    <?php else: ?>
        <?php if(Auth::user()->admin): ?>
            <div class="mb-2">
                <a class="btn btn-success" href="<?php echo e(route('forum.createthread', $category->id)); ?>"><i class="fas fa-plus" aria-hidden="true"></i> New Post</a>
            </div>
        <?php else: ?>
            <p class="mb-2 text-muted"><small>You can't post here.</small></p>
        <?php endif; ?>
    <?php endif; ?>
	
    <div class="card border-0">
        <div class="card-header text-white bg-primary"><a class="text-white" href="<?php echo e(route('forum.index')); ?>"><?php echo e(config('app.name')); ?> Forum</a> / <a class="text-white" href="<?php echo e(route('forum.category', $category->id)); ?>"><?php echo e($category->name); ?></a></div>
        <table class="table table-hover mb-0">
            <thead">
                <th class="p-1 pl-2" style="width: 70%">Title</th>
                <th class="p-1 text-center">Author</th>
                <th class="p-1 text-center">Replies</th>
                <th class="p-1 text-center">Last Post</th>
            </thead>
            <tbody>
                <?php $__currentLoopData = $posts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="pt-3 pb-3">
                            <a class="text-decoration-none" href="<?php echo e(route('forum.getthread', $post->id)); ?>">
                                <div class="<?php if($post->stickied): ?> text-success <?php else: ?> text-dark <?php endif; ?>">
                                    <p class="mb-0"><?php if($post->stickied): ?> <i class="fas fa-thumbtack"></i> <?php endif; ?> <?php if($post->locked): ?> <i class="fas fa-lock"></i> <?php endif; ?> <?php echo e($post->title); ?></p>
                                </div>
                            </a>
                        </td>
                        <td class="pt-3 pb-3 align-middle text-center"><a href="<?php echo e(route('users.profile', $post->user->id)); ?>"><?php echo e($post->user->username); ?></a></td>
                        <td class="pt-3 pb-3 align-middle text-muted text-center"><?php echo e($post->replies()->count()); ?></td>
                        <td class="pt-3 pb-3 align-middle text-muted text-center"><?php echo e($post->updated_at->diffForHumans()); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>

    <div class="d-flex justify-content-center mt-3">
        <?php echo e($posts->links('pagination::bootstrap-4')); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\project\tadah\tadah\resources\views/forum/category.blade.php ENDPATH**/ ?>