diff --git a/application/modules/admin/controllers/ProfilController.php b/application/modules/admin/controllers/ProfilController.php index 994da8b5b81c6d5ad85b09817097a566998d7d37..ce03f4f63f547256e4d58462fbebac83361bd5f4 100644 --- a/application/modules/admin/controllers/ProfilController.php +++ b/application/modules/admin/controllers/ProfilController.php @@ -380,16 +380,26 @@ class Admin_ProfilController extends ZendAfi_Controller_Action { public function accueilAction() { - $this->view->titre = $this->_('Configuration de la page: %s', $this->_profil->getLibelle()); - $params = array_merge($this->_profil->toArray(), - $this->_profil->getCfgSiteAsArray(), - $this->_profil->getCfgAccueilAsArray()); + $this->view->titre = + $this->_('Configuration de la page: %s', + $this->_profil->getLibelle()); + + $params = + array_merge($this->_profil->toArray(), + $this->_profil->getCfgSiteAsArray(), + $this->_profil->getCfgAccueilAsArray()); $this->view->form = ZendAfi_Form_Configuration_Profile_Page::newWith($params); $this->view->form->setAction($this->view->url()); - if ($this->_request->isPost() && $this->view->form->isValid($this->_request->getPost())) - return $this->updateAccueil($this->_profil); + if ( ! $this->_request->isPost() ) + return; + + if( ! $this->view->form->isValidModelAndArray($this->_profil, + $this->_request->getPost())) + return; + + return $this->updateAccueil($this->_profil); } diff --git a/application/modules/admin/controllers/TemplateController.php b/application/modules/admin/controllers/TemplateController.php index 4bc70e83978ab104ccf00de6def2a51f5d1f3de1..ac174509c1829a181987d5e5f7710444263c8096 100644 --- a/application/modules/admin/controllers/TemplateController.php +++ b/application/modules/admin/controllers/TemplateController.php @@ -99,7 +99,10 @@ class Admin_TemplateController extends ZendAfi_Controller_Action { public function resetAction() { - $template = Class_Template::current()->resetSettings(); + $template = Class_Template::current() + ->resetSettings() + ->resetPacks(); + $this->_helper->notify($this->_('Thème %s réinitialisé', $template->getId())); return $this->_redirectClose($this->_getReferer()); } diff --git a/library/Class/ArticleCategorie.php b/library/Class/ArticleCategorie.php index f9209edde6dfb766e65c1bbe60cab2925b33cb0a..c4624bf620d9508120fd3bd50f1e71d0e7872f7b 100644 --- a/library/Class/ArticleCategorie.php +++ b/library/Class/ArticleCategorie.php @@ -78,6 +78,20 @@ class ArticleCategorieLoader extends Storm_Model_Loader { $model->delete(); }); } + + + public function getOrCreate(string $label, ?Class_ArticleCategorie $parent = null) : Class_ArticleCategorie { + $parent_id = $parent ? $parent->getId() : 0; + + if ($category = Class_ArticleCategorie::findFirstBy(['libelle' => $label, + 'id_cat_mere' => $parent_id])) + return $category; + + $category = Class_ArticleCategorie::newInstance(['libelle' => $label, + 'id_cat_mere' => $parent_id]); + $category->save(); + return $category; + } } diff --git a/library/Class/CompareUrl.php b/library/Class/CompareUrl.php index 74872bca36cc8d14fab0e0a512fa0f23f4891fc8..363decd65ccc045bbbf930328c543bb99cdbdc68 100644 --- a/library/Class/CompareUrl.php +++ b/library/Class/CompareUrl.php @@ -54,65 +54,129 @@ class Class_CompareUrl { } - public function sameAsRequest($url) { - if(!$url) + public function sameAsRequest($url) : bool { + if ( ! $url ) return false; - if(!is_string($url)) + if ( ! is_string($url) ) return false; - if (!$request_path = static::getRequestPath()) + if ( '/' == $url) + return true; + + $url = Class_Url::absolute($url); + if (false === strpos($url, Class_Url::domain())) return false; - $request_path = Class_Url::absolute($request_path); + if ( ! $request_path = static::getRequestPath() ) + return false; - if ('/' == $request_path) + $current_url = Class_Url::absolute($request_path); + + if ('/' == $current_url) return false; - return $this->_checkByStrPos($request_path, $url) + return $this->_checkByStrPos($current_url, $url) ? true - : $this->_checkByProfil($url); + : $this->_checkByProfilOrUrlRewrite($current_url, $url); } - protected function _checkByStrPos($current_url, $url) { - $pos = strpos($url, $current_url); + protected function _checkByStrPos(string $current_url, string $url) : bool { + return $current_url === $url; + } - if(null === $pos) - return false; - return false !== $pos; - } + protected function _checkByProfilOrUrlRewrite(string $current_url, string $url) : bool { + if ( $this->_checkByLibrary($current_url, $url)) + return true; + if ($this->_checkByProfil($current_url, $url)) + return true; - protected function _checkByProfil($url) { - $url = Class_Url::absolute($url); - if (false === strpos($url, Class_Url::domain())) - return null; + if ( $library_in_url = $this->_getLibrary($current_url)) + return false; - if ( ! $url_request = new Zend_Controller_Request_Http($url)) + if ( ! $profile_in_url = $this->_getProfile($url)) return false; - $this->_getRouter()->route($url_request); + return Class_Profil::getCurrentProfil()->getId() == $profile_in_url->getId(); + } + - $current_profile = Class_Profil::getCurrentProfil(); - if ((int)$url_request->getParam('id_profil', $current_profile->getId()) !== $current_profile->getId()) + protected function _checkByProfil(string $current_url, string $url) : bool { + if ( ! $profile_in_url = $this->_getProfile($url)) return false; - if ([$url_request->getModuleName(), $url_request->getControllerName()] == ['opac', 'index']) - return true; + if ( $current_profile = $this->_getProfile($current_url) ) + return $current_profile->getId() == $profile_in_url->getId(); + + return false; + } - $current_profile_url = array_merge(['module' => 'opac', - 'controller' => 'index'], - $current_profile->getUrlParts()); - if ($url_request->getControllerName() == $current_profile_url['module']) - return true; + protected function _checkByLibrary(string $current_url, string $url) : bool { + if ( ! $library_in_url = $this->_getLibrary($url)) + return false; - if ($url_request->getModuleName() !== $current_profile_url['module']) + if ( ! $current_library = $this->_getLibrary($current_url)) return false; - return $url_request->getControllerName() == $current_profile_url['controller']; + return $current_library->getId() == $library_in_url->getId(); + } + + + protected function _getLibrary(string $url) : ?Class_Bib { + return + $this->_withUrlAsRequestDo($url, + function(Zend_Controller_Request_Http $url_as_request) : ?Storm_Model_Abstract + { + if ( ('bib' == $url_as_request->getControllerName()) + && $library = Class_Bib::find($url_as_request->getParam('id', 0))) + return $library; + + if ( $library = Class_Bib::findFirstBy(['rewrite_url' => $url_as_request->getControllerName()]) ) + return $library; + + return null; + }); + } + + + protected function _withUrlAsRequestDo(string $url, + Closure $callback) : ?Storm_Model_Abstract { + $url_as_request = ''; + + try { + $url_as_request = new Zend_Controller_Request_Http($url); + } catch ( Exception $e ) { + return null; + } + + if ( ! $url_as_request) + return null; + + $this->_getRouter()->route($url_as_request); + return $callback($url_as_request); + } + + + protected function _getProfile(string $url) : ?Class_Profil { + return + $this->_withUrlAsRequestDo($url, + function(Zend_Controller_Request_Http $url_as_request) : ?Storm_Model_Abstract + { + if ($profile = Class_Profil::find($url_as_request->getParam('id_profil', 0))) + return $profile; + + if ($profile = Class_Profil::findFirstBy(['rewrite_url' => $url_as_request->getActionName()]) ) + return $profile; + + if ($profile = Class_Profil::findFirstBy(['rewrite_url' => $url_as_request->getControllerName()]) ) + return $profile; + + return null; + }); } diff --git a/library/Class/Profil.php b/library/Class/Profil.php index bf54432ff31a853cbd29b14b62f06d5330e64614..232efb2e0e46c31a5491764cc1c85d0b70642600 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -1536,9 +1536,9 @@ class Class_Profil extends Storm_Model_Abstract { $validator = new ZendAfi_Validate_ProfilRewriteUrl(); $validator->isValid($this); - foreach($validator->getMessages() as $message) { + + foreach($validator->getMessages() as $message) $this->check(false, $message); - } return $this; } diff --git a/library/Class/StylesPack.php b/library/Class/StylesPack.php index 91ac1e56e58fd794ed6052de95ff3ab1de078f78..2f7ac271c861eb8f8be335a484b14cb6139181a2 100644 --- a/library/Class/StylesPack.php +++ b/library/Class/StylesPack.php @@ -23,17 +23,23 @@ class Class_StylesPackLoader extends Class_TemplatePack_Loader { public function getOrCreate(string $label, array $data, Class_Template $template) : Class_StylesPack { - if ( $style_pack = Class_StylesPack::findFirstBy(['label' => $label, - 'template' => $template->getId()])) - return $style_pack; + $style_pack = $this->_getAStylePack($label, $template); - $style_pack = Class_StylesPack::newInstance(['label' => $label, - 'template' => $template->getId()]) - ->setClassesJson($data); - $style_pack->save(); + if ( $style_pack->isNew()) { + $style_pack->setClassesJson($data); + $style_pack->save(); + } return $style_pack; } + + + protected function _getAStylePack(string $label, Class_Template $template) : Class_StylesPack { + return $style_pack = Class_StylesPack::findFirstBy(['label' => $label, + 'template' => $template->getId()]) + ?? Class_StylesPack::newInstance(['label' => $label, + 'template' => $template->getId()]); + } } diff --git a/library/Class/Systeme/ModulesMenu/Null.php b/library/Class/Systeme/ModulesMenu/Null.php index 478f1ec27eca8211ae109b597f9dfe0b19666a6b..6a8c72894d6ef6deac3540c971d334a21d359229 100644 --- a/library/Class/Systeme/ModulesMenu/Null.php +++ b/library/Class/Systeme/ModulesMenu/Null.php @@ -39,8 +39,10 @@ class Class_Systeme_ModulesMenu_Null extends Class_Systeme_ModulesAccueil_Null { $preferences['preferences'] = $preferences; $profil_parts = []; - if (isset($preferences['use_profil']) && $preferences['use_profil']) - $profil_parts = ['id_profil' => $preferences['use_profil']]; + if (isset($preferences['use_profil']) + && $preferences['use_profil'] + && ($profil = Class_Profil::find($preferences['use_profil']))) + $profil_parts ['id_profil'] = $preferences['use_profil']; return is_array($this->_url) ? Class_Url::assemble(array_merge($this->_url, $profil_parts)) diff --git a/library/Class/Systeme/Widget/Menu.php b/library/Class/Systeme/Widget/Menu.php index ab695136c79549d62bff44246ff6a6ad8a8470e5..2e734da54edcfdf0816377aace8a15f1868e8c59 100644 --- a/library/Class/Systeme/Widget/Menu.php +++ b/library/Class/Systeme/Widget/Menu.php @@ -313,6 +313,15 @@ class Class_Systeme_Widget_Menu extends Class_Systeme_Widget_Abstract { } + public function hasActiveChild() : bool { + foreach($this->getChildrenAsMenu() as $menu) + if ( $menu->isActive()) + return true; + + return false; + } + + public function isProfile() { return is_a($this->_getWidgetResources(), Class_Systeme_ModulesMenu_Profil::class); } diff --git a/library/Class/Template.php b/library/Class/Template.php index ae1dd8eaf7cb8b947a0fdbdd991a723f4024002e..4bb71e4ab854af70a1125abdf88c423af0b28368 100644 --- a/library/Class/Template.php +++ b/library/Class/Template.php @@ -528,6 +528,17 @@ class Class_Template { } + public function resetPacks() : self { + foreach ( Class_StylesPack::findAllByTemplate($this) as $pack) + $pack ->delete(); + + foreach ( Class_ResponsivePack::findAllByTemplate($this) as $pack) + $pack ->delete(); + + return $this; + } + + public function updateSettings() { $this->getSettings()->updateSettings(); return $this; diff --git a/library/Class/Template/Loader.php b/library/Class/Template/Loader.php index 01981e15aa0a5f1f03ad1d9ca47937579bed5273..7f83d9c4371525cd32f8e0122a4f5d0acc53fdfb 100644 --- a/library/Class/Template/Loader.php +++ b/library/Class/Template/Loader.php @@ -31,6 +31,7 @@ class Class_Template_Loader { return $this->_templates_cache = [new Chili_Template, + new Herisson_Template, new Historic_Template, new Intonation_Template, new Muscle_Template, diff --git a/library/Class/Template/ProfilePatcher.php b/library/Class/Template/ProfilePatcher.php index ff9bc8b388dd0d53f141e0159c8d91f6c1bc8ad0..98f95f4a5f90afdff4b298bf956b36777772c430 100644 --- a/library/Class/Template/ProfilePatcher.php +++ b/library/Class/Template/ProfilePatcher.php @@ -37,6 +37,7 @@ class Class_Template_ProfilePatcher extends Class_Template_NullPatcher { public function setProfile($profile) { $this->_profile = $profile; + $this->_profile_id = $profile->getId(); $this->_template = (new Class_Template_Loader)->findFromProfile($profile); Class_Profil::setCurrentProfil($profile); return $this; @@ -75,21 +76,10 @@ class Class_Template_ProfilePatcher extends Class_Template_NullPatcher { protected function _addWidget($type, $division, $settings = []) { - $new_id = $this->_profile->createNewModuleAccueilId(); + (new Class_Template_ProfilePatcher_Profile($this->_profile)) + ->addWidget($type, $division, $settings); - $preferences = array_merge(Class_Systeme_ModulesAccueil::getInstance() - ->getModuleByCode($type) - ->getDefaultValues(), - $settings); - - $this->_profile->updateModuleConfigAccueil($new_id, - ['type_module' => $type, - 'division' => $division, - 'preferences' => $preferences]); - - $this->_profile->save(); - - return $this; + return $this->_clearCache(); } @@ -141,4 +131,129 @@ class Class_Template_ProfilePatcher extends Class_Template_NullPatcher { public function getDefaultWidgetConfiguration(array $params) : array { return []; } + + + protected function _disableItemsMap() { + $preferences = new Class_Profil_ItemsSettings($this->_profile); + $params = $preferences->toArray(); + $params ['all_items_map'] = 0; + $preferences + ->setSettings($params) + ->save(); + + return $this->_clearCache(); + } + + + protected function _setActionSettings($controller, $action, $settings) { + (new Class_Profil_Preferences()) + ->setModulePref($this->_profile, + (new Class_Profil_ModuleDefinition($controller, + $action)), + $settings); + + return $this->_clearCache(); + } + + + protected function _setSimpleSearchSettings($settings) { + (new Class_Profil_Preferences()) + ->setModulePref($this->_profile, + (new Class_Profil_ModuleDefinition('recherche', + 'resultat', + 'simple')), + $settings); + + return $this->_clearCache(); + } + + + + protected function _setNoMapsInBibSettings($settings) { + (new Class_Profil_Preferences()) + ->setModulePref($this->_profile, + (new Class_Profil_ModuleDefinition('bib', + 'en-lire-plus')), + $settings); + + return $this->_clearCache(); + } + + + protected function _setNoTeamsInBibSettings($settings) { + (new Class_Profil_Preferences()) + ->setModulePref($this->_profile, + (new Class_Profil_ModuleDefinition('bib', + 'en-lire-plus')), + $settings); + + return $this->_clearCache(); + } + + + protected function _setNoMediaInNoticeSettings(array $settings) : self { + foreach ( [Class_TypeDoc::LIVRE, + Class_TypeDoc::PERIODIQUE] as $doc_type_id) + (new Class_Profil_Preferences()) + ->setModulePref($this->_profile, + (new Class_Profil_ModuleDefinition('recherche', + 'viewnotice', + $doc_type_id)), + $settings); + + return $this->_clearCache(); + } + + + protected function _createPage(string $title) : Class_Template_ProfilePatcher_Profile { + if ($page = Class_Profil::findFirstBy(['parent_id' => $this->_profile->getId(), + 'libelle' => $title])) { + return new Class_Template_ProfilePatcher_Profile($page); + } + + $page = Class_Profil::newInstance(['parent_profil' => $this->_profile, + 'libelle' => $title]); + $page->save(); + + return new Class_Template_ProfilePatcher_Profile($page); + } + + + protected function _addWidgetInMenu($code, $settings) { + return + ['type_menu' => 'MODULE_ACCUEIL_' . $code, + 'type_module' => $code, + 'preferences' => $settings]; + } + + + protected function _setHeaderSettings($settings) { + (new Class_Template_ProfilePatcher_Profile($this->_profile)) + ->setHeaderSettings($settings); + + return $this->_clearCache(); + } + + + protected function _setMainSettings($settings) { + (new Class_Template_ProfilePatcher_Profile($this->_profile)) + ->setMainSettings($settings); + + return $this->_clearCache(); + } + + + protected function _setFooterSettings($settings) { + (new Class_Template_ProfilePatcher_Profile($this->_profile)) + ->setFooterSettings($settings); + + return $this->_clearCache(); + } + + + protected function _clearCache() : self { + Class_Profil::clearCache(); + $this->_profile = Class_Profil::find($this->_profile_id); + return $this; + } } diff --git a/library/Class/Template/ProfilePatcher/Profile.php b/library/Class/Template/ProfilePatcher/Profile.php new file mode 100644 index 0000000000000000000000000000000000000000..5645543baad3c32b4bc95f6ebb34bd4f8b52e571 --- /dev/null +++ b/library/Class/Template/ProfilePatcher/Profile.php @@ -0,0 +1,112 @@ +<?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 Class_Template_ProfilePatcher_Profile { + protected $_profile; + + + public function __construct($profile) { + $this->_profile = $profile; + } + + + public function setMainSettings($settings) { + return $this->_withSectionAdd(new Class_Systeme_Widget_Section_Main, + $settings); + } + + + public function setHeaderSettings($settings) { + return $this->_withSectionAdd(new Class_Systeme_Widget_Section_Header, + $settings); + } + + + public function setFooterSettings($settings) { + return $this->_withSectionAdd(new Class_Systeme_Widget_Section_Footer, + $settings); + } + + + public function getFooterSettings() : array { + return $this->_getSectionSettings(new Class_Systeme_Widget_Section_Footer); + } + + + protected function _getSectionSettings(Class_Systeme_Widget_Section $section) : array { + $section = ($section + ->setProfileId($this->_profile->getId()) + ->load()); + return $section->getLocalSettings(); + } + + + protected function _withSectionAdd($section, $settings) { + $section = ($section + ->setProfileId($this->_profile->getId()) + ->load()); + + $section + ->setNewDatas($settings) + ->updateProfile(); + + $this->_profile = $section->getProfile(); + + return $this; + } + + + public function addWidget($type, $division, $settings = []) { + $preferences = array_merge(Class_Systeme_ModulesAccueil::getInstance() + ->getModuleByCode($type) + ->getDefaultValues(), + $settings); + + $this->_profile + ->updateModuleConfigAccueil($this->_profile->createNewModuleAccueilId(), + ['type_module' => $type, + 'division' => $division, + 'preferences' => $preferences]); + $this->_profile->save(); + return $this; + } + + + public function setRewriteUrl(string $title) : self { + $this->_profile->setRewriteUrl($title); + + if ( ! $this->_profile->isValid()) + $this->_profile->setRewriteUrl(''); + + return $this; + } + + + public function getId() { + return $this->_profile->getId(); + } + + + public function getUrl() : string { + return $this->_profile->getUrl(); + } +} diff --git a/library/ZendAfi/Form.php b/library/ZendAfi/Form.php index cbf2687f6856ce4f3a12c40afe3dedd1130cc231..b67bc9c4c5d913b357f6c6f95f6c59278d20038e 100644 --- a/library/ZendAfi/Form.php +++ b/library/ZendAfi/Form.php @@ -124,7 +124,6 @@ class ZendAfi_Form extends Zend_Form { public function isValid($array_or_model) { - if (is_array($array_or_model)) return parent::isValid($array_or_model); diff --git a/library/ZendAfi/Validate/ProfilRewriteUrl.php b/library/ZendAfi/Validate/ProfilRewriteUrl.php index c26e0600f2c70ef9cbd95d9f1f6e933b83ccad43..22a2adb819681a99d130cc0bd09c8f14bd83a4c4 100644 --- a/library/ZendAfi/Validate/ProfilRewriteUrl.php +++ b/library/ZendAfi/Validate/ProfilRewriteUrl.php @@ -19,11 +19,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class ZendAfi_Validate_ProfilRewriteUrl extends Zend_Validate_Abstract { + + const INVALID_URL = 'invalidURL', URL_ALREADY_EXISTS_IN_A_PROFIL = 'urlAlreadyExistsInAProfil', URL_ALREADY_EXISTS_IN_A_PAGE = 'urlAlreadyExistsInAPage'; + protected $_messageTemplates = [ self::INVALID_URL => "'%value%' n'est pas une URL de profil valide", @@ -179,6 +182,4 @@ class ZendAfi_Validate_ProfilRewriteUrl extends Zend_Validate_Abstract { $this->$name = $value; $this->_error($message); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Accueil/Base.php b/library/ZendAfi/View/Helper/Accueil/Base.php index 9626d3b8a6bc57a11217f6bc371510baa9bb9a1e..aa911d2029325d645069903ee2d192f7add9462b 100644 --- a/library/ZendAfi/View/Helper/Accueil/Base.php +++ b/library/ZendAfi/View/Helper/Accueil/Base.php @@ -241,7 +241,7 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac $scripts ->addOPACScript('visible_when_hidden') ->addJQueryReady(sprintf('$("#boite_%s").visible_when_hidden("#boite_%s")', - $this->id_module, + $this->_settings->getIdForHtml(), $hidden_id)); } diff --git a/library/templates/Herisson/Assets/contents/accessibilite.html b/library/templates/Herisson/Assets/contents/accessibilite.html new file mode 100644 index 0000000000000000000000000000000000000000..d744538e675cb5fa38374bf8d50e032e825ac70e --- /dev/null +++ b/library/templates/Herisson/Assets/contents/accessibilite.html @@ -0,0 +1,145 @@ +<div class="accessibilite"> + <h1>Attestation de conformité au RGAA</h1> + + <h2>Qu’est-ce que l’accessibilité numérique ?</h2> + + <p>Un site web accessible est un site qui permet à tous les internautes d’accéder à ses contenus sans difficulté, y compris les personnes qui présentent un handicap et utilisent des logiciels ou matériels spécialisés.</p> + + <p>Un site accessible permet par exemple de :</p> + + <ul> + <li>Naviguer avec des synthèses vocales ou des plages braille (notamment utilisées par les internautes aveugles ou malvoyants).</li> + <li>Personnaliser l’affichage du site selon ses besoins (grossissement des caractères, modification des couleurs).</li> + <li>Naviguer sans utiliser la souris, avec le clavier uniquement ou via un écran tactile.</li> + </ul> + + <h2>Adresse du site et date de réalisation</h2> + + <p>La déclaration de conformité du site https://opacce.pergame.net a été établie le 7 septembre 2020.</p> + + <h2>Version du RGAA de référence</h2> + + <p>La version utilisée pour réaliser les tests est la version 3.0 du RGAA.</p> + + <h2>Identité du déclarant</h2> + + <p>AFI ANNECY</p> + + <p>11 Boulevard du Fier 74000 ANNECY</p> + + <p>01 60 00 00 00</p> + + <p>afi_annecy@afi-sa.fr</p> + + <h2>Technologies utilisées sur le site</h2> + + <ul> + <li>HTML5</li> + <li>CSS</li> + <li>JavaScript</li> + </ul> + + <h2>Agents utilisateurs testés</h2> + + <ul> + <li>Google Chrome 64.0.3278.0</li> + <li>Firefox ESR 52.1.2</li> + </ul> + + <h2>Outils utilisés pour l’évaluation</h2> + + <ul> + <li>Opquast Desktop 2.0.4</li> + <li>Color contrast analyser</li> + <li>Firebug</li> + </ul> + + <h2>Liste des pages ayant fait l’objet de la vérification de conformité</h2> + + <h3>Accueil</h3> + + <p>https://opacce.pergame.net</p> + + <h3>Résultat de recherche</h3> + + <p>/recherche/simple/expressionRecherche/lapin</p> + + <h3>Notice</h3> + + <p>/recherche/viewnotice/expressionRecherche/lapin/id/69264</p> + + <h2>Analyse globale</h2> + + <p>Les niveaux visés par le cadre légal de mise en conformité des sites publics sont les niveaux A et AA du référentiel. L'analyse du site met en évidence une conformité de 54% au regard de ces critères.</p> + + <p>La plus grande partie des critères d'accessibilité sont respectés. Les critères non respectés sont dus à des contraintes techniques résultant de l'utilisation du système de gestion de contenu.</p> + + <p>Résultats détaillés des tests unitaires :</p> + + <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 100%;" summary="Résultats détaillés des tests unitaires"> + <tbody> + <tr> + <td style="text-align: center;">Niveau</td> + <td style="text-align: center;">Nombre de tests</td> + <td style="text-align: center;">Tests conformes</td> + <td style="text-align: center;">Tests non validés</td> + <td style="text-align: center;">Conformité</td> + </tr> + <tr> + <td style="text-align: center;">Niveau A +AA</td> + <td style="text-align: center;">52</td> + <td style="text-align: center;">28</td> + <td style="text-align: center;">24</td> + <td style="text-align: center;">54%</td> + </tr> + </tbody> + </table> + + <p> </p> + + <div class="mise_en_avant">Nous nous engageons à apporter régulièrement les modifications nécessaires pour maintenir, corriger et améliorer l'accessibilité de ce site.</div> + + <h2>Composants tiers dérogés</h2> + + <ul> + <li>Google Maps</li> + <li>Vidéos issues de Allociné, INA</li> + <li>Calendrier javascript : il s'agit d'un composant jquery-ui natif néanmoins sont utilisation est optionnelle</li> + <li>Diaporama : il s'agit d'un composant natif néanmoins son utilisation est optionnelle</li> + </ul> + + <h2>Dérogations spécifiques</h2> + + <ul> + <li>Les contenus éditoriaux profonds peuvent comporter des listes, des intertitres, des mises en gras ou italique et des images qui ne seraient pas conformes. Néanmoins, à notre connaissance cela ne provoque aucun blocage d'accès à l'information. La reprise et la vérification de toutes les pages du sites représenteraient une charge de travail disproportionnée par rapport au gain attendu.</li> + <li>La validité HTML ne peut être garantie sur l'ensemble des pages néanmoins à notre connaissance cela ne provoque aucun dysfonctionnement des aides techniques. La reprise et la vérification de toutes les pages du sites représenteraient une charge de travail disproportionnée par rapport au gain attendu.</li> + <li>Les vidéos n'ont pas d'audio-description décrivant leur contenu. La bibliothèque n'est pas en mesure de fournir des audio-descriptions pour l'ensemble de ces vidéos.</li> + <li>Une alternative n'est pas disponible pour l'intégralité des photos, images et liens. Ce défaut est en cours de résolution.</li> + <li>Lors de la prise de focus de certains éléments de formulaire un style spécifique est appliqué néanmoins ce changement de style ne respecte pas les modalités prévues par le RGAA3. Ce cas particuliers seront remontés pour une évolution ultérieure du RGAA.</li> + </ul> + + <h2>Droit à la compensation</h2> + + <p>Il est important de rappeler qu’en vertu de l’article 11 de la loi de février 2005, la personne handicapée a droit à la compensation des conséquences de son handicap, quels que soient l’origine et la nature de sa déficience, son âge ou son mode de vie. De ce fait, chaque organisme a l'obligation de prendre les moyens nécessaires afin de donner accès, dans un délai raisonnable, aux informations et fonctionnalités recherchées par la personne handicapée, que le contenu fasse l'objet d'une dérogation ou non.</p> + + <h2>Nous contacter</h2> + + <p>Si vous souhaitez nous contacter pour quelques raisons que ce soit plusieurs solutions sont à votre disposition :</p> + + <ul> + <li>Par courrier : AFI ANNECY 11 Boulevard du Fier 74000 ANNECY<br /> + </li> + <li>Par courriel : afi_annecy@afi-sa.fr<br /> + </li> + </ul> + + <h2>Défenseur des droits</h2> + + <p>Si vous constatez un défaut d'accessibilité vous empêchant d'accéder à un contenu ou une fonctionnalité du site, que vous nous le signalez et que vous ne parvenez pas à obtenir une réponse rapide de notre part, vous êtes en droit de faire parvenir vos doléances ou une demande de saisine au Défenseur des droits. Plusieurs moyens sont à votre disposition :</p> + + <ul> + <li>un formulaire de contact : /index/formulairecontact</li> + <li>une adresse postale : Le Défenseur des droits - 7 rue Saint-Florentin - 75409 Paris Cedex 08</li> + </ul> + +</div> \ No newline at end of file diff --git a/library/templates/Herisson/Assets/contents/mentions_legales.html b/library/templates/Herisson/Assets/contents/mentions_legales.html new file mode 100644 index 0000000000000000000000000000000000000000..fcf03cb2c601a1f29cbaa3de012821d05eec3662 --- /dev/null +++ b/library/templates/Herisson/Assets/contents/mentions_legales.html @@ -0,0 +1,82 @@ +<div class="mentions_legales"> + <h1>Propriétaire du site</h1><br /> + + <p>AFI ANNECY<br /> + 11 Boulevard du Fier<br /> + 74000 ANNECY<br /> + Tél. 01 06 00 00 00</p><br /> + + <p><u>Directeur de publication</u> : Arnaud Lelache, Président de AFI<br /> + Rédaction, publication, animation et gestion éditoriale : Employés de chez AFI</p><br /> + + <h2>Photographies</h2> + + <p>AFI ANNECY<br /> + © BOKEH<br /> + Banques d’images : Pixabay</p><br /> + + <h2>Coordonnées de l'hébergeur du site Internet</h2><br /> + + <p>AFI ANNECY<br /> + 11 Boulevard du Fier<br /> + 74000 ANNECY<br /> + Tél. 01 06 00 00 00</p><br /> + + <h2>Coordonnées du concepteur du site internet</h2><br /> + + <p><u>Identité visuelle</u> : <br /> + AFI ANNECY<br /> + 11 Boulevard du Fier<br /> + 74000 ANNECY<br /> + Tél. 01 06 00 00 00</p><br /> + + <p><u>Développement</u> : <br /> + AFI<br /> + 35 rue de la Maison Rouge<br /> + 77185 Lognes<br /> + Tél : 01.60.17.12.34<br /> + www.afi-sa.fr</p><br /> + + <h2>Gestion des cookies :</h2><br /> + + <p>Cookies déposés par le site https://opacce.pergame.net</p> + + <p><u>Cookie de session</u><br /> + Ce site utilise, pour chaque visite, un cookie de session qui permet de se connecter au site et de bénéficier de tous les services que nous proposons. Ce cookie est effacé à la fermeture du navigateur.</p><br /> + + <p><u>Cookies de fonctionnement</u> (fenêtres modales, notifications etc...)<br /> + Ce site utilise des cookies de fonctionnement. Ces cookies sont conservés sur votre ordinateur (entre quelques jours et un an) afin de faciliter votre navigation et notamment d'éviter l'affichage de fenêtres ou de notifications (toutes concernant l'actualité des Médiathèques) que vous auriez déjà vues. Ces cookies ne sont en aucun cas destinés à d'autres fins (publicité, etc.).</p><br /> + + <p><u>Cookies concernant l'accessibilité</u><br /> + Des cookies pourront être placés sur votre machine si vous utilisez les options d'accessibilité afin de modifier le style de la page (exemple : avoir une écriture blanche sur fond noir). Ces cookies sont exclusivement utilisés afin de permettre à l'internaute d'effectuer ce choix une fois pour toutes et ne pas avoir à recommencer cette manipulation à chaque visite.</p><br /> + + <p><u>Cookies Google Analytics</u> (mesure d'audience)<br /> + Ce site utilise Google Analytics, un service d'analyse de site internet fourni par Google Inc. (« Google »). Google Analytics utilise des cookies, qui sont des fichiers texte placés sur votre ordinateur, pour aider le site internet à analyser l'utilisation du site par ses utilisateurs. Les données générées par les cookies concernant votre utilisation du site (y compris votre adresse IP) seront transmises et stockées par Google. Google utilisera cette information dans le but d'évaluer votre utilisation du site, de compiler des rapports sur l'activité du site à destination de son éditeur et de fournir d'autres services relatifs à l'activité du site et à l'utilisation d'Internet. Google est susceptible de communiquer ces données à des tiers en cas d'obligation légale ou lorsque ces tiers traitent ces données pour le compte de Google, y compris notamment l'éditeur de ce site. </p><br /> + + <h2>Informations légales : </h2> + + <p>La communauté d’agglomération signale que l’accès à ce site implique l’acceptation sans réserve des dispositions suivantes.<br /> + Contenus<br /> + Les informations communiquées sur ce site sont présentées à titre indicatif. Elles ne sauraient être totalement exhaustives.<br /> + Malgré l’attention apportée aux contenus de ce site internet, des erreurs ou dysfonctionnements peuvent subsister. Merci de nous faire part des éventuels problèmes constatés afin que nous y remédions à : https://opacce.pergame.net</p><br /> + + <p><u>Etablissement de liens </u><br /> + Les personnes désireuses de faire un lien vers le site internet peuvent en faire la demande auprès de AFI par courriel : afi_annecy@afi-sa.fr</p><br /> + + <p><u>Liens vers d’autres sites</u><br /> + Le site peut proposer des liens vers d’autres sites affiliés et non affiliés. Ces sites sont indépendants. Les liens vers ces sites n’impliquent, en aucun cas, une approbation de contenu ou un partenariat entre l’éditeur et ces sites. Dès lors, l’éditeur ne saurait être responsable de leurs contenus, leurs produits, leurs publicités ou tous éléments ou services présentés sur ces sites. Nous vous rappelons que ces sites sont soumis à leurs propres conditions d’utilisation et de protection des données personnelles.</p><br /> + + <p><u>Accès au site</u><br /> + L’accès à ce site et son utilisation sont réservés à un usage strictement personnel. Les informations sont fournies à titre gratuit. Elles peuvent être modifiées à tout moment et sans préavis. L’éditeur se réserve également le droit de suspendre, d’interrompre ou de limiter sans avis préalable l’accès à tout ou partie du site.</p><br /> + + <p><u>Respect des droits de propriété </u><br /> + L’ensemble des éléments textuels, visuels, audio exposés sur le site sont protégés par la législation conformément aux dispositions du Code de la Propriété Intellectuelle français, des règlements nationaux et des conventions internationales en vigueur. <br /> + Vous ne pouvez en aucun cas utiliser, distribuer, copier, reproduire, modifier, dénaturer ou transmettre le site ou des éléments du site tels que notamment textes, images, sons et logos sans l’autorisation écrite et préalable de la communauté d’agglomération ou des titulaires des droits. Le non-respect de cette interdiction peut notamment constituer une contrefaçon des droits de propriété intellectuelle ou une atteinte aux droits des personnes et peut à ce titre engager votre responsabilité, y compris dans le cadre d’une action pénale.</p><br /> + + <p><u>Responsabilité</u><br /> + La communauté d’agglomération ne peut être tenue responsable des dommages directs ou indirects causés au matériel de l’utilisateur, lors de l’accès au site, et résultant soit de l’utilisation d’un matériel obsolète, soit de l’apparition d’un bug ou d’une incompatibilité. <br /> + </p> + + + +</div> diff --git a/library/templates/Herisson/Assets/css/herisson.css b/library/templates/Herisson/Assets/css/herisson.css new file mode 100644 index 0000000000000000000000000000000000000000..7252b01ba5c9e53b62f0e3140e246246f7ed4a55 --- /dev/null +++ b/library/templates/Herisson/Assets/css/herisson.css @@ -0,0 +1,1613 @@ +@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); + +:root { + + --black: #000000; /*noir*/ + --black-opacity:rgba(0, 0, 0, 0.8); /*noir avec opacité*/ + --black-opacity-50:rgba(0, 0, 0, 0.5); /*noir avec opacité*/ + --white: #FFFFFF; /*blanc*/ + --red: #c70000; /*rouge*/ + --vert: #138A06; /*vert*/ + --yellow: #ffaa00; /*jaune*/ + + /*Fond blanc*/ + --background: #FFFFFF; /*blanc*/ + --card-header: #612100; /*chocolat noir*/ + --card-title: #a8755b; /*chocolat au lait*/ + + /*Fond clair*/ + --background-light: #FFF7EB; /*chocolat blanc*/ + --card-header_background-light: #612100; /*chocolat noir*/ + --card-template_background-light: #FFFFFF; /*blanc*/ + --card-title_background-light: #A4684D; /*chocolat au lait*/ + --card-text_background-light: #000000; /*noir*/ + + /*Fond foncé*/ + --background-dark: /*#a8755b;*/ #c1957f; /*chocolat au lait*/ + --card-header_background-dark: #FFF7EB; /*chocolat blanc*/ + --card-title_background-dark: #612100; /*chocolat noir*/ + --card-text_background-dark: #000000; /*noir*/ + + /*Fond très foncé*/ + --background-very-dark: /*#75503E;*/ #6C5347; /*chocolat noir*/ + --card-header_background-very-dark: #FFF7EB; /*chocolat blanc*/ + --card-title_background-very-dark: #FFC2A3; /*chocolat au lait*/ + --card-text_background-very-dark: #FFFFFF; /*blanc*/ + + + /*couleur very fonce: #6C5347*/ + /*couleur normal: #c1957f;*/ + +} + + +/* Nouvelles classes */ +.h-xl-300 { + height: 300px!important; +} +@media(max-width: 1200px){ + .h-md-180 { + height: 180px!important; + } +} +.w-auto { + width: auto!important; +} +.w-max { + width: max-content!important; +} +.w-300 { + width: 300px!important; +} +.object-fit-cover { + object-fit: cover!important; +} +.object-fit-contain { + object-fit: contain!important; +} +.mx-auto { + margin-left:auto!important; + margin-right:auto!important; +} +.my-auto { + margin-top:auto!important; + margin-bottom:auto!important; +} +.mt-8 { + margin-top: 6rem !important; +} +.mb-8 { + margin-bottom: 6rem !important; +} +.my-8 { + margin-top: 6rem !important; + margin-bottom: 6rem !important; +} +.mt-10 { + margin-top: 10rem !important; +} +.mb-10 { + margin-bottom: 10rem !important; +} +.my-10 { + margin-top: 10rem !important; + margin-bottom: 10rem !important; +} +.px-9 { + padding-top: 9.5rem!important; + padding-bottom: 9.5rem!important; +} +.py-9 { + padding-left: 9.5rem!important; + padding-right: 9.5rem!important; +} +.widget-footer.card-footer { + position: absolute; + right: 0; + top: 0em; +} +.py-9 .widget-footer.card-footer { + padding-left: 10.75rem !important; + padding-right: 10.75rem !important; +} + +.no_border_widget, +.no_border_widget .card, +.no_border_widget .card-footer { + border: none !important; +} +.no_description p[class*="model_description_Class_"] { + display: none!important; +} +.no_footer_card div[class*="card_footer_Intonation_"] { + display: none !important; +} +.no_overlay .card_overlay { + display: none!important; +} +.card_shadow .card_template { + margin: 0 1.5% 2% 1.5%!important; + box-shadow: 4px 4px 6px #888!important; +} +.button_text { + text-align: center; +} + +.limit_badges_2 .badge-group .badge:nth-child(n+3) { + display: none; +} + +body { + color: var(--black); + font-size: 14px; + font-family: 'Raleway', sans-serif; + font-weight: 500; +} + + +/*géréral*/ +.card-title .text-second { + font-weight: bold; +} +footer .nav .button_text { + font-weight: bold; +} +.credits .bokeh_community { + font-weight: bold; + font-size: 14px; +} +.text-muted { + color: var(--black)!important; +} +.card-body[class*="InRecord"] { + padding: 0 !important; +} +a, +a:hover { + color: var(--black); + text-decoration: none; +} +.text-second, +.text-second:hover, +.leaflet-container a.text-second { + color: var(--card-title_background-light); + line-height: initial; +} +.text-second, +.leaflet-container a.text-second { + display: inline-block; +} + +.small, +small { + font-size: 80%; + font-weight: 500; +} +.btn { + font-weight: 500; +} +.custom-select { + font-weight: 600; + border: 1px solid var(--black) !important; +} +.form-control { + border: 1px solid var(--black); +} + +dt { + text-align: right; +} +.form-group label { + text-align: right; +} +.formulaire_contact .form-group label { + text-align: right; + max-width: 20%; + flex: 0 0 20%; +} +.formulaire_contact label.required::after { + content: none; + margin: 0 5px; +} +.wrapper_zendafi_form_contactform_adresse.form-group label, +.wrapper_zendafi_form_contactform_ville.form-group label{ + padding-right: 12px !important; +} + +p { + margin: 0; +} +p[class*="model_description_Class_"], +.wrapper_reviews .card-text, +.wrapper_description dt.resume + dd { + font-style: italic; + margin-top: 1em; +} + +.dropdown-menu { + font-size: 1rem; + color: #212529; + text-align: center; + list-style: none; +} + +.tree_view_child .card-link { + display: none; +} + +.widget-header.card-header { + font-size: 35px; + text-transform: uppercase; + text-align: left; + font-weight: normal; + margin-bottom: 1em; + border-bottom-width: 1px; + border-bottom-style: solid; + border-bottom-color: var(--black); +} +h1 { + font-size: 35px; + text-transform: uppercase; + text-align: left; + font-weight: normal; +} + + + +.cms_articleview h2.card-title { + background: none; + font-size:30px; + text-transform:uppercase; + color: var(--background-very-dark); + text-align: center; + font-weight: normal; +} + +.card-title .text-second { + font-size: 20px; + font-weight: bold; + overflow: hidden; + text-overflow: Ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} +.card-title + .card-text .card-title, +.card-title + .card-text .card-title .text-second { + line-height: initial; +} +h2, h2.card-title { + font-size: 24px; + color: var(--background-dark); + text-transform: uppercase; + font-weight: normal; +} +.breadcrumb { + background: none; +} +.breadcrumb-item .text-second { + display: initial; + color: var(--card-header_background-light); +} +.breadcrumb-item.active { + font-weight: bold; + color: var(--card-header_background-light); +} + +h3 { + font-size: 22px; + color: var(--black); + text-transform: uppercase; +} +h4 { + font-size:20px; + color: var(--background-very-dark); + text-decoration: underline; +} +h5 { + font-size:18px; + color: var(--background-dark); + text-decoration: underline; +} +h6, +li h3 { + font-size:16px; + color: var(--black); + text-decoration: underline; +} +.text-muted { + color: var(--background-very-dark) !important; +} +.calendar_event_date { + font-weight: bold; +} +.form-control.zendafi_form_input_search_tool::placeholder { + color: #6c757d; + opacity: 1; + font-size: 12px; +} + + +/*logo header*/ +header .boite.image.position_fixed_top_left .image_widget.img-fluid { + height: 92px; +} +/*logo header*/ +footer .boite.image .image_widget.img-fluid { + height: 92px; +} +/*image compte*/ +[data-action="abonne_fiche"] .jumbotron img, +.wrapper_library_team img, +.wrapper_user_settings img { + display: none; +} + + +/*vignette html*/ +.card-img-overlay:not(.record_no_thumbnail) { + background-color: var(--black-opacity); + transition: all 0.4s; +} + +.card.record_no_thumbnail .button_text { + background-color: var(--white); + width: 250px !important; + box-shadow: 0px 2px 4px #888; +} +.carousel .card.record_no_thumbnail { + height: 250px !important; +} +.carousel .card.record_no_thumbnail .button_text { + width: 100% !important; +} +.masonry .card.record_no_thumbnail .button_text { + width: 230px !important; +} + +.card.record_no_thumbnail * { + color: var(--black); + margin: auto; +} + + +/*packs*/ +/*Fond blanc*/ +.background-white, +.background-white.card { + background: var(--background); +} +.background-white .widget-header.card-header { + color: var(--card-header); + border-bottom-color: var(--card-header); +} +.background-white .card-title .text-second { + color: var(--card-title); +} + +/*Fond clair*/ +.background-light, +.background-light.card { + background: var(--background-light); +} +.background-light.card_shadow .card_template { + background: var(--card-template_background-light)!important; +} +.background-light .widget-header.card-header { + color: var(--card-header_background-light); + border-bottom-color: var(--card-header_background-light); +} +.background-light .card-title .text-second { + color: var(--card-title_background-light); +} +.background-light .dropdown-menu.show { + background: var(--background-light); +} +.background-light .bokeh_community { + color: var(--card-text_background-light); +} +.background-light .badge-secondary .badge_text { + font-style: italic; + font-weight: initial; + color: var(--card-text_background-light); +} + +/*Fond foncé*/ +.background-dark, +.background-dark.card { + background: var(--background-dark); +} +.background-dark.card_shadow .card_template { + box-shadow: none !important; +} +.background-dark .widget-header.card-header { + color: var(--card-header_background-dark); + border-bottom-color: var(--card-header_background-dark); +} +.background-dark .card-title .text-second { + color: var(--card-title_background-dark); +} +.background-dark .nav .button_text { + color: var(--card-text_background-dark); +} +.background-dark .dropdown-menu.show { + background: var(--background-dark); +} +.background-dark .bokeh_community { + color: var(--card-text_background-dark); +} +.background-dark .badge-secondary .badge_text { + font-style: italic; + font-weight: initial; + color: var(--card-text_background-dark); +} +.background-dark .card-text { + color: var(--card-text_background-dark); +} +.background-dark .text-muted { + color: var(--card-text_background-dark)!important; +} +.background-dark .card-body + .card-footer .card-link * { + color: var(--card-text_background-dark); +} +.background-dark .biblio_footer .badge_tag * { + color: var(--card-text_background-dark); +} + +/*Fond très foncé*/ +.background-very_dark, +.background-very_dark.card { + background: var(--background-very-dark); +} +.background-very_dark.card_shadow .card_template { + box-shadow: none !important; +} +.background-very_dark .widget-header.card-header { + color: var(--card-header_background-very-dark); + border-bottom-color: var(--card-header_background-very-dark); +} +.background-very_dark .card-title .text-second { + color: var(--card-title_background-very-dark); +} +.background-very_dark .nav .button_text { + color: var(--card-text_background-very-dark); +} +.background-very_dark .dropdown-menu.show { + background: var(--background-very-dark); +} +.background-very_dark .bokeh_community { + color: var(--card-text_background-very-dark); +} +.background-very_dark .badge-secondary .badge_text { + font-style: italic; + font-weight: initial; + color: var(--card-text_background-very-dark); +} +.background-very_dark .card-text { + color: var(--card-text_background-very-dark); +} + +.background-very_dark .text-muted { + color: var(--card-text_background-very-dark)!important; +} +.background-very_dark.background-white_and_light_card .card.card_template:nth-child(2n+1) .text-muted { + color: var(--card-title_background-dark) !important; +} +.background-very_dark.background-white_and_light_card .card.card_template:nth-child(2n+1) .card-text { + color: var(--card-title_background-dark); +} +.background-very_dark.background-white_and_light_card .card.card_template:nth-child(2n+1) .card-title .text-second { + color: var(--card-title); +} +.background-very_dark .card-body + .card-footer .card-link * { + color: var(--card-text_background-very-dark); +} +.background-very_dark .biblio_footer .badge_tag, +.background-very_dark .biblio_footer .badge_tag * { + background: none; +} + + +/*boite menu principal*/ +.boite.nav .nav-link .button_text { + color: var(--background-very-dark); + text-transform:uppercase; +} +.boite.nav .nav-link:hover .button_text, +.boite.nav .nav-link.active .button_text, +.dropdown-menu.show li:hover .text-second { + color: var(--card-title_background-dark); + font-weight: bold; +} +.nav nav .nav-item { + padding: 0 1.75rem; +} +.nav nav .nav-item .dropdown-menu { + transform: translate3d(2em, 1.6em, 0px) !important; + right: 0 !important; + left: auto !important; +} +.nav nav .nav-item .nav-link { + font-size: initial; + line-height: initial; + background: none; + border: none !important; +} + + +/*boite recherche scroll*/ +.recherche_scroll button.btn { + background: var(--background-dark); + border: none; + box-shadow: none; +} +.recherche_scroll button.dropdown-toggle.btn::after { + content: "\f002"; + background: url('/library/templates/Herisson/Assets/images/search-solid.svg'); + background-size: 100%; + color: transparent; + background-repeat: no-repeat; + margin: auto; + border: none; + vertical-align: initial; + display: initial; + filter: invert(1); + width: 1em; + display: inline-block; + line-height: 1em; +} +.recherche_scroll .search_dropdown_menu form > button.search_submit_button { + color: var(--card-text_background-very-dark) !important; +} +.widget.rech_simple .dropdown-menu button.search_submit_button i:first-child { + margin-right: 0; +} +.recherche_scroll button.btn:hover { + background: var(--background-very-dark); + box-shadow: none; +} +.recherche_scroll div.show button.dropdown-toggle.btn { + background: var(--background-very-dark); +} +.recherche_scroll .dropdown-menu.search_dropdown_menu.show { + left: 0 !important; + right: 0 !important; + display: flex; + box-shadow: none; + position: fixed; + padding: 10px !important; + width: 100% !important; + top: 5.8em !important; + border-bottom: none !important; + height: auto !important; + z-index: 10; + min-width: 50%; + margin: auto; +} +.recherche_scroll .search_dropdown_menu form { + justify-content: center; +} +.nav nav .nav-item .recherche_scroll .dropdown-menu.search_dropdown_menu.show { + transform: none!important; +} +.recherche_scroll .dropdown-menu.search_dropdown_menu.show > div { + width: 100%; +} +.recherche_scroll .form-group.container-fluid { + width: auto; +} +.recherche_scroll .dropdown-menu select { + min-width: 250px; +} + +/*login*/ +.login .dropdown-menu.show { + transform: translate3d(0, 4.4em, 0px) !important; + 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; +} + +/*boite image bannière*/ +.image_banniere img { + height: 300px; + width: 100%; + object-fit: cover; +} +@media(max-width: 1200px) { + .image_banniere img { + height: 180px; + width: 100%; + object-fit: cover; + } +} + +/*boite bib haut de page*/ +.biblio_header .card-title, +.biblio_header .badge-group, +.biblio_header .library_opening_hours { + display: none; +} +.biblio_header .card-body { + padding: 0; +} +.biblio_header .card-body + .card-footer { + display: none!important; +} +.biblio_header .card_description { + margin: 0; +} +.biblio_header .closed, +.biblio_header .vert { + box-shadow: 2px 2px 4px #888; + font-size: 18px; +} +.biblio_header .model_description_Class_Bib { + display: none; +} + + +/*boite bib bas de page horaire*/ +.biblio_footer .library_opening, +.biblio_footer h3 { + display: none; +} +.biblio_footer .badge-group { + display: grid; +} +.biblio_footer .badge_tag.badge_address { + background: none; + margin-bottom: 1em; +} +.biblio_footer .badge_tag.badge_address .badge_text { + font-size: 14px; + font-style: normal; + font-weight: bold; +} +.biblio_footer .library_opening_hours { + font-weight: bold; +} +.biblio_footer .custom_fied { + display: none; +} +.biblio_footer .model_description_Class_Bib { + display: none; +} + + +/* Fonds transparent */ +.action_rendering .facette_titre .list-group-item, +.card { + background: none; +} +.widget > .card-footer, .card-footer { + padding: 5px; + background: none; +} +.widget-footer.card-footer { + padding: 1.75rem !important; +} +.action_rendering .list-group-item > .card { + background: none; +} +/*ne fonctionne pas mais c'est fait exprès*/ +.bg-transparent { + background-color: none !important; +} + + +/*bouton*/ +.vert { + background-color: var(--vert) !important; +} +.closed { + background-color: var(--red) !important; +} +.text-warning { + color: var(--red) !important; +} +.red_list_message { + color: var(--red) !important; +} +.badge * { + color: var(--white); + font-size: 14px; +} +.btn-primary, +.btn-primary:hover, +.badge-primary, +.badge-primary:hover { + background-color: var(--background-dark); + border-color: var(--background-dark); +} +.btn-primary, +a.btn-primary, +a.btn-primary:hover, +.badge-primary *, +a.badge-primary:focus, +a.badge-primary:hover { + color: var(--black)!important; + background-color: var(--background-dark); + border-color: var(--background-dark); +} +.btn-secondary, +.btn-secondary:hover, +button.btn-secondary, +button.btn-secondary:hover { + color: var(--black); + background-color: var(--white); + box-shadow: 4px 4px 6px #888 ; +} +.wrapper_user_informations .btn-secondary.text-light { + color: var(--black) !important; + box-shadow: none; + border: 1px solid var(--black) !important; +} +.wrapper_user_informations .btn-secondary.text-light:hover { + color: var(--black) !important; + opacity: 0.5; +} +.badge-secondary, +.badge-secondary:hover, +a.badge-secondary:focus, +a.badge-secondary:hover { + color: var(--white); + background-color: var(--black); + border-color: var(--black); +} +.result_pager .btn-secondary.text-light { + background: var(--black); +} + +.btn-info, +.btn-info:hover, +.badge-info, +.badge-info:hover, +a.badge-info:focus, +a.badge-info:hover { + color: var(--white); + background-color:var(--background-very-dark); + border-color: var(--background-very-dark); +} + +.btn-light, +.btn-light:hover { + color: var(--white); + background-color: var(--background-very-dark); + border-color: var(--background-very-dark); +} +.btn-dark, +.btn-dark:hover { + color: var(--white); + background-color: var(--black); + border-color: var(--black); +} +.badge_tag { + margin: 2px; +} +.badge.badge-light { + background: var(--background-dark); +} +.badge.badge-light * { + color: var(--black); +} +.badge.badge-light .text-dark { + color: var(--white)!important; +} + +.badge-yellow, +.badge-yellow:hover, +.btn-yellow, +.btn-yellow:hover { + background-color:var(--yellow); + border-color: var(--yellow); +} +.badge-yellow *, +.badge-yellow:hover *, +.btn-yellow *, +.btn-yellow:hover * { + color: var(--black); +} + +.badge-dark { + background-color: var(--black); +} + +.bg-danger { + background-color: var(--red)!important; +} +.text-vert { + color: var(--vert)!important; +} +.bg-vert, +.vert { + background-color: var(--vert)!important; +} +.btn-vert { + color: var(--white); + background-color: var(--vert); + border-color: var(--vert); +} +.text-danger { + color: var(--red)!important; +} +.text-info { + color: var(--red) !important; + text-transform: uppercase; +} +.badge-light.bg-white { + background: var(--background-dark) !important; +} +.active_criteria * { + color: var(--white); +} +.result_list_mod .btn-light, +.result_list_mod .btn-light:hover, +.result_wall_mod .btn-light, +.result_wall_mod .btn-light:hover { + background-color: var(--background-dark); +} +.result_list_mod .btn-light *, +.result_wall_mod .btn-light * { + color: var(--black); +} + +.result_list_mod .btn-light:not(:disabled):not(.disabled).active, +.result_list_mod .btn-light:not(:disabled):not(.disabled).active:hover, +.result_wall_mod .btn-light:not(:disabled):not(.disabled).active, +.result_wall_mod .btn-light:not(:disabled):not(.disabled).active:hover { + background-color: var(--background-very-dark); +} +.result_list_mod .btn-light:not(:disabled):not(.disabled).active *, +.result_wall_mod .btn-light:not(:disabled):not(.disabled).active * { + color: var(--white); +} + +.rating-ico:first-child, +.rating-ico { + color: var(--vert); + margin-right: 1px; +} +label[data-name="note"] ~ div label.multi-element-label { + color: var(--red); + display: inline-block; + flex: auto; + font-size: 1.25em; + font-weight: 200; + margin: 0; + padding: 0 3px 0 0; + transition: all .2s; +} +label[data-name="note"] ~ div label.multi-element-label:hover { + cursor: pointer; + color: var(--vert); + font-weight: 900; +} +label[data-name="note"] ~ div label.multi-element-label:hover ~ label { + font-weight: 900; + color: var(--vert); +} + +.navbar-light.btn-secondary { + background-color: var(--background-dark); +} +.filters { + display: inline-block; +} +.filters .col { + width: max-content; +} +.filters button { + border: 1px solid var(--black); +} +.filters .filter_reset_button { + display: inline-flex; + background: var(--background-very-dark); + color: var(--white); +} +.filters .filter_reset_button i { + margin: auto .25em; +} + +.critiques .card-deck .card_Intonation_Library_View_Wrapper_ReviewInRecord:not(:nth-child(2)) { + display: none; +} +header .boite.nav .configuration_module { + right: 25% !important; +} +main .ajaxable { + margin-top: 40px; +} +.wrapper_user_agenda .jumbotron_section_content > .container-fluid { + margin-top: 40px; +} + +body[class*="abonne_"] .badge.badge-light.fs_1em { + background: none; +} + +/*accessibilite*/ +.accessibility .dropdown-menu.show { + background: var(--background); + width: max-content; + display: grid; + transform: translate3d(-10em, -24em, 0px) !important; +} +.accessibility .dropdown-menu.show .accessibility { + font-size: 14px; +} +.accessibility .dropdown-menu.show .accessibility img { + height: 30px!important; +} + +[data-font-size="default"] { + margin-bottom: 3.5em; +} +[data-font-size="decrease_font_size"], +[data-font-size="current_font_size"], +[data-font-size="increase_font_size"] { + width: auto; + position: absolute; + bottom: 5px; +} +[data-font-size="decrease_font_size"] { + left: 0; +} +[data-font-size="current_font_size"] { + left: 40%; +} +[data-font-size="increase_font_size"] { + right: 0; +} + +/* Mur */ +.library .masonry { + margin-top: 2em; +} +.masonry_grid .masonry-brick { + grid-row-end: unset !important; + margin-bottom: 1em; +} +.masonry .masonry-brick { + visibility: hidden; + overflow: hidden; + /*min-height: 100%;*/ + grid-row-end: unset !important; + /*padding-bottom: 1em;*/ +} +.masonry .masonry-brick .masonry-content { + min-height: 100%; +} + + +/*carousel*/ +.carousel-inner { + width: 93%; + margin: auto; +} +.carousel-control-prev { + left:-2em; +} +.carousel-control-next { + right:-2em; +} +.carousel-control-next:before, +.carousel-control-prev:after { + font-size: 15px; +} +.carousel-control-next:before{ + content:"Suivant"; +} +.carousel-control-prev:after { + content:"Précédent"; +} +[class*="carousel-control"] { + height:25px; + background-color: var(--background-dark); + font-size: 4px; + opacity : 1 !important; + color:var(--white) !important; +} +a[class*="carousel-control"]:hover { + background-color:var(--background-very-dark); + color: var(--white) !important; +} +.carousel-indicators .bg-dark { + background-color: var(--background-dark) !important; +} + + +/*a mettre dans le theme herisson*/ +/*brown light 1 sur 2*/ +.list-group .list-group-item:nth-child(2n+1), +.masonry .masonry-brick:nth-child(2n+1) .masonry-content { + background: var(--background-light); +} +.list-group .list-group-item.bg-transparent:nth-child(2n+1), +.masonry .masonry-brick.bg-transparent:nth-child(2n+1) .masonry-content { + background: var(--background-light)!important; +} +.background-white_and_light_card .card.card_template:nth-child(2n+1) { + background: var(--background-light); +} +.list-group .list-group-item.active { + background: var(--background-very-dark); + color: var(--white); +} + +/* Page recherche */ +.form_facets .facette_titre { + background: var(--background-dark); + box-shadow: 0px 2px 4px #888; +} +.action_rendering .facette_titre * { + color: var(--black); + font-weight: bold; +} +.action_rendering .facette_titre b { + text-transform: uppercase; +} + + + +/*page notice*/ +.jumbotron { + background-color: var(--background-light); +} +.jumbotron_title .card-link { + display: inline-block; + margin-bottom: 1em; +} +.jumbotron .nav-link { + font-size: 1.5em; + color: var(--black) !important; +} +.jumbotron .nav-link.disabled { + color: var(--black-opacity-50)!important; + background-color: transparent; + border-color: transparent; +} +.jumbotron .nav-link div { + font-size: 14px; +} + +.jumbotron_content .leaflet-pane.leaflet-popup-pane * { + border: none; +} +.jumbotron_content .wrapper_related .carousel.slide.multiple_carousel .card-img.img-fluid.rounded, +.jumbotron_content .wrapper_document_author .carousel.slide.multiple_carousel .card-img.img-fluid.rounded { + max-height: 250px; + width: auto; +} +h2.jumbotron_section_title * { + color: var(--background-very-dark); + font-size: 35px; + font-weight: bold; +} +.jumbotron_section_content a.text-second { + text-decoration: underline; +} +.bokeh_jumbotron { + margin-top: 40px; +} +.bokeh_jumbotron .jumbotron_thumbnail { + margin-top: -40px; +} + +.bokeh_jumbotron .jumbotron_thumbnail .img-thumbnail { + box-shadow: 0px 2px 4px #888; + min-width: 100px; +} + + +/*fiche bib*/ +.wrapper_library_openings .default_opening_hours h3 { + font-size: 20px; + color: var(--background-very-dark); + text-decoration: underline; + margin-top: 1em; +} +.wrapper_library_openings section h2, +.wrapper_library_details section h2 { + display: none; +} +/*bibliotheque nb doc + utilisateur */ +.wrapper_library_details section ~ p { + display: none; +} +.wrapper_library_details section ~ .container-fluid { + margin-top: 1em; +} +.wrapper_library_details section ~ .container-fluid div { + padding: 0; +} +.wrapper_library_agenda [class*="custom_field"] { + display: none; +} + +/*auteur*/ +.wrapper_author_biography h3 { + font-size: 18px; + color: var(--card-header); + text-transform: uppercase; + margin-top: .5em; +} +.wrapper_author_biography h2 { + font-size: 24px; + color: var(--background-dark); + text-transform: uppercase; + font-weight: normal; + margin-top: 1em; +} + +.jumbotron_content .wrapper_author_biography .biography_scroll b, +.jumbotron_content .wrapper_author_biography .biography_scroll i { + margin: unset; + font-style: unset; + font-weight: unset; + vertical-align: unset; +} + +/*.list-group,*/ +.search_records_col, +.truncate_list_wrapper { + margin-top: 40px; +} +.list-group .list-group-item { + box-shadow: 0px 2px 4px #888; + margin-bottom: 50px !important; +} +.facets_suggestions .list-group .list-group-item { + box-shadow: 0px 2px 4px #888; + margin-bottom: initial !important; + background: none; +} +.wrapper_author_biography .list-group .list-group-item { + box-shadow: 0px 2px 4px #888; + margin-bottom: 0 !important; +} +.search_records_col .masonry .masonry-brick { + box-shadow: 0px 2px 4px #888; + margin-bottom: 10px !important; +} +.list-group .list-group-item .cardify_horizontal_img { + margin-top: -40px; + min-width: 100px; +} +.list-group .list-group-item .cardify_horizontal_img .card-link img { + box-shadow: 0px 2px 4px #888; + width: 250px; +} + +.list-group .list-group-item .cardify_horizontal_img .img-thumbnail { + background: none; +} + + + +/*image carte*/ +footer .leaflet_osm { + height: 200px; + width: auto; +} +footer .leaflet-pane.leaflet-popup-pane { + display: none; +} + +/*administration*/ +.admin_tools .dropdown-menu.show { + background: var(--white); +} +.menu_admin_front .admin_menu_title * { + text-align: center; +} +.menu_admin_front li { + text-align: left; + font-size: 14px; + padding: .15em 0 !important; +} +.menu_admin_front a img { + height: 20px !important; + width: 20px !important; + object-fit: contain; +} + +/*carte*/ +.leaflet-popup.osm-customiz-popup.leaflet-zoom-animated { + width: 220px; +} +.leaflet-popup-content { + width: 220px !important; + margin: 0!important; + padding: 10px; + height: 100%; +} + + +.filters .col .dropdown-menu.show { + transform: translate3d(8px, 37px, 0px) !important; +} + +.wrapper_user_loans .card_template .card-footer { + justify-content: space-evenly !important; +} + +/*info mon compte*/ +.wrapper_user_informations .card-body .row { + column-count: 2; + display: block; +} +.wrapper_user_informations .card-body .row dt { + text-align: left ; + max-width:100%; + flex: 0 0 100%; + padding: 8px 0; +} + +.wrapper_user_informations .card-body .row dd { + border: 1px solid #ced4da; + height: 40px; + border-radius: 5px!important; + padding: 8px 15px; + flex: 0 0 100%; + max-width:100%; +} + + +.wrapper_zendafi_form_user_settings_userimageselector { + display: none; +} +/*formulaire mon compte*/ +.zendafi_form_user_settings_popup_features.form-check-input { + position: initial; + margin-top: .5rem; + margin-left: 0; +} + + +/*recherche*/ +.search_result .search_title_col { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + line-height: 16px; + max-height: 64px; +} +.search_result .unremovable_criterion { + display: none; +} +.wrapper_zendafi_form_advancedsearch_genre .tag_selection { + padding: 0.2em; + margin: 0.2em; + border-bottom: none; +} +.wrapper_zendafi_form_advancedsearch_genre #genre_saisie { + padding: 2em; +} + +/*responsive*/ +@media (max-width: 1500px) { + .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(4,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + .masonry .card.record_no_thumbnail .button_text { + width: 160px !important; + } + .masonry_grid .masonry-brick { + width: 270px; + } + .search_records_col .masonry .masonry-brick { + width: 260px; + } + .card-deck-medium > .card_template { + width: 365px; + } +} + +@media (min-width: 1500px) { + .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(5,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + .masonry .card.record_no_thumbnail .button_text { + width: 230px !important; + } + .masonry_grid .masonry-brick { + width: 300px; + } + .search_records_col .masonry .masonry-brick { + width: 275px; + } + .card-deck-medium > .card_template { + width: 480px; + } +} + +@media (max-width: 1200px) { + .py-9 { + padding-left: 2rem !important; + padding-right: 2rem !important; + } + .py-9 .widget-footer.card-footer { + padding-left: 3.75rem !important; + padding-right: 3.75rem !important; + } + .card-deck-medium { + margin: 0; + display: grid!important; + gap: 15px 0!important; + grid-template-columns: repeat(3, auto)!important; + } + .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(3,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + header .boite.image.position_fixed_top_left .image_widget.img-fluid { + height: 100%; + padding-top: 1em; + } + .search_records_col .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(2,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + .card-footer .dropleft.dropup .dropdown-menu { + bottom: 1.5em !important; + right: 0 !important; + width: 220px; + } + .view_more_record_actions .dropleft.dropup .dropdown-menu { + bottom: 1.5em !important; + right: 0 !important; + width: 350px; + } + .masonry_grid .masonry-brick { + width: 250px; + } + .search_records_col .masonry .masonry-brick { + width: 255px; + } + .card-deck-medium > .card_template { + width: 240px; + } +} + +@media (max-width: 575px) { + .py-9 { + padding-left: 0 !important; + padding-right: 0 !important; + } + h2.jumbotron_section_title * { + color: var(--background-very-dark); + font-size: 30px; + font-weight: bold; + } + .form-group label { + text-align: left; + } + dt { + text-align: left; + } + .card_grid { + display: grid; + gap: 15px 10px; + grid-template-columns: repeat(1, auto); + } + .filters .col { + display: block; + max-width: 100%; + flex: 0 0 100%; + } + .filters .col button, + .filter_reset_button { + width: 100%; + margin: 0.5em 0; + } + .filters .col .dropdown-menu.show { + transform: translate3d(0, 44px, 0px) !important; + width: 100%; + } + .card-deck-medium { + margin: 0; + display: grid!important; + gap: 15px 0!important; + grid-template-columns: repeat(1, auto)!important; + } + .background-white .card-deck > .card_template { + margin: 0 1.5% 2% 1.5% !important; + box-shadow: 4px 4px 6px #888 !important; + } + .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(1,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + .search_records_col .masonry { + display: grid; + grid-gap: 1em; + grid-template-columns: repeat(1,auto); + grid-auto-rows: 40px; + gap: 0 10px; + grid-template-rows: repeat(10000, auto); + } + .boite.nav .navbar-light::after { + content: "MENU"; + font-size: .875rem; + } + .boite.nav .navbar-toggler-icon { + display: none; + } + main img { + max-width: 100%; + height: auto; + } + .py-9 .widget-footer.card-footer { + padding-left: 0.75rem !important; + padding-right: 0.75rem !important; + } + .widget-footer.card-footer { + position: initial; + margin-left: auto; + /*margin-right: 1em;*/ + margin-right: 0; + padding: 1.75rem 0 !important; + } + header .boite.nav [class*="menu_entry_MENU"] .dropdown-menu.list-unstyled.w-max.show { + width: 100% !important; + box-shadow: none; + border: none; + } + .rech_simple { + padding: 0; + } + .navbar-nav .dropdown-menu.search_dropdown_menu { + display: initial; + border: none; + } + .boite.nav nav .navbar-collapse { + margin-top: 2em; + } + .recherche_scroll button.btn-secondary { + display: none; + } + .recherche_scroll .dropdown-menu.search_dropdown_menu.show { + left: 0 !important; + right: 0 !important; + display: flex; + box-shadow: none; + position: initial; + padding: 10px 0 !important; + width: 100% !important; + top: 15.8em !important; + border-bottom: 1px solid rgba(0,0,0,.15) !important; + height: auto !important; + z-index: 10; + min-width: 50%; + margin: 1em 0; + } + .recherche_scroll .form-group.container-fluid { + width: 100%; + padding: .25rem; + } + .recherche_scroll .zendafi_form_search_submit_button { + margin: auto; + } + header .boite.login .dropdown-menu.dropdown-menu-right.show { + box-shadow: none; + border: none; + position: fixed !important; + left: 0 !important; + z-index: 1000; + float: left; + min-width: 10rem; + padding: .5rem 0; + margin: 5em auto; + font-size: 1rem; + color: #212529; + text-align: left; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border-radius: .25rem; + right: 0 !important; + width: 100% !important; + transform: none !important; + } + + .jumbotron_nav_link.nav-link { + display: grid; + padding: .5rem 1rem; + } + .wrapper_user_informations .card-link { + margin-bottom: .5em; + max-width: 100%; + flex: 0 0 100%; + display: block; + } + .wrapper_user_informations .card-body .row { + column-count: 1; + display: block; + } + .collection_actions .collection_action { + max-width: 100%; + flex: 0 0 100%; + margin-bottom: .5em; + } + .search_facets_col .navbar-toggler-icon { + display: none; + } + .search_facets_col .navbar-toggler::after { + content: "Filtrer"; + font-size: .875rem; + } + .result_select_records .button_text { + display: initial !important; + } + .result_list_mod, + .result_wall_mod { + display: none; + } + .result_select_records .dropdown-menu.show { + width: 280px; + transform: translate3d(-121px, 32px, 0px) !important; + } + .cardify_horizontal_actions .card_action input.form-check-input + label { + width: 70%; + } + .masonry_grid .masonry-brick { + width: 100%; + } + .search_records_col .masonry .masonry-brick { + width: 100%; + } + .card-deck-medium > .card_template { + width: 100%; + } +} + +@media (min-width: 576px) { + body .card_grid { + grid-template-columns: repeat( auto-fill, minmax(145px, 18%) ); + } +} + +@media (min-width: 1200px) { + body .card_grid { + grid-template-columns: repeat( auto-fill, minmax(185px, 19%) ); + } +} + +@media (min-width: 1600px) { + body .card_grid { + grid-template-columns: repeat( auto-fill, minmax(250px, 19%) ); + } +} diff --git a/library/templates/Herisson/Assets/images/bandeau.jpg b/library/templates/Herisson/Assets/images/bandeau.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cc1c2213f45e376289295eaefa3c6a80253c60da Binary files /dev/null and b/library/templates/Herisson/Assets/images/bandeau.jpg differ diff --git a/library/templates/Herisson/Assets/images/bandeau_herisson.jpg b/library/templates/Herisson/Assets/images/bandeau_herisson.jpg new file mode 100644 index 0000000000000000000000000000000000000000..90007211d01c8526561a58d7d5e35078438d5863 Binary files /dev/null and b/library/templates/Herisson/Assets/images/bandeau_herisson.jpg differ diff --git a/library/templates/Herisson/Assets/images/banniere_herisson.jpg b/library/templates/Herisson/Assets/images/banniere_herisson.jpg new file mode 100644 index 0000000000000000000000000000000000000000..43418b9a5415244e4f9979b42a6ed50aaee43310 Binary files /dev/null and b/library/templates/Herisson/Assets/images/banniere_herisson.jpg differ diff --git a/library/templates/Herisson/Assets/images/herisson_logo.png b/library/templates/Herisson/Assets/images/herisson_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..33a532962cc6bfe0f639ea0f50f124e8108c2cd3 Binary files /dev/null and b/library/templates/Herisson/Assets/images/herisson_logo.png differ diff --git a/library/templates/Herisson/Assets/images/logo_herisson.png b/library/templates/Herisson/Assets/images/logo_herisson.png new file mode 100644 index 0000000000000000000000000000000000000000..516042464d02338349ad959e3a83fafe47868838 Binary files /dev/null and b/library/templates/Herisson/Assets/images/logo_herisson.png differ diff --git a/library/templates/Herisson/Assets/images/search-solid.svg b/library/templates/Herisson/Assets/images/search-solid.svg new file mode 100644 index 0000000000000000000000000000000000000000..f41bbdd43b020e19e1c47f7c8b64801b85a2274a --- /dev/null +++ b/library/templates/Herisson/Assets/images/search-solid.svg @@ -0,0 +1 @@ +<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path></svg> \ No newline at end of file diff --git a/library/templates/Herisson/Library/FormCustomizer.php b/library/templates/Herisson/Library/FormCustomizer.php new file mode 100644 index 0000000000000000000000000000000000000000..accec2be20c8ba5fbd39d8ca1fe733c3915bbb00 --- /dev/null +++ b/library/templates/Herisson/Library/FormCustomizer.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_Library_FormCustomizer extends Intonation_Library_FormCustomizer { + public function getTemplateForm($form) { + return (new Herisson_Library_FormCustomizer_Template($this->_template, $form))->getForm(); + } +} diff --git a/library/templates/Herisson/Library/FormCustomizer/Template.php b/library/templates/Herisson/Library/FormCustomizer/Template.php new file mode 100644 index 0000000000000000000000000000000000000000..68a739aba16efde219e825767c224fe4f051c835 --- /dev/null +++ b/library/templates/Herisson/Library/FormCustomizer/Template.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_Library_FormCustomizer_Template extends Intonation_Library_FormCustomizer_Template { + public function getForm() { + parent::getForm(); + + $this->_form + ->addElement('checkbox', + $this->_template->withNameSpace('herisson_css'), + ['label' => $this->_('herisson.css'), + 'order' => 3]); + + $this->_addToTemplateGroup(['herisson_css']); + + return $this; + } +} diff --git a/library/templates/Herisson/Library/ProfilePatcher.php b/library/templates/Herisson/Library/ProfilePatcher.php new file mode 100644 index 0000000000000000000000000000000000000000..5e4fee738357696ff086c0124189131a30b01f1c --- /dev/null +++ b/library/templates/Herisson/Library/ProfilePatcher.php @@ -0,0 +1,912 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher { + + protected + $_main_menu_simple_bib, + $_main_menu_reseau_bib, + $_credits_menu, + $_recherche_scroll_menu, + + $_agenda_page, + $_reseau_page, + + $_adulte_page, + $_jeunesse_page, + $_multimedia_page, + $_imageetson_page, + + $_mentionslegales_page, + $_accessibilite_page, + + $_disable_widget_template, + + $_only_content_widget_template, + $_disable_only_content_widget_template, + + $_widget_nav_classes, + $_tag_main_settings, + + $_widget_in_main_settings, + $_widget_general_settings, + $_header_section_settings, + $_footer_section_settings; + + + public function __construct($template) { + parent::__construct($template); + + $this->_disable_widget_template = [$this->_template->withNameSpace('show_header') => 0, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 0]; + + $this->_only_content_widget_template = [$this->_template->withNameSpace('show_header') => 0, + $this->_template->withNameSpace('show_content') => 1, + $this->_template->withNameSpace('show_footer') => 0]; + + $this->_disable_only_content_widget_template = [$this->_template->withNameSpace('show_header') => 1, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 1]; + + $this->_widget_general_settings = ['no_background', + 'no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto']; + + $this->_widget_nav_classes = ['background-white', + 'no_border_widget', + 'no_border_radius']; + + $this->_tag_main_settings = ['boite' => ['no_border_radius', + 'm-auto', + 'py-3', + 'px-3', + 'herisson_widget'], + $this->_template->withNameSpace('width_xsmall') => 12]; + + $this->_widget_in_main_settings = array_merge(['boite' => ['no_border_widget', + 'no_shadow', + 'mx-auto'], + 'rendering' => 'card', + 'layout' => 'grid', + 'size' => 99, + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_large') => 10], + $this->_disable_only_content_widget_template); + + $this->_header_section_settings = ['boite' => ['no_background'], + $this->_template->withNameSpace('width_xsmall') => 12]; + $this->_footer_section_settings = ['boite' => ['background-dark'], + $this->_template->withNameSpace('width_xsmall') => 12]; + } + + + protected function _generatePacks() { + $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto = + $this->_getOrCreateStylePack($this->_('Marges horizontales automatiques, sans bordure de boites, sans arrondi, sans ombre, sans fond'), + ['no_background', + 'no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto']); + + + $this->_style_pack_no_border_no_radius_no_shadow_mx_auto_my_5 = + $this->_getOrCreateStylePack($this->_('Marges horizontales automatiques, marges vertical à 5, sans bordure de boites, sans arrondi, sans ombre'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'my-5']); + + + + $this->_style_pack_background_white = + $this->_getOrCreateStylePack($this->_('Fond blanc'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'background-white', + 'py-3', + 'my-3']); + $this->_style_pack_background_light = + $this->_getOrCreateStylePack($this->_('Fond clair'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'background-light', + 'py-3', + 'my-3']); + $this->_style_pack_background_dark = + $this->_getOrCreateStylePack($this->_('Fond foncé'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'background-dark', + 'py-3', + 'my-3']); + $this->_style_pack_background_very_dark = + $this->_getOrCreateStylePack($this->_('Fond très foncé'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'background-very_dark', + 'py-3', + 'my-3']); + $this->_style_pack_image_banniere = + $this->_getOrCreateStylePack($this->_('Image banniere'), + ['no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'image_banniere', + 'mt-8']); + $this->_style_pack_biblio_header = + $this->_getOrCreateStylePack($this->_('Boite bibliothèque bouton horaires'), + ['no_background', + 'no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'biblio_header']); + $this->_style_pack_biblio_footer = + $this->_getOrCreateStylePack($this->_('Boite bibliothèque horaires'), + ['no_background', + 'no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'biblio_footer', + 'no_footer_card']); + $this->_style_pack_recherche_scroll = + $this->_getOrCreateStylePack($this->_('Boite recherche scroll'), + ['no_background', + 'no_border_widget', + 'no_border_radius', + 'no_shadow', + 'mx-auto', + 'recherche_scroll']); + + return $this; + + } + + + protected function _upgradeProfile() { + parent::_upgradeProfile(); + + $this->_profile + ->setRewriteUrl('accueil') + ->setAccessLevel(-1) + ->setLibelle($this->_('Thème Hérisson - Accueil')); + + if ( ! $this->_profile->hasFavicon()) + $this->_profile->setFavicon('../Assets/images/favicon.ico'); + + $this->_profile->save(); + + Class_AdminVar::set('MENU_BOITE', 1); + + return $this + ->_addAgendaPage() + ->_addReseauPage() + ->_addAdultePage() + ->_addJeunessePage() + ->_addMultimediaPage() + ->_addImageetsonPage() + ->_addMentionslegalesPage() + ->_addAccessibilitePage(); + } + + + /* Page agenda */ + protected function _addAgendaPage() { + $this->_agenda_page = $this + ->_createPage($this->_('Agenda')) + ->setRewriteUrl($this->_('agenda')) + ->addWidget(Intonation_Library_Widget_Carousel_Agenda_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Agenda')], + $this->_widget_in_main_settings)); + + return $this; + } + + + /* Page réseau des bibliothèques */ + protected function _addReseauPage() { + $this->_reseau_page = $this + ->_createPage($this->_('Réseau des bibliothèques')) + ->setRewriteUrl($this->_('reseau_des_bibliotheques')) + ->addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Réseau des bibliothèques')], + $this->_widget_in_main_settings)); + + return $this; + } + + /* Page espace adulte */ + protected function _addAdultePage() { + $this->_adulte_page = $this + ->_createPage($this->_('Adulte')) + ->setRewriteUrl($this->_('adulte')) + ->addWidget(Intonation_Library_Widget_Carousel_Domain_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Adulte')], + $this->_widget_in_main_settings)); + + return $this; + } + + + /* Page espace jeunesse */ + protected function _addJeunessePage() { + $this->_jeunesse_page = $this + ->_createPage($this->_('Jeunesse')) + ->setRewriteUrl($this->_('jeunesse')) + ->addWidget(Intonation_Library_Widget_Carousel_Domain_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Jeunesse')], + $this->_widget_in_main_settings)); + + return $this; + } + + + /* Page espace multimédia */ + protected function _addMultimediaPage() { + $this->_multimedia_page = $this + ->_createPage($this->_('Multimédia')) + ->setRewriteUrl($this->_('multimedia')) + ->addWidget(Intonation_Library_Widget_Carousel_Domain_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Multimédia')], + $this->_widget_in_main_settings)); + + return $this; + } + + + /* Page espace image et son */ + protected function _addImageetsonPage() { + $this->_imageetson_page = $this + ->_createPage($this->_('Image et son')) + ->setRewriteUrl($this->_('image_et_son')) + ->addWidget(Intonation_Library_Widget_Carousel_Domain_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Image et son')], + $this->_widget_in_main_settings)); + + return $this; + } + + + /* Page mentions légales */ + protected function _addMentionslegalesPage() { + $categorie = $this->_getOrCreateCategory($this->_('Herisson')); + + $article_content = file_get_contents(ROOT_PATH . 'library/templates/Herisson/Assets/contents/mentions_legales.html'); + + $article = (new Class_Article()) + ->updateAttributes(['titre' => $this->_('Mentions légales'), + 'categorie' => $categorie, + 'status' => Class_Article::STATUS_VALIDATED, + 'contenu' => $article_content]); + $article->save(); + + $this->_mentionslegales_page = $this + ->_createPage($this->_('Mentions légales')) + ->setRewriteUrl($this->_('mentions_legales')) + ->addWidget(Intonation_Library_Widget_Free_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Mentions légales'), + 'id_items' => $article->getId()], + $this->_widget_in_main_settings)); + return $this; + } + + /* Page accessibilite */ + protected function _addAccessibilitePage() { + $categorie = $this->_getOrCreateCategory($this->_('Herisson')); + + $article_content = file_get_contents(ROOT_PATH . 'library/templates/Herisson/Assets/contents/accessibilite.html'); + + $article = (new Class_Article()) + ->updateAttributes(['titre' => $this->_('Accessibilité'), + 'categorie' => $categorie, + 'status' => Class_Article::STATUS_VALIDATED, + 'contenu' => $article_content]); + $article->save(); + + $this->_accessibilite_page = $this + ->_createPage($this->_('Accessibilité')) + ->setRewriteUrl($this->_('accessibilite')) + ->addWidget(Intonation_Library_Widget_Free_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Accessibilité'), + 'id_items' => $article->getId()], + $this->_widget_in_main_settings)); + return $this; + } + + + protected function _upgradeSections() { + return $this + ->_setHeaderSettings($this->_header_section_settings) + ->_setMainSettings(['boite' => ['no_border_radius', + 'm-auto', + 'herisson_widget'], + $this->_template->withNameSpace('width_xsmall') => 12]) + + ->_setFooterSettings($this->_footer_section_settings); + } + + + protected function _upgradeMenus() { + $recherche_widget_menu = + $this->_addWidgetInMenu(Intonation_Library_Widget_Search_Definition::CODE, + array_merge(['titre' => $this->_('Recherche scroll'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_recherche_scroll->getId(), + 'search_button' => 'class fas fa-search', + 'placeholder' => $this->_('Tapez ici votre recherche (Titre, Auteur, Mot clé...)'), + 'type_doc' => 'Tous types de documents :', + 'facets_in_session' => 0, + 'always_new_search' => 1, + 'select_doc' => 1, + 'recherche_avancee' => 0, + 'doc_type_selection_label' => '', + 'HerissonVisibleWhenHidden' => '6', + $this->_template->withNameSpace('form_style') => 'toggle', + 'menu' => $this->_profile_id . '-' . $this->_recherche_scroll_menu, + $this->_template->withNameSpace('width_xsmall') => 12], + $this->_disable_widget_template)); + + $this->_recherche_scroll_menu = $this->_profile + ->addMenu(['libelle' => $this->_('Menu recherche en scroll'), + 'picto' => '', + 'menus' => [$recherche_widget_menu]]); + + $this->_main_menu_simple_bib = $this->_profile + ->addMenu(['libelle' => $this->_('Menu bibliothèque'), + 'picto' => '', + 'menus' => [['type_menu' => 'ACCUEIL', + 'libelle' => $this->_('Accueil'), + 'use_profil' => $this->_profile_id], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Infos pratiques'), + 'url' => $this->_getLibraryUrl()], + + ['type_menu' => 'PROFIL', + 'libelle' => $this->_('Agenda'), + 'clef_profil' => $this->_agenda_page->getId()], + + ['type_menu' => 'MENU', + 'libelle' => $this->_('Espaces'), + 'sous_menus' => [['type_menu' => 'PROFIL', + 'libelle' => $this->_('Adulte'), + 'clef_profil' => $this->_adulte_page->getId()], + + ['type_menu' => 'PROFIL', + 'libelle' => $this->_('Jeunesse'), + 'clef_profil' => $this->_jeunesse_page->getId()], + + ['type_menu' => 'PROFIL', + 'libelle' => $this->_('Multimedia'), + 'clef_profil' => $this->_multimedia_page->getId()], + + ['type_menu' => 'PROFIL', + 'libelle' => $this->_('Image et son'), + 'clef_profil' => $this->_imageetson_page->getId()]]], + + $recherche_widget_menu]]); + + + $this->_main_menu_reseau_bib = $this->_profile + ->addMenu(['libelle' => $this->_('Menu réseau bibliothèques'), + 'picto' => '', + 'menus' => [['type_menu' => 'ACCUEIL', + 'libelle' => $this->_('Accueil'), + 'use_profil' => $this->_profile_id], + + ['type_menu' => 'MENU', + 'libelle' => $this->_('Infos pratiques'), + 'sous_menus' => [['type_menu' => 'PROFIL', + 'libelle' => $this->_('Tout le réseau'), + 'clef_profil' => $this->_reseau_page->getId()], + ['type_menu' => 'URL', + 'libelle' => $this->_('Bibliothèque n°1'), + 'url' => $this->_getLibraryUrl()], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Bibliothèque n°2'), + 'url' => $this->_getLibraryUrl()], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Bibliothèque n°3'), + 'url' => $this->_getLibraryUrl()], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Bibliothèque n°4'), + 'url' => $this->_getLibraryUrl()]]], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Agenda'), + 'url' => $this->_agenda_page->getUrl()], + + ['type_menu' => 'MENU', + 'libelle' => $this->_('Espaces'), + 'sous_menus' => [['type_menu' => 'PROFIL', + 'libelle' => $this->_('Adulte'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_adulte_page->getId()])], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Jeunesse'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_jeunesse_page->getId()])], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Multimedia'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_multimedia_page->getId()])], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Image et son'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_imageetson_page->getId()])]]], + $recherche_widget_menu]]); + + $credit_widget_menu = + $this->_addWidgetInMenu(Intonation_Library_Widget_Credits_Definition::CODE, + array_merge(['titre' => $this->_('Crédits'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'boite' => ['p-3'], + 'link_to_all' => 0, + $this->_template->withNameSpace('width_xsmall') => 12], + $this->_disable_widget_template)); + + $this->_credits_menu = $this->_profile + ->addMenu(['libelle' => $this->_('Menu crédits'), + 'picto' => '', + 'menus' => [['type_menu' => 'URL', + 'libelle' => $this->_('Contact'), + 'url' => '/index/formulairecontact'], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Mentions Légales'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_mentionslegales_page->getId()])], + + ['type_menu' => 'URL', + 'libelle' => $this->_('Accessibilité'), + 'url' => Class_Url::relative(['controller' => 'index', + 'action' => 'index', + 'id_profil' => $this->_accessibilite_page->getId()])], + $credit_widget_menu]]); + + $this->_profile->save(); + return $this; + } + + + protected function _upgradeWidgets() { + $this + ->removeWidgets() + + ->_addWidget(Intonation_Library_Widget_Nav_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Navigation principal'), + 'boite' => array_merge(['my-3', + 'justify-content-center', + 'position_fixed_top'], + $this->_widget_nav_classes), + 'menu' => $this->_profile_id . '-' . $this->_main_menu_simple_bib, + $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_SMALL, + $this->_template->withNameSpace('width_xsmall') => 12], + $this->_only_content_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Image_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Logo du réseau'), + 'boite' => ['no_background', + 'no_shadow', + 'mr-auto', + 'justify-content-center', + 'position_fixed_top_left', + 'no_border_widget', + 'no_border_radius'], + 'image' => Class_Url::absolute('/library/templates/Herisson/Assets/images/herisson_logo.png'), + 'link' => $this->_('/accueil'), + $this->_template->withNameSpace('width_xsmall') => 4, + $this->_template->withNameSpace('width_medium') => 2, + $this->_template->withNameSpace('width_large') => 2], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Login_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Connexion'), + 'boite' => ['no_background', + 'no_shadow', + 'align-items-center', + 'ml-auto', + 'text-align-center', + 'position_fixed_top_right', + 'no_border_widget', + 'no_border_radius'], + 'titre_connecte' => $this->_('Mon compte'), + 'message_connecte' => '', + 'identifiant' => $this->_('Identifiant'), + 'identifiant_exemple' => $this->_('N° de carte'), + 'mot_de_passe' => $this->_('Mot de passe'), + 'mot_de_passe_exemple' => $this->_('Année de naissance'), + 'lien_connexion' => $this->_('Se connecter'), + 'lien_deconnection' => $this->_('Se déconnecter'), + 'lien_mot_de_passe_oublie' => $this->_('Mot de passe oublié'), + 'lien_compte' => $this->_('Mon compte'), + 'lien_creer_compte' => $this->_('S\'enregistrer'), + $this->_template->withNameSpace('form_style') => 'toggle', + $this->_template->withNameSpace('width_xsmall') => 12], + $this->_only_content_widget_template)) + + + ->_addWidget(Intonation_Library_Widget_Image_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Image banniere'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_image_banniere->getId(), + 'image' => Class_Url::absolute('/library/templates/Herisson/Assets/images/banniere_herisson.jpg'), + 'link' => $this->_('/accueil'), + $this->_template->withNameSpace('width_xsmall') => 12], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Ouverture bibliothèque'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_biblio_header->getId(), + 'rendering' => 'card-description', + 'layout' => 'horizontal_list', + 'filters' => '', + 'size'=> 1, + 'osm_map' => 0, + 'osm_layer' => 0, + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_large') => 10], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Search_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Recherche'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'boite' => ['justify-content-center', + 'align-items-center', + 'my-5'], + 'search_button' => 'class fas fa-search', + 'placeholder' => $this->_('Tapez ici votre recherche (Titre, Auteur, Mot clé...)'), + 'type_doc' => '', + 'facets_in_session' => 0, + 'always_new_search' => 1, + 'select_doc' => 1, + 'recherche_avancee' => 0, + 'doc_type_selection_label' => 'Tous types de documents :', + $this->_template->withNameSpace('form_style') => 'inline', + $this->_template->withNameSpace('width_xsmall') => 11, + $this->_template->withNameSpace('width_medium') => 10, + $this->_template->withNameSpace('width_large') => 9], + $this->_disable_widget_template)) + + + ->_addWidget(Intonation_Library_Widget_Breadcrumb_Definition::CODE, + Class_Profil::DIV_BANNIERE, + array_merge(['titre' => $this->_('Fil d\'ariane'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_large') => 10], + $this->_disable_widget_template)) + + /*MAIN*/ + ->_addWidget(Intonation_Library_Widget_Carousel_Article_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Actualités'), + $this->_template->withNameSpace('styles_pack') => /*$this->_style_pack_no_border_no_radius_no_shadow_mx_auto_my_5->getId(),*/ + $this->_style_pack_background_white->getId(), + 'boite' => [/*'no_background',*/ + 'text-align-center', + 'no_badges', + 'card_shadow', + 'no_description', + 'no_footer_card', + 'title-uppercase'], + 'rendering' => 'card', + 'layout' => 'horizontal_list', + 'size' => 3, + 'order' => 'DateCreationDesc', + 'link_to_all' => 1, + $this->_template->withNameSpace('width_xsmall') => 11, + $this->_template->withNameSpace('width_large') => 10], + $this->_disable_only_content_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Record_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Nouveautés'), + $this->_template->withNameSpace('styles_pack') => /*$this->_style_pack_no_border_no_radius_no_shadow_mx_auto_my_5->getId(),*/ + $this->_style_pack_background_light->getId(), + 'boite' => [/*'background-light',*/ + 'py-9', + 'no_overlay'], + 'rendering' => 'card-overlay', + 'layout' => 'grid', + 'size' => 15, + 'order' => 'date_creation desc, alpha_titre asc', + 'link_to_all' => 1, + $this->_template->withNameSpace('width_xsmall') => 11, + $this->_template->withNameSpace('width_medium') => 12], + $this->_disable_only_content_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Review_Definition::CODE, + Class_Profil::DIV_MAIN, + array_merge(['titre' => $this->_('Avis'), + $this->_template->withNameSpace('styles_pack') => /*$this->_style_pack_no_border_no_radius_no_shadow_mx_auto_my_5->getId(),*/ + $this->_style_pack_background_white->getId(), + 'boite' => [/*'no_background',*/ + 'limit_badges_2', + 'background-white_and_light_card'], + 'rendering' => 'card', + 'layout' => 'horizontal_list', + 'size' => 5, + 'link_to_all' => 1, + $this->_template->withNameSpace('width_xsmall') => 11, + $this->_template->withNameSpace('width_large') => 10], + $this->_disable_only_content_widget_template)) + + /*FOOTER*/ + ->_addWidget(Intonation_Library_Widget_Image_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Logo du réseau'), + 'boite' => ['no_border', + 'no_shadow', + 'm-auto', + 'py-3', + 'align-items-center'], + 'image' => Class_Url::absolute('/library/templates/Herisson/Assets/images/herisson_logo.png'), + 'link' => $this->_('/accueil'), + $this->_template->withNameSpace('width_xsmall') => 8, + $this->_template->withNameSpace('width_medium') => 5, + $this->_template->withNameSpace('width_large') => 2], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Boite bibliothèque horaires'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_biblio_footer->getId(), + 'boite' => ['justify-content-center'], + 'rendering' => 'card-description', + 'layout' => 'horizontal_list', + 'filters' => '', + 'size'=> 1, + 'osm_map' => 0, + 'osm_layer' => 0, + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_medium') => 6, + $this->_template->withNameSpace('width_large') => 3, + $this->_template->withNameSpace('order_xsmall') => 2, + $this->_template->withNameSpace('order_medium') => 3, + $this->_template->withNameSpace('order_large') => 1], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Menu_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Menu footer'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'boite' => ['justify-content-center'], + 'layout' => 'vertical', + 'menu' => $this->_profile_id . '-' . $this->_credits_menu, + $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_XSMALL, + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_medium') => 12, + $this->_template->withNameSpace('width_large') => 3, + $this->_template->withNameSpace('order_xsmall') => 1, + $this->_template->withNameSpace('order_large') => 2], + $this->_disable_widget_template)) + + ->_addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Carte bibliothèque'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'rendering' => 'card-description', + 'layout' => 'horizontal_list', + 'filters' => '', + 'size'=> 0, + 'osm_map' => 1, + 'osm_layer' => 1, + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_medium') => 6, + $this->_template->withNameSpace('width_large') => 3, + $this->_template->withNameSpace('order_xsmall') => 3, + $this->_template->withNameSpace('order_medium') => 2, + $this->_template->withNameSpace('order_large') => 3], + $this->_only_content_widget_template)) + + ->_addScrollDownWidget() + ->_addScrollTopWidget() + ->_addAdminWidget() + ->_addAccessibilityWidget() + ->_addNotificationWidget(); + + return $this; + } + + + + protected function _addScrollTopWidget() { + $this->_addWidget(Intonation_Library_Widget_Scroll_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Défilement vers le haut'), + 'boite' => ['no_border', 'no_border_radius', 'position_fixed_bottom_right', 'mb-5'], + 'direction' => 'up'], + $this->_disable_widget_template)); + + return $this; + } + + protected function _addScrollDownWidget() { + $this->_addWidget(Intonation_Library_Widget_Scroll_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Défilement vers le bas'), + 'boite' => ['no_border', 'no_border_radius', 'position_fixed_top_right', 'mt-8'], + 'direction' => 'down'], + $this->_disable_widget_template)); + + return $this; + } + + protected function _addAdminWidget() { + return + $this->_addWidget(Intonation_Library_Widget_AdminTools_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Administration'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'boite' => ['no_border', + 'position_fixed_bottom_left', + 'white_widget']], + $this->_disable_widget_template)); + } + + protected function _addAccessibilityWidget() { + return + $this->_addWidget(Intonation_Library_Widget_Accessibility_Definition::CODE, + Class_Profil::DIV_FOOTER, + array_merge(['titre' => $this->_('Accessibilité'), + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_no_background_no_border_no_radius_no_shadow_mx_auto->getId(), + 'boite' => ['no_border', + 'position_fixed_bottom_right', + 'white_widget']], + $this->_disable_widget_template)); + } + + + /*cle a molette*/ + protected function _upgradeActions() { + $form_action_settings = ['boite' => ['mx-auto'], + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_medium') => 11, + $this->_template->withNameSpace('width_large') => 6]; + + $default_action_settings = ['boite' => ['no_border_widget', + 'no_border', + 'mx-auto'], + $this->_template->withNameSpace('width_xsmall') => 12, + $this->_template->withNameSpace('width_medium') => 11, + $this->_template->withNameSpace('width_large') => 0]; + + $simple_search_action_settings = array_merge(['facettes_codes' => (Class_TypeDoc::CODE_FACETTE + . Class_CodifAuteur::CODE_FACETTE + . Class_CodifCentreInteret::CODE_FACETTE + . Class_CodifMatiere::CODE_FACETTE + . Class_Codification::CODE_EDITEUR), + 'facets_order' => 0, + 'facets_closed_codes' => '', + 'liste_format' => Class_Systeme_ModulesAppli::LISTE_FORMAT_VIGNETTES], + $default_action_settings); + + $no_maps_bib_settings = + [Intonation_Library_View_Wrapper_Library_RichContent_Map::class => 0]; + + $no_teams_bib_settings = + [Intonation_Library_View_Wrapper_Library_RichContent_Team::class => 0]; + + $no_media_notice_settings = + [Intonation_Library_View_Wrapper_Record_RichContent_Media::class => 0]; + + $this + ->_setSimpleSearchSettings($simple_search_action_settings) + ->_setNoMapsInBibSettings($no_maps_bib_settings) + ->_setNoTeamsInBibSettings($no_teams_bib_settings) + ->_setNoMediaInNoticeSettings($no_media_notice_settings) + ->_setActionSettings('cms', 'articleview', $default_action_settings) + ->_setActionSettings('recherche', 'avancee', $default_action_settings) + ->_setActionSettings('widget', 'render-all', $default_action_settings) + ->_setActionSettings('auth', 'lostpass', $form_action_settings) + ->_setActionSettings('auth', 'login', $form_action_settings) + ->_setActionSettings('auth', 'register', $form_action_settings) + ->_setActionSettings('index', 'formulairecontact', $form_action_settings) + ->_disableItemsMap(); + + return $this; + } + + + protected function _createPage(string $title) : Class_Template_ProfilePatcher_Profile { + return parent::_createPage($title) + ->setHeaderSettings($this->_header_section_settings) + ->setMainSettings($this->_tag_main_settings) + ->setFooterSettings($this->_footer_section_settings); + } + + + protected function _getLibraryUrl() : string { + return ($libraries = Class_Bib::findAllVisible()) + ? array_shift($libraries)->getUrl() + : ''; + } + + + protected function _getOrCreateCategory($label) { + return Class_ArticleCategorie::getOrCreate($this->_('Herisson'), + Class_ArticleCategorie::getOrCreate($this->_('Magasin de thèmes'))); + } + + + public function getDefaultWidgetMenuConfiguration(array $params) : array { + return + ['boite' => [], + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_background_white->getId(), + $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_SMALL, + $this->_nameSpaced('responsive_pack') => $this->_full_width_responsive_pack->getId(), + $this->_template->withNameSpace('show_header') => 0, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 0]; + } + + + public function getDefaultWidgetConfiguration(array $params) : array { + return + ['boite' => [], + 'link_to_all' => 1, + $this->_template->withNameSpace('styles_pack') => $this->_style_pack_background_white->getId(), + $this->_nameSpaced('responsive_pack') => $this->_full_width_responsive_pack->getId(), + $this->_template->withNameSpace('show_header') => 1, + $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_footer') => 1]; + } +} diff --git a/library/templates/Herisson/Library/Settings.php b/library/templates/Herisson/Library/Settings.php new file mode 100644 index 0000000000000000000000000000000000000000..769d56401c360484b83be7bd197cf4c7f05eeca8 --- /dev/null +++ b/library/templates/Herisson/Library/Settings.php @@ -0,0 +1,173 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_Library_Settings extends Intonation_Library_Settings { + protected function _getDefaultSettings() { + $settings = parent::_getDefaultSettings(); + $settings[$this->_template->withNameSpace('herisson_css')] = 1; + + $custom_css_classes = $settings[$this->_template->withNameSpace('custom_css_class')]; + + $custom_css_classes = array_merge($custom_css_classes, + ['herisson_widget', + 'mx-auto', + 'my-auto', + 'background', + 'background-light', + 'background-dark', + 'background-very_dark', + 'text-align-center', + 'background-white', + 'no_border_widget', + 'no_description', + 'no_footer_card', + 'title-uppercase', + 'card_shadow', + 'px-9', + 'py-9', + 'my-10', + 'mb-10', + 'mt-10', + 'mt-8', + 'mb-8', + 'my-8', + 'background-white_light_card']); + + $settings[$this->_template->withNameSpace('custom_css_class')] = $custom_css_classes; + + $hydrating_mapping = $settings[$this->_template->withNameSpace('hydrating_mapping')]; + + $hydrating_mapping['div id site_web_wrapper'] = 'container align-self-center'; + $hydrating_mapping['div class library_opening_hours'] = 'col-12'; + $hydrating_mapping['form class row'] = 'no-gutters col-12 px-0'; + $hydrating_mapping['form class login'] = 'row no-gutters px-3 m-auto'; + $hydrating_mapping['div class wrapper_zendafi_form_expressionrecherche'] = 'order-4 col-12 col-md-7 col-lg-9 px-1'; + $hydrating_mapping['button class search_submit_button'] = 'order-7'; + $hydrating_mapping['div class review_author'] = 'col-12 col-lg-12 text-md-left'; + $hydrating_mapping['div class review_date'] = 'col-12 col-lg-12 text-md-left'; + $hydrating_mapping['div class review_rating'] = 'col-12 my-3'; + $hydrating_mapping['a'] = 'text-second'; + $hydrating_mapping['a class more_action'] = 'text-prim'; + $hydrating_mapping['div class search_result'] = 'px-3 px-sm-0 mx-auto col-12'; + + $hydrating_mapping['div class search_facets_col'] = 'col-12 col-md-3 col-lg-2 order-5'; + $hydrating_mapping['div class search_records_col'] = 'col-12 col-md-9 col-lg-10 order-6'; + + $hydrating_mapping['form class form_facets'] = 'mb-2 col-12'; + $hydrating_mapping['div class list-group-item'] = 'px-3 mb-3'; + $hydrating_mapping['div class list-group'] = 'no_border'; + $hydrating_mapping['div class truncate_list_wrapper'] = 'col-12 list-group no_border'; + $hydrating_mapping['li class facette_titre'] = 'list-unstyled py-3 px-3 my-1'; + $hydrating_mapping['li class facet_item'] = 'facette py-1 pr-1 pl-4 d-flex justify-content-between align-items-center'; + $hydrating_mapping['div class card-body'] = 'px-3 py-3'; + $hydrating_mapping['div class card-footer'] = 'px-3 py-3'; + $hydrating_mapping['div class card-link'] = 'px-3 py-3'; + + $hydrating_mapping['img class card-img'] = 'img-fluid rounded h-xl-300 h-md-180 w-auto object-fit-cover'; + $hydrating_mapping['img class img-thumbnail'] = 'h-xl-300 h-md-180 w-auto object-fit-cover'; + + $hydrating_mapping['div class record_no_thumbnail'] = 'card card-img-overlay h-xl-300 h-md-180 w-auto'; + + $hydrating_mapping['div class bokeh_jumbotron'] = 'jumbotron jumbotron-fluid w-100 py-3 px-3 mb-3'; + $hydrating_mapping['div class article_location_header'] = 'col-12 order-1 d-none'; + $hydrating_mapping['div class article_location_static_map'] = 'col-12 col-md-6 order-3 order-md-2 pt-md-5 px-5 px-md-0 d-none'; + $hydrating_mapping['div class article_location_data'] = 'col-12 col-md-6 col-xl-4 order-2 order-md-3 d-none'; + $hydrating_mapping['div class card-deck'] = 'card-deck-medium'; + $hydrating_mapping['li class nav-item'] = 'px-0 text-center'; + + $hydrating_mapping['form class form'] = 'row mx-0 w-100'; + + $hydrating_mapping['div class button_text'] = 'd-inline d-md-inline'; + $hydrating_mapping['div class navbar-header'] = 'd-flex justify-content-between mx-auto'; + $hydrating_mapping['input class zendafi_form_login_login'] = 'btn btn-sm btn-primary order-3 my-1 mx-auto'; + $hydrating_mapping['div class wrapper_zendafi_form_login_lostpass'] = 'col-12 order-4 text-align-center'; + + $hydrating_mapping['div class jumbotron_nav_tab_text'] = 'd-none d-xl-block text-center'; + + $hydrating_mapping['a class dropdown-item'] = 'text-second ml-auto px-0 w-max no_background'; + + $hydrating_mapping['div class dropdown-divider'] = 'd-none'; + + $hydrating_mapping['span class badge_event_start'] = 'badge-success no_truncate d-none'; + $hydrating_mapping['span class badge_event_end'] = 'badge-warning no_truncate d-none'; + $hydrating_mapping['span class badge_event_period'] = 'badge-success no_truncate d-none'; + $hydrating_mapping['span class badge_text'] = 'align-middle d-inline-block text-left no_truncate'; + + $hydrating_mapping['div class search_dropdown_menu'] = 'dropdown-menu-right w-max'; + $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'; + + $hydrating_mapping['p class opened'] = 'text-white bg-success p-1 rounded d-inline-block m-0'; + $hydrating_mapping['p class closed'] = 'text-white bg-danger p-1 rounded d-inline-block m-0'; + + $hydrating_mapping['a class reset_criteria'] = 'btn btn-info btn-sm m-0 text-dark text-left btn-warning'; + $hydrating_mapping['a class active_criteria'] = 'btn btn-info btn-sm m-0 text-dark text-left btn-warning'; + + $hydrating_mapping['div class search_criteria_col'] = 'col-12 order-2 mb-2'; + + $hydrating_mapping['a class record_doctype'] = 'badge-info'; + $hydrating_mapping['a class record_edition_year'] = 'badge-info'; + $hydrating_mapping['a class record_novelty'] = 'badge-primary'; + $hydrating_mapping['span class record_pro_reviews_count'] = 'badge-light p-1'; + $hydrating_mapping['span class record_pro_reviews_average_score'] = 'badge-light p-1'; + $hydrating_mapping['span class record_borrower_review_count'] = 'badge-light p-1'; + $hydrating_mapping['span class record_borrower_review_average_score'] = 'badge-light p-1'; + $hydrating_mapping['a class record_facets'] = 'badge-secondary'; + $hydrating_mapping['a class record_collection'] = 'badge-primary'; + $hydrating_mapping['a class record_serie'] = 'badge-secondary mt-1'; + + $hydrating_mapping['button class validate'] = 'order-2'; + $hydrating_mapping['button class init'] = 'order-1 btn btn-secondary'; + + $hydrating_mapping['div class dropdown-menu-right'] = 'dropdown-menu w-300'; + $hydrating_mapping['ul class dropdown-menu'] = 'dropdown-menu list-unstyled w-max'; + $hydrating_mapping['div class filters'] = 'tabs mb-3'; + + $hydrating_mapping['img class user_ico'] = 'img-fluid rounded d-none'; + + $hydrating_mapping['div class jumbotron_rich_content'] = 'col-12 border-primary mb-5 pb-3'; + $hydrating_mapping['a class render_all_link'] = 'text-dark'; + $hydrating_mapping['a class badge_tag'] = 'text-left badge p-1'; + $hydrating_mapping['div id site_web_wrapper'] = 'col container align-self-center no_background'; + $hydrating_mapping['body class opac'] = 'no_background'; + + + $hydrating_mapping['div class jumbotron_thumbnail'] = 'order-2 col-6 col-sm-5 col-md-3 col-lg-2 col-xl-2'; + $hydrating_mapping['div class jumbotron_title'] = 'order-4 order-md-3 col-10 col-md-6 col-lg-5 col-xl-5 ml-md-1 px-md-3'; + + $hydrating_mapping['a class nav-link'] = ''; + + + $hydrating_mapping['div class embed-responsive'] = 'h-xl-300 h-md-180 w-auto object-fit-cover'; + $hydrating_mapping['div class facets_suggestions'] = 'mb-3'; + + $settings[$this->_template->withNameSpace('hydrating_mapping')] = $hydrating_mapping; + return $settings; + } +} diff --git a/library/templates/Herisson/Template.php b/library/templates/Herisson/Template.php new file mode 100644 index 0000000000000000000000000000000000000000..3e496eb9759a25e4df9a4df0864d72a869ce1496 --- /dev/null +++ b/library/templates/Herisson/Template.php @@ -0,0 +1,80 @@ +<?php +/** + * Copyright (c) 2012-2020, 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 Herisson_Template extends Intonation_Template { + const ID = 'HERISSON'; + + public function __construct() { + $this->setId(static::ID) + ->setTitle($this->_('Herisson')) + ->setSettings(new Herisson_Library_Settings($this)) + ->setPatcher(new Herisson_Library_ProfilePatcher($this)); + } + + + public function getProfile() { + if ($this->_profile) + return $this->_profile; + + if ($this->_profile = Class_Profil::findFirstBy(['template' => $this->getId()])) + return $this->_profile; + + $this->createFrom(Class_Profil::getPortail()); + + return $this->_profile = Class_Profil::getCurrentProfil(); + } + + + public function renderOpac($view) { + return (new Herisson_View_Opac($this, $view))->render(); + } + + + public function renderSubModal($view) { + return (new Herisson_View_SubModal($this, $view))->render(); + } + + + public function customTemplateForm($form) { + $helper = new Herisson_Library_FormCustomizer($this); + return $helper->getTemplateForm($form); + } + + + public function addHelperPath($view) { + parent::addHelperPath($view); + $view->addHelperPath('templates/Herisson/View', 'Herisson_View'); + } + + + public function addAdminHelperPath($view) { + parent::addAdminHelperPath($view); + $view->addHelperPath('templates/Herisson/View/Admin', 'Herisson_View_Admin'); + } + + + public function getCarouselRenderer(string $layout) : string { + return (Intonation_Library_Widget_Carousel_Definition::MULTIPLE_CAROUSEL_PLUS == $layout) + ? Chili_View_RenderMultipleCarousel::class + : ''; + } +} \ No newline at end of file diff --git a/library/templates/Herisson/View/Opac.php b/library/templates/Herisson/View/Opac.php new file mode 100644 index 0000000000000000000000000000000000000000..c8b46d3888aaa696b0de8e68d550b5c981908133 --- /dev/null +++ b/library/templates/Herisson/View/Opac.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_View_Opac extends Intonation_View_Opac { + protected function _addTemplateCss($script_loader) { + if ($this->_template->getHerissonCss()) + $script_loader->addStyleSheet(Class_Url::absolute('/library/templates/Herisson/Assets/css/herisson.css')); + } +} diff --git a/library/templates/Herisson/View/RenderRecord/RenderItems.php b/library/templates/Herisson/View/RenderRecord/RenderItems.php new file mode 100644 index 0000000000000000000000000000000000000000..b8b31b14e3a68685ce7dfad383c517f4bcda0fc3 --- /dev/null +++ b/library/templates/Herisson/View/RenderRecord/RenderItems.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright (c) 2012-2020, 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 Herisson_View_RenderRecord_RenderItems extends Intonation_View_RenderRecord_RenderItems { + protected function _isMapEnabled() { + return false; + } +} diff --git a/library/templates/Herisson/View/SubModal.php b/library/templates/Herisson/View/SubModal.php new file mode 100644 index 0000000000000000000000000000000000000000..b58e670eb9f9134ee63930566394a01d9dd54532 --- /dev/null +++ b/library/templates/Herisson/View/SubModal.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright (c) 2012-2019, 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 Herisson_View_SubModal extends Intonation_View_SubModal { + protected function _headContent() { + Class_ScriptLoader::getInstance() + ->addStyleSheet(Class_Url::absolute('/library/templates/Herisson/Assets/css/herisson.css')); + return parent::_headContent(); + } +} diff --git a/library/templates/Intonation/Library/ProfilePatcher.php b/library/templates/Intonation/Library/ProfilePatcher.php index e94b5b04cd9ffe0a17e71d92e14369cbefb4978f..a9f3a8a75eb2a804f39d4e66ce37ee3995634794 100644 --- a/library/templates/Intonation/Library/ProfilePatcher.php +++ b/library/templates/Intonation/Library/ProfilePatcher.php @@ -51,11 +51,17 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { $this ->_generateDefaultsPacks() + ->_clearCache() ->_upgradeProfile() + ->_clearCache() ->_upgradeMenus() + ->_clearCache() ->_upgradeSections() + ->_clearCache() ->_upgradeActions() - ->_upgradeWidgets(); + ->_clearCache() + ->_upgradeWidgets() + ->_clearCache(); return $this->_profile; } @@ -129,6 +135,14 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { 'no_shadow', 'mx-auto']); + $this->_no_border_no_radius_no_shadow_no_background_m_auto = + $this->_getOrCreateStylePack($this->_('Centré, sans bordure, sans arrondi, sans ombre, sans fond'), + ['no_border', + 'no_border_radius', + 'no_shadow', + 'no_background', + 'm-auto']); + $this->_full_width_responsive_pack = $this->_getOrCreateResponsivePack($this->_('1 colonne'), [$this->_nameSpaced('width_xsmall') => '12']); @@ -154,14 +168,6 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { protected function _generatePacks() { - $this->_no_border_no_radius_no_shadow_no_background_m_auto = - $this->_getOrCreateStylePack($this->_('Centré, sans bordure, sans arrondi, sans ombre, sans fond'), - ['no_border', - 'no_border_radius', - 'no_shadow', - 'no_background', - 'm-auto']); - $this->_men_in_black = $this->_getOrCreateStylePack($this->_('Titre et pied de boite noir, texte blanc'), ['no_border', @@ -234,7 +240,10 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { ->setCfgSiteParam('responsive', '') ->setCfgSiteParam('couleur_lien_bandeau', '') ->setCfgSiteParam('couleur_texte_bandeau', '') - ->setAccessLevel(-1); + ->setAccessLevel(-1) + ->setCfgAccueil($this->_profile->getDefaultCfgAccueil()); + + $this->_profile->save(); return $this; } @@ -254,9 +263,6 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { $this->_template->withNameSpace('width_xlarge') => 8]) ->updateProfile(); - Class_Profil::clearCache(); - $this->_profile = Class_Profil::find($this->_profile_id); - return $this; } @@ -464,35 +470,37 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { $this->_template->withNameSpace('show_content') => 0, $this->_template->withNameSpace('show_footer') => 1]) - ->_addWidget(Intonation_Library_Widget_Credits_Definition::CODE, + ->_addWidget(Intonation_Library_Widget_CookiesManager_Definition::CODE, Class_Profil::DIV_FOOTER, - ['titre' => $this->_('Crédits'), - 'boite' => ['text-right'], + ['titre' => $this->_('Gestion des cookies'), + 'boite' => ['text-center'], $this->_template->withNameSpace('styles_pack') => $this->_black_and_white->getId(), - $this->_template->withNameSpace('width_xsmall') => 7, + $this->_template->withNameSpace('width_xsmall') => 4, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 1, $this->_template->withNameSpace('show_footer') => 0]) - ->_addWidget(Intonation_Library_Widget_Share_Definition::CODE, + + ->_addWidget(Intonation_Library_Widget_Credits_Definition::CODE, Class_Profil::DIV_FOOTER, - ['titre' => $this->_('Partager'), + ['titre' => $this->_('Crédits'), 'boite' => ['text-center'], $this->_template->withNameSpace('styles_pack') => $this->_black_and_white->getId(), - $this->_template->withNameSpace('width_xsmall') => 5, + $this->_template->withNameSpace('width_xsmall') => 4, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 1, $this->_template->withNameSpace('show_footer') => 0]) - ->_addWidget(Intonation_Library_Widget_CookiesManager_Definition::CODE, + ->_addWidget(Intonation_Library_Widget_Share_Definition::CODE, Class_Profil::DIV_FOOTER, - ['titre' => $this->_('Gestion des cookies'), - $this->_template->withNameSpace('styles_pack') => $this->_no_border_no_radius_no_shadow_no_background->getId(), + ['titre' => $this->_('Partager'), + 'boite' => ['text-center'], + $this->_template->withNameSpace('styles_pack') => $this->_black_and_white->getId(), + $this->_template->withNameSpace('width_xsmall') => 4, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 1, $this->_template->withNameSpace('show_footer') => 0]) - ->_addScrollDownWidget() ->_addScrollTopWidget() ->_addAdminWidget() diff --git a/library/templates/Intonation/Library/Settings.php b/library/templates/Intonation/Library/Settings.php index 615fb177bf1705abb7ce247e9034f6804f28fe7c..47abd5a356340ddb43a98364901d77ef11fd31c7 100644 --- a/library/templates/Intonation/Library/Settings.php +++ b/library/templates/Intonation/Library/Settings.php @@ -153,6 +153,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'span class badge_tag' => 'text-left badge', 'span class badge_event_start' => 'badge-success no_truncate', 'span class badge_event_end' => 'badge-warning no_truncate', + 'span class badge_event_period' => 'badge-success no_truncate', 'a class calendar_day_event_start' => 'border-bottom border-info', 'span class calendar_day_event_start' => 'border-bottom border-info', 'a class day_clickable' => 'text-success font-weight-bold', diff --git a/library/templates/Intonation/Library/View/Wrapper/Record.php b/library/templates/Intonation/Library/View/Wrapper/Record.php index b5bd9bed9a2f4608bc228e1213499acab3a82101..e51f0b7272e69f1d98c732db69eecd6febc70415 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Record.php +++ b/library/templates/Intonation/Library/View/Wrapper/Record.php @@ -358,7 +358,7 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra $total_to_read = count($same_serie_records); $badges [] = (new Intonation_Library_Badge) - ->setClass('badge-white record_serie') + ->setClass('record_serie') ->setImage($this->getIco('readed', 'library')) ->setText($this->_('%d sur %d', $total_readed_in_serie, diff --git a/library/templates/Intonation/Library/Widget/Accessibility/View.php b/library/templates/Intonation/Library/Widget/Accessibility/View.php index 83c13567e6b3445a99d2855b909c8d4590441710..53440df3c71192789976dcb0bd4c67cbd68d12d1 100644 --- a/library/templates/Intonation/Library/Widget/Accessibility/View.php +++ b/library/templates/Intonation/Library/Widget/Accessibility/View.php @@ -88,17 +88,17 @@ class Intonation_Library_Widget_Accessibility_View extends Zendafi_View_Helper_A $colors_options = [new Class_Entity(['File' => '', - 'CookieKey' => 'no_style', - 'NoStyle' => 1, - 'Text' => $this->_('Aucun style'), - 'Icon' => 'no_css_bucket']), - - new Class_Entity(['File' => '', 'CookieKey' => 'default_style', 'DefaultStyle' => 1, 'Text' => $this->_('Style par défaut'), 'Icon' => 'reset_bucket']), + new Class_Entity(['File' => '', + 'CookieKey' => 'no_style', + 'NoStyle' => 1, + 'Text' => $this->_('Aucun style'), + 'Icon' => 'no_css_bucket']), + new Class_Entity(['File' => 'blanc_sur_noir', 'CookieKey' => 'white_on_black', 'Text' => $this->_('Blanc sur noir'), @@ -150,6 +150,7 @@ class Intonation_Library_Widget_Accessibility_View extends Zendafi_View_Helper_A $attribs['data-stylesheet-no'] = 1; return $this->view->button((new Class_Button) + ->setText($option->getText()) ->setAttribs($attribs) ->setText($option->getText()) ->setImage($icon)); diff --git a/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php b/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php index ee60a1cec480683bceef9e13b44fb8e12b6a6041..c1140f4a6ca474882d373f25643ca2c111553a6f 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Menu/View.php @@ -79,7 +79,7 @@ class Intonation_Library_Widget_Carousel_Menu_View extends Intonation_Library_Wi protected function _getLayoutHelper($layout) { - $this->_layout_helper = parent::_getLayoutHelper($layout); + $this->_layout_helper = parent::_getLayoutHelper((string) $layout); if (in_array($layout, [Intonation_Library_Widget_Carousel_Menu_Definition::LAYOUT_VERTICAL, diff --git a/library/templates/Intonation/Library/Widget/Carousel/View.php b/library/templates/Intonation/Library/Widget/Carousel/View.php index d0ef454b002d94cc0e3022de312a34fcd3781748..c70df1da2016404c7a1696ab91469b4a790f77ea 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/View.php @@ -69,7 +69,7 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help protected function _renderHeadScriptsOn($script_loader) { - $this->_getLayoutHelper($this->_settings->getLayout()) + $this->_getLayoutHelper((string) $this->_settings->getLayout()) ->renderHeadScriptsOn($script_loader); } @@ -244,7 +244,7 @@ abstract class Intonation_Library_Widget_Carousel_View extends Zendafi_View_Help protected function _renderLayout($layout, $elements, $content_callback) { - $layout_helper = $this->_getLayoutHelper($layout); + $layout_helper = $this->_getLayoutHelper((string) $layout); $helper_func = array_reverse(explode('_', get_class($layout_helper)))[0]; return call_user_func_array([$layout_helper, $helper_func], diff --git a/library/templates/Intonation/View/RenderMenuEntry.php b/library/templates/Intonation/View/RenderMenuEntry.php index 9f36e36a8880ac5822e8531805d019d9e08a6862..b97db351dd55c4ff47d2054e62ce97168098c8c1 100644 --- a/library/templates/Intonation/View/RenderMenuEntry.php +++ b/library/templates/Intonation/View/RenderMenuEntry.php @@ -113,7 +113,8 @@ class Intonation_View_RenderMenuEntry extends ZendAfi_View_Helper_BaseHelper { . $this->_tag('span', $this->_('Afficher ou masquer le menu "%s"', $instance->getLabel()), ['class' => 'caret sr-only']), ['id' => $id, 'onclick' => 'return false;', - 'class' => 'nav-link dropdown-toggle', + 'class' => ('nav-link dropdown-toggle ' + . $this->_getActiveClass($instance)), 'title' => $this->_('Afficher ou masquer le menu "%s"', $instance->getLabel()), 'data-toggle' => 'dropdown', 'role' => 'button', @@ -130,7 +131,9 @@ class Intonation_View_RenderMenuEntry extends ZendAfi_View_Helper_BaseHelper { protected function _getActiveClass($entry) { - return $entry->isActive() + return (($entry->isMenu() + && $entry->hasActiveChild()) + || $entry->isActive()) ? 'active_item' : ''; } diff --git a/library/templates/Intonation/View/Search/Result.php b/library/templates/Intonation/View/Search/Result.php index 41434ccc78e28540c2f0ccc7e6b8eb671bf843b0..2fd6b4ea9d2dcd1f0f57cbbc8847ffde203d98d0 100644 --- a/library/templates/Intonation/View/Search/Result.php +++ b/library/templates/Intonation/View/Search/Result.php @@ -208,7 +208,7 @@ class Intonation_View_Search_Result extends ZendAfi_View_Helper_BaseHelper { ->setImage($this->view->templateIco('wall', 'utils')) ->setText($this->_tag('span', $this->_('Mur'))) ->setTitle($this->_('Afficher le résultat de recherche en mode mur')) - ->setClass('btn-sm list_format' . ($this->_isWallMode() ? 'active' : '')) + ->setClass('btn-sm list_format' . ($this->_isWallMode() ? ' active' : '')) ->alwaysDisplayText(); } diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 5109fc0faa29e4551721799a1bcfa2e72c2caad4..021084d39cba868eebdc0807556addc3c726e9e3 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -223,6 +223,9 @@ abstract class ProfilOptionsControllerWithProfilAdulteTestCase extends AbstractC 'V' => ['libelle' => 'Menu vertical', 'picto' => 'vide.gif']]; + $this->fixture(Class_Profil::class, + ['id' => 4]); + $this->profil_adulte = $this->fixture('Class_Profil', ['id' => 22, 'rewrite_url' => 'adulte']) ->setBrowser('opac') @@ -384,7 +387,8 @@ class ProfilOptionsControllerProfilAdulteWithCacheTest extends ProfilOptionsCont /** @test */ public function linkToSearchShouldUseProfil4() { - $this->assertXPath('//a[contains(@href,"/recherche/simple/statut/reset/id_profil/4")]'); + $this->assertXPath('//a[contains(@href,"/recherche/simple/statut/reset/id_profil/4")]', + $this->_response->getBody()); } diff --git a/tests/library/Class/CompareUrlTest.php b/tests/library/Class/CompareUrlTest.php index 3d81d834f9d9c364f267558883df65f6c65f20eb..b17b871c6b674d838405149700d32fffb1fc9dd0 100644 --- a/tests/library/Class/CompareUrlTest.php +++ b/tests/library/Class/CompareUrlTest.php @@ -36,12 +36,31 @@ class CompareUrlSameAsRequestTest extends AbstractControllerTestCase { public function setUp() { parent::setUp(); + + $this->_buildTemplateProfil(['id' => 1]); + Class_Profil::find(1)->setRewriteUrl('accueil')->save(); $this->fixture('Class_Profil', ['id' => 2, 'rewrite_url' => 'agenda' ]); + + $this->fixture(Class_Profil::class, + ['id' => 5, + 'rewrite_url' => 'jeunesse' + ]); + + $this->fixture(Class_Profil::class, + ['id' => 6, + 'parent_id' => 5, + 'rewrite_url' => 'info' + ]); + + $this->fixture(Class_Bib::class, + ['id' => 789, + 'libelle' => 'Valleiry', + 'rewrite_url' => 'valleiry']); } @@ -81,6 +100,19 @@ class CompareUrlSameAsRequestTest extends AbstractControllerTestCase { ['/agenda', 'https://library-portal.org/agenda', false], + ['/info', '/info', true], + ['/jeunesse/info', '/info', true], + ['/jeunesse/info', '/jeunesse/info', true], + ['/index/index/id_profil/6', '/info', true], + ['/index/index/id_profil/6', '/jeunesse/info', true], + ['/jeunesse', '/jeunesse/info', false], + ['/jeunesse', '/info', false], + ['/index/index/id_profil/5', '/info', false], + ['/index/index/id_profil/5', '/jeunesse/info', false], + + ['/valleiry', '/valleiry', true], + ['/valleiry', '/bib/en-lire-plus/id/789', true], + ['/bib/en-lire-plus/id/789', '/valleiry', true], ]; } diff --git a/tests/library/ZendAfi/View/Helper/Accueil/MenuVerticalTest.php b/tests/library/ZendAfi/View/Helper/Accueil/MenuVerticalTest.php index 98d061b68ed36f2733011535f1865b7b9325950b..1a00e8a61b9fdab394b3273b37f736d2c618037e 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/MenuVerticalTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/MenuVerticalTest.php @@ -716,6 +716,9 @@ class MenuVerticalNewsItemUsingProfileTest extends MenuVerticalTestCase { Class_Profil::getCurrentProfil() ->setCfgMenus([7 => ['libelle' => 'Testing', 'menus' => [$news]]]); + + $this->fixture(Class_Profil::class, + ['id' => 13]); } diff --git a/tests/scenarios/Templates/ChiliTest.php b/tests/scenarios/Templates/ChiliTest.php index 40305d0851ec0679867fa70c94c4873d66c7c158..b8d4c34bca21f7f7371f4dbdee1e5e382f6bc099 100644 --- a/tests/scenarios/Templates/ChiliTest.php +++ b/tests/scenarios/Templates/ChiliTest.php @@ -25,6 +25,10 @@ abstract class ChiliTemplateTestCase extends Admin_AbstractControllerTestCase { public function setUp() { parent::setUp(); + + $this->fixture(Class_Profil::class, + ['id' => 1]); + Class_AdminVar::set('FEATURES_LIST', 0); Class_Systeme_ModulesAccueil::reset(); @@ -824,6 +828,7 @@ class ChiliTemplateNotLoggedTest extends ChiliTemplateTestCase { public function setUp() { parent::setUp(); + ZendAfi_Auth::getInstance()->clearIdentity(); $this->dispatch('/'); } diff --git a/tests/scenarios/Templates/HerissonTemplateTest.php b/tests/scenarios/Templates/HerissonTemplateTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4aa5964fd61daed177a696ab0b9d68636dbdefba --- /dev/null +++ b/tests/scenarios/Templates/HerissonTemplateTest.php @@ -0,0 +1,433 @@ +<?php +/** + * Copyright (c) 2012-2020, 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 HerissonTemplateTestCase extends AbstractControllerTestCase { + + protected $_storm_default_to_volatile = true, + $_current_profile; + + + public function setUp() { + parent::setUp(); + $profile = $this->_buildTemplateProfil(['id' => 22]); + + $this->_addFixtures(); + + $herisson_profile_id = (new Herisson_Template)->tryOn($profile); + $this->_current_profile = Class_Profil::find(Class_Profil::getCurrentProfil()->getId()); + } + + + /** @test */ + public function templateHerissonShouldCurrentProfile() { + $this->assertEquals('HERISSON', $this->_current_profile->getTemplate()); + } + + + protected function _addFixtures() { + } +} + + + + +class HerissonTemplateSubPagesTest extends HerissonTemplateTestCase { + /** @test */ + public function pageAgendaShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Agenda', + 'rewrite_url' => 'agenda'])); + } + + + /** @test */ + public function pageAdulteShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Adulte', + 'rewrite_url' => 'adulte'])); + } + + + /** @test */ + public function pageJeunesseShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Jeunesse', + 'rewrite_url' => 'jeunesse'])); + } + + + /** @test */ + public function pageMultimediaShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Multimédia', + 'rewrite_url' => 'multimedia'])); + } + + + /** @test */ + public function pageImageEtSonShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Image et son', + 'rewrite_url' => 'image_et_son'])); + } + + + /** @test */ + public function pageMentionsLegalesShouldBeCreated() { + $this->assertNotNull(Class_Profil::findFirstBy(['parent_id' => $this->_current_profile->getId(), + 'libelle' => 'Mentions légales', + 'rewrite_url' => 'mentions_legales'])); + } + + + /** @test */ + public function footerShouldHaveBackgroundDarkChecked() { + $this->assertEquals(['boite' => [0 => 'background-dark'], + 'visibility' => '1', + 'HerissonWidthXsmall' => '12', + 'titre' => 'Division pied de page'], + (new Class_Template_ProfilePatcher_Profile($this->_current_profile)) + ->getFooterSettings()); + } + + + /** @test */ + public function profileShouldHaveDefaultFavico() { + $this->assertEquals('../Assets/images/favicon.ico', + $this->_current_profile->getFavicon()); + } +} + + + + +class HerissonTemplateRechercheViewNoticeHarryPotterTest extends HerissonTemplateTestCase { + public function setUp() { + parent::setUp(); + + $this->fixture('Class_Bib', + ['id' => 3, + 'libelle' => 'Annecy', + 'lieu' => $this->fixture('Class_Lieu', + ['id' => 2, + 'libelle' => 'Bonlieu', + 'latitude' => 1, + 'longitude' => 1])]); + + $this->fixture('Class_Notice', + ['id' => 23, + 'unimarc' => file_get_contents(__DIR__ . '/../../fixtures/dvd_potter.uni'), + 'exemplaires' => [ + $this->fixture('Class_Exemplaire', + ['id' => 2, + 'id_bib' => 3]) + ]]); + + $this->dispatch('/noticeajax/resources/id/23'); + } + + + /** @test */ + public function responseShouldContainsLinkToEnLirePlusAnnecy() { + $this->assertXPathContentContains('//div[contains(@class, "items_wall")]//a[contains(@href, "/bib/en-lire-plus/id/3")]', + 'Annecy'); + } + + + /** @test */ + public function documentItemsShouldNotContainsMap() { + $this->assertNotXpath('//div[contains(@class, "items_map")]'); + } +} + + + +class HerissonTemplateIndexTest extends HerissonTemplateTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/index'); + } + + + /** @test */ + public function navigationAgendaEntryShouldHaveUrlAgenda() { + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/agenda")]', 'Agenda'); + } +} + + + + +class HerissonTemplateMenuEntriesDispatchTest extends HerissonTemplateTestCase { + + + /** @test */ + public function menuAdulteShouldBeActiveWhenDispatchingAccueilAdulte() { + $this->dispatch('/accueil/adulte'); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/adulte")][@class="nav-link active_item active"]', 'Adulte'); + } + + + /** @test */ + public function menuAdulteShouldBeActiveWhenDispatchingAdulte() { + $this->dispatch('/adulte'); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/adulte")][@class="nav-link active_item active"]', 'Adulte'); + } + + + /** @test */ + public function menuAdulteShouldBeActiveWhenDispatchingIdProfil25() { + $this->dispatch('/index/index/id_profil/' . Class_Profil::findFirstBy(['rewrite_url' => 'adulte'])->getId()); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/adulte")][@class="nav-link active_item active"]', 'Adulte'); + } + + + /** @test */ + public function menuRoseShouldBeActiveWhenDispatchingRose() { + $this->dispatch('/rose'); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/rose")][@class="nav-link active_item active"]', 'Infos pratiques'); + } + + + /** @test */ + public function menuRoseShouldBeActiveWhenDispatchingBibOuvertures() { + $this->dispatch('/bib/ouvertures/id/789'); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/rose")][@class="nav-link active_item active"]', 'Infos pratiques'); + } + + + /** @test */ + public function menuAccueilShouldNotBeActiveWhenDispatchingRose() { + $this->dispatch('/rose'); + $this->assertNotXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/accueil")][@class="nav-link active_item active"]', 'Accueil'); + } + + + /** @test */ + public function menuAccueilShouldNotBeActiveWhenDispatchingBibOuvertures() { + $this->dispatch('/bib/ouvertures/id/789'); + $this->assertNotXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/accueil")][@class="nav-link active_item active"]', 'Accueil'); + } + + + /** @test */ + public function menuAgendaShouldNotBeActiveWhenDispatchingRose() { + $this->dispatch('/rose'); + $this->assertNotXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/agenda")][@class="nav-link active_item active"]', 'Agenda'); + } + + + /** @test */ + public function menuEspaceShouldBeActiveWhenDispatchingAdulte() { + $this->dispatch('/adulte'); + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"#")][@class="nav-link dropdown-toggle active_item active"]', 'Espaces'); + } + + + protected function _addFixtures() { + $this->fixture(Class_Bib::class, + ['id' => 789, + 'libelle' => 'Rose', + 'visibilite' => Class_Bib::V_NODATA, + 'rewrite_url' => 'rose']); + } +} + + + + +class HerissonTemplateSubProfilesRewriteUrlTest extends AbstractControllerTestCase { + + protected $_storm_default_to_volatile = true; + + + public function setUp() { + parent::setUp(); + $profile = $this->_buildTemplateProfil(['id' => 21, + 'libelle' => 'accueil', + 'rewrite_url' => 'agenda']); + + $profile = $this->_buildTemplateProfil(['id' => 22]); + (new Herisson_Template)->tryOn($profile); + $this->dispatch('/index'); + } + + + /** @test */ + public function pageAgendaShouldNotHaveRewriteUrl() { + $this->assertEquals('', Class_Profil::findFirstBy(['libelle' => 'Agenda'])->getRewriteUrl()); + } + + + /** @test */ + public function navigationAgendaEntryShouldNotHaveUrlAgenda() { + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/id_profil/24")]', 'Agenda'); + } +} + + + + +class HerissonTemplateLibraryRewriteUrlTest extends AbstractControllerTestCase { + + protected $_storm_default_to_volatile = true; + + + public function setUp() { + parent::setUp(); + $profile = $this->_buildTemplateProfil(['id' => 21, + 'libelle' => 'accueil', + 'rewrite_url' => 'agenda']); + + $this->fixture(Class_Bib::class, + ['id' => 1, + 'libelle' => 'Saint Jorioz', + 'visibilite' => Class_Bib::V_NODATA, + 'rewrite_url' => 'saint_jorioz' + ]); + + $profile = $this->_buildTemplateProfil(['id' => 22]); + (new Herisson_Template)->tryOn($profile); + $this->dispatch('/index'); + } + + + /** @test */ + public function navigationLibraryEntryShouldContainsSaintJorioz() { + $this->assertXPathContentContains('//body//header//div[contains(@class, "boite nav")]//li//a[contains(@href,"/saint_jorioz")]', 'Infos pratiques'); + } +} + + + +class HerissonTemplateMentionsLegalesTest extends HerissonTemplateTestCase { + public function setUp() { + parent::setUp(); + $profile = Class_Profil::findFirstBy(['libelle' => 'Mentions légales']); + Class_Article_Loader::setSelectTool(new Class_Article_SelectForTest); + $this->dispatch('/index/index/id_profil/' . $profile->getId()); + } + + + /** @test */ + public function articleMentionLegaleShouldHaveBeenCreated() { + $this->assertNotNull(Class_Article::findFirstBy(['titre' => 'Mentions légales'])); + } + + + /** @test */ + public function articleMentionLegaleShouldBeInCategoryMagasinDeThemesHerisson() { + $this->assertEquals('Herisson', + Class_Article::findFirstBy(['titre' => 'Mentions légales']) + ->getCategorieLibelle()); + } + + + /** @test */ + public function mentionsLegalesArticleContentShouldContainsGestionDesCookies() { + $this->assertContains('Gestion des cookies', + Class_Article::findFirstBy(['titre' => 'Mentions légales'])->getContenu()); + } + + + /** @test */ + public function articleMentionsLegalesShouldBeInWidgetFree() { + $this->assertXPathContentContains('//main//div[contains(@class, "boite free")]//h1', + 'Propriétaire du site'); + } +} + + + + +class HerissonTemplateDispatchRechercheViewnotice extends HerissonTemplateTestCase { + + + public function setUp() { + parent::setUp(); + + $this->fixture(Class_Notice::class, + ['id' => 987, + 'type_doc' => 1]); + + $this->dispatch('/recherche/viewnotice/id/987'); + } + + + /** @test */ + public function tabMediaShouldNotBeInDOM() { + $this->assertNotXPath('//div//li[contains(@class, "wrapper_document_media")]'); + } +} + + + + +class HerissonTemplateWithResponseMultipleCarouselTest extends HerissonTemplateTestCase { + + + public function setUp() { + parent::setUp(); + + $profile = Class_Profil::getCurrentProfil(); + + $profile_patcher = (new Class_Template_ProfilePatcher(null)) + ->setProfile($profile); + + $this->fixture(Class_Notice::class, + ['id' => 1, + ]); + + $profile_patcher + ->addWidget(Intonation_Library_Widget_Carousel_Record_Definition::CODE, + Class_Profil::DIV_MAIN, + ['rendering' => 'card-description', + 'layout' => 'multiple_carousel_plus', + 'size' => 1]); + + $this->dispatch('/index'); + } + + + /** @test */ + public function widgetResponsiveMultipleCarouselPlusShouldBePresent() { + $this->assertXPath('//main//div[@id="boite_1"]//div[contains(@class, "responsive_multiple_carousel")]'); + } + + + /** @test */ + public function widgetResponsiveMultipleCarouselPlusShouldContainsMultipleCarouselForLg() { + $this->assertXPath('//main//div[@id="boite_1"]//div[contains(@class, "responsive_multiple_carousel")]//div[contains(@class, "col-12 d-none d-lg-block")]//div[contains(@class, "carousel slide multiple_carousel")]'); + } + + + /** @test */ + public function widgetResponsiveMultipleCarouselPlusShouldContainsMultipleCarouselForMd() { + $this->assertXPath('//main//div[@id="boite_1"]//div[contains(@class, "responsive_multiple_carousel")]//div[contains(@class, "col-12 d-none d-md-block d-lg-none")]//div[contains(@class, "carousel slide multiple_carousel")]'); + } + + + /** @test */ + public function widgetResponsiveMultipleCarouselPlusShouldContainsCarouselForSmall() { + $this->assertXPath('//main//div[@id="boite_1"]//div[contains(@class, "responsive_multiple_carousel")]//div[contains(@class, "col-12 d-block d-md-none")]//div[contains(@class, "carousel slide")]'); + } +} \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesAddWidgetTest.php b/tests/scenarios/Templates/TemplatesAddWidgetTest.php index 8cfb504808ccd91b5d889f79b0f8bc24eeaca749..43adaa5c14d887a8a2b1885568e4b51631860cd0 100644 --- a/tests/scenarios/Templates/TemplatesAddWidgetTest.php +++ b/tests/scenarios/Templates/TemplatesAddWidgetTest.php @@ -293,3 +293,42 @@ class TemplatesAddWidgetPreviewDispatchTest extends TemplatesIntonationTestCase $this->assertXPath('//div[contains(@class, "widget")]'); } } + + + + +class TemplatesAddWidgetInHerissonTest extends Admin_AbstractControllerTestCase { + protected $_storm_default_to_volatile = true; + + + public function setUp() { + parent::setUp(); + + $this->_buildTemplateProfil(['id' => 90898, + 'template' => 'HERISSON']); + + $this->dispatch('/admin/widget/add-from-template'); + } + + + public function categoriesTitles() : array { + return [['Agenda'], + ['Articles'], + ['Auteurs'], + ['Avis'], + ['Bibliothèques'], + ['Domaines'], + ['Notices'], + ['Site / menus / recherche'], + ['Sitothèque et RSS']]; + } + + + /** + * @test + * @dataProvider categoriesTitles + */ + public function pageShouldContainsExpectedCategories($title) { + $this->assertXPathContentContains('//div//h3', $title); + } +} \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesStylesPackTest.php b/tests/scenarios/Templates/TemplatesStylesPackTest.php index 32b8bcbfccacf022bc42783d472431f0590cf0b9..d99444dba0534ef389eab4f711ad03a5e2477223 100644 --- a/tests/scenarios/Templates/TemplatesStylesPackTest.php +++ b/tests/scenarios/Templates/TemplatesStylesPackTest.php @@ -857,7 +857,6 @@ class TemplatesStylesPackGenerateDefaultIntonationPackTest extends Admin_Abstrac public function widgetsUses() { return [['Sans bordure, sans arrondi, sans ombre, sans fond', ['logo', - 'Gestion des cookies', 'Boite notification']], ['Centré, sans bordure, sans arrondi, sans ombre, sans fond', @@ -873,6 +872,7 @@ class TemplatesStylesPackGenerateDefaultIntonationPackTest extends Admin_Abstrac ['Boite noir, texte blanc', ['Menu principal', + 'Gestion des cookies', 'Crédits', 'Partager']], @@ -913,8 +913,8 @@ class TemplatesStylesPackGenerateDefaultChiliPackTest extends Admin_AbstractCont /** @test */ - public function shouldContainsSevenTeenDefaultChiliStylesPack() { - $this->assertCount(17, Class_StylesPack::findAllBy(['template' => 'CHILI'])); + public function shouldContains18DefaultChiliStylesPack() { + $this->assertCount(18, Class_StylesPack::findAllBy(['template' => 'CHILI'])); } @@ -922,7 +922,7 @@ class TemplatesStylesPackGenerateDefaultChiliPackTest extends Admin_AbstractCont public function shouldNotDuplicateStylesPack() { $this->_buildTemplateProfil(['id' => 3]); $this->dispatch('/admin/template/apply/template/CHILI/on/3'); - $this->assertCount(17, Class_StylesPack::findAllBy(['template' => 'CHILI'])); + $this->assertCount(18, Class_StylesPack::findAllBy(['template' => 'CHILI'])); } @@ -1001,8 +1001,8 @@ class TemplatesStylesPackGenerateDefaultMusclePackTest extends Admin_AbstractCon /** @test */ - public function shouldContainsElevenDefaultMuscleStylesPack() { - $this->assertCount(11, Class_StylesPack::findAllBy(['template' => 'MUSCLE'])); + public function shouldContains12DefaultMuscleStylesPack() { + $this->assertCount(12, Class_StylesPack::findAllBy(['template' => 'MUSCLE'])); } @@ -1010,7 +1010,7 @@ class TemplatesStylesPackGenerateDefaultMusclePackTest extends Admin_AbstractCon public function shouldNotDuplicateStylesPack() { $this->_buildTemplateProfil(['id' => 3]); $this->dispatch('/admin/template/apply/template/MUSCLE/on/3'); - $this->assertCount(11, Class_StylesPack::findAllBy(['template' => 'MUSCLE'])); + $this->assertCount(12, Class_StylesPack::findAllBy(['template' => 'MUSCLE'])); } @@ -1078,8 +1078,8 @@ class TemplatesStylesPackGenerateDefaultPolygonePackTest extends Admin_AbstractC /** @test */ - public function shouldContainsNineDefaultPolygoneStylesPack() { - $this->assertCount(9, Class_StylesPack::findAllBy(['template' => 'POLYGONE'])); + public function shouldContains10DefaultPolygoneStylesPack() { + $this->assertCount(10, Class_StylesPack::findAllBy(['template' => 'POLYGONE'])); } @@ -1087,7 +1087,7 @@ class TemplatesStylesPackGenerateDefaultPolygonePackTest extends Admin_AbstractC public function shouldNotDuplicateStylesPack() { $this->_buildTemplateProfil(['id' => 3]); $this->dispatch('/admin/template/apply/template/POLYGONE/on/3'); - $this->assertCount(9, Class_StylesPack::findAllBy(['template' => 'POLYGONE'])); + $this->assertCount(10, Class_StylesPack::findAllBy(['template' => 'POLYGONE'])); } @@ -1151,8 +1151,8 @@ class TemplatesStylesPackGenerateDefaultTerreDuMileuPackTest extends Admin_Abstr /** @test */ - public function shouldContainsNineDefaultIntonationStylesPack() { - $this->assertCount(9, Class_StylesPack::findAllBy(['template' => 'TERREDUMILIEU'])); + public function shouldContains10DefaultIntonationStylesPack() { + $this->assertCount(10, Class_StylesPack::findAllBy(['template' => 'TERREDUMILIEU'])); } @@ -1160,7 +1160,7 @@ class TemplatesStylesPackGenerateDefaultTerreDuMileuPackTest extends Admin_Abstr public function shouldNotDuplicateStylesPack() { $this->_buildTemplateProfil(['id' => 3]); $this->dispatch('/admin/template/apply/template/TERREDUMILIEU/on/3'); - $this->assertCount(9, Class_StylesPack::findAllBy(['template' => 'TERREDUMILIEU'])); + $this->assertCount(10, Class_StylesPack::findAllBy(['template' => 'TERREDUMILIEU'])); } diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index d73559f0bbd339aa4284ac123ae738ab6262526a..2e38511cc88877db23be898cf8dbb9cd1a75feed 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -121,7 +121,17 @@ class TemplatesControllerResetIntonationTest extends TemplatesEnabledTestCase { ['id' => 1, 'template' => 'INTONATION']); - $this->dispatch('/admin/template/reset/template/INTONATION', true); + $this->fixture(Class_StylesPack::class, + ['id' => 1, + 'template' => 'INTONATION' + ]); + + $this->fixture(Class_ResponsivePack::class, + ['id' => 1, + 'template' => 'INTONATION' + ]); + + $this->dispatch('/admin/template/reset/template/INTONATION'); } @@ -135,6 +145,18 @@ class TemplatesControllerResetIntonationTest extends TemplatesEnabledTestCase { public function templateSettings1ShouldBeDelete() { $this->assertNull(Class_Template_Settings::find(1)); } + + + /** @test */ + public function templateStylesPackShouldBeDeleted() { + $this->assertNull(Class_StylesPack::find(1)); + } + + + /** @test */ + public function templateResponsivePackShouldBeDeleted() { + $this->assertNull(Class_ResponsivePack::find(1)); + } } @@ -818,6 +840,10 @@ class TemplatesPostEditTest extends TemplatesEnabledTestCase { Class_Template_Settings::findFirstBy(['template' => 'INTONATION'])->getSettingsInstance()->getIntonationCoreCss()); } + public function intonationCoreCssShouldHaveBeenSavedToTwo() { + $this->assertEquals('1', Class_Template_Settings::find(2)->getSettingsInstance()->getIntonationCoreCss()); + } + /** @test */ public function intonationHydratedMappingShouldContainsBodyAndWidgetDryKey() { @@ -829,8 +855,7 @@ class TemplatesPostEditTest extends TemplatesEnabledTestCase { /** @test */ public function intonationIconsMapDocTypesShouldContains101AndFaLink() { $this->assertEquals(['1' => 'class fas fa-link', - '2' => ''], - Class_Template_Settings::findFirstBy(['template' => 'INTONATION'])->getSettingsInstance()->getIntonationIconsMapDocTypes()); + '2' => ''], Class_Template_Settings::find(2)->getSettingsInstance()->getIntonationIconsMapDocTypes()); } } @@ -2016,8 +2041,8 @@ class TemplateSearchSavedSettingsTest extends TemplatesIntonationTestCase { /** @test */ - public function layoutShouldBeWall() { - $this->assertXPath('//a[contains(@class, "active")][contains(@href, "liste_format/4")]'); + public function buttonLayoutWallShouldBeSelected() { + $this->assertXPath('//a[@class = "card-link btn-sm list_format active btn btn-light"][contains(@href, "liste_format/4")]'); }