Commit bbaa986c097d9b383906fa21fde033db3e0c1554

Authored by Hayk Nazaryan
1 parent 6408200e47
Exists in master

vacancy update and create popups

Showing 5 changed files with 34 additions and 29 deletions Side-by-side Diff

app/Http/Controllers/EmployerController.php
... ... @@ -285,7 +285,8 @@ class EmployerController extends Controller
285 285  
286 286 $Employer = Employer::query()
287 287 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
288   - return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
  288 +
  289 + return redirect()->back()->with('success', 'Вакансия успешно сохранена и опубликована');
289 290 }
290 291  
291 292 // Сохранение карточки вакансии
resources/views/employers/edit_vacancy.blade.php
... ... @@ -32,6 +32,10 @@
32 32 @endsection
33 33 @section('content')
34 34 <section class="cabinet">
  35 + @include('modals.flash-message', [
  36 + 'title' => 'Спасибо!',
  37 + 'message' => session('success')
  38 + ])
35 39 <div class="container">
36 40 <ul class="breadcrumbs cabinet__breadcrumbs">
37 41 <li><a href="{{ route('index') }}">Главная</a></li>
resources/views/employers/list_vacancy.blade.php
... ... @@ -31,27 +31,10 @@
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 + @include('modals.flash-message', [
  35 + 'title' => 'Спасибо!',
  36 + 'message' => session('success')
  37 + ])
55 38 <div class="container">
56 39 <ul class="breadcrumbs cabinet__breadcrumbs">
57 40 <li><a href="{{ route('index') }}">Главная</a></li>
resources/views/modals/flash-message.blade.php
... ... @@ -0,0 +1,24 @@
  1 +@if (session('success'))
  2 + <div id="flash-message" class="modal modal_bg">
  3 + <div class="modal__body">
  4 + <div class="modal__title">{{$title}}</div>
  5 + <div class="modal__text">{{$message}}</div>
  6 + <a href="javascript:void(0)" onclick="$.fancybox.close();" class="button button_light modal__button">Закрыть</a>
  7 + </div>
  8 + </div>
  9 +
  10 + <script>
  11 + $(document).ready(function () {
  12 + $.fancybox.open({
  13 + src: '#flash-message',
  14 + type: 'inline',
  15 + opts: {
  16 + touch: false,
  17 + afterShow: function() {
  18 +
  19 + }
  20 + }
  21 + });
  22 + })
  23 + </script>
  24 +@endif
resources/views/modals/message.blade.php
... ... @@ -1,7 +0,0 @@
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>