Procházet zdrojové kódy

hide label ticketmessage

ideas
Charly před 3 roky
rodič
revize
0088e6df2f
5 změnil soubory, kde provedl 51 přidání a 4 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 %}

Načítá se…
Zrušit
Uložit