You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
28KB

  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["adminlte-index"],{
  2. /***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js":
  3. /*!**********************************************************************************!*\
  4. !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js ***!
  5. \**********************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js");
  10. /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_index_js__WEBPACK_IMPORTED_MODULE_0__);
  11. /* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.scss */ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss");
  12. /***/ }),
  13. /***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js":
  14. /*!******************************************************************************!*\
  15. !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.js ***!
  16. \******************************************************************************/
  17. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  18. __webpack_require__(/*! core-js/modules/es.date.to-string.js */ "./node_modules/core-js/modules/es.date.to-string.js");
  19. __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
  20. __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");
  21. __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js");
  22. __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
  23. __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js");
  24. __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js");
  25. __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
  26. __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");
  27. __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
  28. $(document).ready(function () {
  29. lcCrudIndexToggle();
  30. lcCrudIndexBatchActions();
  31. lcCrudIndexInitFilter();
  32. });
  33. function lcCrudIndexToggle() {
  34. var toggles = document.querySelectorAll('.custom-switch input[type="checkbox"]');
  35. for (i = 0; i < toggles.length; i++) {
  36. toggles[i].addEventListener('change', function () {
  37. var toggle = this;
  38. var newValue = this.checked;
  39. var oldValue = !newValue;
  40. var toggleUrl = this.closest('.custom-switch').dataset.url + "&newValue=" + newValue.toString();
  41. var toggleRequest = $.ajax({
  42. type: "POST",
  43. url: toggleUrl,
  44. data: {},
  45. dataType: 'json'
  46. });
  47. toggleRequest.done(function (response) {
  48. SovNotification.add('success', 'La propriété a bien été mise à jour.');
  49. });
  50. toggleRequest.fail(function () {
  51. toggle.checked = oldValue;
  52. toggle.disabled = true;
  53. toggle.closest('.checkbox-switch').classList.add('disabled');
  54. SovNotification.add('error', 'Une erreur est survenue.');
  55. });
  56. });
  57. }
  58. }
  59. function lcCrudIndexBatchActions() {
  60. var titleContent = $('.content-header-title > .title').html();
  61. $(document).on('click', '.deselect-batch-button', function () {
  62. $(this).closest('.content').find(':checkbox.form-batch-checkbox-all').prop('checked', false).trigger('change');
  63. });
  64. $(document).on('change', '.form-batch-checkbox-all', function () {
  65. $(this).closest('.content').find(':checkbox.form-batch-checkbox').prop('checked', $(this).prop('checked')).trigger('change');
  66. });
  67. $(document).on('change', '.form-batch-checkbox', function () {
  68. var $content = $(this).closest('.content-wrapper');
  69. var $input = $content.find(':hidden#batch_form_entityIds');
  70. var ids = $input.val() ? $input.val().split(',') : [];
  71. var id = $(this).val();
  72. if ($(this).prop('checked')) {
  73. $(this).closest('tr').addClass('selected-row');
  74. if (-1 === ids.indexOf(id)) {
  75. ids.push(id);
  76. }
  77. } else {
  78. $(this).closest('tr').removeClass('selected-row');
  79. ids = ids.filter(function (value) {
  80. return value !== id;
  81. });
  82. $content.find(':checkbox.form-batch-checkbox-all').prop('checked', false);
  83. }
  84. if (0 === ids.length) {
  85. $content.find('.global-actions').show();
  86. $content.find('.batch-actions').hide();
  87. $content.find('table').removeClass('table-batch');
  88. } else {
  89. $content.find('.batch-actions').show();
  90. $content.find('.global-actions').hide();
  91. $content.find('table').addClass('table-batch');
  92. }
  93. $input.val(ids.join(','));
  94. $content.find('.content-header-title > .title').html(0 === ids.length ? titleContent : '');
  95. });
  96. var modalTitle = $('#batch-action-confirmation-title');
  97. var titleContentWithPlaceholders = modalTitle.text();
  98. $('[data-action-batch]').on('click', function (event) {
  99. event.preventDefault();
  100. event.stopPropagation();
  101. var $actionElement = $(this);
  102. var actionName = $actionElement.attr('data-action-name');
  103. var selectedItems = $('input[type="checkbox"].form-batch-checkbox:checked');
  104. modalTitle.text(titleContentWithPlaceholders.replace('%action_name%', actionName).replace('%num_items%', selectedItems.length));
  105. $('#modal-batch-action').modal({
  106. backdrop: true,
  107. keyboard: true
  108. }).off('click', '#modal-batch-action-button').on('click', '#modal-batch-action-button', function () {
  109. $actionElement.unbind('click');
  110. $form = document.createElement('form');
  111. $form.setAttribute('action', $actionElement.attr('data-action-url'));
  112. $form.setAttribute('method', 'POST');
  113. $actionNameInput = document.createElement('input');
  114. $actionNameInput.setAttribute('type', 'hidden');
  115. $actionNameInput.setAttribute('name', 'batchActionName');
  116. $actionNameInput.setAttribute('value', $actionElement.attr('data-action-name'));
  117. $form.appendChild($actionNameInput);
  118. $entityFqcnInput = document.createElement('input');
  119. $entityFqcnInput.setAttribute('type', 'hidden');
  120. $entityFqcnInput.setAttribute('name', 'entityFqcn');
  121. $entityFqcnInput.setAttribute('value', $actionElement.attr('data-entity-fqcn'));
  122. $form.appendChild($entityFqcnInput);
  123. $actionUrlInput = document.createElement('input');
  124. $actionUrlInput.setAttribute('type', 'hidden');
  125. $actionUrlInput.setAttribute('name', 'batchActionUrl');
  126. $actionUrlInput.setAttribute('value', $actionElement.attr('data-action-url'));
  127. $form.appendChild($actionUrlInput);
  128. $csrfTokenInput = document.createElement('input');
  129. $csrfTokenInput.setAttribute('type', 'hidden');
  130. $csrfTokenInput.setAttribute('name', 'batchActionCsrfToken');
  131. $csrfTokenInput.setAttribute('value', $actionElement.attr('data-action-csrf-token'));
  132. $form.appendChild($csrfTokenInput);
  133. selectedItems.each(function (i, item) {
  134. $entityIdInput = document.createElement('input');
  135. $entityIdInput.setAttribute('type', 'hidden');
  136. $entityIdInput.setAttribute('name', "batchActionEntityIds[".concat(i, "]"));
  137. $entityIdInput.setAttribute('value', item.value);
  138. $form.appendChild($entityIdInput);
  139. });
  140. document.body.appendChild($form); //modalTitle.text(titleContentWithPlaceholders);
  141. $form.submit();
  142. });
  143. });
  144. }
  145. function lcCrudIndexInitFilter() {
  146. $('#filters_form_reset').val('');
  147. $('.lc-reset-filters').on('click', function (e) {
  148. //e.preventDefault();
  149. $(this).parents('.table-filters-line').find('select,input').val('').trigger('change');
  150. $('#filters_form_reset').val('clearAll');
  151. Tools.log($(this).prop('form'));
  152. $(this).prop('form').submit(); //$(this).parents('form').submit();
  153. });
  154. }
  155. /***/ }),
  156. /***/ "../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss":
  157. /*!********************************************************************************!*\
  158. !*** ../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/index.scss ***!
  159. \********************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. // extracted by mini-css-extract-plugin
  164. /***/ })
  165. },
  166. /******/ __webpack_require__ => { // webpackRuntimeModules
  167. /******/ "use strict";
  168. /******/
  169. /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
  170. /******/ __webpack_require__.O(0, ["vendors-node_modules_core-js_internals_export_js","vendors-node_modules_core-js_modules_es_string_replace_js","vendors-node_modules_core-js_modules_es_array_find_js-node_modules_core-js_modules_es_date_to-6fef76","vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f7c72f"], () => (__webpack_exec__("../LaClicBundle/SovBundle/Resources/assets/app/adminlte/index/app.index.js")));
  171. /******/ var __webpack_exports__ = __webpack_require__.O();
  172. /******/ }
  173. ]);
  174. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi4vTGFDbGljQnVuZGxlL1NvdkJ1bmRsZS9SZXNvdXJjZXMvYXNzZXRzL2FwcC9hZG1pbmx0ZS9pbmRleC9hcHAuaW5kZXguanMiLCJ3ZWJwYWNrOi8vLy4uL0xhQ2xpY0J1bmRsZS9Tb3ZCdW5kbGUvUmVzb3VyY2VzL2Fzc2V0cy9hcHAvYWRtaW5sdGUvaW5kZXgvaW5kZXguanMiLCJ3ZWJwYWNrOi8vLy4uL0xhQ2xpY0J1bmRsZS9Tb3ZCdW5kbGUvUmVzb3VyY2VzL2Fzc2V0cy9hcHAvYWRtaW5sdGUvaW5kZXgvaW5kZXguc2NzcyJdLCJuYW1lcyI6WyIkIiwiZG9jdW1lbnQiLCJyZWFkeSIsImxjQ3J1ZEluZGV4VG9nZ2xlIiwibGNDcnVkSW5kZXhCYXRjaEFjdGlvbnMiLCJsY0NydWRJbmRleEluaXRGaWx0ZXIiLCJ0b2dnbGVzIiwicXVlcnlTZWxlY3RvckFsbCIsImkiLCJsZW5ndGgiLCJhZGRFdmVudExpc3RlbmVyIiwidG9nZ2xlIiwibmV3VmFsdWUiLCJjaGVja2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Y29udGVudC13cmFwcGVyJyk7XG4gICAgICAgIGxldCAkaW5wdXQgPSAkY29udGVudC5maW5kKCc6aGlkZGVuI2JhdGNoX2Zvcm1fZW50aXR5SWRzJyk7XG4gICAgICAgIGxldCBpZHMgPSAkaW5wdXQudmFsKCkgPyAkaW5wdXQudmFsKCkuc3BsaXQoJywnKSA6IFtdO1xuICAgICAgICBjb25zdCBpZCA9ICQodGhpcykudmFsKCk7XG5cbiAgICAgICAgaWYgKCQodGhpcykucHJvcCgnY2hlY2tlZCcpKSB7XG4gICAgICAgICAgICAkKHRoaXMpLmNsb3Nlc3QoJ3RyJykuYWRkQ2xhc3MoJ3NlbGVjdGVkLXJvdycpO1xuICAgICAgICAgICAgaWYgKC0xID09PSBpZHMuaW5kZXhPZihpZCkpIHtcbiAgICAgICAgICAgICAgICBpZHMucHVzaChpZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAkKHRoaXMpLmNsb3Nlc3QoJ3RyJykucmVtb3ZlQ2xhc3MoJ3NlbGVjdGVkLXJvdycpO1xuICAgICAgICAgICAgaWRzID0gaWRzLmZpbHRlcihmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUgIT09IGlkXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICRjb250ZW50LmZpbmQoJzpjaGVja2JveC5mb3JtLWJhdGNoLWNoZWNrYm94LWFsbCcpLnByb3AoJ2NoZWNrZWQnLCBmYWxzZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoMCA9PT0gaWRzLmxlbmd0aCkge1xuICAgICAgICAgICAgJGNvbnRlbnQuZmluZCgnLmdsb2JhbC1hY3Rpb25zJykuc2hvdygpO1xuICAgICAgICAgICAgJGNvbnRlbnQuZmluZCgnLmJhdGNoLWFjdGlvbnMnKS5oaWRlKCk7XG4gICAgICAgICAgICAkY29udGVudC5maW5kKCd0YWJsZScpLnJlbW92ZUNs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