Commit 0c1442d0 authored by Ghislain Loas's avatar Ghislain Loas

wip on theme store

parent d017705d
Pipeline #9560 passed with stage
in 42 minutes and 1 second
......@@ -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);
}
}
......@@ -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) {
......
......@@ -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')
......
......@@ -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);
}
......
......@@ -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;
......
<?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());
}
}
......@@ -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(),
......
......@@ -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',
......
<?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))
: '';
}
}
......@@ -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());
}
......
......@@ -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;
}
......
......@@ -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']));
......
<?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'];
}
}
......@@ -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();
}
}
<?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 [];
}
}
......@@ -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();
}
}
......@@ -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;
}