Commit d2fa9ea9e069abf543839865010dbf2bd9180032

Authored by Hayk Nazaryan
1 parent d3fc274b19
Exists in master

add vacancy created modal

Showing 3 changed files with 29 additions and 1 deletions Side-by-side Diff

app/Http/Controllers/EmployerController.php
... ... @@ -206,7 +206,7 @@ class EmployerController extends Controller
206 206 $ad_jobs = Ad_employer::create($params_emp);
207 207 $ad_jobs->jobs()->sync($request->get('job_title_id'));
208 208  
209   - return redirect()->route('employer.vacancy_list');
  209 + return redirect()->route('employer.vacancy_list')->with('success', 'Вакансия успешно опубликована');
210 210 }
211 211  
212 212 // Список вакансий
resources/views/employers/list_vacancy.blade.php
... ... @@ -31,6 +31,27 @@
31 31  
32 32 @section('content')
33 33 <section class="cabinet">
  34 + @if (session('success'))
  35 + @include('modals.message', [
  36 + 'title' => 'Спасибо!',
  37 + 'message' => session('success')
  38 + ])
  39 +
  40 + <script>
  41 + $(document).ready(function () {
  42 + $.fancybox.open({
  43 + src: '#vacancy-created',
  44 + type: 'inline',
  45 + opts: {
  46 + touch: false,
  47 + afterShow: function() {
  48 +
  49 + }
  50 + }
  51 + });
  52 + })
  53 + </script>
  54 + @endif
34 55 <div class="container">
35 56 <ul class="breadcrumbs cabinet__breadcrumbs">
36 57 <li><a href="{{ route('index') }}">Главная</a></li>
resources/views/modals/message.blade.php
... ... @@ -0,0 +1,7 @@
  1 +<div id="vacancy-created" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__title">{{$title}}</div>
  4 + <div class="modal__text">{{$message}}</div>
  5 + <a href="javascript:void(0)" onclick="$.fancybox.close();" class="button button_light modal__button">Закрыть</a>
  6 + </div>
  7 +</div>