Browse Source

Correctif form_theme suite maj easyadmin

tags/0.1
Guillaume 3 years ago
parent
commit
8f28663709
2 changed files with 54 additions and 48 deletions
  1. +6
    -4
      Resources/views/adminlte/crud/_form.html.twig
  2. +48
    -44
      Resources/views/adminlte/crud/form_theme.html.twig

+ 6
- 4
Resources/views/adminlte/crud/_form.html.twig View File



{% block configured_stylesheets %} {% block configured_stylesheets %}
{{ parent() }} {{ parent() }}
{% for css_asset in form.vars.ea_crud_form.assets.cssFiles %}

{% for css_asset in form.vars.ea_crud_form.assets.cssAssets %}
<link rel="stylesheet" href="{{ asset(css_asset) }}"> <link rel="stylesheet" href="{{ asset(css_asset) }}">
{% endfor %} {% endfor %}


{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %}
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreAssets %}
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }} {{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }}
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}


{% block configured_javascripts %} {% block configured_javascripts %}
{{ parent() }} {{ parent() }}
{% for js_asset in form.vars.ea_crud_form.assets.jsFiles %}

{% for js_asset in form.vars.ea_crud_form.assets.jsAssets %}
<script src="{{ asset(js_asset) }}"></script> <script src="{{ asset(js_asset) }}"></script>
{% endfor %} {% endfor %}


{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreEntries %}
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreAssets %}
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }} {{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }}
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

+ 48
- 44
Resources/views/adminlte/crud/form_theme.html.twig View File





{% block file_manager_widget %} {% block file_manager_widget %}
{% set managerDir = form.vars.ea_crud_form.ea_field.customOptions.get('managerDir') %}
{% set type = form.vars.ea_crud_form.ea_field.customOptions.get('type') %}

<div class="lc-filemanager row">
{% if type == 'image' %}
<div class="col-md-3 col-xs-12 form-group">
<div class="lc-filemenager-preview card">
<div class="no-image">
<i class="fa fa-image"></i>
</div>
<img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
</div>
</div>
{% else %}
<div class="callout callout-success">
<h5><i class="fa fa-file-alt"></i>
<span id="{{ form.path.vars.id }}_preview_text">{{ form.path.vars.value }}</span>
</h5>
</div>
{% endif %}


<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
{% if form.parent.vars['row_attr']['data-sortable'] is defined %}
<button type="button" class="btn btn-success lc-btn-sortable" data-toggle="tooltip"
title="Trier les images">
<i class="fa fa-arrows-alt"></i>
</button>
{% endif %}
<button type="button" class="btn btn-primary lc-filemanager-open" data-id="{{ form.path.vars.id }}"
data-toggle="tooltip" title="Sélectionner un fichier"
data-target="{{ path('file_manager', {module:1, conf: managerDir})|raw }}">
<i class="fa fa-folder-open"></i>
</button>
{% if form.vars.ea_crud_form.ea_field is not null %}

{% set managerDir = form.vars.ea_crud_form.ea_field.customOptions.get('managerDir') %}
{% set type = form.vars.ea_crud_form.ea_field.customOptions.get('type') %}

<div class="lc-filemanager row">
{% if type == 'image' %}
<div class="col-md-3 col-xs-12 form-group">
<div class="lc-filemenager-preview card">
<div class="no-image">
<i class="fa fa-image"></i>
</div>
<img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
</div>
</div> </div>
{{ form_widget(form.legend) }}
<div class="input-group-append">
<button type="button" class="btn btn-danger lc-filemanager-delete" data-toggle="tooltip"
title="Supprimer l'image"
data-id="{{ form.path.vars.id }}">
<i class="fa fa-trash"></i>
</button>
{% else %}
<div class="callout callout-success">
<h5><i class="fa fa-file-alt"></i>
<span id="{{ form.path.vars.id }}_preview_text">{{ form.path.vars.value }}</span>
</h5>
</div> </div>
{% endif %}

<div class="col-12">
<div class="input-group">
<div class="input-group-prepend">
{% if form.parent.vars['row_attr']['data-sortable'] is defined %}
<button type="button" class="btn btn-success lc-btn-sortable" data-toggle="tooltip"
title="Trier les images">
<i class="fa fa-arrows-alt"></i>
</button>
{% endif %}
<button type="button" class="btn btn-primary lc-filemanager-open" data-id="{{ form.path.vars.id }}"
data-toggle="tooltip" title="Sélectionner un fichier"
data-target="{{ path('file_manager', {module:1, conf: managerDir})|raw }}">
<i class="fa fa-folder-open"></i>
</button>
</div>
{{ form_widget(form.legend) }}
<div class="input-group-append">
<button type="button" class="btn btn-danger lc-filemanager-delete" data-toggle="tooltip"
title="Supprimer l'image"
data-id="{{ form.path.vars.id }}">
<i class="fa fa-trash"></i>
</button>
</div>




{{ form_rest(form) }}
{{ form_rest(form) }}
</div>
</div> </div>
</div>
</div>
</div>
{% endif %}
{% endblock file_manager_widget %} {% endblock file_manager_widget %}


{% block checkbox_radio_label -%} {% block checkbox_radio_label -%}

Loading…
Cancel
Save