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

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-md-12">
            <div class="page-header">
                <h1>#<?php echo e($job->id); ?> <small><?php echo e($job->title); ?> / <?php echo e(trans('user.views.edit_job.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">
                    <p class="small text-center">
                        <?php echo trans('user.views.index.mandatory_fields'); ?>

                    </p>

                    <hr>
                    <?php echo $__env->make('user._partials.errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <form method="POST" class="form-horizontal" action="<?php echo e(route('user.job.update', $job->id)); ?>">
                        <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                        <fieldset>
                            <legend><?php echo e(trans('user.views.edit_job.form.legend_main')); ?></legend>
                            <div class="form-group <?php if($errors->has('company')): ?> has-error <?php endif; ?>">
                                <label for="selectCompany" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.company')); ?></label>
                                <div class="col-md-6">
                                    <select name="company" class="form-control" id="selectCompany">
                                        <option value="__none__" <?php if(old('company', $job->company_id == null ? '__none__' : $job->company_id) == '__none__'): ?> selected <?php endif; ?> ><?php echo e(trans('user.views.edit_job.form.company_none')); ?></option>
                                        <?php foreach($companies as $company): ?>
                                            <option value="<?php echo e($company->id); ?>" <?php if(old('company', $job->company_id == null ? '__none__' : $job->company_id) == $company->id): ?> selected <?php endif; ?>><?php echo e($company->name); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('title')): ?> has-error <?php endif; ?>">
                                <label for="inputTitle" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.title')); ?>*</label>
                                <div class="col-md-6">
                                    <input id="inputTitle" type="text" class="form-control" name="title" value="<?php echo e(old('title', $job->title)); ?>" placeholder="<?php echo e(trans('user.views.edit_job.form.title_placeholder')); ?>">
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('description')): ?> has-error <?php endif; ?>">
                                <label for="inputDescription" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.description')); ?>*</label>
                                <div class="col-md-6">
                                    <textarea id="inputDescription" name="description" placeholder="<?php echo e(trans('user.views.edit_job.form.description_placeholder')); ?>" class="form-control" rows="7"><?php echo e(old('description', $job->description)); ?></textarea>
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('instructions')): ?> has-error <?php endif; ?>">
                                <label for="inputInstructions" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.instructions')); ?>*</label>
                                <div class="col-md-6">
                                    <textarea id="inputInstructions" name="instructions" placeholder="<?php echo e(trans('user.views.edit_job.form.instructions_placeholder')); ?>" class="form-control" rows="4"><?php echo e(old('instructions', $job->instructions)); ?></textarea>
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('categories')): ?> has-error <?php endif; ?>">
                                <label class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.categories')); ?>*</label>
                                <div class="col-md-6">
                                    <?php foreach($categories as $category): ?>
                                        <div class="checkbox">
                                            <label>
                                                <input name="categories[]" type="checkbox" id="checkboxCategory<?php echo e($category->id); ?>" value="<?php echo e($category->id); ?>" <?php if(in_array($category->id, old('categories', $job->categories()->lists('category_id')))): ?> checked <?php endif; ?>> <?php echo e($category->title); ?>

                                            </label>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('type')): ?> has-error <?php endif; ?>">
                                <label class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.type')); ?>*</label>
                                <div class="col-md-6">
                                    <?php foreach($types as $type): ?>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="type" id="optionType<?php echo e($type->id); ?>" value="<?php echo e($type->id); ?>" <?php if(old('type', $job->type_id) == $type->id): ?> checked <?php endif; ?>>
                                                <?php echo e($type->title); ?>

                                            </label>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            </div>
                        </fieldset>
                        <fieldset>
                            <legend><?php echo e(trans('user.views.edit_job.form.legend_location')); ?></legend>
                            <div class="form-group <?php if($errors->has('remote')): ?> has-error <?php endif; ?>">
                                <div class="col-md-6 col-md-push-4">
                                    <div class="checkbox">
                                        <label>
                                            <input name="remote" type="hidden" value="0">
                                            <input name="remote" type="checkbox" value="1" <?php if(old('remote', $job->remote) == '1'): ?> checked <?php endif; ?>>
                                            <?php echo e(trans('user.views.edit_job.form.remote')); ?>

                                        </label>
                                    </div>
                                    <hr>
                                    <p class="text-center text-muted"><i><?php echo e(trans('user.views.edit_job.form.or')); ?></i></p>
                                    <hr>
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('country')): ?> has-error <?php endif; ?>">
                                <label for="inputCountry" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.country')); ?>*</label>
                                <div class="col-md-6">
                                    <input id="inputCountry" type="text" class="form-control" name="country" value="<?php echo e(old('country', $job->country)); ?>" placeholder="<?php echo e(trans('user.views.edit_job.form.country_placeholder')); ?>">
                                </div>
                            </div>
                            <div class="form-group <?php if($errors->has('city')): ?> has-error <?php endif; ?>">
                                <label for="inputCity" class="col-md-4 control-label"><?php echo e(trans('user.views.edit_job.form.city')); ?>*</label>
                                <div class="col-md-6">
                                    <input id="inputCity" type="text" class="form-control" name="city" value="<?php echo e(old('city', $job->city)); ?>" placeholder="<?php echo e(trans('user.views.edit_job.form.city_placeholder')); ?>">
                                </div>
                            </div>
                        </fieldset>
                        <hr>
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    <?php echo e(trans('user.views.edit_job.form.post')); ?>

                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>