Blame view

resources/views/employers/vacancy_autolift.blade.php 16.5 KB
f86fd56d9   Fedor   task-132985 autor...
1
2
3
4
5
  @extends('layout.frontend', ['title' => 'Автоподнятие вакансий'])
  @section('scripts')
      <script>
          $(document).on('click', '#submit', function () {
              let data = {};
5d6e2f2f5   Fedor   task-132985 minor...
6
              data.is_enabled = document.querySelector('.js_autoraise_toggle').checked;
f86fd56d9   Fedor   task-132985 autor...
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
              data.times_per_day = $('[name="times_per_day"]').chosen().val();
              data.days_repeat = $('[name="days_repeat"]').chosen().val();
              data.time_send_first = $('[name="time_send_first"]').val();
              data.time_send_second = $('[name="time_send_second"]').val();
              data.time_send_third = $('[name="time_send_third"]').val();
              data.time_send_tg = $('[name="time_send_tg"]').val();
  
              data.vacancies = [];
  
              document.getElementsByName('vacancy_table_row').forEach(function(field) {
                  data.vacancies.push({
                      'id': field.dataset.id,
                      'autolift_site': field.querySelector('input[name="autolift_site"]').checked,
                      'autosend_tg': field.querySelector('input[name="autosend_tg"]').checked
                  })
              });
  
              $.ajax({
                  url: '{{ route('employer.autolift_save') }}',
                  type: 'POST',
                  data: data,
                  headers: {
                      'X-CSRF-TOKEN': '{{ csrf_token() }}'
                  },
                  success: function (result) {
ab181e741   Fedor   task-132985 autol...
32
                      location.reload();
f86fd56d9   Fedor   task-132985 autor...
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
                  },
                  error: function (result) {
                      //todo пульнуть какуюнить модалку
                  },
              });
          })
      </script>
  @endsection
  @section('content')
      <section class="cabinet">
          <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' => 15])
                  </div>
                  <form class="cabinet__body">
                      @csrf
                      <div class="cabinet__body-item">
                          <h2 class="title cabinet__title">Автоподнятие вакансий</h2>
                          <div class="cabinet__inputs">
ab181e741   Fedor   task-132985 autol...
60
61
                              <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth">
                                  <?php
8ec6b4403   Fedor   task-132985 autor...
62
                                      $createdAtClone = isset($options->created_at) ? clone($options->created_at) : now();
ab181e741   Fedor   task-132985 autol...
63
64
65
                                      $diff = $createdAtClone->addDays($options->days_repeat)->diffInDays($options->created_at);
                                  ?>
                                  <label class="toggle">
5d6e2f2f5   Fedor   task-132985 minor...
66
                                      <input name="is_enabled" type="checkbox" @if($options->is_enabled) checked disabled @endif class="toggle__input js_autoraise_toggle">
ab181e741   Fedor   task-132985 autol...
67
68
69
70
71
                                      <span class="toggle__icon"></span>
                                      <span class="toggle__text">Деактивировано</span>
                                      <span class="toggle__text">Активировано</span>
                                  </label>
                                  <p class="mod js_autoraise_prompt @if($options->is_enabled === 1) hidden @endif">Срок действия автоподнятия вакансии истек. Желаете его возобновить?</p>
3801c86ea   Hayk Nazaryan   fix autolift left...
72
                                  <p class="mod js_autoraise_prompt @if($options->is_enabled === 0) hidden @endif">Автоподнятие вакансии продолжит действовать в течение следующих дней: <span>{{$leftDays}}</span></p>
ab181e741   Fedor   task-132985 autol...
73
                              </div>
f86fd56d9   Fedor   task-132985 autor...
74
75
76
77
78
                              <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">
ab181e741   Fedor   task-132985 autol...
79
                                          <select name="times_per_day" class="js-select2 js_autoraise_select">
f86fd56d9   Fedor   task-132985 autor...
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
                                              <option @if($options['times_per_day'] === null) selected @endif disabled>Выберите вариант из списка</option>
                                              <option @if($options['times_per_day'] === 1) selected @endif value="1">1 раз</option>
                                              <option @if($options['times_per_day'] === 2) selected @endif value="2">2 раза</option>
                                              <option @if($options['times_per_day'] === 3) selected @endif value="3">3 раза</option>
                                          </select>
                                      </div>
                                  </div>
                              </div>
                              <label class="cabinet__inputs-item form-group">
                                  <div class="form-group__label">Выберите первое время обновления (по
                                      МСК)</div>
                                  <div class="form-group__item">
                                      <span class="form-group__item-icon">
                                          <svg>
                                              <use xlink:href="images/sprite.svg#date"></use>
                                          </svg>
                                      </span>
                                      <input
                                          name="time_send_first"
                                          type="text"
ab181e741   Fedor   task-132985 autol...
100
                                          class="input js-picker input-picker"
f86fd56d9   Fedor   task-132985 autor...
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
                                          placeholder="Время"
                                          value="{{ $options['time_send_first'] }}"
                                      >
                                  </div>
                              </label>
                              <label class="cabinet__inputs-item form-group">
                                  <div class="form-group__label">Выберите второе время обновления (по
                                      МСК)</div>
                                  <div class="form-group__item">
                                      <span class="form-group__item-icon">
                                          <svg>
                                              <use xlink:href="images/sprite.svg#date"></use>
                                          </svg>
                                      </span>
                                      <input
                                          name="time_send_second"
                                          type="text"
ab181e741   Fedor   task-132985 autol...
118
119
120
121
                                          class="input js-picker input-picker"
                                          placeholder="Время"
                                          value="{{ $options['time_send_second'] }}"
                                          @if($options['times_per_day'] < 2) disabled @endif
