Skip to content
Snippets Groups Projects
Commit 2b111998 authored by Laurent's avatar Laurent
Browse files

hotline #52410 form elements without label should be wrap with td colspan 2

parent 8edcfb3e
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!2061Master,!1966Hotline#52410 capv38 bug modif boites dans le backoffice
Pipeline #43 failed with stage
in 7 minutes
......@@ -101,9 +101,15 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper {
switch ($name) {
case 'label':
$input_tag_params = ['tag' => 'td',
'class' => 'gauche'];
if ( !trim($element->getLabel()) )
$input_tag_params['colspan'] = 2;
$newDecorators[] = [['input_data' => 'HtmlTag'],
['tag' => 'td',
'class' => 'gauche']];
$input_tag_params];
$decorator->setOptions([]);
$decorator->setOption('wrap', ['tag' => 'td',
'attribs' => ['class' => 'droite']]);
......
......@@ -52,6 +52,18 @@ class Admin_AccueilControllerCmsWithDefaultDiaporamaNavigationTest extends Admin
}
/** @test */
public function inputIdItemsTDShouldHaveColspanTwo() {
$this->assertXPath('//td[@colspan="2"]//input[@name="id_items"]');
}
/** @test */
public function inputTitreTDShouldNotHaveColspan() {
$this->assertXPath('//td[not(@colspan)]//input[@name="titre"]');
}
/** @test */
public function inputIdItemsShouldContains1and2() {
$this->assertXPath('//form//input[@name="id_items"][@value="1-2"]', $this->_response->getBody());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment