editPack.blade.php 10 KB

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