diff --git a/application/modules/opac/controllers/RssController.php b/application/modules/opac/controllers/RssController.php index 0142edbdd06ea08a115b6deb48597c2cde9fe815..dea4b90025dd3612cc1aee284945414a19ff5d5c 100644 --- a/application/modules/opac/controllers/RssController.php +++ b/application/modules/opac/controllers/RssController.php @@ -287,9 +287,17 @@ class RssController extends ZendAfi_Controller_Action { public function renderItemsAction() { - if (!$this->view->rss = Class_Rss::find($this->_getParam('id', null))) + if (!$rss = Class_Rss::find($this->_getParam('id', null))) return $this->getHelper('ViewRenderer')->setNoRender(); - $this->getHelper('ViewRenderer')->setLayoutScript('subModal.phtml'); + $content = $this->view->rss_RenderItems($rss); + + $script_loader = Class_ScriptLoader::getInstance(); + $scripts = $script_loader + ->addAdminScript('onload_utils') + ->addJQueryReady('setupAnchorsTarget();') + ->html(); + + return $this->_helper->HTMLAjaxResponse($scripts . $content); } } diff --git a/application/modules/opac/views/scripts/rss/render-items.phtml b/application/modules/opac/views/scripts/rss/render-items.phtml deleted file mode 100644 index 46529203a705181025864334469a178c1fc248ed..0000000000000000000000000000000000000000 --- a/application/modules/opac/views/scripts/rss/render-items.phtml +++ /dev/null @@ -1,2 +0,0 @@ -<?php -echo $this->rss_RenderItems($this->rss); diff --git a/library/Class/User/Cards.php b/library/Class/User/Cards.php index 45d92510572561e9504c7e3ebcc053885dc2fcea..ecb7257e20d6d323c9c69fb6790084093b9448f2 100644 --- a/library/Class/User/Cards.php +++ b/library/Class/User/Cards.php @@ -161,6 +161,17 @@ class Class_User_Cards extends Storm_Model_Collection { } + public function getPNBLoans() { + $loans = $this->getLoans() + ->select(function($loan) + { + return $loan->isPNB(); + }); + + return $loans; + } + + public function getLoansHistory() { return $this->_decorateOperationFrom( function($card) { diff --git a/library/templates/Intonation/Library/ProfilePatcher.php b/library/templates/Intonation/Library/ProfilePatcher.php index 12fd3884c3f3c485ea0785c4aaebfc58cf61bcf6..1352acadd10ceb2d7140dbc62e7fd7e26262440d 100644 --- a/library/templates/Intonation/Library/ProfilePatcher.php +++ b/library/templates/Intonation/Library/ProfilePatcher.php @@ -41,6 +41,21 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher { protected function _upgradeProfile() { + $label = $this->_('Tags bibliothèque'); + + if ( ! Class_CustomField_Meta::findFirstBy(['label' => $label])) { + $meta = Class_CustomField_Meta::newInstance(['label' => $label, + 'field_type' => Class_CustomField_Meta::MULTI_CHECKBOX, + 'indexable' => 0]); + $meta->save(); + + $field = Class_CustomField::newInstance(['meta_id' => $meta->getId(), + 'priority' => 99, + 'model' => 'Bib']); + + $field->save(); + } + $this->_profile ->setCfgSiteParam('skin', '') ->setCfgSiteParam('browser', 'opac') diff --git a/library/templates/Intonation/Library/View/Wrapper/Library.php b/library/templates/Intonation/Library/View/Wrapper/Library.php index 697c24fa9713b0ad7f14c1572ef0423f92b34d76..7f415196fede2d1f6c31dc982e2eb2a37bb0c569 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Library.php +++ b/library/templates/Intonation/Library/View/Wrapper/Library.php @@ -143,7 +143,7 @@ class Intonation_Library_View_Wrapper_Library extends Intonation_Library_View_Wr $this->_model->getTelephone(), $this->_model->getLibelle()))), - ((new Intonation_Library_Badge) + ((new Intonation_Library_Badge) ->setTag('a') ->setClass('primary text-light') ->setUrl(sprintf('mailto:%s', $this->_model->getMail())) @@ -156,6 +156,23 @@ class Intonation_Library_View_Wrapper_Library extends Intonation_Library_View_Wr $this->_model->getLibelle()))) ]; + foreach($this->_model->getAllCustomFields()->getFieldValues() as $field) { + if ($field->getLabel() !== $this->_('Tags bibliothèque')) + continue; + + if ( ($values = $field->getValue()) === '') + continue; + + $values = explode(';', $values); + foreach ( $values as $value) + $badges [] = (new Intonation_Library_Badge) + ->setTag('span') + ->setClass('secondary') + ->setText($value) + ->setTitle($this->_('À savoir : %s', + $value)); + } + return $this->_view->renderBadges($badges); } diff --git a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Details.php b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Details.php index fb0612b676d900c47866ad5a4fe2454f28f8459b..6ef90cfba195c47f8399b75819643ba07282a39d 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Details.php +++ b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Details.php @@ -69,6 +69,9 @@ class Intonation_Library_View_Wrapper_Library_RichContent_Details extends Intona $count = 0; foreach($this->_model->getAllCustomFields()->getFieldValues() as $field) { + if ($field->getLabel() === $this->_('Tags bibliothèque')) + continue; + if ($field->getValue() === '') continue; diff --git a/library/templates/Intonation/Library/View/Wrapper/PNBLoan.php b/library/templates/Intonation/Library/View/Wrapper/PNBLoan.php new file mode 100644 index 0000000000000000000000000000000000000000..a75b9e507cdb6fdd9b31cb6bc71faee8196495b7 --- /dev/null +++ b/library/templates/Intonation/Library/View/Wrapper/PNBLoan.php @@ -0,0 +1,113 @@ +<?php +/** + * Copyright (c) 2012-2018, 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 Intonation_Library_View_Wrapper_PNBLoan extends Intonation_Library_View_Wrapper_Loan { + + + public function getMainTitle() { + $desc = $this->_('Emprunté par %s %s', + $this->_model->getUser()->getIdabon(), + $this->_model->getUser()->getNomComplet()); + + return ($record = $this->_getRecord()) + ? $desc . BR . $record->getMainTitle() + : $desc . BR . $this->_model->getTitre(); + } + + + public function getSecondaryTitle() { + return ($record = $this->_getRecord()) + ? $record->getSecondaryTitle() + : ''; + } + + + public function getBadges() { + $issue_date = $this->_model->getIssueDate(); + $return_date = $this->_model->getDateRetourISO8601(); + + $badges = [ + ((new Intonation_Library_Badge) + ->setTag('span') + ->setClass('info') + ->setImage(Class_Template::current()->getIco($this->_view, + 'loan', + 'library')) + ->setText($issue_date) + ->setTitle($this->_('Date d\'emprunt : %s', $issue_date))), + + ((new Intonation_Library_Badge) + ->setTag('span') + ->setClass(($this->_model->isLate() + ? 'danger' + : 'success')) + ->setImage(Class_Template::current()->getIco($this->_view, + 'return-date', + 'library')) + ->setText($return_date) + ->setTitle($this->_('Date de retour : %s', $return_date))), + + ((new Intonation_Library_Badge) + ->setTag('span') + ->setClass('secondary') + ->setImage(Class_Template::current()->getIco($this->_view, + 'library', + 'library')) + ->setText($this->_model->getBibliotheque()) + ->setTitle($this->_('Bibliothèque de l\'emprunt: %s', $this->_model->getBibliotheque()))), + ]; + + return $this->_view->renderBadges($badges); + } + + + public function getActions() { + $actions = []; + + if (!$record = $this->_getRecord()) + return $actions; + + foreach((new Intonation_Library_UserPatcher)->getDefaultSelections() as $selection) { + $selection + ->setView($this->_view) + ->setUser(Class_Users::getIdentity()) + ->setRecord($record->getModel()); + + $actions [] = $selection->getAction(); + } + + return $actions; + } + + + protected function _getRecord() { + if ($this->_record) + return $this->_record; + + if (!$this->_model->getNoticeOPAC()) + return $this->_record = null; + + return $this->_record = $wrapper = (new Intonation_Library_View_Wrapper_Record) + ->setView($this->_view) + ->setModel($this->_model->getNoticeOPAC()); + } +} diff --git a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Loans.php b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Loans.php index 81d3a8ce6b8208ed35f25e4655fcce98fe7f90f5..d3b3e3d7edebb6d89d03ad2526e25595b465bdb9 100644 --- a/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Loans.php +++ b/library/templates/Intonation/Library/View/Wrapper/User/RichContent/Loans.php @@ -78,7 +78,10 @@ class Intonation_Library_View_Wrapper_User_RichContent_Loans extends Intonation_ $cards = new Class_User_Cards($this->_model); $pnb = ($cards->hasPNB()) - ? $this->view->abonne_LoansPNB($cards->getPNBLoans()) + ? $this->_view->abonne_PNBLoansList(new Class_Entity(['Profile' => Class_Profil::getCurrentProfil(), + 'RequestParams' => [], + 'User' => $this->_model, + 'Loans' => $cards->getPNBLoans()])) : ''; $history = $this->_view->abonne_LoansList(new Class_Entity(['Profile' => Class_Profil::getCurrentProfil(), diff --git a/library/templates/Intonation/Library/WidgetTemplates.php b/library/templates/Intonation/Library/WidgetTemplates.php index d61834997539321f291184850ff96d16814329fb..3abf83c87db0c7e098b39441e7359ff9af76dc9d 100644 --- a/library/templates/Intonation/Library/WidgetTemplates.php +++ b/library/templates/Intonation/Library/WidgetTemplates.php @@ -58,6 +58,11 @@ class Intonation_Library_WidgetTemplates { 'horizontal_list', 'wall']], + $this->_('Flux RSS') => ['RSS' => ['carousel', + 'list', + 'horizontal_list', + 'list_with_options']], + $this->_('Lettres d\'informations') => ['NEWSLETTERS' => ['carousel', 'multiple_carousel', 'list', diff --git a/library/templates/Intonation/View/Abonne/PNBLoansList.php b/library/templates/Intonation/View/Abonne/PNBLoansList.php new file mode 100644 index 0000000000000000000000000000000000000000..77543539c1848d694bb4dadaa78a8b5b5712082f --- /dev/null +++ b/library/templates/Intonation/View/Abonne/PNBLoansList.php @@ -0,0 +1,42 @@ +<?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 Intonation_View_Abonne_PNBLoansList extends Intonation_View_Abonne_LoansList { + + public function abonne_PNBLoansList($config) { + return parent::abonne_LoansList($config); + } + + + public function render($loans) { + $loans = array_map(function($loan) + { + return (new Intonation_Library_View_Wrapper_PNBLoan) + ->setModel($loan) + ->setView($this->view); + }, $loans->getArrayCopy()); + + return $loans + ? $this->view->renderCollection(new Storm_Collection($loans)) + : ''; + } +} diff --git a/library/templates/Intonation/View/RenderRecord/RenderReviews.php b/library/templates/Intonation/View/RenderRecord/RenderReviews.php index e7cfbc5230d69496dc27242448eae768675f7951..b07da1c657ff17fc179705aa7701227edbd989c0 100644 --- a/library/templates/Intonation/View/RenderRecord/RenderReviews.php +++ b/library/templates/Intonation/View/RenderRecord/RenderReviews.php @@ -59,7 +59,7 @@ class Intonation_View_RenderRecord_RenderReviews extends ZendAfi_View_Helper_Bas protected function _renderPro() { - return $this->_renderReview($this->_('Des professionels'), $this->_record->getAvisBibliothecaires()); + return $this->_renderReview($this->_('Des professionnels'), $this->_record->getAvisBibliothecaires()); } diff --git a/library/templates/Intonation/View/RenderTruncateList.php b/library/templates/Intonation/View/RenderTruncateList.php index b75152a65f735932d7cb2fd9409eb06215bf5e96..c96e90b050130962fb93313ca1c84c9ac47eba55 100644 --- a/library/templates/Intonation/View/RenderTruncateList.php +++ b/library/templates/Intonation/View/RenderTruncateList.php @@ -138,8 +138,8 @@ class Intonation_View_RenderTruncateList extends ZendAfi_View_Helper_BaseHelper '#' . $this->_container_id . ' div.card *, .dropdown, .dropdown-menu') ->addJQueryReady("var container = $('#" . $this->_container_id . "');" - . "container.children().slice(0,3).show();" - . "$('#" . $this->_input_id . "').attr('onkeypress', 'return event.keyCode != 13;');"); + . "setTimeout(function() {container.children().slice(0,3).show();" + . "$('#" . $this->_input_id . "').attr('onkeypress', 'return event.keyCode != 13;');}, 10);"); return $this; } diff --git a/library/templates/Intonation/View/Search/Result.php b/library/templates/Intonation/View/Search/Result.php index 60f545a2a78f4e99132c3c794a0aef414016757d..410feb24a24d09051c6661b82b29e87367aeb4d9 100644 --- a/library/templates/Intonation/View/Search/Result.php +++ b/library/templates/Intonation/View/Search/Result.php @@ -137,7 +137,7 @@ class Intonation_View_Search_Result extends ZendAfi_View_Helper_BaseHelper { ->setView($this->view); $tools [] = $this->view->tagAction($search_wrapper - ->getMainLink() + ->getActions()[0] ->setAttribs(['data-popup' => true, 'class' => 'btn btn-sm btn-primary text-white'])); diff --git a/library/templates/Muscle/Library/WidgetTemplates.php b/library/templates/Muscle/Library/WidgetTemplates.php new file mode 100644 index 0000000000000000000000000000000000000000..2802a3de7869320252487f69fa1db1fa6ec278dd --- /dev/null +++ b/library/templates/Muscle/Library/WidgetTemplates.php @@ -0,0 +1,44 @@ +<?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 Muscle_Library_WidgetTemplates extends Intonation_Library_WidgetTemplates { + + protected function _getDefaultStyles() { + return ['no_background', + 'no_border', + 'no_border_radius', + 'no_shadow', + 'm-auto', + 'auto_col', + 'pt-3', + 'pb-3']; + } + + + protected function _getMenuDefaultStyles() { + return ['no_border', + 'no_border_radius', + 'no_shadow', + 'justify-content-start', + 'pt-3']; + } +} diff --git a/library/templates/Muscle/Template.php b/library/templates/Muscle/Template.php index 24a21c27b286ace77cb88535da5defe1f3c4f12e..cc379b16749a73d28f3d92490357e4716f6e23e8 100644 --- a/library/templates/Muscle/Template.php +++ b/library/templates/Muscle/Template.php @@ -60,4 +60,9 @@ class Muscle_Template extends Intonation_Template { $helper = new Muscle_Library_FormCustomizer($this); return $helper->getTemplateForm($form); } + + + public function getWidgetTemplates() { + return (new Muscle_Library_WidgetTemplates)->getTemplates(); + } } diff --git a/library/templates/MyBibApp/Library/WidgetTemplates.php b/library/templates/MyBibApp/Library/WidgetTemplates.php new file mode 100644 index 0000000000000000000000000000000000000000..1bd5d82610325180bd09ce99e7d76a1893b0ee25 --- /dev/null +++ b/library/templates/MyBibApp/Library/WidgetTemplates.php @@ -0,0 +1,36 @@ +<?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 MyBibApp_Library_WidgetTemplates extends Intonation_Library_WidgetTemplates { + + protected function _getDefaultStyles() { + return ['mba_widget', + 'no_border', + 'no_border_radius', + 'no_shadow']; + } + + + protected function _getMenuDefaultStyles() { + return []; + } +} diff --git a/library/templates/MyBibApp/Template.php b/library/templates/MyBibApp/Template.php index 745e6931e1010836da09231fe3e644ab8383520b..65f14858f83582c73c21d8fa8d11ace1abfc465a 100644 --- a/library/templates/MyBibApp/Template.php +++ b/library/templates/MyBibApp/Template.php @@ -58,4 +58,9 @@ class MyBibApp_Template extends Intonation_Template { $helper = new MyBibApp_Library_FormCustomizer($this); return $helper->getTemplateForm($form); } + + + public function getWidgetTemplates() { + return (new MyBibApp_Library_WidgetTemplates)->getTemplates(); + } } diff --git a/library/templates/Polygone/Assets/css/polygone.css b/library/templates/Polygone/Assets/css/polygone.css index 3d61fb45feb2d152f5a42a65f8dc334e8881be07..d645ef7fee62f50e9113ecc2a1f2c72c607b92e0 100644 --- a/library/templates/Polygone/Assets/css/polygone.css +++ b/library/templates/Polygone/Assets/css/polygone.css @@ -63,15 +63,6 @@ header { display: none !important; } -.menu_buttons .nav-link, -.menu_buttons .nav-link:hover { - -} - -.login .dropdown-toggle, -.login .dropdown-menu { -} - .ui-state-active, .btn:active, a:active, @@ -109,18 +100,6 @@ col-form-label-sm, left: -33% !important; } -.rech_simple.widget button[type='submit'] { -} - -.rech_simple.widget ::placeholder { -} - -.widget.card, -.widget-header, -.breadcrumb, -nav { -} - .nav nav .nav-link { font-size: 1.8em; border-right: 1px solid var(--polygone-black) !important; @@ -143,10 +122,6 @@ nav .nav-item:last-child .nav-link { box-shadow: var(--polygone-grey) 0px 0px 5px; } -body, -#site_web_wrapper { -} - footer { font-size: 0.875em; } @@ -171,19 +146,10 @@ footer .nav-link { padding: 0; } -.widget.login * { -} - -.widget.login input { -} - .widget.login form * { text-align: left; } -.widget.login .text-secondary { -} - .widget.login .dropdown-toggle, .widget.login .dropdown-toggle:after { font-size: 20px; @@ -206,10 +172,6 @@ header .card-body { padding: 0; } -.widget.login a { - -} - .widget.login #login { position: absolute; bottom: 4em; @@ -229,44 +191,14 @@ header .card-body { max-width: 200px; } -.widget-footer a.btn-secondary { -} - -.widget-footer { - text-align: right; -} - -.badge-group .badge { -} - -.badge-group a.badge { -} - -a, -a:hover { -} - -a.text-primary, -a.text-primary:hover { -} - .carousel-item .card-footer { margin: 0 1rem; } -.widget > .card-footer, -.card-footer { -} - .masonry-content > .card > .card-footer { padding: 5px; } -.list-group-item.active, -.nav-tabs, -.border-primary { -} - .nav-tabs .nav-item { border-bottom: 1px solid transparent; } @@ -289,6 +221,7 @@ a.text-primary:hover { background-repeat: no-repeat; background-position: top left; background-color: transparent; + background-size: 100%; } .widget > .card-footer, .card-footer { @@ -298,7 +231,7 @@ a.text-primary:hover { footer { background-image: url('../images/footer_corner.png'); background-repeat: no-repeat; - background-position: bottom right; + background-position: top right; background-color: #31ade4; } @@ -306,8 +239,8 @@ footer { background: transparent; } -.polygone_big_menu_buttons .nav-item { - width: 33.33%; +.polygone_big_menu_buttons { + margin: 3em 0; } .polygone_big_menu_buttons .nav-link { @@ -315,8 +248,11 @@ footer { padding: 0 !important; } -.polygone_big_menu_buttons .nav-item + .nav-item .nav-link { - margin-left: 10px; +.polygone_big_menu_buttons .navbar-expand .navbar-nav { + column-count: 3; + column-gap: 1em; + column-width: auto; + display: block; } .polygone_big_menu_buttons .nav-link div { @@ -338,7 +274,7 @@ footer { } .polygone_big_menu_buttons .nav-link img { - width: 100%; + width: 800px; height: auto; } @@ -374,7 +310,7 @@ a:visited { background: #1884c7; color: #fff; display: none; - z-index: 3; + z-index: 11; text-align: center; opacity: 0.9; } @@ -392,7 +328,7 @@ a:visited { } .scroll_search form { - width: 40%; + width: auto; display: inline-block; } @@ -410,12 +346,11 @@ a:visited { .flying_widget .navbar-collapse.collapsing, .flying_widget .navbar-collapse.collapse { - padding: 2em 0.5em; + padding: 100px 150px 2em 2em; height: 30000px; overflow:visible; } - .flying_widget .navbar-collapse { height: 30000px; background-color: #1884c7; @@ -428,16 +363,49 @@ a:visited { .flying_widget .navbar-brand { display: inline-block; + font-weight: bold; } .flying_widget .navbar-header { - padding: 1em; - padding-top: 150px; + padding: 0; + text-align: end; + position: absolute; + right: 5px; + top: 300px; + text-transform: uppercase; } -.flying_widget * { +.flying_widget .navbar-header > * { + margin: 0; + padding: 0; +} + +.flying_widget .nav-item + .nav-item .nav-link:before { + font-family: "Font Awesome 5 Free"; + content: '\f111'; + font-weight: 900; + font-size: 1em; + line-height: 1em; + color: #223a7e; + margin-right: 5px; +} + +.flying_widget .nav-item:first-child .nav-link { + text-align: center; + margin-bottom: 2em; +} + +.flying_widget .nav-item:first-child .nav-link .button_text { + color: black; + display: block !important; + text-align: center !important; +} + +.flying_widget *, +.flying_widget *:after { transition-delay: unset; transition-duration: unset; + color: white; } .flying_widget { @@ -445,6 +413,106 @@ a:visited { min-width: 8.33%; } +.flying_widget .navbar-toggler-icon { + background-image: none; +} + +.flying_widget .navbar-toggler-icon:after { + font-family: "Font Awesome 5 Free"; + content: '\f054'; + font-weight: 900; + font-size: 1.5em; + color: #223a7e; +} + +.navbar-light[aria-expanded="true"] .navbar-toggler-icon::after { + font-family: "Font Awesome 5 Free"; + content: '\f053'; + font-weight: 900; + color: #223a7e; +} + .z-index-11 { z-index: 11; +} + +.polygone_widget .widget-header, +.polygone_simple_widget .widget-header { + text-align: center; +} + +.widget.scroll.position_fixed_top_right { + top: 50px !important; +} + +.widget-footer { + text-align: center; +} + +.widget-footer a.btn { + background: black !important; + color: white !important; + border-radius: 10px !important; + margin-bottom: 3em; + padding: 0.5em 1em; + font-size: 1.2em; +} + +.widget-footer a.btn > i { + display: none; +} + +header .widget.library .card-title { + background: rgba(255, 255, 255, 0.7); + padding: 2px; +} + +footer .widget.image { + position: absolute; + right: 15px; + bottom: 15px; +} + +footer * { + color: #223a7e; + text-align: left !important; +} + +footer .widget.menu { + padding: 1em; +} + +footer { + min-height: 300px; +} + +footer .widget.library { + padding: 0 1em; +} + +footer .widget.library .card-title a:before, +footer .widget.menu .nav-item .nav-link:before { + font-family: "Font Awesome 5 Free"; + content: '\f111'; + font-weight: 900; + font-size: 1em; + line-height: 1em; + color: #223a7e; + margin-right: 5px; +} + +footer .widget.library .card-title a:before, +footer .widget.menu .nav-item:first-child .nav-link:before { + content: '\f054'; +} + +footer .widget.library .card-title a, +footer .widget.menu .nav-item:first-child .nav-link { + font-weight: bold; + font-size: 1.2em; + text-transform: uppercase; +} + +footer .widget.library .card-title a { + font-size: 0.83em; } \ No newline at end of file diff --git a/library/templates/Polygone/Library/ProfilePatcher.php b/library/templates/Polygone/Library/ProfilePatcher.php index 901c3b017b8c0301a737e1eb36977d9ada9b1135..44cb0f6f35c90ca78d6377e4d3a5443b53048bf1 100644 --- a/library/templates/Polygone/Library/ProfilePatcher.php +++ b/library/templates/Polygone/Library/ProfilePatcher.php @@ -55,10 +55,8 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->setNewDatas(['boite' => ['no_border_radius'], $this->_template->withNameSpace('width_xsmall') => 11, $this->_template->withNameSpace('width_large') => 8, - $this->_template->withNameSpace('width_xlarge') => 6, $this->_template->withNameSpace('offset_xsmall') => 1, - $this->_template->withNameSpace('offset_large') => 2, - $this->_template->withNameSpace('offset_xlarge') => 3]) + $this->_template->withNameSpace('offset_large') => 2]) ->updateProfile(); Class_Profil::clearCache(); @@ -71,10 +69,8 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->setNewDatas(['boite' => ['no_border_radius'], $this->_template->withNameSpace('width_xsmall') => 11, $this->_template->withNameSpace('width_large') => 8, - $this->_template->withNameSpace('width_xlarge') => 6, $this->_template->withNameSpace('offset_xsmall') => 1, - $this->_template->withNameSpace('offset_large') => 2, - $this->_template->withNameSpace('offset_xlarge') => 3]) + $this->_template->withNameSpace('offset_large') => 2]) ->updateProfile(); Class_Profil::clearCache(); @@ -87,10 +83,8 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->setNewDatas(['boite' => ['no_border_radius'], $this->_template->withNameSpace('width_xsmall') => 11, $this->_template->withNameSpace('width_large') => 8, - $this->_template->withNameSpace('width_xlarge') => 6, $this->_template->withNameSpace('offset_xsmall') => 1, - $this->_template->withNameSpace('offset_large') => 2, - $this->_template->withNameSpace('offset_xlarge') => 3]) + $this->_template->withNameSpace('offset_large') => 2]) ->updateProfile(); Class_Profil::clearCache(); @@ -241,7 +235,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher 'picto' => '', 'menus' => [ ['type_menu' => 'ACCUEIL', - 'libelle' => $this->_('Accueil'), + 'libelle' => $this->_('Le Polygone'), 'picto' => Class_Url::absolute('/library/templates/Polygone/Assets/images/logo_footer.png'), 'use_profil' => $this->_profile_id], @@ -301,9 +295,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher 'layout' => 'vertical', 'menu' => $this->_profile_id . '-' . $this->_flying_menu, $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_ALWAYS, - $this->_template->withNameSpace('width_xsmall') => 6, - $this->_template->withNameSpace('width_medium') => 4, - $this->_template->withNameSpace('width_large') => 3, + $this->_template->withNameSpace('width_xsmall') => 12, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 0, $this->_template->withNameSpace('show_footer') => 0]) @@ -420,7 +412,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->_addWidget(Intonation_Library_Widget_Carousel_Agenda_Definition::CODE, Class_Profil::DIV_MAIN, ['titre' => $this->_('Actualités'), - 'boite' => ['no_background', 'no_border', 'no_border_radius', 'no_shadow'], + 'boite' => ['no_background', 'no_border', 'no_border_radius', 'no_shadow', 'polygone_simple_widget'], 'rendering' => 'card-overlay', 'layout' => 'carousel', 'size' => 3, @@ -435,7 +427,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->_addWidget(Intonation_Library_Widget_Carousel_Agenda_Definition::CODE, Class_Profil::DIV_MAIN, ['titre' => $this->_('Prochains événements'), - 'boite' => ['no_background', 'no_border', 'no_border_radius', 'no_shadow'], + 'boite' => ['no_background', 'no_border', 'no_border_radius', 'no_shadow', 'mt-3', 'polygone_simple_widget'], 'rendering' => 'card', 'layout' => 'multiple_carousel', 'size' => 3, @@ -450,14 +442,14 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher ->_addWidget(Intonation_Library_Widget_Carousel_Record_Definition::CODE, Class_Profil::DIV_MAIN, ['titre' => $this->_('Nouveautés'), - 'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'polygone_widget'], + 'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'polygone_widget', 'mb-5'], 'rendering' => 'card-overlay', 'layout' => 'horizontal_list', 'size' => 5, 'link_to_all' => 1, $this->_template->withNameSpace('width_xsmall') => 12, $this->_template->withNameSpace('show_header') => 1, - $this->_template->withNameSpace('show_content') => 0, + $this->_template->withNameSpace('show_content') => 1, $this->_template->withNameSpace('show_footer') => 1]) ->_addWidget(Intonation_Library_Widget_Carousel_Library_Definition::CODE, @@ -470,7 +462,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher 'size' => 1, 'link_to_all' => 0, $this->_template->withNameSpace('width_xsmall') => 12, - $this->_template->withNameSpace('width_medium') => 6, + $this->_template->withNameSpace('width_medium') => 4, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 0, $this->_template->withNameSpace('show_footer') => 0]) @@ -484,6 +476,7 @@ class Polygone_Library_ProfilePatcher extends Intonation_Library_ProfilePatcher $this->_template->withNameSpace('expand_breakpoint') => Intonation_Library_Constants::RESPONSIVE_MODE_XSMALL, $this->_template->withNameSpace('width_xsmall') => 6, $this->_template->withNameSpace('width_medium') => 3, + $this->_template->withNameSpace('offset_medium') => 1, $this->_template->withNameSpace('show_header') => 0, $this->_template->withNameSpace('show_content') => 0, $this->_template->withNameSpace('show_footer') => 0]) diff --git a/library/templates/Polygone/Library/Settings.php b/library/templates/Polygone/Library/Settings.php index 3d4afa8ef2c82ba1ab3bc92bcac7d0c3425f8c60..675f19ac81fffe6b27827b7ec5c1212236495bad 100644 --- a/library/templates/Polygone/Library/Settings.php +++ b/library/templates/Polygone/Library/Settings.php @@ -56,6 +56,7 @@ class Polygone_Library_Settings extends Intonation_Library_Settings { 'menu_buttons', 'polygone_big_menu_buttons', 'polygone_widget', + 'polygone_simple_widget', 'no_card_footer', 'no_badges', 'scroll_search', diff --git a/library/templates/Polygone/Library/WidgetTemplates.php b/library/templates/Polygone/Library/WidgetTemplates.php new file mode 100644 index 0000000000000000000000000000000000000000..b230764c75709c6953cb833a0c0fe2c689ffc4cf --- /dev/null +++ b/library/templates/Polygone/Library/WidgetTemplates.php @@ -0,0 +1,39 @@ +<?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 Polygone_Library_WidgetTemplates extends Intonation_Library_WidgetTemplates { + + protected function _getDefaultStyles() { + return ['no_border', + 'no_border_radius', + 'no_shadow', + 'polygone_widget', + 'mb-5']; + } + + + protected function _getMenuDefaultStyles() { + return ['no_border', + 'no_border_radius', + 'no_shadow']; + } +} diff --git a/library/templates/Polygone/Template.php b/library/templates/Polygone/Template.php index dd9ac4e65adaa9da50f626002b59a98ce8099c0f..949dc9fa85b4fb43f527285b45a4afe2416b78d8 100644 --- a/library/templates/Polygone/Template.php +++ b/library/templates/Polygone/Template.php @@ -60,4 +60,9 @@ class Polygone_Template extends Intonation_Template { $helper = new Polygone_Library_FormCustomizer($this); return $helper->getTemplateForm($form); } + + + public function getWidgetTemplates() { + return (new Polygone_Library_WidgetTemplates)->getTemplates(); + } } diff --git a/library/templates/TerreDuMilieu/Library/WidgetTemplates.php b/library/templates/TerreDuMilieu/Library/WidgetTemplates.php new file mode 100644 index 0000000000000000000000000000000000000000..78f62ff15633d682b74daf3996c1aa74f61d6f6b --- /dev/null +++ b/library/templates/TerreDuMilieu/Library/WidgetTemplates.php @@ -0,0 +1,42 @@ +<?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 TerreDuMilieu_Library_WidgetTemplates extends Intonation_Library_WidgetTemplates { + + protected function _getDefaultStyles() { + return ['no_background', + 'no_border', + 'no_border_radius', + 'no_shadow', + 'm-auto', + 'tdm_widget']; + } + + + protected function _getMenuDefaultStyles() { + return ['no_border', + 'no_border_radius', + 'no_shadow', + 'tdm_widget', + 'admin_tools_invert_colors']; + } +} diff --git a/library/templates/TerreDuMilieu/Template.php b/library/templates/TerreDuMilieu/Template.php index ad2c1745779942180e0e7f83615331769ecf72f1..d5cf875f0720eb2d5fe800ff9e06384886bff0a8 100644 --- a/library/templates/TerreDuMilieu/Template.php +++ b/library/templates/TerreDuMilieu/Template.php @@ -60,4 +60,9 @@ class TerreDuMilieu_Template extends Intonation_Template { $helper = new TerreDuMilieu_Library_FormCustomizer($this); return $helper->getTemplateForm($form); } + + + public function getWidgetTemplates() { + return (new TerreDuMilieu_Library_WidgetTemplates)->getTemplates(); + } } diff --git a/public/opac/js/widget_templates/TEMPLATE_RSS_carousel.jpg b/public/opac/js/widget_templates/TEMPLATE_RSS_carousel.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a132751308233de99aaefe4eafcdbdcab1e1ffe5 Binary files /dev/null and b/public/opac/js/widget_templates/TEMPLATE_RSS_carousel.jpg differ diff --git a/public/opac/js/widget_templates/TEMPLATE_RSS_horizontal_list.jpg b/public/opac/js/widget_templates/TEMPLATE_RSS_horizontal_list.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b187c4827d9251c42dec055eb06d0451a4fdc79b Binary files /dev/null and b/public/opac/js/widget_templates/TEMPLATE_RSS_horizontal_list.jpg differ diff --git a/public/opac/js/widget_templates/TEMPLATE_RSS_list.jpg b/public/opac/js/widget_templates/TEMPLATE_RSS_list.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0ab6688812f686cdcd97da7c9826f11311cab241 Binary files /dev/null and b/public/opac/js/widget_templates/TEMPLATE_RSS_list.jpg differ diff --git a/public/opac/js/widget_templates/TEMPLATE_RSS_list_with_options.jpg b/public/opac/js/widget_templates/TEMPLATE_RSS_list_with_options.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4c9eed2ccf8867a15a5077e5eff0658193f96c32 Binary files /dev/null and b/public/opac/js/widget_templates/TEMPLATE_RSS_list_with_options.jpg differ diff --git a/tests/scenarios/Templates/PolygoneTemplateTest.php b/tests/scenarios/Templates/PolygoneTemplateTest.php index 92a162878b3211ba2d9a82fbb29ec97cc66c7cb5..ab9ad15b043eefffae353f49970cb39b8e2dd52a 100644 --- a/tests/scenarios/Templates/PolygoneTemplateTest.php +++ b/tests/scenarios/Templates/PolygoneTemplateTest.php @@ -94,6 +94,12 @@ class PolygoneTemplateProfilePatcherTest extends PolygoneTemplateTestCase { public function editTemplatePolygoneShouldBePresent() { $this->assertXPathContentContains('//a[contains(@href, "admin/template/edit/template/POLYGONE")]', 'Configuration du template'); } + + + /** @test */ + public function customFieldTagsBibliothequeShouldHaveBeenCreated() { + $this->assertNotNull(Class_CustomField_Meta::findFirstBy(['label' => 'Tags bibliothèque'])); + } } @@ -442,4 +448,4 @@ class PolygoneTemplateSuggestionsNanookTest extends PolygoneTemplateTestCase { public function francisShouldHaveWrotePurpleForTheWinSuggest() { $this->assertXPathContentContains('//main//div', 'Purple for the win suggéré par francis francis'); } -} +} \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index d315359a6da4d93ccadd722a0770f4b801977c2b..35e7e541c8ca411b4baf6d69782044ca0f7be574 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -4730,24 +4730,28 @@ class TemplatesDispatchWidgetTemplateImageTest extends TemplatesIntonationTestCa [6, 3], [6, 4], [7, 0], + [7, 1], + [7, 2], + [7, 3], [8, 0], - [8, 1], - [8, 2], [9, 0], [9, 1], [9, 2], - [9, 3], - [9, 4], [10, 0], [10, 1], [10, 2], [10, 3], [10, 4], - [10, 5], - [10, 6], - [10, 7], - [10, 8], - [11, 0] + [11, 0], + [11, 1], + [11, 2], + [11, 3], + [11, 4], + [11, 5], + [11, 6], + [11, 7], + [11, 8], + [12, 0] ]; }