Roman_applicant-site/resources/views/admin-reception-screen/index.blade.php

89 lines
4.1 KiB
PHP

@extends('layouts.admin-layout')
@section('content')
<div class="container">
<h2>Экран Приема</h2>
<br>
<a href="{{ route('admin-reception-screen.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>
</tr>
</thead>
<tbody>
@foreach($receptionScreens as $receptionScreen)
<tr>
<th scope="row">{{ $receptionScreen->position }}</th>
<td>{{ $receptionScreen->name }}</td>
<td><a href="{{ route("admin-reception-screen.edit", $receptionScreen) }}" class="btn btn-secondary">редактировать</a>
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
href="{{ route('admin-reception-screen.destroy', $receptionScreen) }}" class="btn btn-danger">
удалить
</a>
</td>
@if(count($receptionScreen->files) !== 0)
</tr>
<tr>
<td colspan="3">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Позиция</th>
<th scope="col">Имя Файла</th>
<th scope="col">действия</th>
</tr>
</thead>
<tbody>
@foreach($receptionScreen->files->sortBy('position') as $file)
<tr>
<th scope="row">{{ $file->position }}</th>
<td>{{ $file->name }}</td>
<td><a href="{{ route("admin-reception-screen.edit", $file) }}"
class="btn btn-secondary">редактировать</a>
<a rel="nofollow" data-method="delete"
data-confirm="Вы действительно хотите удалить?"
href="{{ route('admin-reception-screen.destroy', $file) }}"
class="btn btn-danger">
удалить
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mb-2">
<a href="{{ route('admin-reception-screen.create') }}"
class="btn btn-primary">
Добавить файл
</a>
</div>
</td>
</tr>
@else
<tr>
<td colspan="3">
<a href="{{ route('admin-reception-screen.create') }}" class="btn btn-primary">Добавить
файл</a>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<br>
<br>
{{ Form::open(array('url' => route('uploadfile'), 'method' => 'POST', 'files'=>'true')) }}
Select the file to upload.
{{ Form::file('image') }}
{{ Form::submit('Upload File')}}
{{Form::close()}}
</div>
@endsection