edit_vacancy.blade.php
11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре'])
@section('scripts')
<script>
console.log('Приближаемся к системе, нас рой тут...');
$(document).on('change', '#position_id', function() {
var this_ = $(this);
var val_ = this_.val();
var ajax_ = $('#job_title_id');
console.log('Создания списка людей, которые поднимутся на корабль...');
$.ajax({
type: "GET",
url: "{{ route('employer.selected_people') }}",
data: "id="+val_,
success: function (data) {
console.log('Ответка пришла');
console.log('Список избранных людей создан');
ajax_.html(data);
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
console.log('Обрыв связи');
console.log('Error: ' + data);
}
});
});
</script>
@endsection
@section('content')
<section class="cabinet">
@include('modals.flash-message', [
'title' => 'Спасибо!',
'message' => session('success')
])
<div class="container">
<ul class="breadcrumbs cabinet__breadcrumbs">
<li><a href="{{ route('index') }}">Главная</a></li>
<li><b>Личный кабинет</b></li>
</ul>
<div class="cabinet__wrapper">
<div class="cabinet__side">
<div class="cabinet__side-toper">
@include('employers.emblema')
</div>
@include('employers.menu', ['item' => 3])
</div>
<form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer->id]) }}" method="POST">
@csrf
<input type="hidden" name="employer_id" value="{{ $Employer->id }}"/>
<div class="cabinet__body-item">
<div class="cabinet__descr">
<h2 class="title cabinet__title">Редактировать вакансию</h2>
<p class="cabinet__text"><b>Данные по вакансии</b></p>
<p class="cabinet__text">Все поля обязательны для заполнения *</p>
</div>
</div>
<div class="cabinet__body-item">
<h4>Поля для вакансии</h4>
<div class="cabinet__inputs">
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">Название вакансии</label>
<div class="form-group__item">
<input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required>
@error('name')
<span class="text-xs text-red-600 dark:text-red-400">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
<label class="form-group__label">Телефон</label>
<div class="form-group__item">
<input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон">
@error('telephone')
<span class="text-xs text-red-600 dark:text-red-400">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
<label class="form-group__label">Емайл</label>
<div class="form-group__item">
<input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту">
@error('email')
<span class="text-xs text-red-600 dark:text-red-400">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
<label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
<div class="form-group__item">
<input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата">
@error('salary')
<span class="text-xs text-red-600 dark:text-red-400">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display: none">
<label class="form-group__label">Город посадки</label>
<div class="form-group__item">
<input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? 'Не указан' }}" placeholder="Севастополь">
@error('city')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">Редактирование должностей</label>
<div class="form-group__item">
<div class="select">
<select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
@php $i = 1 @endphp
@if ($jobs->count())
@foreach($jobs as $it)
@php $selected = false; @endphp
@foreach ($ad_employer->jobs_code as $it_um)
@if (isset($it_um->job_title_id))
@if ($it_um->job_title_id == $it->id))
@php $selected = true; @endphp
@endif
@endif
@endforeach
<option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
@endforeach
@endif
</select>
</div>
</div>
</div>
<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
<label class="form-group__label">Описание вакансии</label>
<div class="form-group__item">
<textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
@error('text')
<span class="text-xs text-red-600">
{{ $message }}
</span>
@enderror
</div>
</div>
</div>
<a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
<button type="submit" class="button cabinet__submit">Сохранить и опубликовать</button>
</div>
</form>
</div>
</div>
</section>
</div>
<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
<script>
CKEDITOR.replace('text', {
allowedContent: true,
extraAllowedContent: 'p br strong em u ul ol li span;*{*}',
on: {
paste: function (event) {
let data = event.data.dataValue;
data = data.replace(/<br\s*\/?>\s*<br\s*\/?>/g, '<br>');
event.data.dataValue = data.trim();
}
},
contentsCss: [
CKEDITOR.basePath + 'contents.css',
'/css/custom-ckeditor.css'
]
});
//CKEDITOR.replace( 'text', {
// filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
// filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
// filebrowserUploadMethod: 'form'
// });
</script>
@endsection