From 1745310d899e7d6feb4a7984cefa7785c66d6b92 Mon Sep 17 00:00:00 2001 From: RomanGolienko Date: Fri, 2 Aug 2024 14:58:58 +0300 Subject: [PATCH] screen changes --- .../DirectionForTildaController.php | 99 +++++++++++++++++++ .../views/new-design/tilda/index.blade.php | 36 +++++++ .../views/new-design/tilda/show.blade.php | 33 +++++++ routes/pages.php | 5 + 4 files changed, 173 insertions(+) create mode 100644 app/Http/Controllers/DirectionForTildaController.php create mode 100644 resources/views/new-design/tilda/index.blade.php create mode 100644 resources/views/new-design/tilda/show.blade.php diff --git a/app/Http/Controllers/DirectionForTildaController.php b/app/Http/Controllers/DirectionForTildaController.php new file mode 100644 index 0000000..c5f62fd --- /dev/null +++ b/app/Http/Controllers/DirectionForTildaController.php @@ -0,0 +1,99 @@ +allowedFilters('name') + ->orderBy('id', 'desc')->get(); +// $directions = Direction::all()->sortBy('created_at', SORT_REGULAR, true); + $filter = $request->filter ?? null; + return view('new-design.tilda.index', compact('directions', 'filter')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + */ + public function show(Direction $direction) + { +// $department = $direction->department; +// $faculty = Faculty::find($department->faculty->id); +// $educationalInstitution = $faculty->educationalInstitution; +// +// $ege = $direction +// ->entranceExaminations +// ->where('examination_type_id', '=', ExaminationTypeEnum::Ege->value) +// ->sortBy('position') +// ->pluck('scores', 'subject_id'); +// +// $spo = $direction +// ->entranceExaminations->where('examination_type_id', '=', ExaminationTypeEnum::Spo->value) +// ->sortBy('position') +// ->pluck('scores', 'subject_id'); +// +// $magistracy = $direction +// ->entranceExaminations +// ->where('examination_type_id', '=', ExaminationTypeEnum::Magistracy->value) +// ->sortBy('position') +// ->pluck('scores', 'subject_id'); + + return view( + 'new-design.tilda.show', + compact( + 'direction' + ) + ); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/resources/views/new-design/tilda/index.blade.php b/resources/views/new-design/tilda/index.blade.php new file mode 100644 index 0000000..b479dcf --- /dev/null +++ b/resources/views/new-design/tilda/index.blade.php @@ -0,0 +1,36 @@ +@extends('layouts.admin_layout') +@section('content') + +@foreach($directions as $direction) +{{-- @dd($direction)--}} + + + + + + + + + + +
{{ $direction->position }}{{ $direction->name }} +
+

+ @foreach($direction->directionProfiles as $directionProfile) + {{ $directionProfile->name }}
+ @endforeach +

+
{{ Str::words($direction->description, 10, '...') }}{{ $direction->slug }}{{ $direction->department->name }}{{ $direction->educationLevel->name }} + редактировать + Дублировать + удалить +
+ +@endforeach +@endsection + diff --git a/resources/views/new-design/tilda/show.blade.php b/resources/views/new-design/tilda/show.blade.php new file mode 100644 index 0000000..9e7493e --- /dev/null +++ b/resources/views/new-design/tilda/show.blade.php @@ -0,0 +1,33 @@ +@php + use App\Models\Subject; + use App\Models\EducationForm; +@endphp +@extends('layouts.new-design-layout') +@section('content') + + +
+
+
+
+{{--

{{$direction->name}} {{$direction->code}}

--}} +
+

Уроdень образования: +{{-- @if($direction->education_level_id = 1)--}} + +{{-- @elseif--}} + +{{-- @endif--}} +

+
+
+
+
+ + @dd($direction) + +@endsection diff --git a/routes/pages.php b/routes/pages.php index 5b3c0ad..52b29f7 100644 --- a/routes/pages.php +++ b/routes/pages.php @@ -4,6 +4,7 @@ use App\Http\Controllers\admin\FeedbackController; use App\Http\Controllers\admin\PageController; use App\Models\Faculty; use Illuminate\Support\Facades\Route; +use App\Http\Controllers\DirectionForTildaController; Route::get('/inostran', function () { return view('new-design.inostran'); @@ -21,6 +22,10 @@ Route::get('/magistr', [PageController::class, 'magistr'])->name('magistr'); Route::post('/feedback', [FeedbackController::class, 'store'])->name('feedback.store'); +Route::resource('/tilda', DirectionForTildaController::class)->scoped(['direction' => 'slug']); + + + //Route::get('/course', function () { // return view('menu.course');