
<?php $__env->startSection('pageTitle', isset($pageTitle) ? $pageTitle : 'Document Title'); ?>
<?php $__env->startSection('meta_tags'); ?>
<?php echo SEO::generate(); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<section class="section department-single">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="d-flex justify-content-between align-items-center mb-4 flex-wrap">
                    <!-- Title -->
                    <h3 class="mb-0">Bulletin Room</h3>
                    <!-- Breadcrumb -->
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb bg-transparent mb-0 px-0">
                            <li class="breadcrumb-item"><a href="<?php echo e(url('/')); ?>">Home</a></li>
                            <li class="breadcrumb-item active" aria-current="page">Bulletin</li>
                        </ol>
                    </nav>
                </div>
                <hr>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8">
                <!-- Blog Posts Section -->
                <section id="blog-posts" class="blog-posts">
                    <div class="container">
                        <div class="row gy-4">
                            <div class="col-12">
                                <?php if(!empty(latest_posts(0, 1))): ?>
                                <?php $__currentLoopData = latest_posts(0,1); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $latest_post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                $duration = readDuration($latest_post->title, $latest_post->content);
                                ?>
                                <article>
                                    <div class="post-img">
                                        <img src="/images/posts/<?php echo e($latest_post->featured_image); ?>" alt="" class="img-fluid">
                                    </div>

                                    <h2 class="title">
                                        <a href="<?php echo e(route('read_post',$latest_post->slug)); ?>"><?php echo e($latest_post->title); ?></a>
                                    </h2>
                                    <div class="meta-top">
                                        <ul>
                                            <li class="d-flex align-items-center"><i class="icofont-ui-user"></i> <a href="<?php echo e(route('author_posts',$latest_post->author->username)); ?>"><?php echo e($latest_post->author->name); ?></a></li>
                                            <li class="d-flex align-items-center"><i class="mdi mdi-calendar-badge"></i><?php echo e(date_formatter($latest_post->created_at)); ?></li>
                                            <li class="d-flex align-items-center"><i class="icofont-clock-time"></i><?php echo e(readDuration($duration)); ?><?php echo e(Str::plural('min', $duration)); ?></li>
                                        </ul>
                                    </div>

                                    <div class="content">
                                        <p class="text-justify">
                                            <?php echo Str::ucfirst(words($latest_post->content, 50)); ?>

                                        </p>

                                        <div class="read-more">
                                            <a href="<?php echo e(route('read_post', $latest_post->slug)); ?>">Read More</a>
                                        </div>
                                    </div>

                                </article>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </div><!-- End post list item -->


                            <div class="card shadow border-0 p-3">
                                <?php if(!empty(latest_posts(1, 3))): ?>
                                <?php $__currentLoopData = latest_posts(1,3); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="row mb-4 align-items-stretch">
                                    <!-- Image Section -->
                                    <div class="col-md-4 d-flex p-3">
                                        <img
                                            src="<?php echo e(asset('/images/posts/resized/thumb_' . $post->featured_image)); ?>"
                                            class="img-fluid card-radius w-100 object-fit-cover"
                                            style="height: 100%; max-height: 250px; object-fit: cover;"
                                            alt="<?php echo e($post->title ?? 'Post Image'); ?>">
                                    </div>

                                    <!-- Content Section -->
                                    <div class="col-md-8">
                                        <div class="card-body h-100 d-flex flex-column justify-content-between">
                                            <div>
                                                <h5 class="card-title fw-bold">
                                                    <a href="<?php echo e(route('read_post',$post->slug)); ?>"><?php echo e($post->title); ?></a>
                                                </h5>

                                                <div class="text-muted small mb-2 card-details">
                                                    <i class="icofont-ui-user"></i>
                                                    <a href="<?php echo e(route('author_posts',$post->author->username)); ?>"><?php echo e($post->author->name); ?></a> &nbsp;
                                                    <i class="mdi mdi-calendar-badge"></i> <?php echo e(date_formatter($post->created_at)); ?> &nbsp;
                                                    <i class="icofont-category"></i>
                                                    <a href="<?php echo e(route('category_post', $post->post_category->slug)); ?>" class="ml-1"><?php echo e($post->post_category->name); ?></a>
                                                </div>

                                                <p class="card-text">
                                                    <?php echo Str::ucfirst(words($post->content, 25)); ?>

                                                </p>
                                            </div>

                                            <div>
                                                <a href="<?php echo e(route('read_post',$post->slug)); ?>">Read More...</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <!-- End post list item -->
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </div><!-- End blog posts list -->

                        </div>
                </div>
                </section><!-- /Blog Posts Section -->

                <!-- Blog Pagination Section -->
                <section id="blog-pagination" class="blog-pagination section">

                    <div class="container">
                        <div class="d-flex justify-content-center">
                            <ul>
                                <li><a href="#"><i class="bi bi-chevron-left"></i></a></li>
                                <li><a href="#">1</a></li>
                                <li><a href="#" class="active">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li>...</li>
                                <li><a href="#">10</a></li>
                                <li><a href="#"><i class="bi bi-chevron-right"></i></a></li>
                            </ul>
                        </div>
                    </div>

                </section><!-- /Blog Pagination Section -->
            </div>
            <div class="col-lg-4 sidebar">

                <div class="widgets-container">

                    <!-- Search Widget -->
                     <?php if (isset($component)) { $__componentOriginale6ac12e1b4c8ba8b88cc0f498d1979d5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale6ac12e1b4c8ba8b88cc0f498d1979d5 = $attributes; } ?>
