58 lines
2.8 KiB
PHP
58 lines
2.8 KiB
PHP
`@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container col-md-5">
|
|
<div class="row justify-content-center">
|
|
<div class="card mt-4">
|
|
<div class="card-header">{{__('Создание занятия')}}</div>
|
|
<div class="card-body">
|
|
<a href="{{ route('grades.lessons.create', $grade) }}" class="btn btn-success">Добавить</a>
|
|
</div>
|
|
</div>
|
|
<div class="card mt-4">
|
|
<div class="card-header">{{__('Фильтрация')}}</div>
|
|
<div class="card-body">
|
|
<form action="{{ route('grades.lessons.index', $grade) }}" method="GET">
|
|
<div class="mb-3">
|
|
<label for="subject_id" class="form-label">Предмет:</label>
|
|
<select id="subject_id" name="subject_id" class="form-select" required>
|
|
<option value="">Выберите предмет</option>
|
|
@foreach($subjects as $subject)
|
|
<option value="{{ $subject->id }}"> {{ $subject->id == request('subject_id') ? 'selected' : ''}}
|
|
{{ $subject->name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<button type="submit" class="btn btn-primary">Фильтр</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@if(count($lessons))
|
|
@foreach($lessons as $lesson)
|
|
<a href="{{ route('grades.lessons.show', [$grade, $lesson]) }}" class="text-decoration-none">
|
|
<div class="card mt-4">
|
|
<div class="card-header"><strong>{{$lesson->subject->name}}</strong></div>
|
|
<div class="card-header">{{$lesson->type}}</div>
|
|
<div class="card-body">
|
|
{{ $lesson->name }}
|
|
</div>
|
|
<div class="card-footer">
|
|
<form action="{{ route('grades.lessons.destroy', [$grade, $lesson]) }}" method="POST" style="display: inline-block;">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-danger">Удалить</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
@endforeach
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
`
|