applicant-site/resources/views/admin/admission/index.blade.php

110 lines
5.3 KiB
PHP
Raw Normal View History

@extends('layouts.admin_layout')
@section('content')
<div class="container">
<h2>Меню экрана приема</h2>
<br>
<a href="{{ route('admissions.create') }}" class="btn btn-primary">Добавить меню экрана приема</a>
<br>
<br>
<table class="table">
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
<tr>
<th scope="col">Позиция</th>
<th scope="col">Название</th>
<th scope="col">действия</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($admissions as $admission)
<tr class="">
<th scope="row">{{ $admission->position }}</th>
<td><a href="{{ route('admissions.show', $admission) }}">{{ $admission->name }}
@if(count($admission->documents) !== 0)
-- {{ count($admission->documents) }} файла(ов)
@endif</a></td>
<td>
<a href="{{ route("admissions.edit", $admission) }}"
class="btn btn-secondary">редактировать</a>
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
href="{{ route('admissions.destroy', $admission) }}"
class="btn btn-danger">удалить</a>
</td>
@if(count($admission->documents) !== 0)
<td>
<button class="btn btn-primary" type="button" data-bs-toggle="collapse"
data-bs-target="#collapseAdmission{{ $admission->id }}" aria-expanded="false"
aria-controls="collapseAdmission{{ $admission->id }}">
Свернуть
</button>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse" id="collapseAdmission{{ $admission->id }}">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Позиция</th>
<th scope="col">Имя Файла</th>
<th scope="col">действия</th>
</tr>
</thead>
<tbody>
@foreach($admission->documents as $document)
<tr>
<th scope="row">{{ $document->position }}</th>
<td>{{ $document->name }}</td>
<td><a href="{{ route("documents.edit", $document) }}"
class="btn btn-secondary">редактировать</a>
<a rel="nofollow" data-method="delete"
data-confirm="Вы действительно хотите удалить?"
href="{{ route('documents.destroy', $document) }}"
class="btn btn-danger">
удалить
</a>
</td>
</tr>
@endforeach
<tr class=" border border-white border-bottom-0 border-start-0 border-end-0">
<td colspan="4">
<div class="mb-2">
<a href="{{ route('documents_create_with_admission', $admission) }}"
class="btn btn-primary">
Добавить файл
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td></td>
</tr>
@else
<td><a class="btn btn-secondary disabled" href=""
role="button">
Сверунть
</a></td>
<tr>
<td colspan="4">
<a href="{{ route('documents_create_with_admission', $admission) }}"
class="btn btn-primary">Добавить
файл</a>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<br>
<br>
</div>
@endsection