diff --git a/VERSIONS_WIP/156526 b/VERSIONS_WIP/156526 new file mode 100644 index 0000000000000000000000000000000000000000..f54c92d98b46f9f055db1ad18dc663504f3548d9 --- /dev/null +++ b/VERSIONS_WIP/156526 @@ -0,0 +1 @@ + - fonctionnalité #156526 : Magasin de thèmes : amélioration de l'adaptabilité de l'affichage média et description à droite. \ No newline at end of file diff --git a/library/templates/Herisson/Library/Settings.php b/library/templates/Herisson/Library/Settings.php index 769d56401c360484b83be7bd197cf4c7f05eeca8..9eb49102fa9b3fc16703b28354a5be8796a958f6 100644 --- a/library/templates/Herisson/Library/Settings.php +++ b/library/templates/Herisson/Library/Settings.php @@ -116,9 +116,6 @@ class Herisson_Library_Settings extends Intonation_Library_Settings { $hydrating_mapping['div class card_article'] = 'col-12 mb-0 px-0'; $hydrating_mapping['div class card_action'] = 'col-12 col-md-5 col-lg-12 p-0 mx-1 my-1'; - $hydrating_mapping['div class cardify_horizontal_img'] = 'col-12 col-md-4 col-lg-3 px-0 pl-md-0 pr-md-3'; - $hydrating_mapping['div class cardify_horizontal_content'] = 'col-12 col-md-8 col-lg-6 px-0 py-3 py-md-0'; - $hydrating_mapping['div class cardify_horizontal_actions'] = 'col-12 col-md-12 col-lg-3 px-0 pl-lg-3 pr-lg-0'; $hydrating_mapping['div class card-header'] = 'px-0 py-0 no_background'; $hydrating_mapping['div class widget-header'] = 'card-header no_background'; diff --git a/library/templates/Intonation/Library/Settings.php b/library/templates/Intonation/Library/Settings.php index 8148cd73f2df58966a986d726dc700a9073d5cce..161225ec10ca8682e1e0b080607c699da604cb18 100644 --- a/library/templates/Intonation/Library/Settings.php +++ b/library/templates/Intonation/Library/Settings.php @@ -141,7 +141,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'a class badge' => '', 'a class active' => '', 'a class card-link' => '', - 'div class card_action' => 'col col-sm-12 p-1 m-1', + 'div class card_action' => 'col col-lg-12 p-0 mx-1 my-1', 'div class collection_action' => 'col mr-3', 'div class alone_in_the_list' => 'col-3', 'a class list-group-item' => '', @@ -244,9 +244,9 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'div class rich_content_actions' => 'col-12 px-0 mt-3 record_summary', 'div class rich_content_row_actions' => 'col col-lg-12 pt-1 mt-1 mr-1 pr-1 w-s_nowrap', - 'div class cardify_horizontal_img' => 'col-12 col-sm-3 px-3 px-sm-0', - 'div class cardify_horizontal_content' => 'col-12 col-sm-6 px-3', - 'div class cardify_horizontal_actions' => 'col-12 col-sm-3 px-3 px-sm-0', + 'div class cardify_horizontal_img' => 'col-12 col-md-4 col-lg-3 px-0 pl-md-0 pr-md-3', + 'div class cardify_horizontal_content' => 'col-12 col-md-8 col-lg-6 px-0 py-3 py-md-0', + 'div class cardify_horizontal_actions' => 'col-12 col-md-12 col-lg-3 px-0 pl-lg-3 pr-lg-0', 'div class loading_icon' => 'spinner-border', 'div class review_author' => 'col-12 col-lg-6 text-md-left', diff --git a/tests/scenarios/Templates/ChiliAccordionTest.php b/tests/scenarios/Templates/ChiliAccordionTest.php index 7e793c1342ec562a8d336e85a85de0c5153b78a3..e6f417856ee342d163b1ec847a5cb6eadc2e8cc5 100644 --- a/tests/scenarios/Templates/ChiliAccordionTest.php +++ b/tests/scenarios/Templates/ChiliAccordionTest.php @@ -112,18 +112,18 @@ class ChiliAccordionWidgetTest extends AbstractControllerTestCase { /** @test */ public function cardifyHorizontalImgShouldBeHydratedWithCol12ColSm3Px3() { - $this->assertXPath('//div[@class = "cardify_horizontal_img col-12 col-sm-3 px-3 px-sm-0"]'); + $this->assertXPath('//div[@class = "cardify_horizontal_img col-12 col-md-4 col-lg-3 px-0 pl-md-0 pr-md-3"]'); } /** @test */ public function cardifyHorizontalContentShouldBeHydratedWithCol12ColSm6Px3() { - $this->assertXPath('//div[@class = "cardify_horizontal_content col-12 col-sm-6 px-3"]'); + $this->assertXPath('//div[@class = "cardify_horizontal_content col-12 col-md-8 col-lg-6 px-0 py-3 py-md-0"]'); } /** @test */ public function cardifyHorizontalActionsShouldBeHydratedWithCol12ColSm3Px3() { - $this->assertXPath('//div[@class = "cardify_horizontal_actions col-12 col-sm-3 px-3 px-sm-0"]'); + $this->assertXPath('//div[@class = "cardify_horizontal_actions col-12 col-md-12 col-lg-3 px-0 pl-lg-3 pr-lg-0"]'); } } diff --git a/tests/scenarios/Templates/ChiliSearchTest.php b/tests/scenarios/Templates/ChiliSearchTest.php index 1690a112eac1d4057559febe2bb111ee3dedbb18..e4699e3908006c7e1a5c74c6126ce853d7e9f0ca 100644 --- a/tests/scenarios/Templates/ChiliSearchTest.php +++ b/tests/scenarios/Templates/ChiliSearchTest.php @@ -76,21 +76,21 @@ class ChiliSearchHoldLinkTest extends AbstractControllerTestCase { /** @test */ public function linkToReserverRecord2ShouldBePickupLocationItem1() { - $this->assertXPathContentContains('//div[@class="card_action record_hold_link col col-sm-12 p-1 m-1"]//a[@href = "/recherche/reservation-pickup-ajax/id_notice/2/id_int_bib/1/id_bib/1/copy_id/1"][contains(@class, "record_hold_link")]', + $this->assertXPathContentContains('//div[@class="card_action record_hold_link col col-lg-12 p-0 mx-1 my-1"]//a[@href = "/recherche/reservation-pickup-ajax/id_notice/2/id_int_bib/1/id_bib/1/copy_id/1"][contains(@class, "record_hold_link")]', 'Réserver'); } /** @test */ public function viewMoreRecordActionsShouldBeInDivViewMoreRecordActions() { - $this->assertXPathContentContains('//div[@class="card_action view_more_record_actions btn col col-sm-12 p-1 m-1"]//button[@data-toggle="dropdown"]', + $this->assertXPathContentContains('//div[@class="card_action view_more_record_actions btn col col-lg-12 p-0 mx-1 my-1"]//button[@data-toggle="dropdown"]', 'Plus'); } /** @test */ public function readRecordShouldBeInADivReadDocument() { - $this->assertXPathContentContains('//div[@class="card_action read_document col col-sm-12 p-1 m-1"]//a[contains(@href,"recherche/viewnotice")]', + $this->assertXPathContentContains('//div[@class="card_action read_document col col-lg-12 p-0 mx-1 my-1"]//a[contains(@href,"recherche/viewnotice")]', 'Voir'); } diff --git a/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php b/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php index d991a9e316f68a7b9cdc6a01d7edc48508646653..86c7172ee1ee5b3abd225e2eb9b991d34088e384 100644 --- a/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php +++ b/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php @@ -488,7 +488,7 @@ class TemplatesAbonneSelectionsAsAdminTest extends Admin_AbstractControllerTestC /** @test */ public function listeDesDocumentsShouldNotBeDisplayed() { - $this->assertNotXPathContentContains('//main//div[contains(@class, "cardify_horizontal_content")]//div', 'Liste des documents'); + $this->assertNotXPathContentContains('//body', 'Liste des documents'); } } diff --git a/tests/scenarios/Templates/TemplatesAbonneTest.php b/tests/scenarios/Templates/TemplatesAbonneTest.php index ed7b7f84f1e30dd273eac49e1ced0a8bd32803c5..fcb66e4168d957250ec9027c1d845b95622fbb79 100644 --- a/tests/scenarios/Templates/TemplatesAbonneTest.php +++ b/tests/scenarios/Templates/TemplatesAbonneTest.php @@ -458,7 +458,7 @@ class TemplatesAbonnePaginatedReviewsPage2Test extends TemplatesAbonnePaginatedC /** @test */ public function defaultLayoutShouldBeCardHorizontal() { - $this->assertXPath('//div[@class="list-group bg-transparent no_border"]//div[@class="cardify_horizontal_img col-12 col-sm-3 px-3 px-sm-0"]'); + $this->assertXPath('//div[@class="list-group bg-transparent no_border"]//div[@class="cardify_horizontal_img col-12 col-md-4 col-lg-3 px-0 pl-md-0 pr-md-3"]'); } } @@ -494,14 +494,14 @@ class TemplatesAbonnePaginatedLoansPage1AndSearchTest extends TemplatesAbonnePag /** @test */ public function linkToReturnPnbLoanShouldBePresent() { - $this->assertXPathContentContains('//div[@class="card_action col col-sm-12 p-1 m-1"]/a[@href= "/bib-numerique/return-pnb-loan/page/1/search/house/size/10/id/ec2c17cefacacad7f25f875ae87956c1/loan_id/666_3"]', + $this->assertXPathContentContains('//div[@class="card_action col col-lg-12 p-0 mx-1 my-1"]/a[@href= "/bib-numerique/return-pnb-loan/page/1/search/house/size/10/id/ec2c17cefacacad7f25f875ae87956c1/loan_id/666_3"]', utf8_encode('Retour anticipé')); } /** @test */ public function linkToExtendPnbLoanShouldBePresent() { - $this->assertXPathContentContains('//div[@class="card_action col col-sm-12 p-1 m-1"]/a[contains(@href, "/bib-numerique/extends-pnb-loan/page/1/search/house/size/10/id/ec2c17cefacacad7f25f875ae87956c1/loan_id/666_3")]', + $this->assertXPathContentContains('//div[@class="card_action col col-lg-12 p-0 mx-1 my-1"]/a[contains(@href, "/bib-numerique/extends-pnb-loan/page/1/search/house/size/10/id/ec2c17cefacacad7f25f875ae87956c1/loan_id/666_3")]', 'Prolonger'); } } diff --git a/tests/scenarios/Templates/TemplatesRenderingHorizontalTest.php b/tests/scenarios/Templates/TemplatesRenderingHorizontalTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e72402b56783b59fd78c35a5fe6ea4123b9df048 --- /dev/null +++ b/tests/scenarios/Templates/TemplatesRenderingHorizontalTest.php @@ -0,0 +1,107 @@ +<?php +/** + * Copyright (c) 2012-2022, 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 + */ + + +abstract class TemplatesRenderingHorizontalTestCase extends AbstractControllerTestCase { + + protected $_template_name = ''; + + + public function setUp() { + parent::setUp(); + + $profile = $this->_buildTemplateProfil(['id' => '878979', + 'template' => $this->_template_name]); + + $profile_patcher = (new Class_Template_ProfilePatcher(null)) + ->setProfile($profile); + + $profile_patcher + ->addWidget(Intonation_Library_Widget_Carousel_Newsletter_Definition::CODE, + Class_Profil::DIV_MAIN, + ['rendering' => 'card-horizontal', + 'layout' => 'list', + 'size' => 1, + 'id_items' => '789']); + + $this->fixture(Class_Newsletter::class, + ['id' => 789, + 'titre' => 'Comment améliorer le magasin de thèmes en quelques commits ?', + 'mail_subject' => 'Comment améliorer le magasin de thèmes en quelques commits ?', + 'contenu' => 'Un bon pairing à Annecy']); + + $this->dispatch('/index'); + } + + + /** @test */ + public function divClassCardifyHorizontalImgShouldHaveClassCol12ColMd4ColLg3() { + $this->assertXPath('//div[@class="cardify_horizontal_img col-12 col-md-4 col-lg-3 px-0 pl-md-0 pr-md-3"]'); + } + + + /** @test */ + public function divClassCardifyHorizontalContentShouldHaveClassCol12ColMd8ColLg6() { + $this->assertXPath('//div[@class="cardify_horizontal_content col-12 col-md-8 col-lg-6 px-0 py-3 py-md-0"]'); + } + + + /** @test */ + public function divClassCardifyHorizontalActionsShouldHaveClassCol12ColMd12ColLg3() { + $this->assertXPath('//div[@class="cardify_horizontal_actions col-12 col-md-12 col-lg-3 px-0 pl-lg-3 pr-lg-0"]'); + } + + + /** @test */ + public function divClassCardActionShouldHaveClassColColLg12() { + $this->assertXPath('//div[@class="card_action col col-lg-12 p-0 mx-1 my-1"]'); + } +} + + + + +class TemplatesRenderingHorizontalInIntonationTest extends TemplatesRenderingHorizontalTestCase { + + protected $_template_name = 'INTONATION'; +} + + + + +class TemplatesRenderingHorizontalInHerissonTest extends TemplatesRenderingHorizontalTestCase { + + protected $_template_name = 'HERISSON'; + + + /** @test */ + public function divClassCardActionShouldHaveClassColColLg12() { + $this->assertXPath('//div[@class="card_action col-12 col-md-5 col-lg-12 p-0 mx-1 my-1"]'); + } +} + + + + +class TemplatesRenderingHorizontalInChiliTest extends TemplatesRenderingHorizontalTestCase { + + protected $_template_name = 'CHILI'; +} diff --git a/tests/scenarios/Templates/TemplatesSearchSettingsTest.php b/tests/scenarios/Templates/TemplatesSearchSettingsTest.php index d3f28d1f4611ff58ea793b1908408361b92f98e2..cadeff70c1d79043683ff18becd03b4c87780ab9 100644 --- a/tests/scenarios/Templates/TemplatesSearchSettingsTest.php +++ b/tests/scenarios/Templates/TemplatesSearchSettingsTest.php @@ -78,7 +78,7 @@ class TemplatesSearchSettingsResultWithSearchTermHighLightedTest /** @test */ public function cardLinkReadDocumentTitleShouldNotContainsHTML() { - $this->assertXPath('//div[@class="card_action read_document col col-sm-12 p-1 m-1"]//a[@href="/recherche/viewnotice/id/1/expressionRecherche/ero+Odiar"][@title="Voir le document Un héros très discret"]'); + $this->assertXPath('//div[@class="card_action read_document col col-lg-12 p-0 mx-1 my-1"]//a[@href="/recherche/viewnotice/id/1/expressionRecherche/ero+Odiar"][@title="Voir le document Un héros très discret"]'); } } diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index 9108e566b7650f39640d6a1d20415b5d29238cc1..44703a03020b7d2102ddeee6000b33d5afe00489 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -21,8 +21,8 @@ require_once 'TemplatesTest.php'; -abstract class TemplatesSearchWithSortParameterInWidgetTestCase extends Admin_AbstractControllerTestCase { - protected $_storm_default_to_volatile = true; +abstract class TemplatesSearchWithSortParameterInWidgetTestCase + extends AbstractControllerTestCase { public function setUp() { parent::setUp(); @@ -1177,7 +1177,7 @@ class TemplatesSearchResultWithSearchTermHighLightedTest extends AbstractControl /** @test */ public function cardLinkReadDocumentTitleShouldNotContainsHTML() { - $this->assertXPathContentContains('//div[@class="card_action read_document col col-sm-12 p-1 m-1"]//a[@href="/recherche/viewnotice/id/1/expressionRecherche/ero+Odiar"][@title="Voir le document Un héros très discret"]//span[@class="sr-only"]', + $this->assertXPathContentContains('//div[@class="card_action read_document col col-lg-12 p-0 mx-1 my-1"]//a[@href="/recherche/viewnotice/id/1/expressionRecherche/ero+Odiar"][@title="Voir le document Un héros très discret"]//span[@class="sr-only"]', ' le document Un héros très discret de Heros Audiard de type '); }