Browse Source

Merge branch 'develop' of https://forge.laclic.fr/Laclic/SovBundle into develop

develop
Fab 3 years ago
parent
commit
4225c4481d
60 changed files with 224 additions and 202 deletions
  1. +2
    -1
      Controller/Dashboard/DashboardAdminController.php
  2. +2
    -4
      Controller/Newsletter/NewsletterAdminController.php
  3. +11
    -0
      Repository/AbstractStore.php
  4. +3
    -1
      Repository/File/FileStore.php
  5. +3
    -1
      Repository/Newsletter/NewsletterStore.php
  6. +3
    -1
      Repository/Reminder/ReminderStore.php
  7. +3
    -1
      Repository/Setting/SiteSettingStore.php
  8. +3
    -1
      Repository/Site/NewsStore.php
  9. +3
    -1
      Repository/Site/PageStore.php
  10. +3
    -1
      Repository/Site/SiteStore.php
  11. +3
    -1
      Repository/Ticket/TicketMessageStore.php
  12. +3
    -1
      Repository/Ticket/TicketStore.php
  13. +3
    -1
      Repository/User/GroupUserStore.php
  14. +3
    -1
      Repository/User/UserStore.php
  15. +1
    -1
      Resources/assets/app/admin/reminder/reminder.js
  16. +2
    -2
      Resources/assets/app/admin/ticket/ticket.js
  17. +0
    -155
      Resources/assets/app/adminlte/common/common.js
  18. +0
    -7
      Resources/assets/app/adminlte/common/utils/log.js
  19. +2
    -2
      Resources/assets/app/adminlte/index/index.js
  20. +3
    -0
      Resources/assets/app/adminlte/main/app.main.js
  21. +0
    -0
      Resources/assets/app/adminlte/main/common.scss
  22. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-black-webfont.woff
  23. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-black-webfont.woff2
  24. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-blackit-webfont.woff
  25. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-blackit-webfont.woff2
  26. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-bold-webfont.woff
  27. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-bold-webfont.woff2
  28. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-boldit-webfont.woff
  29. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-boldit-webfont.woff2
  30. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralight-webfont.woff
  31. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralight-webfont.woff2
  32. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralightit-webfont.woff
  33. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralightit-webfont.woff2
  34. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-it-webfont.woff
  35. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-it-webfont.woff2
  36. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-light-webfont.woff
  37. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-light-webfont.woff2
  38. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-lightit-webfont.woff
  39. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-lightit-webfont.woff2
  40. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-regular-webfont.woff
  41. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-regular-webfont.woff2
  42. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-semibold-webfont.woff
  43. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-semibold-webfont.woff2
  44. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-semiboldit-webfont.woff
  45. +0
    -0
      Resources/assets/app/adminlte/main/fonts/sourcesanspro-semiboldit-webfont.woff2
  46. +37
    -0
      Resources/assets/app/adminlte/main/init.js
  47. +0
    -0
      Resources/assets/app/adminlte/main/scss/_card.scss
  48. +0
    -0
      Resources/assets/app/adminlte/main/scss/_common.scss
  49. +0
    -0
      Resources/assets/app/adminlte/main/scss/_modal.scss
  50. +0
    -0
      Resources/assets/app/adminlte/main/scss/_tabs.scss
  51. +0
    -0
      Resources/assets/app/adminlte/main/scss/_toastr.scss
  52. +0
    -0
      Resources/assets/app/adminlte/main/scss/form/_checkboxradio.scss
  53. +0
    -0
      Resources/assets/app/adminlte/main/scss/form/_footer.scss
  54. +8
    -9
      Resources/assets/app/adminlte/plugins/app.plugins.js
  55. +1
    -1
      Resources/assets/functions/notification.js
  56. +1
    -1
      Resources/assets/functions/tools.js
  57. +111
    -0
      Resources/assets/functions/widgets.js
  58. +1
    -1
      Resources/views/adminlte/crud/field/toggle.html.twig
  59. +8
    -6
      Resources/views/adminlte/crud/form_theme.html.twig
  60. +1
    -1
      Resources/views/adminlte/layout.html.twig

