
<?php $__env->startSection('section'); ?>

    <div class="page-body">
        <div class="container-fluid">
            <div class="row page-title">
                <div class="col-sm-6">
                    <h3>Deleted Post List</h3>
                </div>
                <div class="col-sm-6">
                    <nav>
                        <ol class="breadcrumb justify-content-sm-end align-items-center">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">
                                    <svg class="svg-color">
                                        <use href="<?php echo e(asset('assets/svg/iconly-sprite.svg#Home')); ?>"></use>
                                    </svg></a>
                            </li>
                            <li class="breadcrumb-item">Posts</li>
                            <li class="breadcrumb-item ">Post List</li>
                            <li class="breadcrumb-item active">Deleted Post List</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>

        <!-- Container-fluid starts-->
        <div class="container-fluid list-products">
            <div class="row">
                <div class="col-md-12 project-list">
                    <div class="card">
                        <div class="row align-items-center justify-content-between">
                            <!-- Left Side: Active Post Link -->
                         

                            <div class="col-md-6 col-12 mb-2 mb-md-0">
                                <a class="btn btn-warning d-inline-flex" href="<?php echo e(route('post.list')); ?>">
                                    <svg class="feather me-2">
                                        <use href="<?php echo e(asset('assets/svg/feather-icons/dist/feather-sprite.svg#target')); ?>">
                                        </use>
                                    </svg>
                                    Active Post
                                </a>
                            </div>

                            <!-- Right Side: Add New Post Button -->
                            <div class="col-md-6 col-12 text-md-end">
                                <a class="btn btn-primary d-inline-flex align-items-center" href="<?php echo e(route('post.add')); ?>">
                                    <svg class="feather me-2">
                                        <use
                                            href="<?php echo e(asset('assets/svg/feather-icons/dist/feather-sprite.svg#plus-square')); ?>">
                                        </use>
                                    </svg>
                                    Add New Post
                                </a>
                            </div>
                        </div>
                    </div>
                </div>


                <!-- Post Table -->
                <div class="col-sm-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="table-responsive theme-scrollbar product-table">
                                <table class="table display" id="post-datatable">
                                    <thead>
                                        <tr>
                                            <th>S.no</th>
                                            <th>Title</th>
                                            <th>Details</th>
                                            <th>Status</th>
                                            <th>Image</th>
                                            <th>Created By</th>
                                            <th>Created Date</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__currentLoopData = $titles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td><?php echo e($loop->iteration); ?></td>
                                                <td><?php echo e($post->title); ?></td>
                                                <td><?php echo e(Str::limit(strip_tags($post->content), 30)); ?></td>
                                                <td>
                                                    <span
                                                        class="badge rounded-pill toggle-status <?php echo e($post->status ? 'bg-success' : 'bg-danger'); ?>">
                                                        <?php echo e($post->status ? 'Publish' : 'Unpublish'); ?>

                                                    </span>
                                                </td>
                                                <td>
                                                    <?php if($post->featured_image): ?>
                                                        <img src="<?php echo e(asset('storage/' . $post->featured_image)); ?>" width="60"
                                                            height="50" class="rounded">
                                                    <?php else: ?>
                                                        N/A
                                                    <?php endif; ?>
                                                </td>
                                                <td><?php echo e($post->author->name ?? 'N/A'); ?></td>
                                                <td><?php echo e($post->created_at ? $post->created_at->format('d/m/Y') : 'N/A'); ?></td>
                                                <td>
                                                    <!-- Restore Button -->
                                                    <a href="<?php echo e(route('restore.post', $post->id)); ?>"
                                                        class="badge bg-warning text-dark rounded-pill btn-sm">
                                                        Restore
                                                    </a>

                                                    <!-- Permanent Delete Button -->
                                                    <a href="<?php echo e(route('delete.post', $post->id)); ?>"
                                                        class="badge bg-danger text-white rounded-pill btn-sm"
                                                        onclick="return confirm('Are you sure you want to permanently delete this post?')">
                                                        Permanently Delete
                                                    </a>
                                                </td>

                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- DataTables Script -->
    <script src="<?php echo e(asset('assets/js/vendors/simple-datatables/dist/umd/simple-datatables.js')); ?>"></script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.main', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\NEWXAMP\htdocs\nitinnewsproject\resources\views/admin/Post/index-tras.blade.php ENDPATH**/ ?>