Skip to content
Snippets Groups Projects
Commit 0f0d1f3a authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#125267_gpsea_p3_page_ressources_responsive_voir_aussi' into 'hotline'

hotline MT #125267 improve responsive behavior of multiple carousel plus in chili

See merge request !3838
parents 7bf5e20a cd69f7d2
Branches
Tags
2 merge requests!3840Hotline,!3838hotline MT #125267 improve responsive behavior of multiple carousel plus in chili
Pipeline #12335 passed with stage
in 56 minutes and 47 seconds
- ticket #125267 : Magasin de thèmes : amélioration de l'adaptabilité du carousel à 5 colonnes dans le thème Chili.
\ No newline at end of file
......@@ -90,6 +90,9 @@ class Chili_Template extends Intonation_Template {
if (Intonation_Library_Widget_Carousel_Definition::WALL == $layout)
return Chili_View_RenderWall::class;
if (Intonation_Library_Widget_Carousel_Definition::MULTIPLE_CAROUSEL_PLUS == $layout)
return Chili_View_RenderMultipleCarousel::class;
}
......
<?php
/**
* Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Chili_View_RenderMultipleCarousel extends Intonation_View_RenderMultipleCarousel {
protected function _renderCarousel($collection, $callback) {
$md_helper = (new Intonation_View_RenderMultipleCarousel)
->setView($this->view);
$html = [
$this->_div(['class' => 'col-12 d-none d-lg-block'], parent::_renderCarousel($collection, $callback)),
$this->_div(['class' => 'col-12 d-none d-md-block d-lg-none'],
$md_helper->renderMultipleCarousel($collection,
$callback,
3)),
$this->_div(['class' => 'col-12 d-block d-md-none'], $this->view->renderCarousel($collection, $callback)),
];
return $this->view->grid($html, ['class' => 'responsive_multiple_carousel']);
}
}
<?php
/**
* Copyright (c) 2012-2021, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ChiliMultipleCarouselResponsiveTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$profile =
$this->_buildTemplateProfil(['id' => 23,
'template' => 'CHILI']);
$profile_patcher = (new Class_Template_ProfilePatcher(null))
->setProfile($profile);
$profile_patcher
->addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE,
Class_Profil::DIV_MAIN,
['rendering' => 'card-description',
'libraries' => '1;2;3;4;5;6',
'layout' => 'multiple_carousel_plus',
'size' => 10]);
$this->fixture('Class_Bib',
['id' => 1,
'libelle' => 'Esertine']);
$this->fixture('Class_Bib',
['id' => 2,
'libelle' => 'Polliet']);
$this->fixture('Class_Bib',
['id' => 3,
'libelle' => 'Yverdon']);
$this->fixture('Class_Bib',
['id' => 4,
'libelle' => 'Echallens']);
$this->fixture('Class_Bib',
['id' => 5,
'libelle' => 'Sainte Croix']);
$this->fixture('Class_Bib',
['id' => 6,
'libelle' => 'Botten']);
$this->dispatch('/opac/widget/render/widget_id/1/profile_id/23');
}
/** @test */
public function widgetShouldBeHtml5Valid() {
$this->assertHTML5();
}
/** @test */
public function sainteCroixShouldBeInMainPageForLg() {
$this->assertXPathContentContains('//div[contains(@class, "col-12 d-none d-lg-block")]//div[contains(@class, "multiple_carousel")]//div[@class="carousel-item active"]',
'Sainte Croix');
}
/** @test */
public function echallensShouldBeInMdActive() {
$this->assertXPathContentContains('//div[contains(@class, "col-12 d-none d-md-block d-lg-none")]//div[contains(@class, "multiple_carousel")]//div[@class="carousel-item active"]',
'Echallens');
}
/** @test */
public function bottenShouldBeInSmActive() {
$this->assertXPathContentContains('//div[contains(@class, "col-12 d-block d-md-none")]//div[contains(@class, "carousel")]//div[@class="carousel-item active"]',
'Botten', $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