瀏覽代碼

Merge branch 'master' of https://gitea.laclic.fr/Laclic/LcShopBundle

# Conflicts:
#	ShopBundle/EventSubscriber/EasyAdminSubscriber.php
reduction
Guillaume 4 年之前
父節點
當前提交
369efdd65a
共有 19 個文件被更改,包括 411 次插入66 次删除
  1. +1
    -5
      ShopBundle/Controller/Admin/AdminController.php
  2. +17
    -10
      ShopBundle/EventSubscriber/EasyAdminSubscriber.php
  3. +2
    -2
      ShopBundle/Model/ProductCategory.php
  4. +5
    -5
      ShopBundle/Model/ProductFamily.php
  5. +3
    -0
      ShopBundle/Resources/config/easy_admin/base.yaml
  6. +1
    -0
      ShopBundle/Resources/public/js/backend/plugin/toastr/toastr.js.map
  7. +37
    -0
      ShopBundle/Resources/translations/lcshop.fr.yaml
  8. +129
    -0
      ShopBundle/Resources/views/backend/default/edit.html.twig
  9. +8
    -1
      ShopBundle/Resources/views/backend/default/layout.html.twig
  10. +3
    -3
      ShopBundle/Resources/views/backend/default/list.html.twig
  11. +0
    -32
      ShopBundle/Resources/views/backend/default/list.htmlOLD.twig
  12. +117
    -0
      ShopBundle/Resources/views/backend/default/new.html.twig
  13. +1
    -1
      ShopBundle/Resources/views/backend/form/ckfinder_widget.html.twig
  14. +81
    -0
      ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig
  15. +1
    -1
      ShopBundle/Resources/views/backend/order/edit.html.twig
  16. +1
    -1
      ShopBundle/Resources/views/backend/order/new.html.twig
  17. +1
    -2
      ShopBundle/Resources/views/backend/productfamily/edit.html.twig
  18. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/new.html.twig
  19. +2
    -2
      ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig

+ 1
- 5
ShopBundle/Controller/Admin/AdminController.php 查看文件

@@ -364,13 +364,9 @@ class AdminController extends EasyAdminController
$passedOptions = $child->getConfig()->getOptions() ;
$classImplements = class_implements($passedOptions['class']) ;

