CourseWork/resources/views/grade-lesson/index.blade.php

58 lines
2.8 KiB
PHP
Raw Normal View History

2024-06-16 00:41:31 +04:00
`@extends('layouts.application')
2024-05-08 16:55:32 +04:00
@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>
2024-05-13 14:23:21 +04:00
<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>
2024-05-08 16:55:32 +04:00
@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
2024-05-13 14:23:21 +04:00
`