+ 2
- 1
Controller/Dashboard/DashboardAdminController.php View File

{ {
$assets = parent::configureAssets(); $assets = parent::configureAssets();


$assets->addWebpackEncoreEntry('adminlte-common');
$assets->addWebpackEncoreEntry('adminlte-plugins');
$assets->addWebpackEncoreEntry('adminlte-index'); $assets->addWebpackEncoreEntry('adminlte-index');
$assets->addWebpackEncoreEntry('adminlte-form'); $assets->addWebpackEncoreEntry('adminlte-form');
$assets->addWebpackEncoreEntry('adminlte-sort'); $assets->addWebpackEncoreEntry('adminlte-sort');
$assets->addWebpackEncoreEntry('adminlte-field-collection'); $assets->addWebpackEncoreEntry('adminlte-field-collection');
$assets->addWebpackEncoreEntry('adminlte-field-filemanager'); $assets->addWebpackEncoreEntry('adminlte-field-filemanager');
$assets->addWebpackEncoreEntry('adminlte-main');
$assets->addWebpackEncoreEntry('sov-reminder'); $assets->addWebpackEncoreEntry('sov-reminder');


return $assets; return $assets;

+ 2
- 4
Controller/Newsletter/NewsletterAdminController.php View File



abstract class NewsletterAdminController extends AbstractAdminController abstract class NewsletterAdminController extends AbstractAdminController
{ {

public function configureFields(string $pageName): iterable public function configureFields(string $pageName): iterable
{ {
$panel = parent::configureFields($pageName);

return array_merge( return array_merge(
[ [
FormField::addPanel('general'), FormField::addPanel('general'),
->hideOnIndex(), ->hideOnIndex(),
StatusField::new('status'), StatusField::new('status'),
], ],
$panel
$this->getSeoPanel(),
$this->getConfPanel()
); );
} }



+ 11
- 0
Repository/AbstractStore.php View File

<?php

namespace Lc\SovBundle\Repository;

abstract class AbstractStore
{
public function getRepositoryQuery()
{
return $this->query;
}
}

+ 3
- 1
Repository/File/FileStore.php View File



namespace Lc\SovBundle\Repository\File; namespace Lc\SovBundle\Repository\File;


class FileStore implements FileStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class FileStore extends AbstractStore implements FileStoreInterface
{ {
protected FileRepositoryQueryInterface $query; protected FileRepositoryQueryInterface $query;



+ 3
- 1
Repository/Newsletter/NewsletterStore.php View File



namespace Lc\SovBundle\Repository\Newsletter; namespace Lc\SovBundle\Repository\Newsletter;


class NewsletterStore implements NewsletterStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class NewsletterStore extends AbstractStore implements NewsletterStoreInterface
{ {
protected NewsletterRepositoryQueryInterface $query; protected NewsletterRepositoryQueryInterface $query;



+ 3
- 1
Repository/Reminder/ReminderStore.php View File



namespace Lc\SovBundle\Repository\Reminder; namespace Lc\SovBundle\Repository\Reminder;


class ReminderStore implements ReminderStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class ReminderStore extends AbstractStore implements ReminderStoreInterface
{ {
protected ReminderRepositoryQueryInterface $query; protected ReminderRepositoryQueryInterface $query;



+ 3
- 1
Repository/Setting/SiteSettingStore.php View File



namespace Lc\SovBundle\Repository\Setting; namespace Lc\SovBundle\Repository\Setting;


class SiteSettingStore implements SiteSettingStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class SiteSettingStore extends AbstractStore implements SiteSettingStoreInterface
{ {
protected SiteSettingRepositoryQueryInterface $query; protected SiteSettingRepositoryQueryInterface $query;



+ 3
- 1
Repository/Site/NewsStore.php View File



namespace Lc\SovBundle\Repository\Site; namespace Lc\SovBundle\Repository\Site;


class NewsStore implements NewsStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class NewsStore extends AbstractStore implements NewsStoreInterface
{ {
protected NewsRepositoryQueryInterface $query; protected NewsRepositoryQueryInterface $query;



+ 3
- 1
Repository/Site/PageStore.php View File



namespace Lc\SovBundle\Repository\Site; namespace Lc\SovBundle\Repository\Site;


class PageStore implements PageStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class PageStore extends AbstractStore implements PageStoreInterface
{ {
protected PageRepositoryQueryInterface $query; protected PageRepositoryQueryInterface $query;



+ 3
- 1
Repository/Site/SiteStore.php View File



namespace Lc\SovBundle\Repository\Site; namespace Lc\SovBundle\Repository\Site;


class SiteStore implements SiteStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class SiteStore extends AbstractStore implements SiteStoreInterface
{ {
protected SiteRepositoryQueryInterface $query; protected SiteRepositoryQueryInterface $query;



+ 3
- 1
Repository/Ticket/TicketMessageStore.php View File



namespace Lc\SovBundle\Repository\Ticket; namespace Lc\SovBundle\Repository\Ticket;


class TicketMessageStore implements TicketMessageStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class TicketMessageStore extends AbstractStore implements TicketMessageStoreInterface
{ {
protected TicketMessageRepositoryQueryInterface $query; protected TicketMessageRepositoryQueryInterface $query;



+ 3
- 1
Repository/Ticket/TicketStore.php View File



namespace Lc\SovBundle\Repository\Ticket; namespace Lc\SovBundle\Repository\Ticket;


class TicketStore implements TicketStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class TicketStore extends AbstractStore implements TicketStoreInterface
{ {
protected TicketRepositoryQueryInterface $query; protected TicketRepositoryQueryInterface $query;



+ 3
- 1
Repository/User/GroupUserStore.php View File



namespace Lc\SovBundle\Repository\User; namespace Lc\SovBundle\Repository\User;


class GroupUserStore implements GroupUserStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class GroupUserStore extends AbstractStore implements GroupUserStoreInterface
{ {
protected GroupUserRepositoryQueryInterface $query; protected GroupUserRepositoryQueryInterface $query;



+ 3
- 1
Repository/User/UserStore.php View File



namespace Lc\SovBundle\Repository\User; namespace Lc\SovBundle\Repository\User;


class UserStore implements UserStoreInterface
use Lc\SovBundle\Repository\AbstractStore;

class UserStore extends AbstractStore implements UserStoreInterface
{ {
protected UserRepositoryQueryInterface $query; protected UserRepositoryQueryInterface $query;



+ 1
- 1
Resources/assets/app/admin/reminder/reminder.js View File

id: $(this).data('id'), id: $(this).data('id'),
done: $(this).is(':checked') done: $(this).is(':checked')
}, function(data) { }, function(data) {
Notification.add('success', 'Pense-bête mis à jour');
SovNotification.add('success', 'Pense-bête mis à jour');
}, 'json'); }, 'json');
}) ; }) ;
} }

+ 2
- 2
Resources/assets/app/admin/ticket/ticket.js View File

dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.success) { if (data.success) {
Notification.add('success', 'Le status a bien été mise à jour.');
SovNotification.add('success', 'Le status a bien été mise à jour.');
} else { } else {
Notification.add('danger', 'Une erreur est survenue.');
SovNotification.add('danger', 'Une erreur est survenue.');
} }
} }
}); });

+ 0
- 155
Resources/assets/app/adminlte/common/common.js View File


/* Notifications */
//Notification.init() ;


setDateRange();

setAutoCompleteField();


/* Tooltip */
$('[data-toggle="tooltip"]').tooltip();

/* Select2 */
if ($('.select2, select.form-control').length) {

$('form .form-widget>select.form-control, .select2').each(function (i, elm) {
if (!$(this).hasClass('disable-select2')) {
setSelect2($(elm));
}
});

$('form select.form-control').each(function (i, elm) {
if (!$(this).hasClass('disable-select2')) {
setSelect2($(elm));
}
});
}

function setSelect2($select) {
if (typeof $select.data('select2-id') === 'undefined') {

$select.data('init', 'set')
var options = {
width: "100%",
theme: "bootstrap4",
dropdownAutoWidth: false,
allowClear: true,
minimumResultsForSearch: 8
};

if ($select.data('allow-clear') == 'false') {
options.allowClear = false;
}
if ($select.data('width')) {
options.width = 'auto'
}
if ($select.find('option[value=""]')) {
options.placeholder = $select.find('option[value=""]').html()
}
/*if($select.is(':required') == false) {
options.allowclear = true
}*/
var myselect = $select.select2(options);

myselect.on('select2:select', function (e) {
var event = new Event('change');
e.target.dispatchEvent(event);
});
myselect.on('select2:unselect', function (e) {
var event = new Event('change');
e.target.dispatchEvent(event);
});

return myselect;
}
}


$('.action-delete').on('click', function (e) {
e.preventDefault();
const formAction = $(this).attr('formaction');

$('#modal-delete').modal({backdrop: true, keyboard: true})
.off('click', '#modal-delete-button')
.on('click', '#modal-delete-button', function () {
let deleteForm = $('#delete-form');
deleteForm.attr('action', formAction);
deleteForm.submit();
});
});


function setDateRange(){


$('.date-time-range, .date-range').each(function (i, picker) {
options = {
autoUpdateInput: false,
locale: {
"format": "DD/MM/YY",
"separator": " - ",
"applyLabel": "Appliquer",
"cancelLabel": "Annuler",
"fromLabel": "Du",
"toLabel": "au",
"customRangeLabel": "Custom",
"daysOfWeek": ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"],
"monthNames": ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
"firstDay": 1
}
};
if ($(picker).hasClass('date-time-range')){
options = Object.assign(options, {
timePicker: true,
timePickerIncrement: 30,
timePicker24Hour: true,
locale: {
"format": "DD/MM/YYYY HH:mm",
}
});
}
if ($(picker).nextAll('.date-time-range-fields').find('.date-start').val()) {
options.startDate = new Date($(picker).nextAll('.date-time-range-fields').find('.date-start').val());
options.autoUpdateInput = true;
}
if ($(picker).nextAll('.date-time-range-fields').find('.date-end').val()) {
options.endDate = new Date($(picker).nextAll('.date-time-range-fields').find('.date-end').val());
options.autoUpdateInput = true;
}
$(picker).daterangepicker(options);
$(picker).on('apply.daterangepicker', function (ev, pickerElm) {
if ($(picker).hasClass('date-time-range')) {
$(this).val(pickerElm.startDate.format('DD/MM/YY HH:mm') + ' - ' + pickerElm.endDate.format(options.locale.format));
}else{
$(this).val(pickerElm.startDate.format('DD/MM/YY') + ' - ' + pickerElm.endDate.format(options.locale.format));
}
if ($(picker).hasClass('date-time-range')) {
$(picker).nextAll('.date-time-range-fields').find('.date-start').val(pickerElm.startDate.format('YYYY-MM-DD HH:mm'));
$(picker).nextAll('.date-time-range-fields').find('.date-end').val(pickerElm.endDate.format('YYYY-MM-DD HH:mm'));
}else{
$(picker).nextAll('.date-time-range-fields').find('.date-start').val(pickerElm.startDate.format('YYYY-MM-DD'));
$(picker).nextAll('.date-time-range-fields').find('.date-end').val(pickerElm.endDate.format('YYYY-MM-DD'));
}
});
});

}


function setAutoCompleteField() {
var autocompleteFields = $('[data-lc-autocomplete-url]');

autocompleteFields.each(function () {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
});
}

+ 0
- 7
Resources/assets/app/adminlte/common/utils/log.js View File

function log(name) {
try {
return console.log(name);
} catch (e) {
return null;
}
}

+ 2
- 2
Resources/assets/app/adminlte/index/index.js View File

let toggleRequest = $.ajax({type: "POST", url: toggleUrl, data: {}, dataType: 'json'}); let toggleRequest = $.ajax({type: "POST", url: toggleUrl, data: {}, dataType: 'json'});


toggleRequest.done(function (response) { toggleRequest.done(function (response) {
Notification.add('success', 'La propriété a bien été mise à jour.');
SovNotification.add('success', 'La propriété a bien été mise à jour.');
}); });


toggleRequest.fail(function () { toggleRequest.fail(function () {
toggle.checked = oldValue; toggle.checked = oldValue;
toggle.disabled = true; toggle.disabled = true;
toggle.closest('.checkbox-switch').classList.add('disabled'); toggle.closest('.checkbox-switch').classList.add('disabled');
Notification.add('error', 'Une erreur est survenue.');
SovNotification.add('error', 'Une erreur est survenue.');
}); });
}); });
} }

+ 3
- 0
Resources/assets/app/adminlte/main/app.main.js View File


import './init.js';
import './common.scss';

Resources/assets/app/adminlte/common/common.scss → Resources/assets/app/adminlte/main/common.scss View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-black-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-black-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-black-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-blackit-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-blackit-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-blackit-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-bold-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-bold-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-bold-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-boldit-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-boldit-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-boldit-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralight-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralight-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralight-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralightit-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-extralightit-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-extralightit-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-it-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-it-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-it-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-light-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-light-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-light-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-lightit-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-lightit-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-lightit-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-regular-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-regular-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-regular-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-semibold-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-semibold-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-semibold-webfont.woff2 View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff → Resources/assets/app/adminlte/main/fonts/sourcesanspro-semiboldit-webfont.woff View File


Resources/assets/app/adminlte/common/fonts/sourcesanspro-semiboldit-webfont.woff2 → Resources/assets/app/adminlte/main/fonts/sourcesanspro-semiboldit-webfont.woff2 View File


+ 37
- 0
Resources/assets/app/adminlte/main/init.js View File


SovNotification.init() ;

SovWidgets.setDateRange();
SovWidgets.setAutoCompleteField();

/* Tooltip */
$('[data-toggle="tooltip"]').tooltip();

/* Select2 */
if ($('.select2, select.form-control').length) {

$('form .form-widget>select.form-control, .select2').each(function (i, elm) {
if (!$(this).hasClass('disable-select2')) {
SovWidgets.setSelect2($(elm));
}
});

$('form select.form-control').each(function (i, elm) {
if (!$(this).hasClass('disable-select2')) {
SovWidgets.setSelect2($(elm));
}
});
}

$('.action-delete').on('click', function (e) {
e.preventDefault();
const formAction = $(this).attr('formaction');

$('#modal-delete').modal({backdrop: true, keyboard: true})
.off('click', '#modal-delete-button')
.on('click', '#modal-delete-button', function () {
let deleteForm = $('#delete-form');
deleteForm.attr('action', formAction);
deleteForm.submit();
});
});

Resources/assets/app/adminlte/common/scss/_card.scss → Resources/assets/app/adminlte/main/scss/_card.scss View File


Resources/assets/app/adminlte/common/scss/_common.scss → Resources/assets/app/adminlte/main/scss/_common.scss View File


Resources/assets/app/adminlte/common/scss/_modal.scss → Resources/assets/app/adminlte/main/scss/_modal.scss View File


Resources/assets/app/adminlte/common/scss/_tabs.scss → Resources/assets/app/adminlte/main/scss/_tabs.scss View File


Resources/assets/app/adminlte/common/scss/_toastr.scss → Resources/assets/app/adminlte/main/scss/_toastr.scss View File


Resources/assets/app/adminlte/common/scss/form/_checkboxradio.scss → Resources/assets/app/adminlte/main/scss/form/_checkboxradio.scss View File


Resources/assets/app/adminlte/common/scss/form/_footer.scss → Resources/assets/app/adminlte/main/scss/form/_footer.scss View File


Resources/assets/app/adminlte/common/app.common.js → Resources/assets/app/adminlte/plugins/app.plugins.js View File

import 'toastr/toastr.scss' ; import 'toastr/toastr.scss' ;
global.toastr = toastr ; global.toastr = toastr ;



// DaterangePicker // DaterangePicker
import 'moment' ; import 'moment' ;
import 'daterangepicker/daterangepicker.js' ; import 'daterangepicker/daterangepicker.js' ;
import 'daterangepicker/daterangepicker.css' ; import 'daterangepicker/daterangepicker.css' ;


// Tools // Tools
import { Tools } from '../../../tools/tools.js';
global.Tools = Tools;
import { SovTools } from '../../../functions/tools.js';
global.SovTools = SovTools;

// Widgets
import { SovWidgets } from '../../../functions/widgets.js';
global.SovWidgets = SovWidgets;


import { Notification } from './js/notification.js';
global.Notification = Notification;
Notification.init() ;
import { SovNotification } from '../../../functions/notification.js';
global.SovNotification = SovNotification;


// Common
import './common.scss';
import './common.js' ;







Resources/assets/app/adminlte/common/js/notification.js → Resources/assets/functions/notification.js View File



export class Notification {
export class SovNotification {


static init() { static init() {
toastr.options.timeOut = 3000; toastr.options.timeOut = 3000;

Resources/assets/tools/tools.js → Resources/assets/functions/tools.js View File



export class Tools {
export class SovTools {


static log(value) { static log(value) {
try { try {

+ 111
- 0
Resources/assets/functions/widgets.js View File


export class SovWidgets {

static setSelect2($select) {
if (typeof $select.data('select2-id') === 'undefined') {

$select.data('init', 'set')
var options = {
width: "100%",
theme: "bootstrap4",
dropdownAutoWidth: false,
allowClear: true,
minimumResultsForSearch: 8
};

if ($select.data('allow-clear') == 'false') {
options.allowClear = false;
}
if ($select.data('width')) {
options.width = 'auto'
}
if ($select.find('option[value=""]')) {
options.placeholder = $select.find('option[value=""]').html()
}
/*if($select.is(':required') == false) {
options.allowclear = true
}*/
var myselect = $select.select2(options);

myselect.on('select2:select', function (e) {
var event = new Event('change');
e.target.dispatchEvent(event);
});
myselect.on('select2:unselect', function (e) {
var event = new Event('change');
e.target.dispatchEvent(event);
});

return myselect;
}
}

static setDateRange() {
$('.date-time-range, .date-range').each(function (i, picker) {
options = {
autoUpdateInput: false,
locale: {
"format": "DD/MM/YY",
"separator": " - ",
"applyLabel": "Appliquer",
"cancelLabel": "Annuler",
"fromLabel": "Du",
"toLabel": "au",
"customRangeLabel": "Custom",
"daysOfWeek": ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"],
"monthNames": ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
"firstDay": 1
}
};
if ($(picker).hasClass('date-time-range')) {
options = Object.assign(options, {
timePicker: true,
timePickerIncrement: 30,
timePicker24Hour: true,
locale: {
"format": "DD/MM/YYYY HH:mm",
}
});
}
if ($(picker).nextAll('.date-time-range-fields').find('.date-start').val()) {
options.startDate = new Date($(picker).nextAll('.date-time-range-fields').find('.date-start').val());
options.autoUpdateInput = true;
}
if ($(picker).nextAll('.date-time-range-fields').find('.date-end').val()) {
options.endDate = new Date($(picker).nextAll('.date-time-range-fields').find('.date-end').val());
options.autoUpdateInput = true;
}
$(picker).daterangepicker(options);
$(picker).on('apply.daterangepicker', function (ev, pickerElm) {
if ($(picker).hasClass('date-time-range')) {
$(this).val(pickerElm.startDate.format('DD/MM/YY HH:mm') + ' - ' + pickerElm.endDate.format(options.locale.format));
} else {
$(this).val(pickerElm.startDate.format('DD/MM/YY') + ' - ' + pickerElm.endDate.format(options.locale.format));
}
if ($(picker).hasClass('date-time-range')) {
$(picker).nextAll('.date-time-range-fields').find('.date-start').val(pickerElm.startDate.format('YYYY-MM-DD HH:mm'));
$(picker).nextAll('.date-time-range-fields').find('.date-end').val(pickerElm.endDate.format('YYYY-MM-DD HH:mm'));
} else {
$(picker).nextAll('.date-time-range-fields').find('.date-start').val(pickerElm.startDate.format('YYYY-MM-DD'));
$(picker).nextAll('.date-time-range-fields').find('.date-end').val(pickerElm.endDate.format('YYYY-MM-DD'));
}
});
});
}

static setAutoCompleteField() {
var autocompleteFields = $('[data-lc-autocomplete-url]');

autocompleteFields.each(function () {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
});
}
}

+ 1
- 1
Resources/views/adminlte/crud/field/toggle.html.twig View File

data-url="{{ ea_url({crudAction: 'edit', entityId: item.id, fieldName: property_name }) }}"> data-url="{{ ea_url({crudAction: 'edit', entityId: item.id, fieldName: property_name }) }}">
<input type="checkbox" class="custom-control-input" id="{{ id_toggle }}" {{ field.value ? 'checked' }}> <input type="checkbox" class="custom-control-input" id="{{ id_toggle }}" {{ field.value ? 'checked' }}>
<label class="custom-control-label" for="{{ id_toggle }}"> <label class="custom-control-label" for="{{ id_toggle }}">
{{ field.getCustomOption('toggle_label') ?? field.label }}</label>
{{ field.getCustomOption('toggle_label') ? field.label : field.property|sov_trans_admin_field(entity.instance) }}</label>
</div> </div>

+ 8
- 6
Resources/views/adminlte/crud/form_theme.html.twig View File

{{ widget|raw }} {{ widget|raw }}
<span class="checkmark"></span> <span class="checkmark"></span>


{# {% if translation_domain == 'lcshop' %}
{{ name|lc_trad(easyadmin['entity']['name'], 'field') }}
{% else %} #}
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain))|raw -}}
{# {{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain))|raw -}} #}

{% set entityNameOrObject = form.parent.vars.data %}
{% if not entityNameOrObject and form.parent.vars.errors.form.config.dataClass is defined %}
{% set entityNameOrObject = form.parent.vars.errors.form.config.dataClass %}
{% endif %}

{{- (label is not empty and '.' in label) ? label|trans({}, 'admin') : name|sov_trans_admin_field(entityNameOrObject) -}}


{# {% endif %} #}
{{- form_errors(form) -}} {{- form_errors(form) -}}
</label> </label>
{%- endif -%} {%- endif -%}
{% block class %}{{ loop.first ? 'active' }}{% endblock %} {% block class %}{{ loop.first ? 'active' }}{% endblock %}
{% block id %}{{ panel_name }}{% endblock %} {% block id %}{{ panel_name }}{% endblock %}
{% block content %} {% block content %}
{{ dump() }}
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.ea_crud_form.form_panel == panel_name) %} {% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.ea_crud_form.form_panel == panel_name) %}
{% if not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name %} {% if not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name %}
{{ form_row(field) }} {{ form_row(field) }}

+ 1
- 1
Resources/views/adminlte/layout.html.twig View File

$(document).ready(function () { $(document).ready(function () {
{% for label, messages in flash_messages %} {% for label, messages in flash_messages %}
{% for message in messages %} {% for message in messages %}
Notification.add("{{ label }}", "{{ message|trans|raw|replace({'"': '\"'}) }}");
SovNotification.add("{{ label }}", "{{ message|trans|raw|replace({'"': '\"'}) }}");
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
}); });

Loading…
Cancel
Save