if(in_array('App\Context\FilterHubInterface', $classImplements) ||
in_array('Lc\ShopBundle\Context\FilterMerchantInterface', $classImplements)) {
if(in_array('Lc\ShopBundle\Context\FilterMerchantInterface', $classImplements)) {

$propertyMerchant = 'merchant' ;
if(in_array('App\Context\FilterHubInterface', $classImplements)) {
$propertyMerchant = 'hub' ;
}

$form->add($child->getName(), EntityType::class, array(
'class' => $this->em->getClassMetadata($passedOptions['class'])->getName(),

+ 17
- 10
ShopBundle/EventSubscriber/EasyAdminSubscriber.php 查看文件

@@ -3,6 +3,7 @@
namespace Lc\ShopBundle\EventSubscriber;

use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\StatusInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -33,18 +34,24 @@ class EasyAdminSubscriber implements EventSubscriberInterface
$entityRepo = $em->getRepository($entity['class']);

$entityObject = new $entity['class'];
$criteria = array();
if ($entityObject instanceof FilterMerchantInterface) {
$currentMerchant = $this->security->getUser()->getMerchant();
$paginator->nbResultsOnline = $entityRepo->count(array('status'=>1,'merchant'=>$currentMerchant));
$paginator->nbResultsOffline = $entityRepo->count(array('status'=>0,'merchant'=>$currentMerchant));
$paginator->nbResultsDeleted = $entityRepo->count(array('status'=>-1,'merchant'=>$currentMerchant));
}else{
/*$paginator->nbResultsOnline = $entityRepo->count(array('status'=>1));
$paginator->nbResultsOffline = $entityRepo->count(array('status'=>0));
$paginator->nbResultsDeleted = $entityRepo->count(array('status'=>-1));*/
$paginator->nbResultsOnline = $entityRepo->count([]);
$paginator->nbResultsOffline = $entityRepo->count([]);
$paginator->nbResultsDeleted = $entityRepo->count([]);
$criteria['merchant'] = $currentMerchant;
}


if($entityObject instanceof StatusInterface) {
for ($status = -1; $status <= 1; $status++) {
$criteria['status'] = $status;
if ($status == -1) {
$paginator->nbResultsDeleted = $entityRepo->count($criteria);
} elseif ($status == 0) {
$paginator->nbResultsOffline = $entityRepo->count($criteria);
} else if ($status == 1) {
$paginator->nbResultsOnline = $entityRepo->count($criteria);
}
}
}
}


+ 2
- 2
ShopBundle/Model/ProductCategory.php 查看文件

@@ -119,12 +119,12 @@ abstract class ProductCategory extends AbstractDocumentEntity implements TreeInt
return $this;
}

public function getMerchant(): ?Hub
public function getMerchant(): ?Merchant
{
return $this->merchant;
}

public function setMerchant(?Hub $merchant): self
public function setMerchant(?Merchant $merchant): self
{
$this->merchant = $merchant;


+ 5
- 5
ShopBundle/Model/ProductFamily.php 查看文件

@@ -56,7 +56,7 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $subTitle;
protected $subtitle;

/**
* @ORM\Column(type="text", nullable=true)
@@ -220,14 +220,14 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
return $this;
}

public function getSubTitle(): ?string
public function getSubtitle(): ?string
{
return $this->subTitle;
return $this->subtitle;
}

public function setSubTitle(?string $subTitle): self
public function setSubtitle(?string $subtitle): self
{
$this->subTitle = $subTitle;
$this->subtitle = $subtitle;

return $this;
}

+ 3
- 0
ShopBundle/Resources/config/easy_admin/base.yaml 查看文件

@@ -4,6 +4,9 @@ easy_admin:
templates:
list: '@LcShop/backend/default/list.html.twig'
layout: '@LcShop/backend/default/layout.html.twig'
menu: '@LcShop/backend/default/menu.html.twig'
edit: '@LcShop/backend/default/edit.html.twig'
new: '@LcShop/backend/default/new.html.twig'
brand_color: '#1ABC9C'
assets:
favicon: '/assets/img/backend/favicon-pdl.png'

+ 1
- 0
ShopBundle/Resources/public/js/backend/plugin/toastr/toastr.js.map
文件差異過大導致無法顯示
查看文件


+ 37
- 0
ShopBundle/Resources/translations/lcshop.fr.yaml 查看文件

@@ -8,10 +8,47 @@ list:
product:
title: Titre
titleHelp: Un message d'aide
form:
group:
main: Général
address: Adresse
field:
default:
supplier: Producteur
title: Titre
subtitle: Sous-titre
kmsHub: Nombre de kilomètres depuis le dépôt
image: Image
description: Description
type: Type
civility: Civilité
lastname: Nom
firstname: Prénom
country: Pays
address: Adresse
zip: Code postal
city: Ville
phone: Téléphone
company: Société
siret: N° SIRET
tva: N° TVA
price: Prix de vente
ProductFamily:
productsType: Type de déclinaisons
buyingPrice: Prix d'achat
multiplyingFactor: Coefficiant multiplicateur
priceByRefUnit: Prix de vente / unité de référence
availableQuantity: Quantité disponible
availableQuantityDefault: Quantité disponible par défaut
quantity: Quantité disponible cette semaine
behaviorCountStock: Gestion du stock
taxRate: TVA
unit: Unité
action:
new: Créer %entity_label%
switchMerchant: Votre hub
show: Voir
choiceFile: Parcourir
edit: Éditer
search: Rechercher
delete: Supprimer

+ 129
- 0
ShopBundle/Resources/views/backend/default/edit.html.twig 查看文件

@@ -0,0 +1,129 @@
{% form_theme form with easyadmin_config('design.form_theme') only %}

{% set _entity_config = easyadmin_entity(app.request.query.get('entity')) %}
{% set _entity_id = attribute(entity, _entity_config.primary_key_field_name) %}
{% trans_default_domain _entity_config.translation_domain %}

{% set _trans_parameters = { '%entity_name%': _entity_config.name|trans, '%entity_label%': _entity_config.label|trans, '%entity_id%': _entity_id } %}

{% extends _entity_config.templates.layout %}

{% block body_id 'easyadmin-edit-' ~ _entity_config.name ~ '-' ~ _entity_id %}
{% block body_class 'edit edit-' ~ _entity_config.name|lower %}

{% block content_title %}
{% apply spaceless %}
{% set _default_title = 'edit.page_title'|trans(_trans_parameters, 'EasyAdminBundle') %}
{{ _entity_config.edit.title is defined ? _entity_config.edit.title|trans(_trans_parameters) : _default_title }}
{% endapply %}
{% endblock %}

{% block content_footer_wrapper '' %}

{% block main %}
{% block entity_form %}
{{ form(form) }}
{% endblock entity_form %}

{% block delete_form %}
{{ include('@EasyAdmin/default/includes/_delete_form.html.twig', {
view: 'edit',
referer: app.request.query.get('referer', ''),
delete_form: delete_form,
_translation_domain: _entity_config.translation_domain,
_trans_parameters: _trans_parameters,
_entity_config: _entity_config,
}, with_context = false) }}
{% endblock delete_form %}
{% endblock %}

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

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

const entityForm = document.querySelector('form.edit-form');
const formSubmitButton = entityForm.querySelector('button[type="submit"]');
const inputFieldsSelector = 'input,select,textarea';

// Adding visual feedback for invalid fields: any ".form-group" with invalid fields
// receives "has-error" class. The class is removed on click on the ".form-group"
// itself to support custom/complex fields.
formSubmitButton.addEventListener('click', function() {
entityForm.querySelectorAll(inputFieldsSelector).forEach(function (input) {
if (!input.validity.valid) {
const formGroup = input.closest('div.form-group');

formGroup.classList.add('has-error');

formGroup.addEventListener('click', function onFormGroupClick() {
formGroup.classList.remove('has-error');
formGroup.removeEventListener('click', onFormGroupClick);
});
}
});
});

// forms with tabs require some special treatment for errors. The problem
// is when the field with errors is included in a tab not currently visible.
// Browser shows this error "An invalid form control with name='...' is not focusable."
// So, the user clicks on Submit button, the form is not submitted and the error
// is not displayed. This JavaScript code ensures that each tab shows a badge with
// the number of errors in it.
formSubmitButton.addEventListener('click', function() {
const formTabPanes = entityForm.querySelectorAll('.tab-pane');
if (0 === formTabPanes.length) {
return;
}

let firstNavTabItemWithError = null;

formTabPanes.forEach(function (tabPane) {
let tabPaneNumErrors = 0;
tabPane.querySelectorAll(inputFieldsSelector).forEach(function (input) {
if (!input.validity.valid) {
tabPaneNumErrors++;
}
});

let navTabItem = entityForm.querySelector('.nav-item a[href="#' + tabPane.id + '"]');
let existingErrorBadge = navTabItem.querySelector('span.badge.badge-danger');
if (null !== existingErrorBadge) {
navTabItem.removeChild(existingErrorBadge);
}

if (tabPaneNumErrors > 0) {
let newErrorBadge = document.createElement('span');
newErrorBadge.classList.add('badge', 'badge-danger');
newErrorBadge.title = 'form.tab.error_badge_title';
newErrorBadge.textContent = tabPaneNumErrors;

navTabItem.appendChild(newErrorBadge);

if (null === firstNavTabItemWithError) {
firstNavTabItemWithError = navTabItem;
}
}
});

if (firstNavTabItemWithError) {
firstNavTabItemWithError.click();
}
});

$('a.action-delete').on('click', function(e) {
e.preventDefault();

$('#modal-delete').modal({ backdrop: true, keyboard: true })
.off('click', '#modal-delete-button')
.on('click', '#modal-delete-button', function () {
$('#delete-form').trigger('submit');
});
});
});
</script>

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

+ 8
- 1
ShopBundle/Resources/views/backend/default/layout.html.twig 查看文件

@@ -63,7 +63,6 @@
{% block wrapper_wrapper %}
<div class="wrapper">
{% block wrapper %}
<<<<<<< HEAD
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
{% block navbar %}
@@ -187,9 +186,17 @@
{% endblock %}
</div>
{% endblock wrapper %}
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
<b>Version</b> 1.0
</div>
<strong>Copyright © {{'now'|date('Y') }} <a href="http://laclic.fr">La Clic</a>.</strong> All rights
reserved.
</footer>
</div>
{% endblock wrapper_wrapper %}


{#Initilisation des varibles requis dans le JS #}
<script>
const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}";

+ 3
- 3
ShopBundle/Resources/views/backend/default/list.html.twig 查看文件

@@ -81,9 +81,9 @@
<h2 class="card-title text-lg ">
{{ "list.title"|trans({'%label%' : _entity_config['label']|lower }) }}
<span data-toggle="tooltip" title="{{ "list.nbResults"|trans }}" class="badge badge-primary">{{ paginator.nbResults }} <i class="fa fa-bars"></i> </span>
<span data-toggle="tooltip" title="{{ "list.nbResultsOnline"|trans }}" class="badge badge-success">{{ paginator.nbResultsOnline }} <i class="fa fa-check"></i> </span>
<span data-toggle="tooltip" title="{{ "list.nbResultsOffline"|trans }}" class="badge badge-warning">{{ paginator.nbResultsOffline }} <i class="fa fa-pen"></i></span>
{% if is_granted('ROLE_SUPER_ADMIN') %}<span data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" class="badge badge-danger">{{ paginator.nbResultsDeleted }} <i class="fa fa-trash"></i></span>{% endif %}
{% if paginator.nbResultsOnline is defined %}<span data-toggle="tooltip" title="{{ "list.nbResultsOnline"|trans }}" class="badge badge-success">{{ paginator.nbResultsOnline }} <i class="fa fa-check"></i> </span>{% endif %}
{% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip" title="{{ "list.nbResultsOffline"|trans }}" class="badge badge-warning">{{ paginator.nbResultsOffline }} <i class="fa fa-pen"></i></span>{% endif %}
{% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" class="badge badge-danger">{{ paginator.nbResultsDeleted }} <i class="fa fa-trash"></i></span>{% endif %}

</h2>
{% if easyadmin_action_is_enabled_for_list_view('new', _entity_config.name) %}

+ 0
- 32
ShopBundle/Resources/views/backend/default/list.htmlOLD.twig 查看文件

@@ -1,32 +0,0 @@
{% extends '@EasyAdmin/default/list.html.twig' %}

{% block content_title %}
{% if 'action' in app.request.uri and app.request.get('action') == "listChildren" %}
{% set param = _request_parameters|filter((v,k) => k != 'id') %}
{% set action_href = path('easyadmin',param|merge({ action: 'list' })) %}
<a href="{{ action_href }}">< Retour à la liste</a>

{% endif %}
{{ parent() }}
{% if 'action' in app.request.uri and app.request.get('action') == "listChildren" %}
<strong>: {{ entity.title }}</strong>
{% endif %}
{% endblock %}
{% block new_action %}
<div class="button-action">
<a class="{{ _action.css_class|default('') }}"
href="{{ path('easyadmin', _request_parameters|merge({ action: _action.name })) }}"
target="{{ _action.target }}">
{% if _action.icon %}<i class="fa fa-fw fa-{{ _action.icon }}"></i>{% endif %}
{{ _action.label is defined and not _action.label is empty ? _action.label|trans(_trans_parameters) }}
</a>
{% if _entity_config['list']['edit_position'] is defined %}
<a class="{{ _action.css_class|default('') }}"
href="{{ path('easyadmin', _request_parameters|merge({ action: 'sort' })) }}"
target="{{ _action.target }}">
Modifier position
</a>
{% endif %}
</div>

{% endblock %}

+ 117
- 0
ShopBundle/Resources/views/backend/default/new.html.twig 查看文件

@@ -0,0 +1,117 @@
{% form_theme form with easyadmin_config('design.form_theme') only %}

{% set _entity_config = easyadmin_entity(app.request.query.get('entity')) %}
{% trans_default_domain _entity_config.translation_domain %}
{% set _trans_parameters = { '%entity_name%': _entity_config.name|trans, '%entity_label%': _entity_config.label|trans } %}

{% extends _entity_config.templates.layout %}

{% block body_id 'easyadmin-new-' ~ _entity_config.name %}
{% block body_class 'new new-' ~ _entity_config.name|lower %}

{% block content_title %}
{% apply spaceless %}
{% set _default_title = 'new.page_title'|trans(_trans_parameters, 'EasyAdminBundle') %}
{{ _entity_config.new.title is defined ? _entity_config.new.title|trans(_trans_parameters) : _default_title }}
{% endapply %}
{% endblock %}

{% block content_footer_wrapper '' %}

{% block main %}
{% block entity_form %}
{{ form(form) }}
{% endblock entity_form %}
{% endblock %}

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

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

const entityForm = document.querySelector('form.new-form');
const formSubmitButton = entityForm.querySelector('button[type="submit"]');
const inputFieldsSelector = 'input,select,textarea';

// Adding visual feedback for invalid fields: any ".form-group" with invalid fields
// receives "has-error" class. The class is removed on click on the ".form-group"
// itself to support custom/complex fields.
formSubmitButton.addEventListener('click', function() {
entityForm.querySelectorAll(inputFieldsSelector).forEach(function (input) {
if (!input.validity.valid) {
const formGroup = input.closest('div.form-group');

formGroup.classList.add('has-error');

formGroup.addEventListener('click', function onFormGroupClick() {
formGroup.classList.remove('has-error');
formGroup.removeEventListener('click', onFormGroupClick);
});
}
});
});

// forms with tabs require some special treatment for errors. The problem
// is when the field with errors is included in a tab not currently visible.
// Browser shows this error "An invalid form control with name='...' is not focusable."
// So, the user clicks on Submit button, the form is not submitted and the error
// is not displayed. This JavaScript code ensures that each tab shows a badge with
// the number of errors in it.
formSubmitButton.addEventListener('click', function() {
const formTabPanes = entityForm.querySelectorAll('.tab-pane');
if (0 === formTabPanes.length) {
return;
}

let firstNavTabItemWithError = null;

formTabPanes.forEach(function (tabPane) {
let tabPaneNumErrors = 0;
tabPane.querySelectorAll(inputFieldsSelector).forEach(function (input) {
if (!input.validity.valid) {
tabPaneNumErrors++;
}
});

let navTabItem = entityForm.querySelector('.nav-item a[href="#' + tabPane.id + '"]');
let existingErrorBadge = navTabItem.querySelector('span.badge.badge-danger');
if (null !== existingErrorBadge) {
navTabItem.removeChild(existingErrorBadge);
}

if (tabPaneNumErrors > 0) {
let newErrorBadge = document.createElement('span');
newErrorBadge.classList.add('badge', 'badge-danger');
newErrorBadge.title = 'form.tab.error_badge_title';
newErrorBadge.textContent = tabPaneNumErrors;

navTabItem.appendChild(newErrorBadge);

if (null === firstNavTabItemWithError) {
firstNavTabItemWithError = navTabItem;
}
}
});

if (firstNavTabItemWithError) {
firstNavTabItemWithError.click();
}
});

// prevent multiple form submissions to avoid creating duplicated entities
entityForm.addEventListener('submit', function() {
// this timeout is needed to include the disabled button into the submitted form
setTimeout(function() {
const submitButtons = entityForm.querySelectorAll('[type="submit"]');
submitButtons.forEach(function(button) {
button.setAttribute('disabled', 'disabled');
});
}, 1);
}, false);
});
</script>

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

+ 1
- 1
ShopBundle/Resources/views/backend/form/ckfinder_widget.html.twig 查看文件

@@ -8,6 +8,6 @@
<i class="fa fa-fw fa-image"></i>
</div>
<input class="lc-ckfinder-field" type="hidden" name="{{ full_name }}" value="{{ value }}" />
<button type="button" id="{{ button_id }}" class="btn btn-secondary lc-ckfinder-button" {% for attrname, attrvalue in button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ button_text }}</button>
<button type="button" id="{{ button_id }}" class="btn btn-primary lc-ckfinder-button" {% for attrname, attrvalue in button_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ 'action.choiceFile'|trans({}, 'lcshop') }}</button>
</div>
{% endblock %}

+ 81
- 0
ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig 查看文件

@@ -56,3 +56,84 @@
</div>
</div>
{%- endblock form_row %}



{% block easyadmin_widget_groups %}
{% for group_name, group_config in easyadmin_form_groups|filter(group_config => not group_config.form_tab or group_config.form_tab == tab_name) %}
<div class="field-group col-{{ group_config.columns|default('12') }} {{ group_config.css_class|default('') }}">
<div class="card card-primary">
{% if group_config.label|default(false) or group_config.icon|default(false) or group_config.collapsible|default(false) %}
<div class="card-header {{ group_config.icon|default(false) ? 'with-icon' }}">
<h3 class="card-title">
{% if group_config.icon|default(false) %}
<i class="fa fa-fw fa-{{ group_config.icon }}"></i>
{% endif %}
{% set label = 'form.group.'~group_config.label %}
{{ label|trans(domain = _translation_domain)|raw }}
</h3>
</div>

{% if group_config.help|default(false) %}
<div class="legend-help">{{ group_config.help|trans(domain = _translation_domain)|raw }}</div>
{% endif %}
{% endif %}

<div class="card-body">
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.easyadmin.form_group == group_name) %}
{% if not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name %}
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}">
{{ form_row(field) }}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% else %}
{% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.easyadmin.form_tab or field.vars.easyadmin.form_tab == tab_name)) %}
<div class="col-{{ field.vars.easyadmin.field.columns|default('12') }} {{ field.vars.easyadmin.field.css_class|default('') }}">
{{ form_row(field) }}
</div>
{% endfor %}
{% endfor %}
{% endblock easyadmin_widget_groups %}

{% block form_label -%}
{% if label is not same as(false) -%}
{%- if compound is defined and compound -%}
{%- set element = 'legend' -%}
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%}
{%- else -%}
{%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%}
{%- endif -%}
{% if required -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
{%- endif -%}

{%- if label_format is not empty -%}
{% set label = label_format|replace({
'%name%': name,
'%id%': id,
}) %}
{%- else -%}
{% set label = 'form.field.'~easyadmin['entity']['name']~'.'~name %}
{% if label|trans({}, 'lcshop') == label %}
{% set label = 'form.field.default.'~name %}
{% endif %}
{%- endif -%}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ label|trans({}, 'lcshop') }}</{{ element|default('label') }}>

{%- endif -%}
{%- endblock form_label %}


{% block easyadmin_rest %}
{{- form_rest(form) -}}

<div class="card">
<div class="card-footer">
{{- block('item_actions') -}}
</div>
</div>
{% endblock easyadmin_rest %}

+ 1
- 1
ShopBundle/Resources/views/backend/order/edit.html.twig 查看文件

@@ -1,4 +1,4 @@
{% extends '@EasyAdmin/default/edit.html.twig' %}
{% extends '@LcShop/backend/default/edit.html.twig' %}

{% block entity_form %}
{% include '@LcShop/backend/order/form.html.twig' %}

+ 1
- 1
ShopBundle/Resources/views/backend/order/new.html.twig 查看文件

@@ -1,4 +1,4 @@
{% extends '@EasyAdmin/default/new.html.twig' %}
{% extends '@LcShop/backend/default/new.html.twig' %}

{% block entity_form %}


+ 1
- 2
ShopBundle/Resources/views/backend/productfamily/edit.html.twig 查看文件

@@ -1,5 +1,4 @@
{% extends '@EasyAdmin/default/edit.html.twig' %}

{% extends '@LcShop/backend/default/edit.html.twig' %}
{% block entity_form %}
{% include '@LcShop/backend/productfamily/form.html.twig' %}
{% endblock entity_form %}

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/new.html.twig 查看文件

@@ -1,4 +1,4 @@
{% extends '@EasyAdmin/default/new.html.twig' %}
{% extends '@LcShop/backend/default/new.html.twig' %}

{% block entity_form %}
{% include '@LcShop/backend/productfamily/form.html.twig' %}

+ 2
- 2
ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig 查看文件

@@ -10,7 +10,7 @@
{{ form_row(form.title, {"attr" : {"v-model" : "title"}}) }}
</div>
<div class="col-12">
{{ form_row(form.subTitle) }}
{{ form_row(form.subtitle) }}
</div>
<div class="col-12">
{{ form_row(form.image) }}
@@ -48,4 +48,4 @@
</div>
</fieldset>
</div>
</div>
</div>

Loading…
取消
儲存