From dd87a3ce43ad11ea72219a8b2e020a5817572b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Wed, 13 Sep 2023 20:47:23 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=BA=D0=BB=D0=B0=D0=BC=D0=B0-=D0=B1?= =?UTF-8?q?=D0=BB=D0=BE=D0=BA,=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0?= =?UTF-8?q?=BD=D0=B8=D0=B5=20ckeditor=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D1=87=D0=B8=D0=BA=D0=B0,=20=D0=BC=D0=B5=D0=BD=D1=8E-=D1=88?= =?UTF-8?q?=D0=B0=D0=BF=D0=BA=D0=B8-=D1=84=D1=83=D1=82=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/CompanyController.php | 84 +++++++++++++++-- app/Http/Controllers/CKEditorController.php | 7 +- app/Http/Requests/ReclameRequest.php | 65 +++++++++++++ app/Models/reclame.php | 11 +++ public/images/jquery-ui-in-action_1694607980.jpg | Bin 0 -> 9444 bytes resources/views/admin/editbloks/index.blade.php | 69 +++++++++++++- .../views/admin/editbloks/index_ajax.blade.php | 85 +++++++++++++++++ resources/views/admin/pages/form.blade.php | 32 ++++--- resources/views/admin/reclames/add.blade.php | 7 ++ resources/views/admin/reclames/edit.blade.php | 7 ++ resources/views/admin/reclames/form.blade.php | 98 ++++++++++++++++++++ resources/views/admin/reclames/index.blade.php | 12 ++- routes/web.php | 7 ++ 13 files changed, 458 insertions(+), 26 deletions(-) create mode 100644 app/Http/Requests/ReclameRequest.php create mode 100644 public/images/jquery-ui-in-action_1694607980.jpg create mode 100644 resources/views/admin/editbloks/index_ajax.blade.php create mode 100644 resources/views/admin/reclames/add.blade.php create mode 100644 resources/views/admin/reclames/edit.blade.php create mode 100644 resources/views/admin/reclames/form.blade.php diff --git a/app/Http/Controllers/Admin/CompanyController.php b/app/Http/Controllers/Admin/CompanyController.php index 1bae8c3..1d139b7 100644 --- a/app/Http/Controllers/Admin/CompanyController.php +++ b/app/Http/Controllers/Admin/CompanyController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin; use App\Classes\Meta; use App\Http\Controllers\Controller; use App\Http\Requests\PagesRequest; +use App\Http\Requests\ReclameRequest; use App\Http\Requests\SEORequest; use App\Models\Employer; use App\Models\employers_main; @@ -15,6 +16,7 @@ use App\Models\pages; use App\Models\reclame; use App\Models\SEO; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Storage; class CompanyController extends Controller { @@ -42,9 +44,16 @@ class CompanyController extends Controller } // кабинет - редактор шапки-футера сайта - public function editblocks() { - $header_footer = header_footer::query()->OrderBy('name')->paginate(15); - return view('admin.editbloks.index', compact('header_footer')); + public function editblocks(Request $request) { + if ($request->ajax()) { + $header_footer = header_footer::where('header', $request->header)->OrderBy('sort')->OrderBy('name')->paginate(15); + $list_menu = header_footer::where('header', $request->header)->OrderBy('name')->get(); + return view('admin.editbloks.index_ajax', compact('header_footer')); + } else { + $header_footer = header_footer::where('header', '1')->OrderBy('sort')->OrderBy('name')->paginate(15); + $list_menu = header_footer::where('header', '1')->OrderBy('name')->get(); + return view('admin.editbloks.index', compact('header_footer')); + } } // кабинет - редактор работодатели на главной @@ -123,7 +132,12 @@ class CompanyController extends Controller } public function editor_pages_store(PagesRequest $request) { - pages::create($request->all()); + $params = $request->all(); + if ($request->has('image')) { + $params['image'] = $request->file('image')->store('pages', 'public'); + } + + pages::create($params); return redirect()->route('admin.editor-pages'); } @@ -132,7 +146,16 @@ class CompanyController extends Controller } public function editor_pages_update(PagesRequest $request, pages $page) { - $page->update($request->all()); + $params = $request->all(); + + if ($request->has('image')) { + if (!empty($page->image)) Storage::delete($page->image); + $params['image'] = $request->file('image')->store('pages', 'public'); + } else { + if (!empty($page->image)) $params['image'] = $page->image; + } + + $page->update($params); return redirect()->route('admin.editor-pages'); } @@ -142,9 +165,58 @@ class CompanyController extends Controller } /////////////////////////////////////////////////////////////////// - // кабинет - реклама сайта + ////// кабинет - реклама сайта //////////////////////////////////// public function reclames() { $reclames = reclame::query()->OrderBy('title')->paginate(15); return view('admin.reclames.index', compact('reclames')); } + + public function reclames_add() { + return view('admin.reclames.add'); + } + + public function reclames_store(ReclameRequest $request) { + $params = $request->all(); + /*if('on' == $request->get('is_hidden')) { + $params['is_hidden'] = 1; + } else { + $params['is_hidden'] = 0; + }*/ + if ($request->has('image')) { + $params['image'] = $request->file('image')->store('reclames', 'public'); + } + + reclame::create($params); + return redirect()->route('admin.reclames'); + } + + public function reclames_edit(reclame $reclame) { + return view('admin.reclames.edit', compact('reclame')); + } + + public function reclames_update(ReclameRequest $request, reclame $reclame) { + $params = $request->all(); + /*if('on' == $request->get('is_hidden')) { + $params['is_hidden'] = 1; + } else { + $params['is_hidden'] = 0; + }*/ + + if ($request->has('image')) { + if (!empty($reclame->image)) Storage::delete($reclame->image); + $params['image'] = $request->file('image')->store('reclames', 'public'); + } else { + if (!empty($reclame->image)) $params['image'] = $reclame->image; + } + + $reclame->update($params); + return redirect()->route('admin.reclames'); + } + + public function reclames_destroy(reclame $reclame) { + $reclame->delete(); + return redirect()->route('admin.reclames'); + } + + ///////////////////////////////////////////////////////////////// } diff --git a/app/Http/Controllers/CKEditorController.php b/app/Http/Controllers/CKEditorController.php index d98d01e..4d87061 100644 --- a/app/Http/Controllers/CKEditorController.php +++ b/app/Http/Controllers/CKEditorController.php @@ -3,19 +3,22 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Storage; class CKEditorController extends Controller { public function upload(Request $request) { if($request->hasFile('upload')) { - $originName = $request->file('upload')->getClientOriginalName(); + /*$originName = $request->file('upload')->getClientOriginalName(); $fileName = pathinfo($originName, PATHINFO_FILENAME); $extension = $request->file('upload')->getClientOriginalExtension(); $fileName = $fileName.'_'.time().'.'.$extension; $request->file('upload')->move(public_path('images'), $fileName); $CKEditorFuncNum = $request->input('CKEditorFuncNum'); - $url = asset('images/'.$fileName); + $url = asset('images/'.$fileName); */ + $CKEditorFuncNum = $request->input('CKEditorFuncNum'); + $url = asset(Storage::url($request->file('upload')->store('pages', 'public'))); $msg = 'Image successfully uploaded'; $response = ""; diff --git a/app/Http/Requests/ReclameRequest.php b/app/Http/Requests/ReclameRequest.php new file mode 100644 index 0000000..e4017d2 --- /dev/null +++ b/app/Http/Requests/ReclameRequest.php @@ -0,0 +1,65 @@ + + */ + public function rules() + { + return [ + 'title' => [ + 'required', + 'string', + 'min:3', + 'max:255', + ], + 'image' => [ + 'mimes:jpeg,jpg,png', + 'max:15000', + ], + 'position' => [ + 'required', + 'numeric', + 'min:0', + ], + ]; + } + + public function messages() { + return [ + 'required' => 'Поле :attribute обязательно для ввода', + 'unique' => 'Поле :attribute должно быть уникальным', + 'mimes' => 'Допускаются файлы только с расширением jpeg,jpg,png', + 'numeric' => 'Поле :attribute должно быть числом', + 'min' => [ + 'string' => 'Поле «:attribute» должно быть не меньше :min символов', + 'integer' => 'Поле «:attribute» должно быть :min или больше', + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' + ], + + 'max' => [ + 'string' => 'Поле «:attribute» должно быть не больше :max символов', + 'integer' => 'Поле «:attribute» должно быть :max или меньше', + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' + ], + + ]; + } +} diff --git a/app/Models/reclame.php b/app/Models/reclame.php index 22b653e..1452445 100644 --- a/app/Models/reclame.php +++ b/app/Models/reclame.php @@ -8,4 +8,15 @@ use Illuminate\Database\Eloquent\Model; class reclame extends Model { use HasFactory; + + protected $fillable = [ + 'title', + 'image', + 'link', + 'text', + 'position', + 'is_hidden', + 'col_vo_click', + 'is_remove', + ]; } diff --git a/public/images/jquery-ui-in-action_1694607980.jpg b/public/images/jquery-ui-in-action_1694607980.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e77df633338287f6c60dcb13a0d77544d7d3b16c GIT binary patch literal 9444 zcmbVw1zgojxAyF!yQI6jQ(968 zm;?PSotgvtjo(~0Lv8|bZF@IwH!piPcX}aSeju)(rUAd~9hLsTEPp_PahlkV@t_L+ zJrpx-<47SGxrk$=rl@GHt*fQ1c0&n85C9z28xF2+Pyzs4T)jPYRTSurj7{j#2LTjd z0yH21fTfj}yT(mry~{q;loaW`P(pw7|2sRF{DTJ=<5AV7r~h62&j6v7yQep5A+%BA zLe@53Rwx{f!p?r)?w92|C`@w4=@LUPIg)syCWyl1m)P!4%>9SVpIGh^Tf4Ygqhv1U z>~8I1eTmW9!FtjXCD^_6h1;>5*HgwF96^;m*w6zR`w{& zkHR>fdb)}zd=;gB9J{~aJAcF8HvXu20-)&T9^mO+rP@(@=!Llk6N3Azsl~U15h6U0QslC%9wKizz+wYZs>1($S&>0 z-rL(zc(09@`oL%Nke?H+|u z^?&65l0oB9f1zFucJ!CUin@CARz9A-ml(AtE;9tc0{DOgPykxM1lR!&5CmdC3djK^ zpboTv9xw*CffcX^F2ED`fxF;7hy;&70!RTFAR82bQcwY^Ks{&%9iRui2g6_jdv1rfGD$&}}M$nef z_R-PNDbTslrO~y}Ez!NvBhk~*%hB7=N70wjk1((?=r9B^lrc;&Trt8hQZZg&v|@~6 ztYDmC5@51mN@8kZT4M%a#$y&>Hen87E@Pfz5n{1nNn`0@Ibz+%O2ewa>c*PE+QY`i zX2h1j*1>kb4#iHxeudqKy?}j;LxjVLqlj}0#|I}4rx>Rl=OfM@E-o%Bt{kojt~YKR zZYgdT?i}tB9x)y-o*JGtUI<<$ULD>j-WEP4J`27){%!m~{8apE{2}}e0!#u{0!0E# zf?$G7f<}TVf_*|_LIFZ8LKnhV!WV@7gsVj8M65(gMAk&%MEOKrL`%dlVkTlmVk_bY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W~tJ7 zJYPqj*5JpY!glPYPIA0?q4%WZ#iL?}3q6DKQN(TEP_rnhw8NEJ`~2}e$HkR$OEgan z>cm@;>alUng0DJmZgF;h7?`RToY9m|GI%d4A>x@-8|yypm{?LYk}MVq%SI47zkjO97mnOi6pZ!zFeQ#sr9ImKGm$hZp!|0 zNxO`Qlbr^@NHcT&<38)fDz|rdV&cNHL{)U#=4ke|2f3~dP&%x+YU2goB+!vVkbr-a z{oAYJpFK4^ab!jCz=%@s6Hg;S?|J>XUpx{hnsA4FWk5v%W=p6ym&uHo!TO!$RU}}V z70Jf_-qg;=j7>T$5x2&y!|k$$C##s?5mZhUaFE#3aN8eO9$x z?4JVdJYY=p^WLm)K1pbcPLGq{b{K#AFQ%dA^GyEd2Z=2!rNk$pq;Zgy4A5dEY50(J z+=tNdU^T{aPYjLuVDo4gZQoFAvO|$#44qtJDLHe8R(u0txfd!`~BnY=d-O<^0NYM5pWLGapRJQWw z1`<@JcTV{r0mfh=>N)KL5`=t3g2j>pXPFkQ>Wfx83M(X_JNWY{-PD^Sl%dEL1q zWg==j>j#ER&4iejWWy&{T;u1}bJeXA{1>vrhPJ&Qe1yxSHgAT6{3L z99+u5Q@t-=&Jn1CbGOmX);(WCn{2DYq4Z9DBXe;9B%9NPO< zcJGDT_C;7IPo_B5rT_!Q(Cl{B%HFpZzl!;kh!hH~ 'Админка - Редактор шапки-футера сайта']) @section('script') + @endsection @section('search') @@ -38,6 +63,11 @@ Добавить опцию + +
@@ -50,8 +80,8 @@ № Название Ссылка - Категория - Шапка + Родитель + Сортировка Дата создания Редактировать @@ -69,18 +99,51 @@ {{$page->link}} - {{$page->category}} ({{$page->code_id}}) + + + + + {{$page->created_at}} +
Изменить | @csrf @method('DELETE')
+ @endforeach diff --git a/resources/views/admin/editbloks/index_ajax.blade.php b/resources/views/admin/editbloks/index_ajax.blade.php new file mode 100644 index 0000000..8683d3d --- /dev/null +++ b/resources/views/admin/editbloks/index_ajax.blade.php @@ -0,0 +1,85 @@ +
+ + + + + + + + + + + + + + @foreach($header_footer as $page) + + + + + + + + + + + @endforeach + +
НазваниеСсылкаРодительСортировкаДата созданияРедактировать
+ {{$page->id}} + + {{$page->name}} + + {{$page->link}} + + + + + + {{$page->created_at}} + + +
+ Изменить | + @csrf + @method('DELETE') + +
+ +
+
+ +
+ appends($_GET)->links('admin.pagginate'); ?> +
+ + diff --git a/resources/views/admin/pages/form.blade.php b/resources/views/admin/pages/form.blade.php index cb73ab2..1ea5e6f 100644 --- a/resources/views/admin/pages/form.blade.php +++ b/resources/views/admin/pages/form.blade.php @@ -4,14 +4,6 @@ @method('PUT') @endisset - -
- -
+ + diff --git a/resources/views/admin/reclames/add.blade.php b/resources/views/admin/reclames/add.blade.php new file mode 100644 index 0000000..8c85a0c --- /dev/null +++ b/resources/views/admin/reclames/add.blade.php @@ -0,0 +1,7 @@ +@extends('layout.admin', ['title' => 'Админка - Добавление рекламы']) + +@section('content') +
+ @include('admin.reclames.form') +
+@endsection diff --git a/resources/views/admin/reclames/edit.blade.php b/resources/views/admin/reclames/edit.blade.php new file mode 100644 index 0000000..04550dc --- /dev/null +++ b/resources/views/admin/reclames/edit.blade.php @@ -0,0 +1,7 @@ +@extends('layout.admin', ['title' => 'Админка - Редактирование рекламы']) + +@section('content') +
+ @include('admin.reclames.form') +
+@endsection diff --git a/resources/views/admin/reclames/form.blade.php b/resources/views/admin/reclames/form.blade.php new file mode 100644 index 0000000..b02a743 --- /dev/null +++ b/resources/views/admin/reclames/form.blade.php @@ -0,0 +1,98 @@ +@csrf + +@isset($reclame) + @method('PUT') +@endisset + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+
+
diff --git a/resources/views/admin/reclames/index.blade.php b/resources/views/admin/reclames/index.blade.php index d794ceb..a686147 100644 --- a/resources/views/admin/reclames/index.blade.php +++ b/resources/views/admin/reclames/index.blade.php @@ -35,7 +35,7 @@ @section('content') - + Добавить рекламу
@@ -72,14 +72,18 @@ {{$reclame->position}} - {{$reclame->is_hidden}} + @if ($reclame->is_hidden) + Скрыто + @else + Показано + @endif {{$reclame->col_vo_click}} -
- Изменить | + + Изменить | @csrf @method('DELETE') diff --git a/routes/web.php b/routes/web.php index d62310d..ef7b03f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -180,6 +180,7 @@ Route::group([ // кабинет - редактор работодатели на главной Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); + // кабинет - редактор seo-сайта Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); @@ -206,8 +207,14 @@ Route::group([ // кабинет - реклама сайта Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); + Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); + Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); + Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); + Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); + Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); //////////////////////////////////////////////////////////////////////// + // кабинет - отзывы о работодателе для модерации Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); -- 1.7.10.4