Browse Source

hide label ticketmessage

ideas
Charly 3 years ago
parent
commit
0088e6df2f
5 changed files with 51 additions and 4 deletions
  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 View File

[ [
'entry_type' => TicketMessageType::class, 'entry_type' => TicketMessageType::class,
'allow_add' => false, 'allow_add' => false,
'label_attr' => ['class' => 'label-ticket'],
] ]
); );



+ 6
- 1
Resources/assets/app/adminlte/form/form.scss View File


.form-sent { .form-sent {
.form-control:invalid { .form-control:invalid {
border-color: #dc3545; border-color: #dc3545;
} }
} }


.label-ticket {
display: none;
}


#ticket_form_ticketMessages legend {
display: none;
}



+ 3
- 1
Resources/translations/admin.fr.yaml View File

open: Ouvert open: Ouvert
being-processed: En attente being-processed: En attente
closed: Fermé closed: Fermé

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

+ 2
- 2
Resources/views/admin/ticket/new.html.twig View File

{% extends '@LcSov/adminlte/layout.html.twig' %} {% extends '@LcSov/adminlte/layout.html.twig' %}


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


{% embed '@LcSov/adminlte/embed/card.html.twig' %} {% embed '@LcSov/adminlte/embed/card.html.twig' %}
{% block header_wrapper %}{% endblock %} {% block header_wrapper %}{% endblock %}
{% block body %} {% 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) }} {{ form(form) }}
{% endblock %} {% endblock %}
{% block footer_wrapper %}{% endblock %} {% block footer_wrapper %}{% endblock %}

+ 39
- 0
Resources/views/adminlte/crud/ticket/form_theme.html.twig View File

{% 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…
Cancel
Save