<?php $component = App\View\Components\SidebarSearch::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('sidebar-search'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\SidebarSearch::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale6ac12e1b4c8ba8b88cc0f498d1979d5)): ?>
<?php $attributes = $__attributesOriginale6ac12e1b4c8ba8b88cc0f498d1979d5; ?>
<?php unset($__attributesOriginale6ac12e1b4c8ba8b88cc0f498d1979d5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale6ac12e1b4c8ba8b88cc0f498d1979d5)): ?>
<?php $component = $__componentOriginale6ac12e1b4c8ba8b88cc0f498d1979d5; ?>
<?php unset($__componentOriginale6ac12e1b4c8ba8b88cc0f498d1979d5); ?>
<?php endif; ?>
                    <!--/Search Widget -->

                    <!-- Categories Widget -->
                    <?php
                    $grouped = sidebar_categories()->groupBy(fn($cat) => $cat->parent_category->name ?? 'Others');
                    ?>

                    <div class="categories-widget widget-item">
                        <h3 class="widget-title">Categories</h3>

                        <?php $__currentLoopData = $grouped; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parentName => $categories): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <h6 class="mt-3"><strong><?php echo e($parentName); ?></strong></h6>
                        <ul class="ms-3">
                            <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li>
                                <a href="<?php echo e(route('category_post', $item->slug)); ?>">
                                    <?php echo e($item->name); ?> <span>(<?php echo e($item->posts_count); ?>)</span>
                                </a>
                            </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                    <!--/Categories Widget -->

                    <!-- Recent Posts Widget -->
                    <div class="recent-posts-widget widget-item">

                        <h3 class="widget-title">Recent Posts</h3>
                        <?php if(!empty(latest_posts(0, 5))): ?>
                        <?php $__currentLoopData = latest_posts(0,5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="post-item">
                            <img src="/images/posts/resized/thumb_<?php echo e($post->featured_image); ?>" alt="<?php echo e($post->title); ?>" class="img-fluid" style="max-height: 100px; object-fit: cover;">
                            <div>
                                <h4 style="line-height: 1.5rem;"><a href="<?php echo e(route('read_post', $post->slug)); ?>"><?php echo e($post->title); ?></a></h4>
                                <time><?php echo e(date_formatter($latest_post->created_at)); ?></li></time>
                            </div>
                        </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                        <!-- End recent post item-->
                    </div><!--/Recent Posts Widget -->

                    <!-- Tags Widget -->
                    <div class="tags-widget widget-item">

                        <h3 class="widget-title">Tags</h3>
                        <ul>
                            <?php $__currentLoopData = getTags(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tags): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li><a href="<?php echo e(route('tag_posts', urlencode($tags))); ?>"><?php echo e($tags); ?></a></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>

                    </div><!--/Tags Widget -->

                </div>

            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('front.layout.pages-layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\larablog\resources\views\front\pages\bulletin\bulletin.blade.php ENDPATH**/ ?>