Commit 3141fdd9a72c4bdf2ac8cc10f2ab4701ff6664af
1 parent
b8e64daa1f
Exists in
master
Коммит по критическим обновлениям
Showing 11 changed files with 82 additions and 31 deletions Side-by-side Diff
- app/Http/Controllers/Admin/JobTitlesController.php
- app/Http/Controllers/Admin/MsgAnswersController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/PagesController.php
- resources/views/TITLE_TEXT.blade.php
- resources/views/admin/answers/index.blade.php
- resources/views/admin/job_titles/index.blade.php
- resources/views/employers/list_vacancy.blade.php
- resources/views/employers/subcribe.blade.php
- resources/views/index.blade.php
- resources/views/pages.blade.php
app/Http/Controllers/Admin/JobTitlesController.php
... | ... | @@ -16,10 +16,19 @@ class JobTitlesController extends Controller |
16 | 16 | * |
17 | 17 | * @return \Illuminate\Http\Response |
18 | 18 | */ |
19 | - public function index() | |
19 | + public function index(Request $request) | |
20 | 20 | { |
21 | - $Jobs = Job_title::query()->where('is_remove', '=', '0')-> | |
22 | - orderByDesc('sort')->orderBy('name')->paginate(15); | |
21 | + if ($request->has('sort')) { | |
22 | + $Jobs = Job_title::query()->where('is_remove', '=', '0'); | |
23 | + if ($request->get('sort') == 'up') | |
24 | + $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15); | |
25 | + else | |
26 | + $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15); | |
27 | + } else { | |
28 | + $Jobs = Job_title::query()->where('is_remove', '=', '0')-> | |
29 | + orderByDesc('sort')->orderBy('name')->paginate(15); | |
30 | + } | |
31 | + | |
23 | 32 | return view('admin.job_titles.index', compact('Jobs')); |
24 | 33 | } |
25 | 34 |
app/Http/Controllers/Admin/MsgAnswersController.php
... | ... | @@ -107,7 +107,7 @@ class MsgAnswersController extends Controller |
107 | 107 | $id_admin = Auth::user()->id; |
108 | 108 | $users = User::query()->OrderBy('name')->where('is_bd', '=', '0')->get(); |
109 | 109 | |
110 | - $Msgs = Message::with('user_from')->with('user_to')->with('response') | |
110 | + $Msgs = Message::with('user_from')->with('user_to') //->with('response') | |
111 | 111 | ->where(function($query) use ($id_admin) { |
112 | 112 | $query->where('user_id', '=', $id_admin) |
113 | 113 | ->orWhere('to_user_id', '=', $id_admin); |
app/Http/Controllers/EmployerController.php
... | ... | @@ -226,10 +226,12 @@ class EmployerController extends Controller |
226 | 226 | switch ($sort) { |
227 | 227 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
228 | 228 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
229 | + case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break; | |
230 | + case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break; | |
229 | 231 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
230 | 232 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
231 | - case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | |
232 | - default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | |
233 | + case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break; | |
234 | + default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break; | |
233 | 235 | } |
234 | 236 | } |
235 | 237 | $vacancy_list = $vacancy_list->paginate(4); |
app/Http/Controllers/PagesController.php
... | ... | @@ -16,8 +16,9 @@ class PagesController extends Controller |
16 | 16 | { |
17 | 17 | public function pages(pages $pages) { |
18 | 18 | $page = pages::query()->where('slug', $pages->slug)->first(); |
19 | + $slug = $pages->slug; | |
19 | 20 | |
20 | - return view('pages', compact('page')); | |
21 | + return view('pages', compact('page', 'slug')); | |
21 | 22 | } |
22 | 23 | |
23 | 24 | public function form_feedback(RequestSendAdmin $request){ |
resources/views/TITLE_TEXT.blade.php
... | ... | @@ -0,0 +1,18 @@ |
1 | +<div class="numbers__item"> | |
2 | + <b>555+</b> | |
3 | + <span>Резюме</span> | |
4 | + Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют | |
5 | + фракционных разногласий и призваны к ответу. | |
6 | +</div> | |
7 | +<div class="numbers__item"> | |
8 | + <b>1 001+</b> | |
9 | + <span>Вакансий</span> | |
10 | + В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих | |
11 | + собственных рациональных ограничений. | |
12 | +</div> | |
13 | +<div class="numbers__item"> | |
14 | + <b>265</b> | |
15 | + <span>Компаний</span> | |
16 | + Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных | |
17 | + ограничений. | |
18 | +</div> |
resources/views/admin/answers/index.blade.php
... | ... | @@ -98,7 +98,11 @@ |
98 | 98 | {{$answer->id}} |
99 | 99 | </td> |
100 | 100 | <td class="px-4 py-3"> |
101 | - {{$answer->employer->name_company}} | |
101 | + @if (isset($answer->employer->name_company)) | |
102 | + {{$answer->employer->name_company}} | |
103 | + @else | |
104 | + Не определено | |
105 | + @endif | |
102 | 106 | </td> |
103 | 107 | <td class="px-4 py-3"> |
104 | 108 | {{$answer->user->name}} |
resources/views/admin/job_titles/index.blade.php
1 | 1 | @extends('layout.admin', ['title' => 'Админка - Справочник Должности']) |
2 | 2 | |
3 | 3 | @section('script') |
4 | + <script> | |
5 | + console.log('Test system'); | |
6 | + $(document).on('change', '#sort_ajax', function() { | |
7 | + var this_ = $(this); | |
8 | + var val_ = this_.val(); | |
9 | + console.log('sort items '+val_); | |
10 | + | |
11 | + $.ajax({ | |
12 | + type: "GET", | |
13 | + url: "{{ url()->current() }}", | |
14 | + data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif", | |
15 | + success: function (data) { | |
16 | + console.log('Выбор сортировки'); | |
17 | + console.log(data); | |
18 | + history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | |
19 | + $('#main_ockar').html(data); | |
20 | + }, | |
21 | + headers: { | |
22 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
23 | + }, | |
24 | + error: function (data) { | |
25 | + data = JSON.stringify(data); | |
26 | + console.log('Error: ' + data); | |
27 | + } | |
28 | + }); | |
29 | + }); | |
30 | + </script> | |
4 | 31 | @endsection |
5 | 32 | |
6 | 33 | @section('search') |
... | ... | @@ -20,7 +47,7 @@ |
20 | 47 | <th class="px-4 py-3">Родитель</th> |
21 | 48 | <th class="px-4 py-3">Должность</th> |
22 | 49 | <th class="px-4 py-3">Видимость</th> |
23 | - <th class="px-4 py-3">Сортировка</th> | |
50 | + <th class="px-4 py-3"><a id="sort_jobs" name="sort_jobs" @if(isset($_GET['sort'])) @if($_GET['sort']=='up') href="?sort=down" @else href="?sort=up" @endif @else href="?sort=down" @endif>Сортировка ↑↓</a></th> | |
24 | 51 | <th class="px-4 py-3">Дата создания</th> |
25 | 52 | <th class="px-4 py-3">Изменить</th> |
26 | 53 | </tr> |
resources/views/employers/list_vacancy.blade.php
... | ... | @@ -67,11 +67,13 @@ |
67 | 67 | <div class="cabinet__filters-item"> |
68 | 68 | <div class="select"> |
69 | 69 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
70 | - <option value="default">Сортировка (по умолчанию)</option> | |
71 | - <option value="name_up">По имени (возрастание)</option> | |
70 | + <option value="default" @if (isset($_GET['sort']) && ($_GET['sort'] == 'default')) selected @endif>От новых к старым (по умолчанию)</option> | |
71 | + <option value="public" @if (isset($_GET['sort']) && ($_GET['sort'] == 'public')) selected @endif>Опубликовано</option> | |
72 | + <option value="nopublic" @if (isset($_GET['sort']) && ($_GET['sort'] == 'nopublic')) selected @endif>Не опубликовано</option> | |
73 | + <!--<option value="name_up">По имени (возрастание)</option> | |
72 | 74 | <option value="name_down">По имени (убывание)</option> |
73 | 75 | <option value="created_at_up">По дате (возрастание)</option> |
74 | - <option value="created_at_down">По дате (убывание)</option> | |
76 | + <option value="created_at_down">По дате (убывание)</option>--> | |
75 | 77 | </select> |
76 | 78 | </div> |
77 | 79 | </div> |
resources/views/employers/subcribe.blade.php
resources/views/index.blade.php
... | ... | @@ -69,24 +69,7 @@ |
69 | 69 | <section class="numbers"> |
70 | 70 | <div class="container"> |
71 | 71 | <div class="numbers__body"> |
72 | - <div class="numbers__item"> | |
73 | - <b>500+</b> | |
74 | - <span>Резюме</span> | |
75 | - Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют | |
76 | - фракционных разногласий и призваны к ответу. | |
77 | - </div> | |
78 | - <div class="numbers__item"> | |
79 | - <b>1 000+</b> | |
80 | - <span>Вакансий</span> | |
81 | - В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих | |
82 | - собственных рациональных ограничений. | |
83 | - </div> | |
84 | - <div class="numbers__item"> | |
85 | - <b>265</b> | |
86 | - <span>Компаний</span> | |
87 | - Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных | |
88 | - ограничений. | |
89 | - </div> | |
72 | + @include('TITLE_TEXT') | |
90 | 73 | </div> |
91 | 74 | </div> |
92 | 75 | </section> |
resources/views/pages.blade.php
... | ... | @@ -16,6 +16,11 @@ |
16 | 16 | @endif |
17 | 17 | <h1 class="thing__title">{{ $page->name }}</h1> |
18 | 18 | <p class="thing__text">{!! $page->anons !!}</p> |
19 | + @if ($slug == 'Usloviya-razmescheniya') | |
20 | + <div class="thing__buttons"> | |
21 | + <a href="{{ route('shipping_companies') }}" class="button">Список компаний</a> | |
22 | + </div> | |
23 | + @endif | |
19 | 24 | </div> |
20 | 25 | </div> |
21 | 26 | </section> |