CourseWork/resources/views/grades/show.blade.php
2024-05-07 12:14:18 +04:00

65 lines
2.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.app')
@section('content')
<div class="container col-md-6">
<div class="row justify-content-center">
<div class="card">
<div class="card-header">{{ ('Класс') }}</div>
<div class="card-body">
<div class="mb-3">
<h5><strong>Название: </strong>{{ $grade->name }}</h5>
</div>
</div>
<div class="card-footer">
<a href="{{ route('grades.edit', $grade) }}" class="btn btn-primary">Редактировать</a>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
{{__('Журнал предметов')}}
</div>
<div class="card-body">
@if(count($subjects))
<table class="table table-striped">
<thead>
<th>Название</th>
<th>&nbsp;</th>
</thead>
<tbody>
@foreach ($subjects as $subject)
<tr>
<td class="table-text">
<div>
{{ $subject->name }}
</div>
</td>
<td>
<div>
<a href="{{ route('grades.subjects.edit', [$grade, $subject]) }}" class="btn btn-warning">Редактировать</a>
</div>
</td>
<td>
<form action="{{ route('grades.subjects.destroy', [$grade, $subject]) }}" method="POST" style="display: inline-block;">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Удалить</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<p>У класса отсутствуют предметы</p>
@endif
</div>
<div class="card-footer">
<a href="{{ route('grades.subjects.create', $grade) }}" class="btn btn-success">Добавить</a>
</div>
</div>
</div>
</div>
@endsection