Browse Source

Webpack implémentation

tags/0.1
Fab 3 years ago
parent
commit
e4521db41d
7 changed files with 45 additions and 32 deletions
  1. +1
    -0
      Controller/Admin/DashboardController.php
  2. +0
    -2
      Field/CKEditorField.php
  3. +6
    -0
      Resources/assets/apps/backend-common/app.common.js
  4. +3
    -3
      Resources/assets/apps/backend-common/utils/log.js
  5. +3
    -2
      Resources/assets/apps/form/app.form.js
  6. +1
    -0
      Resources/assets/tabler
  7. +31
    -25
      Resources/views/adminlte/crud/new.html.twig

+ 1
- 0
Controller/Admin/DashboardController.php View File

@@ -37,6 +37,7 @@ class DashboardController extends AbstractDashboardController
{
$assets = parent::configureAssets();
$assets->addWebpackEncoreEntry('backend-common');
$assets->addWebpackEncoreEntry('form');

return $assets;
}

+ 0
- 2
Field/CKEditorField.php View File

@@ -23,8 +23,6 @@ final class CKEditorField implements FieldInterface
->setTemplateName('crud/field/text_editor')
->setFormType(CKEditorType::class)
->addCssClass('field-text_editor')
->addCssFiles('bundles/easyadmin/form-type-text-editor.css')
->addJsFiles('bundles/easyadmin/form-type-text-editor.js')
->setCustomOption(self::OPTION_NUM_OF_ROWS, null);
}


+ 6
- 0
Resources/assets/apps/backend-common/app.common.js View File

@@ -6,6 +6,12 @@ global.$ = global.jQuery = $;
require('adminlte-css') ;
require('adminlte-js') ;
require('fontawesome-css') ;
import 'adminltePlugin/bootstrap/js/bootstrap.min.js';
import './utils/log.js';

log('ncnnc');



//require('select2');
//require('adminlte');

+ 3
- 3
Resources/assets/apps/backend-common/utils/log.js View File

@@ -1,8 +1,8 @@
export default function(name) {
export function log(name) {
try {
return console.log(name);
} catch (e) {
return null;
}
}

};

+ 3
- 2
Resources/assets/apps/form/app.form.js View File

@@ -6,8 +6,9 @@
*/

// any CSS you import will output into a single css file (app.css in this case)
import './form.scss';
import './form.js';

//import 'adminltePlugin/bootstrap/js/bootstrap.min.js';

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

// start the Stimulus application

+ 1
- 0
Resources/assets/tabler

@@ -0,0 +1 @@
Subproject commit 0046a14932327424d8cbba5fcea5b9c68db6a5b0

+ 31
- 25
Resources/views/adminlte/crud/new.html.twig View File

@@ -38,59 +38,65 @@
{% endblock %}

{% block content_title %}
{# {%- apply spaceless -%}
{# {%- apply spaceless -%}
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %}
{{ ea.crud.customPageTitle is null ? default_title|raw : ea.crud.customPageTitle('new')|trans(ea.i18n.translationParameters)|raw }}
{%- endapply -%}#}
{%- endapply -%} #}
{% endblock %}

{% block content_header_wrapper %}
{# {% for action in entity.actions %}
{# {% for action in entity.actions %}
{{ include(action.templatePath, { action: action }, with_context = false) }}
{% endfor %}#}
{% endfor %} #}
{% endblock %}

{% block main %}
<div class="col-8">
<div class="card">
<div class="card-status-top bg-primary"></div>
<div class="card-header ">
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %}
<div class="card">
<div class="card-status-top bg-primary"></div>
<div class="card-header ">
{% set default_title = ea.crud.defaultPageTitle('new')|trans(ea.i18n.translationParameters, 'EasyAdminBundle') %}

<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 class="card-body">

{#
{% block new_form %}
{{ form(new_form) }}
{% endblock new_form %} #}
</div>
</div>
<div class="card-body">
<button type="button" data-bs-toggle="modal" data-bs-target="#niche">Launch modal</button>
</div>
<button type="button" data-bs-toggle="modal" data-bs-target="#niche">Launch modal</button>


<div class="modal-dialog" role="document" id="niche">
<div class="modal" tabindex="-1" role="dialog" id="test22">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci animi beatae delectus deleniti dolorem eveniet facere fuga iste nemo nesciunt nihil odio perspiciatis, quia quis reprehenderit sit tempora totam unde.
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn me-auto" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>


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

{% endblock %}

{% block body_javascript %}
{{ parent() }}

{# <script type="text/javascript">
{# <script type="text/javascript">
$(function () {
$('.ea-new-form').areYouSure({'message': '{{ 'form.are_you_sure'|trans({}, 'EasyAdminBundle')|e('js') }}'});

@@ -185,5 +191,5 @@
});
</script>

{{ include('@EasyAdmin/crud/includes/_select2_widget.html.twig') }}#}
{{ include('@EasyAdmin/crud/includes/_select2_widget.html.twig') }} #}
{% endblock %}

Loading…
Cancel
Save