CourseWork/resources/views/grades/index.blade.php
m.zargarov 769760f414 Fix
2024-06-24 01:28:58 +04:00

87 lines
4.4 KiB
PHP

@extends('layouts.application')
@section('content')
<div class="container col-md-6">
<div class="row justify-content-center">
<div class="card mt-4">
<div class="card-header">{{__('Поиск класса')}}</div>
<div class="card-body">
<form action="{{ route('grades.index') }}" method="GET">
<div class="mb-3">
<label for="name" class="form-label">Название:</label>
<input type="text" id="name" name="name" class="form-control"
value="{{ request('name') ?? '' }}">
</div>
<div>
<button type="submit" class="btn btn-primary">Фильтр</button>
</div>
</form>
</div>
</div>
<div class="card mt-4">
<div class="card-header">{{__('Классы')}}</div>
<div class="card-body">
@if (count($grades))
<table class="table table-striped">
<thead>
<th>Название</th>
<th>&nbsp;</th>
</thead>
<tbody>
@foreach ($grades as $grade)
<tr>
<td class="table-text">
<div>
<a href="{{ route('grades.show', $grade) }}"
class="btn btn-block col-8">{{ $grade->name }}</a>
</div>
</td>
<td>
<div>
<a href="{{ route('grades.lessons.index', $grade) }}" class="btn btn-primary">Занятия</a>
</div>
</td>
@can('list', \App\Models\Grade::class)
<td>
<div>
<a href="{{ route('list-students', $grade) }}" class="btn btn-info">Списки учеников</a>
</div>
</td>
@endcan
@can('update', $grade)
<td>
<div>
<a href="{{ route('grades.edit', $grade) }}" class="btn btn-warning">Редактировать</a>
</div>
</td>
@endcan
@can('delete', $grade)
<td>
<form action="{{ route('grades.destroy', $grade) }}" method="POST"
style="display: inline-block;">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Удалить</button>
</form>
</td>
@endcan
</tr>
@endforeach
</tbody>
</table>
@else
<p>Классы отсутствуют</p>
@endif
</div>
@can('create', \App\Models\Grade::class)
<div class="card-footer">
<a href="{{ route('grades.create') }}" class="btn btn-success">Добавить</a>
</div>
@endcan
<div class="card-footer">{{ $grades->links() }}</div>
</div>
</div>
</div>
@endsection