From 45143e541fa630bc176969591787d38f974a1003 Mon Sep 17 00:00:00 2001 From: aslan Date: Wed, 13 Mar 2024 13:04:36 +0300 Subject: [PATCH] add edit direction validation bootstrap --- .../admin/catalog/direction/create.blade.php | 38 ++--- .../admin/catalog/direction/edit.blade.php | 130 ++++++++++-------- 2 files changed, 91 insertions(+), 77 deletions(-) diff --git a/resources/views/admin/catalog/direction/create.blade.php b/resources/views/admin/catalog/direction/create.blade.php index b6ff5d4..d7952c2 100644 --- a/resources/views/admin/catalog/direction/create.blade.php +++ b/resources/views/admin/catalog/direction/create.blade.php @@ -16,7 +16,7 @@ Поле "Кафедра" обязательно! -
+
@if ($errors->any()) {{ $errors->first('department_id') }} @endif @@ -30,7 +30,7 @@
{{ Form::select('education_level_id', $levels, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('education_level_id') }} @endif @@ -44,7 +44,7 @@
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('education_form_id') }} @endif @@ -60,7 +60,7 @@
{{ Form::number('position', PositionHelper::direction(), ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('position') }} @endif @@ -74,7 +74,7 @@
{{ Form::text('code', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('code') }} @endif @@ -87,7 +87,7 @@
{{ Form::text('slug', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
-
+
@if ($errors->any()) {{ $errors->first('slug') }} @endif @@ -101,7 +101,7 @@
{{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('name') }} @endif @@ -113,7 +113,7 @@
{{ Form::text('description', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
-
+
@if ($errors->any()) {{ $errors->first('description') }} @endif @@ -129,7 +129,7 @@
{{ Form::number('budget_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('budget_places') }} @endif @@ -143,7 +143,7 @@
{{ Form::number('quota', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('quota') }} @endif @@ -157,7 +157,7 @@
{{ Form::number('paid_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('paid_places') }} @endif @@ -172,7 +172,7 @@
{{ Form::number('cost_paid_place', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('cost_paid_place') }} @endif @@ -187,7 +187,7 @@
{{ Form::text('period', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('period') }} @endif @@ -204,7 +204,7 @@
{{ Form::select('direction_profiles[]', $directionProfiles, null, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('direction_profile') }} @endif @@ -225,7 +225,7 @@
{{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('entrance-examination[0][examination_type_id]') }} @endif @@ -239,7 +239,7 @@
{{ Form::select('entrance-examination[0][subject_id]', $subjects, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('entrance-examination[0][subject_id]') }} @endif @@ -253,7 +253,7 @@
{{ Form::select('entrance-examination[0][subject_type_id]', $subjectTypes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('entrance-examination[0][subject_type_id]') }} @endif @@ -267,7 +267,7 @@
{{ Form::number('entrance-examination[0][scores]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('entrance-examination[0][scores]') }} @endif @@ -281,7 +281,7 @@
{{ Form::number('entrance-examination[0][position]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('entrance-examination[0][position]') }} @endif diff --git a/resources/views/admin/catalog/direction/edit.blade.php b/resources/views/admin/catalog/direction/edit.blade.php index 2e086c7..a099f59 100644 --- a/resources/views/admin/catalog/direction/edit.blade.php +++ b/resources/views/admin/catalog/direction/edit.blade.php @@ -1,17 +1,21 @@ @extends('layouts.admin_layout') @section('content') @auth() -

Создать Направление

- {{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => 'ffff']) }} +

Изменить Направление

+ {{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => 'ffff needs-validation', 'novalidate']) }}
- {{ Form::label('department_id', 'Кафедра') }} + {{ Form::label('department_id', 'Кафедра', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }} + *
- {{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select']) }} + {{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }} +
+ Поле "Кафедра" обязательно! +
-
+
@if ($errors->any()) {{ $errors->first('department_id') }} @endif @@ -19,12 +23,13 @@
- {{ Form::label('education_level_id', 'Увовень образования') }} + {{ Form::label('education_level_id', 'Увовень образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id')]) }} + *
- {{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select']) }} + {{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('education_level_id') }} @endif @@ -32,12 +37,13 @@
- {{ Form::label('education_form_id', 'Форма образования') }} + {{ Form::label('education_form_id', 'Форма образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id')]) }} + *
- {{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select']) }} + {{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('education_form_id') }} @endif @@ -47,12 +53,13 @@
- {{ Form::label('position', 'Позиция') }} + {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position')]) }} + *
- {{ Form::number('position', $direction->position, ['class' => 'form-control']) }} + {{ Form::number('position', $direction->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('position') }} @endif @@ -60,12 +67,12 @@
- {{ Form::label('code', 'Код') }} + {{ Form::label('code', 'Код', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code')]) }}
- {{ Form::text('code', $direction->code, ['class' => 'form-control']) }} + {{ Form::text('code', $direction->code, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('code') }} @endif @@ -73,12 +80,12 @@
- {{ Form::label('slug', 'URL') }} + {{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
- {{ Form::text('slug', $direction->slug, ['class' => 'form-control']) }} + {{ Form::text('slug', $direction->slug, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
-
+
@if ($errors->any()) {{ $errors->first('slug') }} @endif @@ -86,24 +93,25 @@
- {{ Form::label('name', 'Название') }} + {{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }} + *
- {{ Form::text('name', $direction->name, ['class' => 'form-control']) }} + {{ Form::text('name', $direction->name, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('name') }} @endif
- {{ Form::label('description', 'Описание') }} + {{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.description')]) }}
- {{ Form::text('description', $direction->description, ['class' => 'form-control']) }} + {{ Form::text('description', $direction->description, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
-
+
@if ($errors->any()) {{ $errors->first('description') }} @endif @@ -113,12 +121,13 @@
- {{ Form::label('budget_places', 'Кол-во бюджетных мест') }} + {{ Form::label('budget_places', 'Кол-во бюджетных мест', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places')]) }} + *
- {{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select']) }} + {{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('budget_places') }} @endif @@ -126,12 +135,13 @@
- {{ Form::label('quota', 'Квота') }} + {{ Form::label('quota', 'Квота', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota')]) }} + *
- {{ Form::number('quota', $direction->quota, ['class' => 'form-select']) }} + {{ Form::number('quota', $direction->quota, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('quota') }} @endif @@ -139,12 +149,13 @@
- {{ Form::label('paid_places', 'Кол-во мест по договорам') }} + {{ Form::label('paid_places', 'Кол-во мест по договорам', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places')]) }} + *
- {{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select']) }} + {{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('paid_places') }} @endif @@ -153,12 +164,13 @@
- {{ Form::label('cost_paid_place', 'Стоимость обучения') }} + {{ Form::label('cost_paid_place', 'Стоимость обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place')]) }} + *
- {{ Form::number('cost_paid_place', $direction->cost_paid_place, ['class' => 'form-select']) }} + {{ Form::number('cost_paid_place', $direction->cost_paid_place, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('cost_paid_place') }} @endif @@ -167,12 +179,13 @@
- {{ Form::label('period', 'Период обучения') }} + {{ Form::label('period', 'Период обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period')]) }} + *
- {{ Form::text('period', $direction->period, ['class' => 'form-select']) }} + {{ Form::text('period', $direction->period, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('period') }} @endif @@ -183,12 +196,13 @@
- {{ Form::label('direction_profile', 'Профиль подготовки') }} + {{ Form::label('direction_profile', 'Профиль подготовки', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile')]) }} + *
- {{ Form::select('direction_profiles[]', $directionProfiles, $direction->directionProfiles, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple']) }} + {{ Form::select('direction_profiles[]', $directionProfiles, $direction->directionProfiles, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first('direction_profile') }} @endif @@ -209,12 +223,12 @@
- {{ Form::label("entrance-examination[{$entranceExamination->id}][examination_type_id]", 'Тип экзамена') }} + {{ Form::label("entrance-examination[{$entranceExamination->id}][examination_type_id]", 'Тип экзамена', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id')]) }}
- {{ Form::select("entrance-examination[{$entranceExamination->id}][examination_type_id]", $examination_types, $entranceExamination->examinationType->id, ['class' => 'form-select']) }} + {{ Form::select("entrance-examination[{$entranceExamination->id}][examination_type_id]", $examination_types, $entranceExamination->examinationType->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first("entrance-examination[{$entranceExamination->id}][examination_type_id]") }} @endif @@ -222,12 +236,12 @@
- {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_id]", 'Предмет') }} + {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_id]", 'Предмет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id')]) }}
- {{ Form::select("entrance-examination[{$entranceExamination->id}][subject_id]", $subjects, $entranceExamination->subject->id, ['class' => 'form-select']) }} + {{ Form::select("entrance-examination[{$entranceExamination->id}][subject_id]", $subjects, $entranceExamination->subject->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_id]") }} @endif @@ -235,12 +249,12 @@
- {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_type_id]", 'Тип предмета') }} + {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_type_id]", 'Тип предмета', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id')]) }}
- {{ Form::select("entrance-examination[{$entranceExamination->id}][subject_type_id]", $subjectTypes, $entranceExamination->subjectType->id, ['class' => 'form-select']) }} + {{ Form::select("entrance-examination[{$entranceExamination->id}][subject_type_id]", $subjectTypes, $entranceExamination->subjectType->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_type_id]") }} @endif @@ -248,10 +262,10 @@
- {{ Form::label("entrance-examination[{$entranceExamination->id}][scores]", 'Кол-во баллов') }} + {{ Form::label("entrance-examination[{$entranceExamination->id}][scores]", 'Кол-во баллов', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores')]) }}
- {{ Form::text("entrance-examination[{$entranceExamination->id}][scores]", $entranceExamination->scores, ['class' => 'form-control']) }} + {{ Form::text("entrance-examination[{$entranceExamination->id}][scores]", $entranceExamination->scores, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }}
@if ($errors->any()) @@ -261,12 +275,12 @@
- {{ Form::label("entrance-examination[{$entranceExamination->id}][position]", 'Позиция') }} + {{ Form::label("entrance-examination[{$entranceExamination->id}][position]", 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position')]) }}
- {{ Form::text("entrance-examination[{$entranceExamination->id}][position]", $entranceExamination->position, ['class' => 'form-control']) }} + {{ Form::text("entrance-examination[{$entranceExamination->id}][position]", $entranceExamination->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }}
-
+
@if ($errors->any()) {{ $errors->first("entrance-examination[{$entranceExamination->id}][position]") }} @endif