Parcourir la source

Intégration page d'édition AdminLTE

tags/0.1
Fab il y a 3 ans
Parent
révision
4c7f4ba867
33 fichiers modifiés avec 255 ajouts et 13 suppressions
  1. +1
    -1
      Field/FileManagerField.php
  2. +144
    -0
      Resources/assets/apps/backend-common/_fonts.scss
  3. +74
    -2
      Resources/assets/apps/backend-common/app.common.js
  4. +0
    -7
      Resources/assets/apps/backend-common/common.scss
  5. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff
  6. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff2
  7. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff
  8. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff2
  9. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff
  10. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff2
  11. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff
  12. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff2
  13. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff
  14. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff2
  15. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff
  16. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff2
  17. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff
  18. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff2
  19. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff
  20. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff2
  21. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff
  22. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff2
  23. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff
  24. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff2
  25. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff
  26. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff2
  27. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff
  28. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff2
  29. +30
    -0
      Resources/assets/fields/filemanager/app.field-filemanager.js
  30. +0
    -0
      Resources/assets/fields/filemanager/form.scss
  31. +1
    -3
      Resources/views/adminlte/crud/new.html.twig
  32. +0
    -0
      Resources/views/adminlte/filemanager/file-manager-modal.html.twig
  33. +5
    -0
      Resources/views/adminlte/layout.html.twig

+ 1
- 1
Field/FileManagerField.php Voir le fichier

@@ -23,7 +23,7 @@ final class FileManagerField implements FieldInterface
->setProperty($propertyName)
->setLabel($label)
->setTemplatePath('@LcSov/tabler/crud/field/image.html.twig')
->addJsFiles('bundles/lcsov/js/form-type-file-manager.js')
->addWebpackEncoreEntries('field-filemanager')
->setFormType(FileManagerType::class)
->addCssClass('field-text')
->setCustomOption(self::OPTION_MAX_LENGTH, null)

+ 144
- 0
Resources/assets/apps/backend-common/_fonts.scss Voir le fichier

@@ -0,0 +1,144 @@
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on May 17, 2021 */



@font-face {
font-family: 'source_sans_proregular';
src: url('fonts/sourcesanspro-regular-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_prolight';
src: url('fonts/sourcesanspro-light-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-light-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_prolight_italic';
src: url('fonts/sourcesanspro-lightit-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-lightit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_proitalic';
src: url('fonts/sourcesanspro-it-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-it-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_proXLtIt';
src: url('fonts/sourcesanspro-extralightit-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-extralightit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_proextralight';
src: url('fonts/sourcesanspro-extralight-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-extralight-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_proSBdIt';
src: url('fonts/sourcesanspro-semiboldit-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-semiboldit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_prosemibold';
src: url('fonts/sourcesanspro-semibold-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-semibold-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_probold_italic';
src: url('fonts/sourcesanspro-boldit-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-boldit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_probold';
src: url('fonts/sourcesanspro-bold-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_problack_italic';
src: url('fonts/sourcesanspro-blackit-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-blackit-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}




@font-face {
font-family: 'source_sans_problack';
src: url('fonts/sourcesanspro-black-webfont.woff2') format('woff2'),
url('fonts/sourcesanspro-black-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;

}

+ 74
- 2
Resources/assets/apps/backend-common/app.common.js Voir le fichier

@@ -1,16 +1,88 @@

//JQUERY
import 'jquery';
global.$ = global.jQuery = $;
import './common.scss';


//ADMINLTE
import 'adminlte-js' ;
import "adminlte-css";
import "fontawesome-css";

//BOOTSTRAP
import 'adminlte-plugin/bootstrap/js/bootstrap.min.js';


// SELECT 2
import 'adminlte-plugin/select2/js/select2.min.js';
import 'adminlte-plugin/select2/js/i18n/fr.js';
import 'adminlte-plugin/select2/css/select2.min.css';
import 'adminlte-plugin/select2-bootstrap4-theme/select2-bootstrap4.min.css';

// SOV CSS
import './common.scss';

import log from './utils/log.js';

log('ncnnc');

$('#test22').modal('show');

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 .form-inline>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;
}
}




+ 0
- 7
Resources/assets/apps/backend-common/common.scss Voir le fichier

@@ -1,7 +0,0 @@

@import "adminlte-css";
@import "fontawesome-css";

body{
font-size: 0.9rem;
}

BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff2 Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff Voir le fichier


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff2 Voir le fichier


+ 30
- 0
Resources/assets/fields/filemanager/app.field-filemanager.js Voir le fichier

@@ -0,0 +1,30 @@


$(document).ready(function () {
initFileManager();
});

function initFileManager() {
$('.lc-filemanager-delete').off('click');
$('.lc-filemanager-delete').on('click', function (e) {
let $field = $(this);
$('#' + $field.data('id')).val("");
$('#' + $field.data('id') + '_preview').prop('src',"");
});
$('.lc-filemanager-open').off('click');
$('.lc-filemanager-open').on('click', function (e) {
let $field = $(this);
$('#lc-filemanager-frame').off('load');
$("#lc-filemanager-frame").on('load', function () {
$('#lc-filemanager-frame').contents().on('click', '.select', function () {
var path = $(this).attr('data-path')
$('#' + $field.data('id')).val(path);
$('#' + $field.data('id') + '_preview').prop('src',path);
$('#lc-filemanager-modal').modal('hide')
});
});
$("#lc-filemanager-frame").prop('src', $field.data('target'));
$('#lc-filemanager-modal').modal('show');
});

}

+ 0
- 0
Resources/assets/fields/filemanager/form.scss Voir le fichier


+ 1
- 3
Resources/views/adminlte/crud/new.html.twig Voir le fichier

@@ -60,11 +60,9 @@
<h2 class="card-title">{{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }}</h2>
</div>
<div class="card-body">

{#
{% block new_form %}
{{ form(new_form) }}
{% endblock new_form %} #}
{% endblock new_form %}
</div>
</div>
</div>

Resources/views/adminlte/crud/filemanager/file-manager-modal.html.twig → Resources/views/adminlte/filemanager/file-manager-modal.html.twig Voir le fichier


+ 5
- 0
Resources/views/adminlte/layout.html.twig Voir le fichier

@@ -19,6 +19,8 @@
<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">
{% endblock %} #}

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&amp;display=fallback">

{% block configured_stylesheets %}
{% for css_asset in ea.assets.cssFiles ?? [] %}
<link rel="stylesheet" href="{{ asset(css_asset) }}">
@@ -169,6 +171,9 @@
{{ htmlContent|raw }}
{% endfor %}
{% endblock %}

{% include '@LcSov/adminlte/filemanager/file-manager-modal.html.twig' %}

</body>
{% endblock body %}
</html>

Chargement…
Annuler
Enregistrer