Pack.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. @extends('layouts.idara.panel')
  2. @section('content')
  3. <link href="https://unpkg.com/filepond@4.30.4/dist/filepond.min.css" rel="stylesheet" type="text/css" />
  4. <link href="https://unpkg.com/filepond-plugin-file-poster@2.5.1/dist/filepond-plugin-file-poster.min.css" rel="stylesheet"
  5. type="text/css" />
  6. <link href="{{ asset('pintura/pintura.scss') }}" rel="stylesheet" />
  7. <!-- Custom css -->
  8. <link href="{{ asset('css/custom.css') }}" rel="stylesheet" />
  9. @include('backend.partials.import')
  10. @include('backend.partials.features')
  11. <form method="post" action="{{ url('promotion/produitPack') }}" enctype="multipart/form-data">
  12. @csrf
  13. <div class="card mt-4">
  14. <div class="card-header">
  15. Vous pouvez ajouter un pack promo
  16. </div>
  17. <div class="card-body">
  18. <div class="container">
  19. @if (session('success'))
  20. <div class="alert alert-success">
  21. {{ session('success') }}
  22. </div>
  23. @endif
  24. @if (count($errors) > 0)
  25. <div class="alert alert-danger">
  26. <strong>Whoops!</strong> Some problems with your input.<br><br>
  27. <ul>
  28. @foreach ($errors->all() as $error)
  29. <li>{{ $error }}</li>
  30. @endforeach
  31. </ul>
  32. </div>
  33. @endif
  34. <div class="row">
  35. <div class="form-group mt-4">
  36. <label for="exampleFormControlTextarea1"><strong>Titre de la promotion :</strong></label>
  37. <input type="text" class="form-control" id="" name="titre" placeholder=""
  38. required>
  39. </div>
  40. <div class="form-group mt-4">
  41. <label for="exampleFormControlTextarea1"><strong>Remise :</strong></label>
  42. <input type="text" class="form-control" id="" name="remise"
  43. placeholder="la remise">
  44. </div>
  45. <div class="row">
  46. <div class="form-group mt-4 col-6">
  47. <label for="exampleFormControlTextarea1"><strong>Début de la promotion :</strong></label>
  48. <input class="form-control" type="datetime-local" id="debut" name="debut">
  49. </div>
  50. <div class="form-group mt-4 col-6">
  51. <label for="exampleFormControlTextarea1"><strong>Fin de la promotion :</strong></label>
  52. <input class="form-control" type="datetime-local" id="fin" name="fin">
  53. </div>
  54. </div>
  55. <div class="form-group mt-4">
  56. <label for="exampleFormControlTextarea1"><strong>Description :</strong></label>
  57. <textarea class="form-control" id="presentation" name="description" rows="6"></textarea>
  58. </div>
  59. <div class="input-group mt-4 control-group increment">
  60. <input type="file" name="image" class="my-pond form-control" required />
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="card mt-4">
  67. <div class="card-header">
  68. Réferencement
  69. </div>
  70. <div class="card-body">
  71. <div class="form-group">
  72. <label for="exampleFormControlInput1" class="mb-3"><strong>Titre(SEO)</strong></label>
  73. <input type="text" class="form-control" name="titre_seo" placeholder="..."
  74. value="{{ old('titre_seo') }}">
  75. </div>
  76. <div class="form-group mt-4">
  77. <label for="exampleFormControlInput1" class="mb-3"><strong>description(SEO)</strong></label>
  78. <textarea name="resume_seo" id="" style="width: 100%" rows="10" value="{{ old('resume_seo') }}"></textarea>
  79. </div>
  80. <div class="form-group mt-4">
  81. <label for="exampleFormControlInput1" class="mb-3"><strong>Mot clé (SEO)</strong></label>
  82. <input type="text" class="form-control" name="mot_cle" placeholder="..."
  83. value="{{ old('mot_cle') }}">
  84. </div>
  85. </div>
  86. </div>
  87. <div class="form-group mt-4 add" style="text-align:end">
  88. <button type="submit" class="btn btn-success" value="Ajouter">Ajouter</button>
  89. </div>
  90. </form>
  91. @include('backend.partials.scriptIndex')
  92. <style>
  93. .ck.ck-editor__main>.ck-editor__editable:not(.ck-focused) {
  94. border-color: var(--ck-color-base-border);
  95. height: 300px;
  96. }
  97. </style>
  98. <script src="https://unpkg.com/filepond@4.30.4/dist/filepond.min.js"></script>
  99. <script src="https://unpkg.com/filepond-plugin-file-poster@2.5.1/dist/filepond-plugin-file-poster.min.js"></script>
  100. <script src="https://unpkg.com/filepond-plugin-file-validate-type@1.2.8/dist/filepond-plugin-file-validate-type.min.js">
  101. </script>
  102. <script src="https://unpkg.com/filepond-plugin-file-validate-size@2.2.8/dist/filepond-plugin-file-validate-size.min.js">
  103. </script>
  104. <script
  105. src="https://unpkg.com/filepond-plugin-image-exif-orientation@1.0.11/dist/filepond-plugin-image-exif-orientation.min.js">
  106. </script>
  107. <script type="module">
  108. var img_width = {{ env('IMG_HEIGHT') }} ;
  109. var img_height = {{ env('IMG_HEIGHT') }};
  110. var img_quality = {{ env('IMG_QUALITY') }};
  111. var img_ratio = {{ env('IMG_RATIO') }};
  112. var max_files = {{ env('MAX_FILES') }};
  113. var max_file_size = "{{ env('MAX_FILE_SIZE') }}B";
  114. var instant_upload = {{ env('INSTANT_UPLOAD') }};
  115. var pond_selector = '.my-pond';
  116. import {
  117. FilePondPluginImageEditor,
  118. } from '/filepond/filepond-plugin-image-editor/FilePondPluginImageEditor.js';
  119. // import Pintura Image Editor modules
  120. import {
  121. // Image editor
  122. openEditor,
  123. processImage,
  124. createDefaultImageReader,
  125. createDefaultImageWriter,
  126. createDefaultImageOrienter,
  127. // Only needed if loading legacy image editor data
  128. legacyDataToImageState,
  129. // Import the editor default configuration
  130. getEditorDefaults,
  131. } from '/pintura/pintura.js';
  132. // French
  133. import fr_FR from '/filepond/locale/fr-fr.js';
  134. FilePond.setOptions(fr_FR);
  135. // Register plugins
  136. FilePond.registerPlugin(
  137. FilePondPluginImageEditor,
  138. FilePondPluginFilePoster,
  139. FilePondPluginImageExifOrientation,
  140. FilePondPluginFileValidateType,
  141. FilePondPluginFileValidateSize,
  142. );
  143. FilePond.create(document.querySelector(pond_selector), {
  144. // Attributes
  145. name: 'image',
  146. maxFiles: max_files,
  147. allowFileSizeValidation: true,
  148. maxFileSize: max_file_size,
  149. allowBrowse: true,
  150. acceptedFileTypes: ['image/*'],
  151. dropOnPage: true,
  152. dropOnElement: true,
  153. instantUpload: instant_upload,
  154. // FilePond Image Editor plugin properties
  155. imageEditor: {
  156. // Maps legacy data objects to new imageState objects (optional)
  157. legacyDataToImageState: legacyDataToImageState,
  158. // Used to create the editor (required)
  159. createEditor: openEditor,
  160. // Used for reading the image data. See JavaScript installation for details on the `imageReader` property (required)
  161. imageReader: [
  162. createDefaultImageReader,
  163. {
  164. // createDefaultImageReader options here
  165. },
  166. ],
  167. // Required when generating a preview thumbnail and/or output image
  168. imageWriter: [
  169. createDefaultImageWriter,
  170. {
  171. // We'll resize images to fit a 512 × 512 square
  172. targetSize: {
  173. width: img_width,
  174. height: img_height,
  175. },
  176. quality: img_quality,
  177. },
  178. ],
  179. // Used to create poster and output images, runs an invisible "headless" editor instance
  180. imageProcessor: processImage,
  181. // Pintura Image Editor options
  182. editorOptions: {
  183. // Pass the editor default configuration options
  184. ...getEditorDefaults(),
  185. // This will set a square crop aspect ratio
  186. imageCropAspectRatio: img_ratio,
  187. }
  188. }
  189. });
  190. FilePond.setOptions({
  191. server: {
  192. process: '/file-upload-promotion',
  193. revert: '/file-delete-promotion',
  194. headers:{
  195. 'X-CSRF-TOKEN': '{{ csrf_token() }}'}
  196. },
  197. });
  198. </script>
  199. @endsection