add red * on required label
This commit is contained in:
parent
8713b401f9
commit
498c71081d
|
@ -67,7 +67,7 @@ class Navigation implements EntityInterface
|
|||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
public function setLabel(?string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
|
|
|
@ -704,6 +704,16 @@ form {
|
|||
}
|
||||
}
|
||||
|
||||
label.required::after {
|
||||
content: '*';
|
||||
margin-left: 3px;
|
||||
color: #b41215;
|
||||
}
|
||||
|
||||
.invalid-feedback {
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
.gjs-editor-cont {
|
||||
border-radius: 10px;
|
||||
overflow: hidden !important;
|
||||
|
|
|
@ -254,3 +254,51 @@
|
|||
{{- form_help(form) -}}
|
||||
</{{ element|default('div') }}>
|
||||
{%- endblock form_row %}
|
||||
|
||||
|
||||
{% 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}) -%}
|
||||
{%- 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 -%}
|
||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>
|
||||
{%- if translation_domain is same as(false) -%}
|
||||
{%- if label_html is same as(false) -%}
|
||||
{{- label -}}
|
||||
{%- else -%}
|
||||
{{- label|raw -}}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- if label_html is same as(false) -%}
|
||||
{{- label|trans(label_translation_parameters, translation_domain) -}}
|
||||
{%- else -%}
|
||||
{{- label|trans(label_translation_parameters, translation_domain)|raw -}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
</{{ element|default('label') }}>
|
||||
{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}
|
||||
{%- else -%}
|
||||
{%- if errors|length > 0 -%}
|
||||
<div id="{{ id }}_errors" class="mb-2">
|
||||
{{- form_errors(form) -}}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endblock form_label %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue