소스 검색

hide label ticketmessage

ideas
Charly 3 년 전
부모
커밋
0088e6df2f
5개의 변경된 파일51개의 추가작업 그리고 4개의 파일을 삭제
  1. +1
    -0
      Form/Ticket/TicketFormType.php
  2. +6
    -1
      Resources/assets/app/adminlte/form/form.scss
  3. +3
    -1
      Resources/translations/admin.fr.yaml
  4. +2
    -2
      Resources/views/admin/ticket/new.html.twig
  5. +39
    -0
      Resources/views/adminlte/crud/ticket/form_theme.html.twig

+ 1
- 0
Form/Ticket/TicketFormType.php 파일 보기

@@ -70,6 +70,7 @@ class TicketFormType extends AbstractType
[
'entry_type' => TicketMessageType::class,
'allow_add' => false,
'label_attr' => ['class' => 'label-ticket'],
]
);


+ 6
- 1
Resources/assets/app/adminlte/form/form.scss 파일 보기

@@ -1,4 +1,3 @@

.form-sent {
.form-control:invalid {
border-color: #dc3545;
@@ -64,5 +63,11 @@
}
}

.label-ticket {
display: none;
}

#ticket_form_ticketMessages legend {
display: none;
}


+ 3
- 1
Resources/translations/admin.fr.yaml 파일 보기

@@ -79,7 +79,9 @@ entity:
open: Ouvert
being-processed: En attente
closed: Fermé

TicketMessage:
fields:
message: Votre réponse
default:
fields:
id: Id

+ 2
- 2
Resources/views/admin/ticket/new.html.twig 파일 보기

@@ -1,7 +1,7 @@
{% extends '@LcSov/adminlte/layout.html.twig' %}

{% block content_title %}
{# {{ 'ticket.profile'|lc_trans_admin_title }}#}
{# {{ 'ticket.profile'|lc_trans_admin_title }} #}
Créer un ticket
{% endblock %}

@@ -10,7 +10,7 @@
{% embed '@LcSov/adminlte/embed/card.html.twig' %}
{% block header_wrapper %}{% endblock %}
{% block body %}
{% form_theme form '@LcSov/adminlte/crud/form_theme.html.twig' %}
{% form_theme form '@LcSov/adminlte/crud/ticket/form_theme.html.twig' %}
{{ form(form) }}
{% endblock %}
{% block footer_wrapper %}{% endblock %}

+ 39
- 0
Resources/views/adminlte/crud/ticket/form_theme.html.twig 파일 보기

@@ -0,0 +1,39 @@
{% use '@LcSov/adminlte/crud/form_theme.html.twig' %}

{% block form_label %}
{# <div class="some-custom-class"> #}
{# {{ parent() }} #}
{# </div> #}

{% if label is same as(false) -%}
<label>{# the empty <label> is needed to not break the form design #}</label>
{%- else -%}
{%- 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 is empty -%}
{%- if label_format is not empty -%}
{% set label = label_format|replace({
'%name%': name,
'%id%': id,
}) %}
{%- else -%}
{# {% set label = name|humanize %} #}
{%- endif -%}
{%- endif -%}

{% set entityNameOrObject = form.parent.vars.data %}
{% if not entityNameOrObject and form.parent.vars.errors.form.config.dataClass is defined %}
{% set entityNameOrObject = form.parent.vars.errors.form.config.dataClass %}
{% endif %}
{#{{ dump() }}#}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ (label is not empty and '.' in label) ? label|trans({}, 'admin') : name|lc_trans_admin_field(entityNameOrObject) }}</{{ element|default('label') }}>

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

Loading…
취소
저장