Browse Source

header panel

feature/ticket
Charly 3 years ago
parent
commit
b442df2017
3 changed files with 48 additions and 26 deletions
  1. +23
    -0
      Resources/assets/app/adminlte/form/form.scss
  2. +25
    -25
      Resources/views/adminlte/crud/form_theme.html.twig
  3. +0
    -1
      Resources/views/adminlte/crud/index.html.twig

+ 23
- 0
Resources/assets/app/adminlte/form/form.scss View File

z-index: 2; z-index: 2;
} }


.field-collection {
padding-top: 15px;

legend {
font-weight: bold;
font-size: 18px;
}

.field-collection-item {
background-color: gainsboro;
padding: 10px;
position: relative;
border-radius: 5px;

.field-collection-delete {
position: absolute;
right: 0px;
top: 0px;
}
}
}





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

{% set is_complex = form_parent(form).vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ?? false %} {% set is_complex = form_parent(form).vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ?? false %}


<div class="field-collection-item {{ is_complex ? 'field-collection-item-complex' }}"> <div class="field-collection-item {{ is_complex ? 'field-collection-item-complex' }}">
{{ form_widget(form) }}

{% if form_parent(form).vars.allow_delete|default(false) %} {% if form_parent(form).vars.allow_delete|default(false) %}
<button type="button" class="btn btn-link field-collection-delete" <button type="button" class="btn btn-link field-collection-delete"
title="{{ 'action.remove_item'|trans({}, 'EasyAdminBundle') }}"> title="{{ 'action.remove_item'|trans({}, 'EasyAdminBundle') }}">
<i class="fas fa-times"></i> <i class="fas fa-times"></i>
</button> </button>
{% endif %} {% endif %}
{{ form_widget(form) }}
</div> </div>
{% endblock collection_entry_widget %} {% endblock collection_entry_widget %}


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


<div class="lc-filemanager row">
<div class="lc-filemanager row">
{% if type == 'image' %} {% if type == 'image' %}
<div class="col-md-3 col-xs-12 form-group"> <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 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>
<img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
</div>
</div> </div>
{% else %} {% else %}
<div class="callout callout-success"> <div class="callout callout-success">
{{ form_rest(form) }} {{ form_rest(form) }}
</div> </div>
</div> </div>
</div>
</div>
{% endblock file_manager_widget %} {% endblock file_manager_widget %}


{% block checkbox_radio_label -%} {% block checkbox_radio_label -%}
{#- Do not display the label if widget is not defined in order to prevent double label rendering -#}
{#- Do not display the label if widget is not defined in order to prevent double label rendering -#}
{%- if widget is defined -%} {%- if widget is defined -%}
{% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class or 'switch-custom' in parent_label_class) %} {% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class or 'switch-custom' in parent_label_class) %}
{% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class or 'switch-custom' in label_attr.class) %} {% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class or 'switch-custom' in label_attr.class) %}
{{ parent() }} {{ parent() }}


{% if ea_crud_form.form_panels is defined %} {% if ea_crud_form.form_panels is defined %}

<div class="card card-outline"> <div class="card card-outline">
<div class="card-header p-0 border-bottom-0"> <div class="card-header p-0 border-bottom-0">
<ul id="nav-params" class="nav nav-pills" role="navigation"> <ul id="nav-params" class="nav nav-pills" role="navigation">


<div class="card {{ panel_config.css_class ?? '' }}"> <div class="card {{ panel_config.css_class ?? '' }}">
<div class="card-status-top bg-primary"></div> <div class="card-status-top bg-primary"></div>
<div class="card-header ">
{% if panel_has_header %}
{% if panel_has_header %}
<div class="card-header ">
{# <div class="content-panel-header {{ collapsible ? 'collapsible' }} {{ panel_config.help|default(false) is not empty ? 'with-help' }}"> #} {# <div class="content-panel-header {{ collapsible ? 'collapsible' }} {{ panel_config.help|default(false) is not empty ? 'with-help' }}"> #}
{% if collapsible %} {% if collapsible %}
<a href="#content-{{ panel_name }}" data-toggle="collapse" class="content-panel-collapse {{ collapsed ? 'collapsed' }}" aria-expanded="{{ collapsed ? 'false' : 'true' }}" aria-controls="content-{{ panel_name }}">
<a href="#content-{{ panel_name }}" data-toggle="collapse"
class="content-panel-collapse {{ collapsed ? 'collapsed' }}"
aria-expanded="{{ collapsed ? 'false' : 'true' }}"
aria-controls="content-{{ panel_name }}">
<i class="fas fw fa-chevron-right collapse-icon"></i> <i class="fas fw fa-chevron-right collapse-icon"></i>
{% endif %}
{% endif %}


{% if panel_config.icon|default(false) %}
<i class="{{ panel_config.icon }}"></i>
{% endif %}
{% if panel_config.icon|default(false) %}
<i class="{{ panel_config.icon }}"></i>
{% endif %}


{{ panel_config.label|lc_trans_admin_panel(ea.getEntity().getFqcn()) }}
{{ panel_config.label|lc_trans_admin_panel(ea.getEntity().getFqcn()) }}


{% if collapsible %}
</a>
{% if collapsible %}
</a>
{% endif %} {% endif %}


{% if panel_config.help|default(false) %} {% if panel_config.help|default(false) %}
<div class="content-panel-header-help">{{ panel_config.help|raw }}</div> <div class="content-panel-header-help">{{ panel_config.help|raw }}</div>
{% endif %} {% endif %}

{% endif %}
</div>
</div>
{% endif %}
<div class="card-body {{ collapsible ? 'collapse' }} {{ not collapsed ? 'show' }}"> <div class="card-body {{ collapsible ? 'collapse' }} {{ not collapsed ? 'show' }}">
{% 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 %}
{% else %} {% else %}
<div class="card"> <div class="card">
<div class="card-status-top bg-primary"></div> <div class="card-status-top bg-primary"></div>
<div class="card-header "></div>
<div class="card-body"> <div class="card-body">


{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name)) %} {% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name)) %}

+ 0
- 1
Resources/views/adminlte/crud/index.html.twig View File

<table class="table table-bordered table-hover table-striped"> <table class="table table-bordered table-hover table-striped">
<thead> <thead>
{% block table_head %} {% block table_head %}

<tr> <tr>
{% if has_batch_actions %} {% if has_batch_actions %}
<th class=""> <th class="">

Loading…
Cancel
Save