Rename help id (snake_case)

This commit is contained in:
Mathieu Piot 2018-03-01 09:42:27 +01:00 committed by Mathieu Piot
parent 77fa3178bd
commit f948147e38
8 changed files with 10 additions and 10 deletions

View File

@ -155,6 +155,6 @@
{% block form_help -%}
{% if help is not empty %}
<span id="{{ id }}HelpBlock" class="help-block">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</span>
<span id="{{ id }}_help" class="help-block">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</span>
{% endif %}
{%- endblock form_help %}

View File

@ -282,6 +282,6 @@
{% block form_help -%}
{% if help is not empty %}
<small id="{{ id }}HelpBlock" class="form-text text-muted">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</small>
<small id="{{ id }}_help" class="form-text text-muted">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</small>
{% endif %}
{%- endblock form_help %}

View File

@ -291,7 +291,7 @@
{% block form_help -%}
{% if help is not empty %}
<p id="{{ id }}HelpBlock" class="help-text">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</p>
<p id="{{ id }}_help" class="help-text">{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}</p>
{% endif %}
{%- endblock form_help %}
@ -397,7 +397,7 @@
id="{{ id }}" name="{{ full_name }}"
{%- if disabled %} disabled="disabled"{% endif -%}
{%- if required %} required="required"{% endif -%}
{%- if helpBlockDisplayed is defined and helpBlockDisplayed and help is not empty %} aria-describedby="{{ id }}HelpBlock"{% endif -%}
{%- if helpBlockDisplayed is defined and helpBlockDisplayed is same as(true) and help is not empty %} aria-describedby="{{ id }}_help"{% endif -%}
{{ block('attributes') }}
{%- endblock widget_attributes -%}

View File

@ -1,3 +1,3 @@
<?php if (!empty($help)): ?>
<p id="<?php echo $view->escape($id) ?>HelpBlock" class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help) ?></p>
<p id="<?php echo $view->escape($id) ?>_help" class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help) ?></p>
<?php endif ?>

View File

@ -1,4 +1,4 @@
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
<?php if ($required): ?> required="required"<?php endif ?>
<?php if (isset($helpBlockDisplayed) && $helpBlockDisplayed && !empty($help)): ?> aria-describedby="<?php echo $view->escape($id) ?>HelpBlock"<?php endif ?>
<?php if (isset($helpBlockDisplayed) && true === $helpBlockDisplayed && !empty($help)): ?> aria-describedby="<?php echo $view->escape($id) ?>_help"<?php endif ?>
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?>

View File

@ -112,7 +112,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
$this->assertMatchesXpath($html,
'/span
[@id="nameHelpBlock"]
[@id="name_help"]
[@class="help-block"]
[.="[trans]Help text test![/trans]"]
'

View File

@ -161,7 +161,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
$this->assertMatchesXpath($html,
'/small
[@id="nameHelpBlock"]
[@id="name_help"]
[@class="form-text text-muted"]
[.="[trans]Help text test![/trans]"]
'

View File

@ -420,7 +420,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
$this->assertMatchesXpath($html,
'/p
[@id="nameHelpBlock"]
[@id="name_help"]
[@class="help-text"]
[.="[trans]Help text test![/trans]"]
'
@ -446,7 +446,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
$this->assertMatchesXpath($html,
'/input
[@aria-describedby="nameHelpBlock"]
[@aria-describedby="name_help"]
'
);
}