

<?php $__env->startSection('title', trans('user.views.jobs.title')); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-md-12">
            <div class="page-header">
                <h1><?php echo e(trans('user.views.jobs.header')); ?> <small><?php echo e(trans('user.views.jobs.subheader')); ?></small></h1>
            </div>

            <?php echo $__env->make('user._partials.navigation', ['_active_navigation' => 'jobs'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

            <hr>

            <div class="row">
                <div class="col-lg-10 col-lg-offset-1">
                    <?php echo Notification::showAll(); ?>

                    <?php if(count($jobs) > 0): ?>
                        <table class="table table-striped table-hover">
                            <thead>
                                <tr>
                                    <th><?php echo e(trans('user.views.jobs.table.title')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.company')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.type')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.location')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.views')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.status')); ?></th>
                                    <th><?php echo e(trans('user.views.jobs.table.active_to')); ?></th>
                                    <th>&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach($jobs as $job): ?>
                                    <tr>
                                        <td><a href="<?php echo e(route('user.job.show', $job->id)); ?>"><?php echo e($job->title); ?></a></td>
                                        <td>
                                            <?php if($job->company): ?>
                                                <a href="<?php echo e(route('user.company.edit', $job->company->id)); ?>"><?php echo e($job->company->name); ?></a>
                                            <?php else: ?>
                                                -
                                            <?php endif; ?>
                                        </td>
                                        <td></td>
                                        <td>
                                            <?php if($job->remote): ?>
                                                <?php echo e(trans('user.views.jobs.table.location_remote')); ?>

                                            <?php else: ?>
                                                <?php echo e($job->country); ?>, <?php echo e($job->city); ?>

                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo e((int) app('counter')->get('model.job.'.$job->id.'.opened.total')->getValue()); ?></td>
                                        <td>
                                            <?php if($job->active): ?>
                                                <span class="label label-success"><?php echo e(trans('user.views.jobs.table.active')); ?></span>
                                            <?php else: ?>
                                                <span class="label label-default"><?php echo e(trans('user.views.jobs.table.inactive')); ?></span>
                                            <?php endif; ?>
                                            <?php if($job->new): ?>
                                                <span class="label label-warning"><?php echo e(trans('user.views.jobs.table.new')); ?></span>
                                            <?php endif; ?>
                                            <?php if($job->featured): ?>
                                                <span class="label label-warning"><?php echo e(trans('user.views.jobs.table.featured')); ?></span>
                                            <?php endif; ?>
                                            <?php if($job->filled): ?>
                                                <span class="label label-danger"><?php echo e(trans('user.views.jobs.table.filled')); ?></span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php if($job->active): ?>
                                                <?php echo e($job->active_to); ?>

                                            <?php else: ?>
                                                -
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-right">
                                            <?php if($job->active): ?>
                                                <a href="<?php echo e(route('job.show', [$job->id, $job->slug])); ?>" class="btn btn-info btn-xs"><i class="glyphicon glyphicon-link"></i></a>
                                            <?php endif; ?>
                                            <a href="<?php echo e(route('user.job.edit', $job->id)); ?>" class="btn btn-default btn-xs"><?php echo e(trans('user.views.jobs.table.edit')); ?></a>
                                            <?php if(!$job->filled): ?>
                                                <a href="<?php echo e(route('user.job.fill', $job->id)); ?>" class="btn btn-danger btn-xs confirm-action"><?php echo e(trans('user.views.jobs.table.fill')); ?></a>
                                            <?php else: ?>
                                                <a href="<?php echo e(route('user.job.unfill', $job->id)); ?>" class="btn btn-success btn-xs confirm-action"><?php echo e(trans('user.views.jobs.table.available')); ?></a>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    <?php else: ?>
                        <div class="alert alert-info" role="alert"><?php echo trans('user.views.jobs.table.empty'); ?></div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>