63 lines
2.6 KiB
PHP
63 lines
2.6 KiB
PHP
@extends('layouts.backend')
|
|
|
|
@section('title', sprintf('%s - Editer', Str::plural(class_basename($modelClass))))
|
|
@section('description', sprintf('Editer un %s', class_basename($modelClass)))
|
|
@section('metaIndex', 'noindex,nofollow')
|
|
|
|
@section('content')
|
|
<div class="card">
|
|
@include('modules.flashMessage')
|
|
<div class="card-header">
|
|
<a href="{{route("bo.$modelTable.index")}}">{{ Str::plural(class_basename($modelClass)) }}</a> - {{ __('Editer') }}</a>
|
|
<div class="btn-group float-end" role="group" aria-label="{{ __('Actions') }}">
|
|
<a href="{{route("bo.$modelTable.export", $model)}}" class="btn btn-success ">{{ __('Exporter') }}</a>
|
|
<a href="{{route("bo.$modelTable.show", $model)}}" class="btn btn-primary ">{{ __('Voir') }}</a>
|
|
<form action="{{route("bo.$modelTable.destroy", $model)}}" method="POST" onsubmit="__CRUD.confirmDelete(event)">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-danger">{{ __('Supprimer') }}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<form action="{{ route("bo.$modelTable.update", $model) }}" method="POST">
|
|
@method('put')
|
|
@csrf
|
|
<table class="table table-sm table-bordered border-primary align-middle table-striped text-center">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th scope="col" class="w-25">{{ __('Propriété') }}</th>
|
|
<th scope="col" class="w-75">{{ __('Valeur') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($modelClass::getEditableProperties() as $fieldName => $prop)
|
|
@if(in_array(CrudAction::update(), $prop['actions']))
|
|
<tr>
|
|
@include('crud.formfield')
|
|
</tr>
|
|
@endif
|
|
@endforeach
|
|
<tr>
|
|
<td>{{__('Réponses') }}</td>
|
|
<td><reponses db-reponses='@json($model->reponseSondages)'></reponses></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="col text-center">
|
|
<button class="btn btn-info" type="submit">{{ __('Modifier') }}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scriptsConstants')
|
|
<script>
|
|
window._locale = '{{ app()->getLocale() }}';
|
|
window._translations = @json(cache(sprintf('translations.%s', app()->getLocale())));
|
|
window._asset = '{{ asset('') }}';
|
|
window._routes = {
|
|
};
|
|
</script>
|
|
@endpush
|