110 lines
5.5 KiB
PHP
110 lines
5.5 KiB
PHP
@extends('layouts.bo-layout')
|
|
|
|
@section('content')
|
|
<form action="{{route('bo.slides.store')}}" method="POST" enctype="multipart/form-data">
|
|
@csrf
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<h1 class="h2"><a href="{{route('bo.slides.index')}}" class="h2 text-decoration-none"><</a> Slides <small class="text-muted">Création</small></h1>
|
|
<div class="btn-toolbar mb-2 mb-md-0">
|
|
<button type="submit" class="btn btn-sm btn-primary">Enregistrer</a>
|
|
</div>
|
|
</div>
|
|
@if ($errors->any())
|
|
<div class="alert alert-danger">
|
|
<ul>
|
|
@foreach ($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="form-group">
|
|
<label for="name">Titre *</label>
|
|
<input type="text" id="title" name="title" class="form-control" placeholder="Titre * " value="{{ old('title') }}" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="name">Texte</label>
|
|
<textarea class="form-control" id="text" name="text" placeholder="Texte">{{ old('text') }}</textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="picture">Image <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.slide_image_maxwidth') }} px par {{ Config::get('theme.slide_image_maxheight') }} px</small></label></br>
|
|
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="form-group col">
|
|
<label for="slider_id">Slider de regroupement</label>
|
|
<select class="form-select" id="slider_id" name="slider_id">
|
|
@foreach($sliders as $slider)
|
|
<option value="{{$slider->id}}">{{$slider->label}}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="form-group col"></div>
|
|
<div class="form-group col"></div>
|
|
<div class="form-group col"></div>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<h2><small class="text-muted">Période de parution</small></h2>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group col">
|
|
<label for="date_start_date">Début <small class="text-muted"> de l'affichage</small></label>
|
|
<input type="date" id="date_start_date" name="date_start_date" class="form-control" value="{{ old('date_start_date') }}">
|
|
<input type="time" id="date_start_time" name="date_start_time" class="form-control" value="{{ old('date_start_time') }}">
|
|
<small class="text-muted">Laisser vide pour un affichage immédiat</small>
|
|
</div>
|
|
<div class="form-group col">
|
|
<label for="date_end_date">Fin <small class="text-muted"> de l'affichage' </small></label>
|
|
<input type="date" id="date_end_date" name="date_end_date" class="form-control" value="{{ old('date_end_date') }}">
|
|
<input type="time" id="date_end_time" name="date_end_time" class="form-control" value="{{ old('date_end_time') }}">
|
|
<small class="text-muted">Laisser vide pour un affichage permanent</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<h2><small class="text-muted">Options de lien</small></h2>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="name">Texte du lien</label>
|
|
<input type="text" class="form-control" name="link_label" placeholder="Texte du lien" value="{{ old('link_label') }}">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="name">Cible du lien</label>
|
|
<input type="text" class="form-control" name="link" placeholder="Cible du Lien" value="{{ old('link') }}">
|
|
</div>
|
|
<div class="form-group text-center">
|
|
<input class="form-check-input" type="checkbox" id="new_tab_cb" name="link_new_tab" @if (old('link_new_tab') !== null)checked @endif>
|
|
<label class="form-check-label" for="new_tab_cb">Ouvrir dans un nouvel onglet</label>
|
|
</div>
|
|
|
|
</form>
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script type="text/javascript">
|
|
var editorConfig = {
|
|
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
|
|
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo' ],
|
|
heading: {
|
|
options: [
|
|
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
|
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
|
|
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
|
|
{ model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
|
|
{ model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' }
|
|
]
|
|
},
|
|
table: {
|
|
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
|
|
}
|
|
};
|
|
ClassicEditor
|
|
.create( document.querySelector( '#text' ), editorConfig)
|
|
.catch( error => {
|
|
console.error( error );
|
|
} );
|
|
</script>
|
|
@endsection
|