diff --git a/VERSIONS_WIP/156518 b/VERSIONS_WIP/156518 new file mode 100644 index 0000000000000000000000000000000000000000..8c66636927bf4b74717e3a5f040feef85f2bfc37 --- /dev/null +++ b/VERSIONS_WIP/156518 @@ -0,0 +1,6 @@ + - fonctionnalité #156518 : Thème Hérisson : Correction de l'affichage des alertes dans la + boite de connexion. + Correction de l'affichage du composant de sélection de + bibliothèques dans le compte lecteur. + Correction de l'affichage du badge de la date de fin + d'abonnement du compte lecteur. \ No newline at end of file diff --git a/library/templates/Herisson/Assets/css/herisson.css b/library/templates/Herisson/Assets/css/herisson.css index 9b5d0812a94922ea2a7f3b25f420416cdefbae48..c9ef5c34e129ecb67ecf9ec422b5e1d60a11fb7d 100644 --- a/library/templates/Herisson/Assets/css/herisson.css +++ b/library/templates/Herisson/Assets/css/herisson.css @@ -343,6 +343,9 @@ footer .boite.image .image_widget.img-fluid { display: none; } +.wrapper_user_settings form img { + display: initial; +} /*vignette html*/ .card-img-overlay:not(.record_no_thumbnail) { @@ -606,12 +609,11 @@ footer .boite.image .image_widget.img-fluid { right: 0 !important; left: auto !important; } -.login .dropdown-menu.show .list-unstyled { - display: flex; -} + .login .dropdown-menu.show .list-unstyled li { margin: auto; } + .login .dropdown-menu.show .form-group label { text-align: center; } diff --git a/library/templates/Intonation/Library/Settings.php b/library/templates/Intonation/Library/Settings.php index 4d4163b5adb41f4641d4f99245ee9004a1913794..8148cd73f2df58966a986d726dc700a9073d5cce 100644 --- a/library/templates/Intonation/Library/Settings.php +++ b/library/templates/Intonation/Library/Settings.php @@ -340,7 +340,10 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'div class library_details_custom_field' => 'col-12', 'div class record_serials_articles' => 'articles', 'div class record_serials_articles_title' => 'col-12 d-none', - 'div class record_serials_articles_list' => 'col-12 ' + 'div class record_serials_articles_list' => 'col-12 ', + 'span class danger' => 'badge-danger text-light', + 'span class success' => 'badge-success text-light', + 'span class warning' => 'badge-warning text-dark', ], 'icons_map_doc_types' => [], diff --git a/library/templates/Intonation/View/RenderForm.php b/library/templates/Intonation/View/RenderForm.php index a55409be20dd86233ce71990724d6b76acbef666..a809ba251a912a07064504125a47b2653a8db1ea 100644 --- a/library/templates/Intonation/View/RenderForm.php +++ b/library/templates/Intonation/View/RenderForm.php @@ -37,7 +37,7 @@ class Intonation_View_RenderForm extends ZendAfi_View_Helper_RenderForm { protected function _getDefaultFormClass() { - return 'form row'; + return 'form default_form row'; } @@ -65,9 +65,13 @@ class Intonation_View_RenderForm extends ZendAfi_View_Helper_RenderForm { ['tag' => 'div', 'class' => $this->_getLabelHtmlTagClass()]]; + $class = $this->_getWrapperElementClass($element); + $newDecorators[] = ['HtmlTagWrapper', ['tag' => 'div', - 'class' => 'form-group container-fluid no-gutters py-1 ' . $this->_getWrapperElementClass($element)]]; + 'class' => 'form-group container-fluid no-gutters py-1 ' + . $class + . ' default_form_' . $class]]; return $newDecorators; } diff --git a/library/templates/Intonation/View/RenderInlineForm.php b/library/templates/Intonation/View/RenderInlineForm.php index 552ce991058c2d1e5289a7b269c1f0cc0d18b6a4..25e934887c3cc432b423c0bbb0f998fc1f537dce 100644 --- a/library/templates/Intonation/View/RenderInlineForm.php +++ b/library/templates/Intonation/View/RenderInlineForm.php @@ -23,7 +23,7 @@ class Intonation_View_RenderInlineForm extends Intonation_View_RenderForm { public function renderInlineForm($form, $buttons =[]) { - $form->setAttrib('class', 'row no-gutters'); + $form->setAttrib('class', 'inline_form row no-gutters'); $html = parent::renderForm($form, $buttons); return $html; } @@ -55,9 +55,14 @@ class Intonation_View_RenderInlineForm extends Intonation_View_RenderForm { $newDecorators[] = ['HtmlTag', ['tag' => 'div', 'class' => 'col-12 col-sm']]; + $class = $this->_getWrapperElementClass($element); + $newDecorators[] = ['HtmlTagWrapper', ['tag' => 'div', - 'class' => 'col row form-group no-gutters ' . $this->_getWrapperElementClass($element)]]; + 'class' => 'col row form-group no-gutters ' + . $class + . ' inline_form_' + . $class]]; return $newDecorators; diff --git a/tests/scenarios/Templates/ChiliTest.php b/tests/scenarios/Templates/ChiliTest.php index 5021b7b7319148182d9b5f67ceec085845ff7b1e..8e1eeff9e7dc0941cee19b2ccfe5fcc8f5d1ee8c 100644 --- a/tests/scenarios/Templates/ChiliTest.php +++ b/tests/scenarios/Templates/ChiliTest.php @@ -842,7 +842,7 @@ class ChiliTemplateNotLoggedTest extends ChiliTemplateTestCase { /** @test */ public function inputUsernameShouldBeHydratedWithOrder3() { - $this->assertXPath('//form/div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_login_username col-12 order-1"]//input[@id="username"][@class= "zendafi_form_login_username form-control form-control-sm"]'); + $this->assertXPath('//form/div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_login_username default_form_wrapper_zendafi_form_login_username col-12 order-1"]//input[@id="username"][@class= "zendafi_form_login_username form-control form-control-sm"]'); } diff --git a/tests/scenarios/Templates/MuscleTemplateTest.php b/tests/scenarios/Templates/MuscleTemplateTest.php index 9c45d17b93a338bc22fde8f16b40e3012d30f131..a48f84023c189a0120f6affcfe15890dd0fdf597 100644 --- a/tests/scenarios/Templates/MuscleTemplateTest.php +++ b/tests/scenarios/Templates/MuscleTemplateTest.php @@ -588,7 +588,7 @@ class MuscleTemplateNotLoggedTest extends MuscleTemplateTestCase { /** @test */ public function inputUsernameShouldBeHydratedWithOrder3() { - $this->assertXPath('//form/div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_login_username col-12 order-1"]//input[@id="username"][@class= "zendafi_form_login_username form-control form-control-sm"]'); + $this->assertXPath('//form/div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_login_username default_form_wrapper_zendafi_form_login_username col-12 order-1"]//input[@id="username"][@class= "zendafi_form_login_username form-control form-control-sm"]'); } diff --git a/tests/scenarios/Templates/TemplatesAbonneTest.php b/tests/scenarios/Templates/TemplatesAbonneTest.php index 2e2bf5eda565ca1e08fc61361e0fac6c189dac56..ed7b7f84f1e30dd273eac49e1ced0a8bd32803c5 100644 --- a/tests/scenarios/Templates/TemplatesAbonneTest.php +++ b/tests/scenarios/Templates/TemplatesAbonneTest.php @@ -1749,7 +1749,7 @@ class TemplatesAbonneJumbotronLoansTest extends TemplatesIntonationAccountTestCa /** @test */ public function abonneHasLoanShouldRenderScript() { $this->dispatch('/abonne/has-loan/id_profil/72'); - $this->assertXPath('//span[@class="success"]'); + $this->assertXPath('//span[@class="success badge-success text-light"]'); } } diff --git a/tests/scenarios/Templates/TemplatesPatronConfigurationsTest.php b/tests/scenarios/Templates/TemplatesPatronConfigurationsTest.php index f89ea8330a191bee05604654e5a87942cb92a4a5..3a4ac7218173a0157e089cc2ed0e33c2d5f115a8 100644 --- a/tests/scenarios/Templates/TemplatesPatronConfigurationsTest.php +++ b/tests/scenarios/Templates/TemplatesPatronConfigurationsTest.php @@ -82,3 +82,48 @@ class TemplatesPatronConfigurationsIdentityProvidersOneAssociatedTest $this->assertXPathContentContains('//table[@id="active_identities"]//td', 'CAS 2.0'); } } + + + + + +class TemplatesPatronConfigurationsSubscriptionDateTest + extends TemplatesIntonationAccountTestCase { + + public function setUp() { + parent::setUp(); + } + + + /** @test */ + public function withSubscribtionIn2020DateShouldBeDisplayInSpanBadgeDanger() { + $this->dispatch('/opac/abonne/configurations/id_profil/72'); + $this->assertXPathContentContains('//div//span[@class="badge_tag danger text-left badge badge-danger text-light"]', + '01/01/2020'); + } + + + /** @test */ + public function withSubscribtionIn2020DateShouldBeDisplayInSpanBadgeSuccess() { + Class_User_ILSSubscription::setTimeSource(new TimeSourceForTest('2019-02-12 11:25:31')); + $this->dispatch('/opac/abonne/configurations/id_profil/72'); + $this->assertXPathContentContains('//div//span[@class="badge_tag success text-left badge badge-success text-light"]', + '01/01/2020'); + } + + + /** @test */ + public function withSubscribtionIsAboutToExpireDateShouldBeDisplayInSpanBadgeWarning() { + Class_User_ILSSubscription::setTimeSource(new TimeSourceForTest('2020-01-01 11:25:31')); + $this->dispatch('/opac/abonne/configurations/id_profil/72'); + $this->assertXPathContentContains('//div//span[@class="badge_tag warning text-left badge badge-warning text-dark"]', + '01/01/2020', + $this->_response->getBody()); + } + + + public function tearDown() { + Class_User_ILSSubscription::setTimeSource(null); + parent::tearDown(); + } +} diff --git a/tests/scenarios/Templates/TemplatesWidgetTest.php b/tests/scenarios/Templates/TemplatesWidgetTest.php index 11803eb4edf03c4259081946442997b548375aee..d264dbde823ad9b867911c6ef309627a06079882 100644 --- a/tests/scenarios/Templates/TemplatesWidgetTest.php +++ b/tests/scenarios/Templates/TemplatesWidgetTest.php @@ -488,7 +488,7 @@ class TemplatesWidgetSearchInlineStyleTest extends TemplatesIntonationTestCase { 'libelle' => 'Lothlorien', 'visibilite' => Class_Bib::V_DATA]); - $this->dispatch('/opac/index/index/id_profil/72', true); + $this->dispatch('/opac/index/index/id_profil/72'); } @@ -526,6 +526,18 @@ class TemplatesWidgetSearchInlineStyleTest extends TemplatesIntonationTestCase { public function advancedSearchButtonShouldHaveClassDropdownToggle() { $this->assertXPath('//div[contains(@class,"boite rech_simple")]//div[@class="dropdown"]/button[contains(@class, "dropdown-toggle")]'); } + + + /** @test */ + public function formShouldHaveClassInlineForm() { + $this->assertXPath('//div//form[@class="inline_form row no-gutters"]'); + } + + + /** @test */ + public function expressionRechercheShouldBeInDivClassInlineForm() { + $this->assertXPath('//div//form[@class="inline_form row no-gutters"]//div[@class="col row form-group no-gutters wrapper_zendafi_form_expressionrecherchewidgetbaseidh inline_form_wrapper_zendafi_form_expressionrecherchewidgetbaseidh"]//input[@name="expressionRecherche"]'); + } } @@ -565,6 +577,18 @@ class TemplatesWidgetSearchToggleStyleTest extends TemplatesIntonationTestCase { public function searchWidgetShouldContainsWrapperZendAfiFormHiddenTri() { $this->assertXPath('//div[contains(@class,"boite rech_simple")]//form//div[contains(@class, "wrapper_zendafi_form_hiddentri")]//input[@name="tri"]'); } + + + /** @test */ + public function formShouldHaveClassDefaultForm() { + $this->assertXPath('//div//form[@class="form default_form row"]'); + } + + + /** @test */ + public function expressionRechercheShouldBeInDivClassDefaultForm() { + $this->assertXPath('//div//form[@class="form default_form row"]//div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_expressionrecherche default_form_wrapper_zendafi_form_expressionrecherche order-4"]//input[@name="expressionRecherche"]'); + } } @@ -673,6 +697,18 @@ class TemplatesWidgetSearchDefaultStyleTest extends TemplatesIntonationTestCase public function searchOptionTypeDocShoulDisplayDocTypeLivre() { $this->assertXPath('//div[contains(@class,"boite rech_simple")]//form//select[contains(@name,"custom_multifacets_doctype")]//option[2][@value="T1"][@label="Livre"]'); } + + + /** @test */ + public function formShouldHaveClassDefaultForm() { + $this->assertXPath('//div//form[@class="form default_form row"]'); + } + + + /** @test */ + public function expressionRechercheShouldBeInDivClassDefaultForm() { + $this->assertXPath('//div//form[@class="form default_form row"]//div[@class="form-group container-fluid no-gutters py-1 wrapper_zendafi_form_expressionrecherche default_form_wrapper_zendafi_form_expressionrecherche order-4"]//input[@name="expressionRecherche"]'); + } }