

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

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

<?php $__env->startSection('content'); ?>
<div class="container">
    <?php if(!$post->locked): ?>
        <div class="mb-2">
            <a class="btn btn-success" href="<?php echo e(route('forum.createreply', $post->id)); ?>"><i class="fas fa-plus" aria-hidden="true"></i> New Reply</a>
        </div>
    <?php else: ?>
        <p class="mb-2 text-muted"><small>This thread was locked.</small></p>
    <?php endif; ?>
	
    <div class="card border-0">
        <div class="card-header text-white <?php if($post->stickied): ?> bg-success <?php else: ?> bg-primary <?php endif; ?>"><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> / <a class="text-white" href="<?php echo e(route('forum.getthread', $post->id)); ?>"><?php echo e($post->title); ?></a></div>
        <div class="card-body">
            <?php if(session()->has('message')): ?>
                <div class="alert alert-success">
                    <?php echo e(session()->get('message')); ?>

                </div>
            <?php endif; ?>

            <div class="row">
                <div class="col-md-2">
                    <p class="m-0"><a <?php if($post->user->admin): ?> class="text-danger" <?php endif; ?> href="<?php echo e(route('users.profile', $post->user->id)); ?>"><?php echo e($post->user->username); ?></a></p>
                    <img class="img-fluid" src="<?php echo e(route('users.thumbnail', $post->user->id)); ?>" alt="<?php echo e($post->user->username); ?>">
                    <p class="m-0"><?php if($post->user->admin): ?> <p class="text-danger mt-0 mb-0"><i class="fas fa-gavel"></i> Administrator</p> <?php endif; ?> Joined: <?php echo e(date('m/d/Y', strtotime($post->user->joined))); ?><br>Posts: <?php echo e($post->user->posts->count() + $post->user->threads->count()); ?></p>
                </div>
                <div class="col-md-10">
                    <p class="text-muted mb-0"><small>Posted on <?php echo e(date('F j, Y, g:i A', strtotime($post->created_at))); ?> (<?php echo e($post->created_at->diffForHumans()); ?>)</small></p>
                    <div id="post-<?php echo e($post->id); ?>-body"><?php echo parsedown($post->body); ?></div>
                </div>
            </div>
            <?php if(Auth::user()->admin): ?>
                <div class="mt-2 float-right">
                    <form style="display: inline;" method="POST" action="<?php echo e(route('forum.togglelock', $post->id)); ?>">
                        <?php echo csrf_field(); ?>
        
                        <button class="btn btn-secondary btn-sm" type="submit"><i class="fas fa-lock"></i> <?php if($post->locked): ?> Unlock <?php else: ?> Lock <?php endif; ?></button>
                    </form>
                    <form style="display: inline;" method="POST" action="<?php echo e(route('forum.togglesticky', $post->id)); ?>">
                        <?php echo csrf_field(); ?>
        
                        <button class="btn btn-success btn-sm" type="submit"><i class="fas fa-thumbtack"></i> <?php if($post->stickied): ?> Unsticky <?php else: ?> Sticky <?php endif; ?></button>
                    </form>
                    <a class="btn btn-primary btn-sm" href="<?php echo e(route('forum.editthread', $post->id)); ?>"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a>
                    <form style="display: inline;" method="POST" action="<?php echo e(route('forum.deletethread', $post->id)); ?>">
                        <?php echo csrf_field(); ?>
        
                        <button class="btn btn-danger btn-sm" type="submit"><i class="fas fa-trash"></i> Delete</button>
                    </form>
                </div>
            <?php endif; ?>
        </div>
        <?php $__currentLoopData = $replies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reply): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <hr class="m-0">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-2">
                        <p class="m-0"><a <?php if($reply->user->admin): ?> class="text-danger" <?php endif; ?> href="<?php echo e(route('users.profile', $reply->user->id)); ?>"><?php echo e($reply->user->username); ?></a></p>
                        <img class="img-fluid" src="<?php echo e(route('users.thumbnail', $reply->user->id)); ?>" alt="<?php echo e($reply->user->username); ?>">
                        <p class="m-0"><?php if($reply->user->admin): ?> <p class="text-danger mt-0 mb-0"><i class="fas fa-gavel"></i> Administrator</p> <?php endif; ?> Joined: <?php echo e(date('m/d/Y', strtotime($reply->user->joined))); ?><br>Posts: <?php echo e($reply->user->posts->count() + $reply->user->threads->count()); ?></p>
                    </div>
                    <div class="col-md-10">
                        <p class="text-muted mb-0"><small>Posted on <?php echo e(date('F j, Y, g:i A', strtotime($reply->created_at))); ?> (<?php echo e($reply->created_at->diffForHumans()); ?>)</small></p>
                        <div id="reply-<?php echo e($reply->id); ?>-body"><?php echo parsedown($reply->body); ?></div>
                    </div>
                </div>
                <?php if(Auth::user()->admin): ?>
                    <div class="mt-2 float-right">
                        <a class="btn btn-primary btn-sm" href="<?php echo e(route('forum.editreply', $reply->id)); ?>"><i class="fas fa-edit" aria-hidden="true"></i> Edit</a>
                        <form style="display: inline;" method="POST" action="<?php echo e(route('forum.deletereply', $reply->id)); ?>">
                            <?php echo csrf_field(); ?>
            
                            <button class="btn btn-danger btn-sm" type="submit"><i class="fas fa-trash"></i> Delete</button>
                        </form>
                    </div>
                <?php endif; ?>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <div class="d-flex justify-content-center">
        <?php echo e($replies->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/post.blade.php ENDPATH**/ ?>