Browse Source

Intégration adminlte

tags/0.1
Guillaume 3 years ago
parent
commit
1fab5ec9ed
32 changed files with 265 additions and 6 deletions
  1. +1
    -1
      Field/FileManagerField.php
  2. +144
    -0
      Resources/assets/apps/backend-common/_fonts.scss
  3. +84
    -2
      Resources/assets/apps/backend-common/app.common.js
  4. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff
  5. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff2
  6. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff
  7. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff2
  8. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff
  9. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff2
  10. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff
  11. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff2
  12. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff
  13. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff2
  14. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff
  15. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff2
  16. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff
  17. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff2
  18. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff
  19. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff2
  20. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff
  21. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff2
  22. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff
  23. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff2
  24. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff
  25. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff2
  26. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff
  27. BIN
      Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff2
  28. +30
    -0
      Resources/assets/fields/filemanager/app.field-filemanager.js
  29. +0
    -0
      Resources/assets/fields/filemanager/form.scss
  30. +1
    -3
      Resources/views/adminlte/crud/new.html.twig
  31. +0
    -0
      Resources/views/adminlte/filemanager/file-manager-modal.html.twig
  32. +5
    -0
      Resources/views/adminlte/layout.html.twig

+ 1
- 1
Field/FileManagerField.php View File

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

+ 144
- 0
Resources/assets/apps/backend-common/_fonts.scss View File

/*! 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;

}

+ 84
- 2
Resources/assets/apps/backend-common/app.common.js View File




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


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

//BOOTSTRAP
import 'adminlte-plugin/bootstrap/js/bootstrap.min.js'; import 'adminlte-plugin/bootstrap/js/bootstrap.min.js';
import './utils/log.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;
}
}

//require('select2');
//require('adminlte');
//import 'adminltePlugin/bootstrap/js/bootstrap.min.js'
///import 'admin-lte/dist/css/adminlte.min.css' ;
//require('admin-lte-css') ;
// import './common.js' ;

BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-black-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-blackit-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-bold-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-boldit-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralight-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-extralightit-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-it-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-light-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-lightit-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-regular-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semibold-webfont.woff2 View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff View File


BIN
Resources/assets/apps/backend-common/fonts/sourcesanspro-semiboldit-webfont.woff2 View File


+ 30
- 0
Resources/assets/fields/filemanager/app.field-filemanager.js View File



$(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 View File


+ 1
- 3
Resources/views/adminlte/crud/new.html.twig View File

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

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

Resources/views/adminlte/crud/filemanager/file-manager-modal.html.twig → Resources/views/adminlte/filemanager/file-manager-modal.html.twig View File


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

<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}"> <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">
{% endblock %} #} {% endblock %} #}


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

{% block configured_stylesheets %} {% block configured_stylesheets %}
{% for css_asset in ea.assets.cssFiles ?? [] %} {% for css_asset in ea.assets.cssFiles ?? [] %}
<link rel="stylesheet" href="{{ asset(css_asset) }}"> <link rel="stylesheet" href="{{ asset(css_asset) }}">
{{ htmlContent|raw }} {{ htmlContent|raw }}
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

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

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

Loading…
Cancel
Save