forked from aslan/applicant-site
Compare commits
14 Commits
feature/vi
...
main
Author | SHA1 | Date |
---|---|---|
aslan | 90d38a74ad | |
aslan | 4b5b29f8b9 | |
aslan | aaaec23a25 | |
aslan | b65cce5722 | |
aslan | b9dfe9669a | |
aslan | d6b07066de | |
aslan | 7206bab9c2 | |
aslan | 18df25c6a8 | |
aslan | 9f926f4ac5 | |
aslan | 73e6502e60 | |
aslan | 97f4cd68e6 | |
aslan | 0419aebe18 | |
aslan | 4093e2ce51 | |
aslan | 90fffa0279 |
|
@ -3,7 +3,9 @@
|
|||
namespace App\Helpers;
|
||||
|
||||
use App\Models\Direction;
|
||||
use App\Models\DirectionDescription;
|
||||
use App\Models\DirectionProfile;
|
||||
use App\Models\Document;
|
||||
use App\Models\EntranceExamination;
|
||||
use App\Models\ExaminationType;
|
||||
use App\Models\Faculty;
|
||||
|
@ -66,4 +68,16 @@ class PositionHelper
|
|||
$maxPosition = EntranceExamination::max('position');
|
||||
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
||||
}
|
||||
|
||||
public static function document()
|
||||
{
|
||||
$maxPosition = Document::max('position');
|
||||
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
||||
}
|
||||
|
||||
public static function directionDescription()
|
||||
{
|
||||
$maxPosition = DirectionDescription::max('position');
|
||||
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\ExaminationTypeEnum;
|
||||
use App\Models\Direction;
|
||||
use App\Models\Faculty;
|
||||
use Illuminate\Http\Request;
|
||||
use Spatie\QueryBuilder\QueryBuilder;
|
||||
|
||||
class DirectionForTildaController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$directions = QueryBuilder::for(Direction::class)
|
||||
->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)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -46,9 +46,11 @@ class NewsController extends Controller
|
|||
public function update(UpdateNewsRequest $request, News $news)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
$urlPhoto = Storage::put('public', $request->file('photo'));
|
||||
|
||||
$news->name = $validated['name'];
|
||||
$news->text = $validated['text'];
|
||||
$news->photo = Storage::url($urlPhoto);
|
||||
$news->save();
|
||||
return redirect()->route('news.index');
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\admin\Catalog;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\admin\StoreDirectionDescriptionRequest;
|
||||
use App\Http\Requests\admin\UpdateDirectionDescriptionRequest;
|
||||
use App\Models\Direction;
|
||||
use App\Models\DirectionDescription;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class DirectionDescriptionController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$directionDescriptions = DirectionDescription::all();
|
||||
return view('admin.catalog.direction_description.index', compact('directionDescriptions'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$directionCodes = Direction::pluck('full_name', 'code');
|
||||
return view('admin.catalog.direction_description.create', compact('directionCodes'));
|
||||
}
|
||||
|
||||
public function store(StoreDirectionDescriptionRequest $request)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
$fileName = $request->file('file')->getClientOriginalName();
|
||||
$name = Storage::put('public', $request->file('file'));
|
||||
|
||||
$directionDescription = new DirectionDescription();
|
||||
$directionDescription->url = Storage::url($name);
|
||||
$directionDescription->direction_code = Direction::select('code', 'id')
|
||||
->where('code', $validated['direction_code'])
|
||||
->first()
|
||||
->id;
|
||||
$directionDescription->file_name = $fileName;
|
||||
$directionDescription->position = $validated['position'];
|
||||
$directionDescription->save();
|
||||
return redirect()->route('direction_descriptions.index');
|
||||
}
|
||||
|
||||
public function edit(DirectionDescription $directionDescription)
|
||||
{
|
||||
$directionCodes = Direction::pluck('full_name', 'code');
|
||||
return view('admin.catalog.direction_description.edit', compact('directionDescription', 'directionCodes'));
|
||||
}
|
||||
|
||||
public function update(UpdateDirectionDescriptionRequest $request, DirectionDescription $directionDescription)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
$fileName = $request->file('file')->getClientOriginalName();
|
||||
$name = Storage::put('public', $request->file('file'));
|
||||
|
||||
$directionDescription->url = Storage::url($name);
|
||||
$directionDescription->direction_code = Direction::select('code', 'id')
|
||||
->where('code', $validated['direction_code'])
|
||||
->first()
|
||||
->id;
|
||||
$directionDescription->file_name = $fileName;
|
||||
$directionDescription->position = $validated['position'];
|
||||
$directionDescription->save();
|
||||
return redirect()->route('direction_descriptions.index');
|
||||
}
|
||||
|
||||
public function destroy(DirectionDescription $directionDescription)
|
||||
{
|
||||
$directionDescription->delete();
|
||||
return redirect()->route('direction_descriptions.index');
|
||||
}
|
||||
}
|
|
@ -24,7 +24,9 @@ class DocumentController extends Controller
|
|||
public function create(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
||||
{
|
||||
$admissions = Admission::pluck('name', 'id');
|
||||
return view('admin.documents.create', compact('admissions'));
|
||||
$lastDocument = Document::latest()->first();
|
||||
// dd($lastDocument->admission_id);
|
||||
return view('admin.documents.create', compact('admissions', 'lastDocument'));
|
||||
}
|
||||
|
||||
public function store(StoreDocumentRequest $request): RedirectResponse
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreDirectionDescriptionRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'direction_code' => 'required|string|max:255|exists:directions,code',
|
||||
'file' => 'required|file',
|
||||
'file_name' => 'nullable|string|max:255',
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
];
|
||||
}
|
||||
}
|
|
@ -16,10 +16,30 @@ class StoreDocumentRequest extends FormRequest
|
|||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'string',
|
||||
'description' => 'string|nullable',
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
'document' => 'required|file',
|
||||
'admission_id' => 'required|int|numeric|max:1000',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'position.required' => 'Поле позиция обязательно.',
|
||||
'position.int' => 'Позиция должно быть целым числом.',
|
||||
'position.numeric' => 'Позиция должно быть числом.',
|
||||
'position.max' => 'Позиция не должен быть больше :max',
|
||||
'name.required' => 'Поле название обязательно.',
|
||||
'name.string' => 'Поле название должен быть строкой.',
|
||||
'name.max' => 'Поле название не должен превышать :max символов.',
|
||||
'name.unique' => 'Название уже занят.',
|
||||
'description.string' => 'Поле описание должен быть строкой.',
|
||||
'document.required' => 'Поле документ обязательно.',
|
||||
'admission_id.required' => 'Поле Пункт приема обучения обязательно.',
|
||||
'admission_id.int' => 'Стоимость Пункт приема должно быть целым числом.',
|
||||
'admission_id.numeric' => 'Стоимость Пункт приема должно быть числом.',
|
||||
'admission_id.max' => 'Стоимость Пункт приема не должен быть больше :max',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateDirectionDescriptionRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'direction_code' => 'required|string|max:255|exists:directions,code',
|
||||
'file' => 'required|file',
|
||||
'file_name' => 'nullable|string|max:255',
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
];
|
||||
}
|
||||
}
|
|
@ -21,8 +21,28 @@ class UpdateDocumentRequest extends FormRequest
|
|||
"unique:documents,name,{$this->document->id}",
|
||||
],
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
'description' => 'string',
|
||||
'description' => 'string|nullable',
|
||||
'admission_id' => 'required|int|numeric|max:1000',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'position.required' => 'Поле позиция обязательно.',
|
||||
'position.int' => 'Позиция должно быть целым числом.',
|
||||
'position.numeric' => 'Позиция должно быть числом.',
|
||||
'position.max' => 'Позиция не должен быть больше :max',
|
||||
'name.required' => 'Поле название обязательно.',
|
||||
'name.string' => 'Поле название должен быть строкой.',
|
||||
'name.max' => 'Поле название не должен превышать :max символов.',
|
||||
'name.unique' => 'Название уже занят.',
|
||||
'description.string' => 'Поле описание должен быть строкой.',
|
||||
'document.required' => 'Поле документ обязательно.',
|
||||
'admission_id.required' => 'Поле Пункт приема обучения обязательно.',
|
||||
'admission_id.int' => 'Стоимость Пункт приема должно быть целым числом.',
|
||||
'admission_id.numeric' => 'Стоимость Пункт приема должно быть числом.',
|
||||
'admission_id.max' => 'Стоимость Пункт приема не должен быть больше :max',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ class UpdateNewsRequest extends FormRequest
|
|||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'text' => 'string',
|
||||
'photo' => 'required|file',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DirectionDescription extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'direction_code',
|
||||
'file_name',
|
||||
'position',
|
||||
'url'
|
||||
];
|
||||
}
|
|
@ -13,29 +13,29 @@
|
|||
"fakerphp/faker": "^1.23.1",
|
||||
"guzzlehttp/guzzle": "^7.8.1",
|
||||
"imangazaliev/didom": "^2.0.1",
|
||||
"laracasts/flash": "^3.2",
|
||||
"laravel/framework": "^10.48.2",
|
||||
"laracasts/flash": "^3.2.3",
|
||||
"laravel/framework": "^10.48.12",
|
||||
"laravel/sanctum": "^3.3.3",
|
||||
"laravel/tinker": "^2.9.0",
|
||||
"laravel/ui": "^4.5.0",
|
||||
"laravel/ui": "^4.5.2",
|
||||
"laravelcollective/html": "^6.4.1",
|
||||
"league/flysystem": "^3.25.0",
|
||||
"league/flysystem": "^3.28.0",
|
||||
"maatwebsite/excel": "^3.1.55",
|
||||
"rap2hpoutre/laravel-log-viewer": "^2.3",
|
||||
"spatie/laravel-query-builder": "^5.8",
|
||||
"rap2hpoutre/laravel-log-viewer": "^2.4.0",
|
||||
"spatie/laravel-query-builder": "^5.8.1",
|
||||
"twbs/bootstrap": "5.2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/breeze": "^1.29.1",
|
||||
"laravel/pint": "^1.14.0",
|
||||
"laravel/sail": "^1.29.0",
|
||||
"mockery/mockery": "^1.6.9",
|
||||
"laravel/pint": "^1.16.0",
|
||||
"laravel/sail": "^1.29.2",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"nunomaduro/collision": "^7.10.0",
|
||||
"phpunit/phpunit": "^10.5.13",
|
||||
"spatie/laravel-ignition": "^2.4.2",
|
||||
"phpunit/phpunit": "^10.5.21",
|
||||
"spatie/laravel-ignition": "^2.8.0",
|
||||
"barryvdh/laravel-ide-helper": "^2.15.1",
|
||||
"squizlabs/php_codesniffer": "^3.9.0",
|
||||
"phpstan/phpstan": "^1.10.62"
|
||||
"squizlabs/php_codesniffer": "^3.10.1",
|
||||
"phpstan/phpstan": "^1.11.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DirectionDescription>
|
||||
*/
|
||||
class DirectionDescriptionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'file_name' => fake()->name(),
|
||||
'position' => 1,
|
||||
'url' => fake()->url(),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ return new class extends Migration
|
|||
{
|
||||
Schema::create('documents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 255)->unique();
|
||||
$table->string('name', 255);
|
||||
$table->string('file_name')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->string('url', 255);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('direction_descriptions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('direction_code')->constrained('directions');
|
||||
$table->string('file_name', 255)->nullable();
|
||||
$table->string('position', 255);
|
||||
$table->string('url', 255);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('direction_descriptions');
|
||||
}
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DirectionDescriptionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
@php use App\Helpers\PositionHelper; @endphp
|
||||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
@auth()
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="">Прикрепить файл</h1>
|
||||
{{ Form::open(['url' => route('direction_descriptions.store'), 'method' => 'POST', 'files'=>'true', 'class' => 'needs-validation', 'novalidate']) }}
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('direction_code', 'Направление', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('direction_code', $directionCodes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Направление" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-danger">
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('direction_code') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('file', 'Путь к Файлу', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::file('file', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Путь к документу" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-danger">
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('file') }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ Form::label('file_name', 'Имя файла') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('file_name', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('name') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('position', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('position', PositionHelper::directionDescription(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('position') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ Form::submit('Загрузить файл', ['class' => 'btn btn-primary'])}}
|
||||
</div>
|
||||
{{Form::close()}}
|
||||
</div>
|
||||
</div>
|
||||
@endauth
|
||||
@endsection
|
|
@ -0,0 +1,71 @@
|
|||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
@auth()
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="">Заменить файл</h1>
|
||||
{{ Form::open(['url' => route('direction_descriptions.update', $directionDescription), 'method' => 'PATCH', 'files'=>'true', 'class' => 'needs-validation', 'novalidate']) }}
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('direction_code', 'Направление', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('direction_code', $directionCodes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Направление" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-danger">
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('direction_code') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('file', 'Путь к Файлу', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::file('file', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Путь к документу" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-danger">
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('file') }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ Form::label('file_name', 'Имя файла') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('file_name', $directionDescription->file_name, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('name') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('position', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('position', $directionDescription->position, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('position') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ Form::submit('Загрузить файл', ['class' => 'btn btn-primary'])}}
|
||||
</div>
|
||||
{{Form::close()}}
|
||||
</div>
|
||||
</div>
|
||||
@endauth
|
||||
@endsection
|
|
@ -0,0 +1,35 @@
|
|||
@php use App\Models\Direction; @endphp
|
||||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Документы</h2>
|
||||
<br>
|
||||
<a href="{{ route('direction_descriptions.create') }}" class="btn btn-primary">Добавить документ</a>
|
||||
<br>
|
||||
<br>
|
||||
<table class="table">
|
||||
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
|
||||
<tr>
|
||||
<th scope="col">Направление</th>
|
||||
<th scope="col">файл</th>
|
||||
<th scope="col">действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($directionDescriptions as $directionDescription)
|
||||
<tr>
|
||||
<td>{{ Str::limit(Direction::where('id', $directionDescription->direction_code)->first()->full_name, 50) }}</td>
|
||||
<td>{{ $directionDescription->file_name }}</td>
|
||||
<td><a href="{{ route("direction_descriptions.edit", $directionDescription) }}" class="btn btn-secondary">редактировать</a>
|
||||
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
|
||||
href="{{ route('direction_descriptions.destroy', $directionDescription) }}" class="btn btn-danger">
|
||||
удалить
|
||||
</a>
|
||||
</td>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
@endsection
|
|
@ -1,3 +1,4 @@
|
|||
@php use App\Helpers\PositionHelper; @endphp
|
||||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
@auth()
|
||||
|
@ -42,7 +43,7 @@
|
|||
{{ Form::label('position', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
{{ Form::text('position', 0, ['class' => 'form-control']) }}
|
||||
{{ Form::text('position', PositionHelper::document(), ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -53,7 +54,7 @@
|
|||
{{ Form::label('admission_id', 'Пункт экрана приема') }}
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
{{ Form::select('admission_id', $admissions, null, ['class' => 'form-select']) }}
|
||||
{{ Form::select('admission_id', $admissions, $lastDocument->admission_id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
|
|
@ -40,6 +40,22 @@
|
|||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
{{ Form::label('photo', 'Путь к фото') }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
{{ Form::file('photo', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.news.photo'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Путь к фото" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-danger">
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('photo') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::submit('Изменить', ['class' => 'btn btn-primary']) }}
|
||||
</div>
|
||||
|
|
|
@ -56,7 +56,9 @@
|
|||
<li class="list-group-item {{ request()->is('admin/feedback*') && !request()->is('admin/feedback_statuses*') ? 'active' : '' }}"><a class="{{ request()->is('admin/feedback*') && !request()->is('admin/feedback_statuses*') ? 'link-light' : '' }}" href="{{ route('feedback.index') }}">Обратная связь</a></li>
|
||||
<li class="list-group-item {{ request()->is('admin/documents*') ? 'active' : '' }}"><a class="{{ request()->is('admin/documents*') ? 'link-light' : '' }}" href="{{ route('documents.index') }}">Документы</a></li>
|
||||
<li class="list-group-item {{ request()->is('admin/admissions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/admissions*') ? 'link-light' : '' }}" href="{{ route('admissions.index') }}">Экран Приема</a></li>
|
||||
<li class="list-group-item"></li>
|
||||
<li class="list-group-item {{ request()->is('admin/directions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/directions*') ? 'link-light' : '' }}" href="{{ route('directions.index') }}">Направления</a></li>
|
||||
<li class="list-group-item {{ request()->is('admin/direction_descriptions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/direction_descriptions*') ? 'link-light' : '' }}" href="{{ route('direction_descriptions.index') }}">Файлы для Направлений</a></li>
|
||||
@can('viewAny', Auth::user())
|
||||
<li class="list-group-item"></li>
|
||||
<li class="list-group-item {{ request()->is('admin/users*') ? 'active' : '' }}"><a class="{{ request()->is('admin/users*') ? 'link-light' : '' }}" href="{{ route('users.index') }}">Список администраторов</a></li>
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
|
||||
@foreach($directions as $direction)
|
||||
{{-- @dd($direction)--}}
|
||||
<table>
|
||||
<tr class="">
|
||||
<th scope="row">{{ $direction->position }}</th>
|
||||
<td><a href="{{ route('tilda.show', $direction) }}">{{ $direction->name }}</a>
|
||||
<br>
|
||||
<p @style(['font-size: 0.7em', 'color: grey'])>
|
||||
@foreach($direction->directionProfiles as $directionProfile)
|
||||
{{ $directionProfile->name }} <br>
|
||||
@endforeach
|
||||
</p>
|
||||
</td>
|
||||
<td>{{ Str::words($direction->description, 10, '...') }}</td>
|
||||
<td>{{ $direction->slug }}</td>
|
||||
<td>{{ $direction->department->name }}</td>
|
||||
<td>{{ $direction->educationLevel->name }}</td>
|
||||
<td>
|
||||
<a href="{{ route("directions.edit", $direction) }}"
|
||||
class="btn btn-secondary">редактировать</a>
|
||||
<a rel="nofollow" data-method="post"
|
||||
href="{{ route('directions.duplication', $direction->id) }}"
|
||||
class="btn btn-warning">Дублировать</a>
|
||||
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
|
||||
href="{{ route('directions.destroy', $direction) }}"
|
||||
class="btn btn-danger">удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@endforeach
|
||||
@endsection
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
@php
|
||||
use App\Models\Subject;
|
||||
use App\Models\EducationForm;
|
||||
@endphp
|
||||
@extends('layouts.new-design-layout')
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
.fon2_blok {
|
||||
background-image: url({{ URL::to('img/front-page/bakalavr-special/fon2_blok.png') }}); background-repeat: no-repeat; background-attachment: fixed;
|
||||
}
|
||||
</style>
|
||||
<div class="fon2_blok">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{-- <h1>{{$direction->name}} {{$direction->code}} </h1>--}}
|
||||
<br>
|
||||
<h3>Уроdень образования:
|
||||
{{-- @if($direction->education_level_id = 1)--}}
|
||||
|
||||
{{-- @elseif--}}
|
||||
|
||||
{{-- @endif--}}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@dd($direction)
|
||||
|
||||
@endsection
|
|
@ -10,6 +10,7 @@ use App\Http\Controllers\admin\Catalog\Direction\ExaminationTypeController;
|
|||
use App\Http\Controllers\admin\Catalog\Direction\SubjectController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\SubjectTypeController;
|
||||
use App\Http\Controllers\admin\Catalog\DirectionController;
|
||||
use App\Http\Controllers\admin\Catalog\DirectionDescriptionController;
|
||||
use App\Http\Controllers\admin\Catalog\EducationalInstitutionController;
|
||||
use App\Http\Controllers\admin\Catalog\FacultyController;
|
||||
use App\Http\Controllers\admin\DocumentController;
|
||||
|
@ -69,6 +70,8 @@ Route::middleware(['auth', 'verified'])->prefix('admin')->group(function () {
|
|||
|
||||
Route::resource('/direction_profiles', DirectionProfileController::class)
|
||||
->scoped(['direction_profile' => 'slug']);
|
||||
Route::resource('/direction_descriptions', DirectionDescriptionController::class)
|
||||
->scoped(['direction_descriptions' => 'slug']);
|
||||
|
||||
Route::resource('/feedback', FeedbackController::class)->only(['index', 'edit', 'update']);
|
||||
Route::resource('/feedback_statuses', FeedbackStatusController::class);
|
||||
|
|
|
@ -4,7 +4,6 @@ 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');
|
||||
|
@ -22,10 +21,6 @@ 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');
|
||||
|
|
|
@ -79,9 +79,10 @@ class NewsTest extends TestCase
|
|||
|
||||
public function testUpdateNews(): void
|
||||
{
|
||||
$file = UploadedFile::fake()->create('fake.jpg', 100);
|
||||
$response = $this->actingAs($this->user)
|
||||
->withSession(['banned' => false])
|
||||
->patch(route('news.update', $this->news), $this->data);
|
||||
->patch(route('news.update', $this->news), [...$this->data, 'photo' => $file]);
|
||||
|
||||
$response->assertRedirect(route('news.index'));
|
||||
|
||||
|
|
Loading…
Reference in New Issue