123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- @extends('layouts.idara.panel')
- @section('content')
- <link href="https://unpkg.com/filepond@4.30.4/dist/filepond.min.css" rel="stylesheet" type="text/css" />
- <link href="https://unpkg.com/filepond-plugin-file-poster@2.5.1/dist/filepond-plugin-file-poster.min.css" rel="stylesheet"
- type="text/css" />
- <link href="{{ asset('pintura/pintura.scss') }}" rel="stylesheet" />
- <!-- Custom css -->
- <link href="{{ asset('css/custom.css') }}" rel="stylesheet" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css"
- integrity="sha512-pTaEn+6gF1IeWv3W1+7X7eM60TFu/agjgoHmYhAfLEU8Phuf6JKiiE8YmsNC0aCgQv4192s4Vai8YZ6VNM6vyQ=="
- crossorigin="anonymous" referrerpolicy="no-referrer" />
- @include('backend.partials.import')
- @include('backend.partials.features')
- <form action="{{ url('promotion/pack/' . $article->id) }}" method="post" enctype="multipart/form-data">
- <input type="hidden" name="_method" value="PUT">
- @csrf
- <div class="card mt-4">
- <div class="card-header">
- Vous pouvez modifier
- </div>
- <div class="card-body">
- <div class="container">
- @if (session('success'))
- <div class="alert alert-success">
- {{ session('success') }}
- </div>
- @endif
- @if (count($errors) > 0)
- <div class="alert alert-danger">
- <strong>Whoops!</strong> Some problems with your input.<br><br>
- <ul>
- @foreach ($errors->all() as $error)
- <li>{{ $error }}</li>
- @endforeach
- </ul>
- </div>
- @endif
- <div class="row">
- <div class="form-group mt-4">
- <label for="exampleFormControlTextarea1"><strong>Titre de la promotion :</strong></label>
- <input type="text" class="form-control" id="" name="titre" placeholder="titre"
- value="{{ $article->titre }}" required>
- </div>
- </div>
- <div class="form-group mt-4">
- <label for="exampleFormControlTextarea1"><strong>Remise :</strong></label>
- <input type="text" class="form-control" id="" name="remise" placeholder="la remise"
- value="{{ $article->remise }}" required>
- </div>
- <div class="row">
- <div class="form-group mt-4 col-6">
- <label for="exampleFormControlTextarea1"><strong>Début de la promotion :</strong></label>
- <input class="form-control" type="datetime-local" id="debut" name="debut"
- value="{{ $article->debut }}">
- </div>
- <div class="form-group mt-4 col-6">
- <label for="exampleFormControlTextarea1"><strong>Fin de la promotion :</strong></label>
- <input class="form-control" type="datetime-local" id="fin" name="fin"
- value="{{ $article->fin }}">
- </div>
- </div>
- <div class="form-group mt-4">
- <label for="exampleFormControlTextarea1"><strong>description :</strong></label>
- <textarea class="form-control" id="presentation" name="description" rows="6">{{ $article->description }}</textarea>
- </div>
- <div class="input-group mt-4 control-group increment">
- <input type="file" name="image" class="my-pond form-control" />
- </div>
- <img src="{{ asset('storage/image/' . $article->photo) }}" style="width:200px"
- alt="description of myimage">
- </div>
- </div>
- </div>
- <div class="card mt-4">
- <div class="card-header">
- Réferencement
- </div>
- <div class="card-body">
- <div class="form-group">
- <label for="exampleFormControlInput1" class="mb-3"><strong>Titre(SEO)</strong></label>
- <input type="text" class="form-control" name="titre_seo" placeholder="..."
- value="{{$article->titre_seo}}">
- </div>
- <div class="form-group mt-4">
- <label for="exampleFormControlInput1" class="mb-3"><strong>Description(SEO)</strong></label>
- <textarea name="resume_seo" id="" style="width: 100%" rows="10" value="">{!!$article->resume_seo!!}</textarea>
- </div>
- <div class="form-group mt-4">
- <label for="exampleFormControlInput1" class="mb-3"><strong>Mot clé (SEO)</strong></label>
- <input type="text" class="form-control" name="mot_cle" placeholder="..."
- value="{{$article->mot_cle}}">
- </div>
- </div>
- </div>
- <div class="form-group add mt-4" style="text-align:end">
- <button type="submit" class="btn btn-danger" value="">Modifier</button>
- </div>
- </form>
- </div>
- @include('backend.partials.scriptIndex')
- <style>
- .ck.ck-editor__main>.ck-editor__editable:not(.ck-focused) {
- border-color: var(--ck-color-base-border);
- height: 300px;
- }
- </style>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js"
- integrity="sha512-pumBsjNRGGqkPzKHndZMaAG+bir374sORyzM3uulLV14lN5LyykqNk8eEeUlUkB3U0M4FApyaHraT65ihJhDpQ=="
- crossorigin="anonymous" referrerpolicy="no-referrer"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/js/selectize.min.js"
- integrity="sha512-IOebNkvA/HZjMM7MxL0NYeLYEalloZ8ckak+NDtOViP7oiYzG5vn6WVXyrJDiJPhl4yRdmNAG49iuLmhkUdVsQ=="
- crossorigin="anonymous" referrerpolicy="no-referrer"></script>
- <script>
- $(function() {
- $("#produits").selectize({
- plugins: ["auto_select_on_type"],
- });
- });
- </script>
- <script src="https://unpkg.com/filepond@4.30.4/dist/filepond.min.js"></script>
- <script src="https://unpkg.com/filepond-plugin-file-poster@2.5.1/dist/filepond-plugin-file-poster.min.js"></script>
- <script src="https://unpkg.com/filepond-plugin-file-validate-type@1.2.8/dist/filepond-plugin-file-validate-type.min.js">
- </script>
- <script src="https://unpkg.com/filepond-plugin-file-validate-size@2.2.8/dist/filepond-plugin-file-validate-size.min.js">
- </script>
- <script
- src="https://unpkg.com/filepond-plugin-image-exif-orientation@1.0.11/dist/filepond-plugin-image-exif-orientation.min.js">
- </script>
- <script type="module">
- var img_width = {{ config('app.IMG_HEIGHT') }} ;
- var img_height = {{ config('app.IMG_HEIGHT') }};
- var img_quality = {{ config('app.IMG_QUALITY') }};
- var img_ratio = {{ config('app.IMG_RATIO') }};
- var max_files = {{ config('app.MAX_FILES') }};
- var max_file_size = "{{ config('app.MAX_FILE_SIZE') }}B";
- var instant_upload = {{ config('app.INSTANT_UPLOAD') }};
- var pond_selector = '.my-pond';
- import {
- FilePondPluginImageEditor,
- } from '/filepond/filepond-plugin-image-editor/FilePondPluginImageEditor.js';
- // import Pintura Image Editor modules
- import {
- // Image editor
- openEditor,
- processImage,
- createDefaultImageReader,
- createDefaultImageWriter,
- createDefaultImageOrienter,
- // Only needed if loading legacy image editor data
- legacyDataToImageState,
- // Import the editor default configuration
- getEditorDefaults,
- } from '/pintura/pintura.js';
- // French
- import fr_FR from '/filepond/locale/fr-fr.js';
- FilePond.setOptions(fr_FR);
- // Register plugins
- FilePond.registerPlugin(
- FilePondPluginImageEditor,
- FilePondPluginFilePoster,
- FilePondPluginImageExifOrientation,
- FilePondPluginFileValidateType,
- FilePondPluginFileValidateSize,
- );
- FilePond.create(document.querySelector(pond_selector), {
- // Attributes
- name: 'image',
- maxFiles: max_files,
- allowFileSizeValidation: true,
- maxFileSize: max_file_size,
- allowBrowse: true,
- acceptedFileTypes: ['image/*'],
- dropOnPage: true,
- dropOnElement: true,
- instantUpload: instant_upload,
- // FilePond Image Editor plugin properties
- imageEditor: {
- // Maps legacy data objects to new imageState objects (optional)
- legacyDataToImageState: legacyDataToImageState,
- // Used to create the editor (required)
- createEditor: openEditor,
- // Used for reading the image data. See JavaScript installation for details on the `imageReader` property (required)
- imageReader: [
- createDefaultImageReader,
- {
- // createDefaultImageReader options here
- },
- ],
- // Required when generating a preview thumbnail and/or output image
- imageWriter: [
- createDefaultImageWriter,
- {
- // We'll resize images to fit a 512 × 512 square
- targetSize: {
- width: img_width,
- height: img_height,
- },
- quality: img_quality,
- },
- ],
- // Used to create poster and output images, runs an invisible "headless" editor instance
- imageProcessor: processImage,
- // Pintura Image Editor options
- editorOptions: {
- // Pass the editor default configuration options
- ...getEditorDefaults(),
- // This will set a square crop aspect ratio
- imageCropAspectRatio: img_ratio,
- }
- }
- });
- FilePond.setOptions({
- server: {
- process: '/file-upload-promotion',
- revert: '/file-delete-promotion',
- headers:{
- 'X-CSRF-TOKEN': '{{ csrf_token() }}'}
- },
- });
- </script>
- @endsection
|