f86fd56d9   Fedor   task-132985 autor...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
                                      >
                                  </div>
                              </label>
                              <label class="cabinet__inputs-item form-group">
                                  <div class="form-group__label">Выберите третье время обновления (по МСК)</div>
                                  <div class="form-group__item">
                                      <span class="form-group__item-icon">
                                          <svg>
                                              <use xlink:href="images/sprite.svg#date"></use>
                                          </svg>
                                      </span>
                                      <input
                                          name="time_send_third"
                                          type="text"
ab181e741   Fedor   task-132985 autol...
136
                                          class="input js-picker input-picker"
f86fd56d9   Fedor   task-132985 autor...
137
138
                                          placeholder="Время"
                                          value="{{ $options['time_send_third'] }}"
ab181e741   Fedor   task-132985 autol...
139
                                          @if($options['times_per_day'] < 3) disabled @endif
f86fd56d9   Fedor   task-132985 autor...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
                                      >
                                  </div>
                              </label>
                              <label class="cabinet__inputs-item form-group">
                                  <div class="form-group__label">Выберите время отправки в телеграм (по МСК)</div>
                                  <div class="form-group__item">
                                      <span class="form-group__item-icon">
                                          <svg>
                                              <use xlink:href="images/sprite.svg#date"></use>
                                          </svg>
                                      </span>
                                      <input
                                          name="time_send_tg"
                                          type="text"
1455f7d70   Hayk Nazaryan   fix autolift tele...
154
                                          class="input js-picker time-send-tg"
f86fd56d9   Fedor   task-132985 autor...
155
156
157
158
159
160
161
162
163
164
165
166
167
                                          placeholder="Время"
                                          value="{{ $options['time_send_tg'] }}"
                                      >
                                  </div>
                              </label>
                              <div class="cabinet__inputs-item form-group">
                                  <label class="form-group__label">Выполнять это действие на протяжении</label>
                                  <div class="form-group__item">
                                      <div class="select">
                                          <select name="days_repeat" class="js-select2">
                                              <option @if($options['days_repeat'] === null) selected @endif disabled>Выполнять это действие на протяжении</option>
                                              <option @if($options['days_repeat'] === 1) selected @endif value="1">1 день</option>
                                              <option @if($options['days_repeat'] === 3) selected @endif value="3">3 дня</option>
ab181e741   Fedor   task-132985 autol...
168
169
170
171
172
                                              <option @if($options['days_repeat'] === 5) selected @endif value="5">5 дней</option>
                                              <option @if($options['days_repeat'] === 7) selected @endif value="7">7 дней</option>
                                              <option @if($options['days_repeat'] === 10) selected @endif value="10">10 дней</option>
                                              <option @if($options['days_repeat'] === 15) selected @endif value="15">15 дней</option>
                                              <option @if($options['days_repeat'] === 30) selected @endif value="30">30 дней</option>
f86fd56d9   Fedor   task-132985 autor...
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
                                          </select>
                                      </div>
                                  </div>
                              </div>
                          </div>
                          <div class="table table_spoiler">
                              <button type="button"
                                      class="table__button js-toggle js-parent-toggle button button_light button_more">
                                  <span>Показать ещё</span>
                                  <span>Свернуть</span>
                              </button>
                              <div class="table__scroll">
                                  <div class="table__body table__body_min-width">
                                      <table>
                                          <thead>
                                              <tr>
                                                  <th>Название</th>
                                                  <th>Обновлять на сайте</th>
                                                  <th>Отправлять в ТГ</th>
                                              </tr>
                                          </thead>
                                          <tbody>
                                              @foreach($vacancies as $vacancy)
                                                  <tr name="vacancy_table_row" data-id="{{ $vacancy->id }}">
                                                      <td>{{ $vacancy->name }}</td>
                                                      <td >
                                                          <span class="checkbox-empty">
                                                              <label class="checkbox">
                                                                  <input
                                                                      type="checkbox"
                                                                      class="checkbox__input"
                                                                      @if($vacancy->autolift_site) checked @endif
                                                                      name="autolift_site"
                                                                  >
                                                                  <span class="checkbox__icon">
                                                                      <svg>
                                                                          <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
                                                                      </svg>
                                                                  </span>
                                                              </label>
                                                          </span>
                                                      </td>
                                                      <td>
                                                          <span class="checkbox-empty">
                                                              <label class="checkbox">
                                                                  <input
                                                                      type="checkbox"
                                                                      class="checkbox__input"
                                                                      @if($vacancy->autosend_tg) checked @endif
                                                                      name="autosend_tg"
                                                                  >
                                                                  <span class="checkbox__icon">
                                                                      <svg>
                                                                          <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
                                                                      </svg>
                                                                  </span>
                                                              </label>
                                                          </span>
                                                      </td>
                                                  </tr>
                                              @endforeach
                                          </tbody>
                                      </table>
                                  </div>
                              </div>
                              <div class="mrg-wrapper" style="display: flex; justify-content: center; clear: both;">
                                  <ins class="mrg-tag" data-ad-client="ad-595528" data-ad-slot="595528" style="display: flex; align-items: center; justify-content: center; width: 300px; z-index: 1;">
  
                                  </ins>
                              </div>
                          </div>
                          <div class="cabinet__inputs">
                              <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth">
                                  <button id="submit" type="button" class="button">Сохранить</button>
                              </div>
                          </div>
                      </div>
                  </form>
              </div>
          </div>
      </section>
      </div>
  @endsection