Commit 61fc1bc0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

wip on theme store

parent d09d74c6
Pipeline #9465 passed with stage
in 41 minutes and 51 seconds
......@@ -133,6 +133,7 @@ class Intonation_Library_View_Wrapper_Library extends Intonation_Library_View_Wr
((new Intonation_Library_Badge)
->setTag('a')
->setClass('primary text-light')
->setText(str_replace([' ', '.', ','], ' ', $this->_model->getTelephone()))
->setUrl(sprintf('tel:%s',
str_replace([' ', '.', ',',], '', $this->_model->getTelephone())))
->setImage(Class_Template::current()->getIco($this->_view,
......
......@@ -145,14 +145,14 @@ class Intonation_Library_View_Wrapper_Loan extends Intonation_Library_View_Wrapp
((new Intonation_Library_Badge)
->setTag('span')
->setClass('info')
->setClass('warning')
->setImage(Class_Template::current()->getIco($this->_view,
'thumbtack',
'library'))
->setText(($this->_model->getOnHold()
? $this->_('Réservé')
->setText(($this->_model->getBookedByOthers()
? $this->_('Déjà réservé')
: ''))
->setTitle($this->_('Exemplaire réservé'))),
->setTitle($this->_('Exemplaire déjà réservé par d\'autres'))),
((new Intonation_Library_Badge)
->setTag('span')
......
<?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_Library_View_Wrapper_Rss extends Intonation_Library_View_Wrapper_Abstract {
public function getMainTitle() {
return $this->_model->getTitre();
}
public function getMainLink() {
return new Intonation_Library_Link(['Url' => $this->_model->getUrl(),
'Text' => $this->_view->_('Voir le flux'),
'Title' => $this->_view->_('Voir le flux %s', $this->_model->getTitre()),
'Image' => Class_Template::current()->getIco($this->_view,
'read-document',
'library')]);
}
public function getPicture() {
return '';
}
public function getPictureAction() {
}
public function getSecondaryTitle() {
}
public function getSecondaryLink() {
}
public function getSecondaryIco() {
}
public function getActions() {
return [];
}
public function getDescription() {
return
$this->getBadges()
. $this->_model->getDescription()
. $this->loadRssItems();
}
public function getFullDescription() {
return $this->getDescription();
}
public function getDescriptionTitle() {
}
public function getBadges() {
$badges = [];
$tags = explode(';', $this->_model->getTags());
foreach ($tags as $tag)
$badges [] = (new Intonation_Library_Badge)
->setTag('span')
->setClass('secondary')
->setText($tag)
->setTitle($this->_('Tag attribué au flux %s', $this->_model->getTitre()));
return $this->_view->renderBadges($badges);
}
public function getDocType() {
}
public function getDocTypeLabel() {
}
public function getEmbedMedia() {
return '';
}
public function getHtmlPicture() {
return '';
}
public function getOsmData() {
return null;
}
protected function loadRssItems() {
return $this->_view->renderAjax('rss', 'render-items', ['id' => $this->_model->getId()]);
}
}
<?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_Library_View_Wrapper_RssItem extends Intonation_Library_View_Wrapper_Abstract {
public function getMainTitle() {
return $this->_model->getTitle();
}
public function getMainLink() {
return new Intonation_Library_Link(['Url' => $this->_model->getLink(),
'Text' => $this->_view->_('Accéder au contenu'),
'Title' => $this->_view->_('Accéder au contenu de %s', $this->getMainTitle()),
'Image' => Class_Template::current()->getIco($this->_view,
'read-document',
'library')]);
}
public function getPicture() {
return '';
}
public function getPictureAction() {
}
public function getSecondaryTitle() {
}
public function getSecondaryLink() {
}
public function getSecondaryIco() {
}
public function getActions() {
return [];
}
public function getDescription() {
return
$this->getBadges()
. $this->_model->getDescription();
}
public function getFullDescription() {
return $this->getDescription();
}
public function getDescriptionTitle() {
}
public function getBadges() {
$badges = [(new Intonation_Library_Badge)
->setTag('span')
->setClass('info')
->setText($this->_model->getPubDate())
->setTitle($this->_('Date de diffusion de %s', $this->getMainTitle()))];
return $this->_view->renderBadges($badges);
}
public function getDocType() {
}
public function getDocTypeLabel() {
}
public function getEmbedMedia() {
return '';
}
public function getHtmlPicture() {
return '';
}
public function getOsmData() {
return null;
}
}
......@@ -43,26 +43,12 @@ class Intonation_Library_View_Wrapper_Search extends Intonation_Library_View_Wra
public function getMainLink() {
$id = $this->_model->getExistingIdFor(Class_Users::getIdentity());
$can_follow = !$id;
return new Intonation_Library_Link(['Url' => $this->_view->url(array_merge($this->_model->getCriteriasUrl(),
['controller' => 'bookmarked-searches',
'action' => $can_follow ? 'add' : 'delete',
'label' => $this->getMainTitle(),
'id' => $id])),
return new Intonation_Library_Link(['Url' => $this->_view->url($this->_model->getCriteriasUrl()),
'Text' => $this->_('Voir'),
'Title' => $this->_('Voir le résultat de recherche'),
'Image' => Class_Template::current()->getIco($this->_view,
($can_follow
? 'no-selection'
: 'selection'),
'library'),
'Text' => ($can_follow
? $this->_('Suivre')
: $this->_('Ne plus suivre')),
'Title' => ($can_follow
? $this->_('Suivre cette recherche')
: $this->_('Ne plus suivre cette recherche.')),
'NoButtonText' => 1,
'Popup' => true]);
'search_more',
'library')]);
}
......@@ -146,12 +132,26 @@ class Intonation_Library_View_Wrapper_Search extends Intonation_Library_View_Wra
public function getActions() {
return [new Intonation_Library_Link(['Url' => $this->_view->url($this->_model->getCriteriasUrl()),
'Text' => $this->_('Voir'),
'Title' => $this->_('Voir le résultat de recherche'),
$id = $this->_model->getExistingIdFor(Class_Users::getIdentity());
$can_follow = !$id;
return [new Intonation_Library_Link(['Url' => $this->_view->url(array_merge($this->_model->getCriteriasUrl(),
['controller' => 'bookmarked-searches',
'action' => $can_follow ? 'add' : 'delete',
'label' => $this->getMainTitle(),
'id' => $id])),
'Image' => Class_Template::current()->getIco($this->_view,
'search_more',
'library')])];
($can_follow
? 'no-selection'
: 'selection'),
'library'),
'Text' => ($can_follow
? $this->_('Suivre')
: $this->_('Ne plus suivre')),
'Title' => ($can_follow
? $this->_('Suivre cette recherche')
: $this->_('Ne plus suivre cette recherche.')),
'InlineText' => 1,
'Popup' => true])];
}
......
<?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_Suggestion extends Intonation_Library_View_Wrapper_Abstract {
public function getMainTitle() {
return $this->_('%s suggéré par %s %s',
$this->_model->getTitre(),
$this->_model->getUser()->getIdabon(),
$this->_model->getUser()->getNomComplet());
}
public function getSecondaryTitle() {
return $this->_model->getAuteur();
}
public function getPicture() {
return '';
}
public function getPictureAction() {
return '';
}
public function getSecondaryIco() {
return Class_Template::current()
->getIco($this->_view,
'author',
'library');
}
public function getDescription() {
$html = [$this->getBadges(),
$this->_model->getCommentaire()];
if ($url = $this->_model->getDescriptionUrl())
$html [] = $this->_view->tagAnchor($url, $url);
if ($response = $this->_model->getResponse()) {
$html [] = $this->_view->tag('h4', $this->_('Réponse du %s', $this->_model->getResponseDate()));
$html [] = $response;
}
$html = array_filter($html);
return implode(BR, $html);
}
public function getFullDescription() {
return $this->getDescription();
}
public function getDescriptionTitle() {
return '';
}
public function getMainLink() {
return null;
}
public function getSecondaryLink() {
if(!$author = $this->getSecondaryTitle())
return null;
if (!$facet = Class_CodifAuteur::findWithFullName($author))
return null;
$author_field = new Class_Notice_FieldAuthor($facet);
return new Intonation_Library_Link(['Url' => $author_field->getUrlForLink(),
'Image' => $this->getSecondaryIco(),
'Text' => $author,
'Title' => $author_field->getTitle()]);
}
public function getDocType() {
return $this->_model->getTypeDoc();
}
public function getDocTypeLabel() {
return ($doc_type = $this->getDocType())
? $doc_type->getLabel()
: '';
}
public function getBadges() {
$badges = [
((new Intonation_Library_Badge)
->setTag('a')
->setClass('warning fs_1em')
->setImage((Class_Template::current()
->getIco($this->_view,
$this->getDocTypeLabel(),
'doc_types')))
->setText($this->getDocTypeLabel())
->setTitle($this->_('Type de document %s de la suggestion %s',
$this->getDocTypeLabel(),
$this->_model->getTitre()))),
((new Intonation_Library_Badge)
->setTag('span')
->setClass('primary fs_1em')
->setImage((Class_Template::current()
->getIco($this->_view,
$this->getDocTypeLabel(),
'doc_types')))
->setText($this->_model->getStatus())
->setTitle($this->_('Statut de la suggestion %s',
$this->getDocTypeLabel(),
$this->_model->getTitre())))];
if ($lib = $this->_model->getLibrary())
$badges [] = ((new Intonation_Library_Badge)
->setTag('span')
->setClass('info')
->setImage(Class_Template::current()->getIco($this->_view,
'library',
'library'))
->setText($lib)
->setTitle($this->_('Site de la suggestion %s', $lib)));
$badges [] = ((new Intonation_Library_Badge)
->setTag('span')
->setClass('secondary')
->setText($this->_model->getDateCreation())
->setTitle($this->_('Date de la suggestion %s', $this->_model->getDateCreation())));
$badges [] = ((new Intonation_Library_Badge)
->setTag('span')
->setClass('secondary')
->setText($this->_model->getIsbn())
->setTitle($this->_('ISBN %s', $this->_model->getIsbn())));
return $this->_view->renderBadges($badges);
}
public function getActions() {
return [];
}
public function getEmbedMedia() {
return '';
}
public function getHtmlPicture() {
return '';
}
public function getOsmData() {
return null;
}
}
\ No newline at end of file
......@@ -42,6 +42,7 @@ class Intonation_Library_View_Wrapper_User_RichContent extends Intonation_Librar
new Intonation_Library_View_Wrapper_User_RichContent_Informations,
new Intonation_Library_View_Wrapper_User_RichContent_Loans,
new Intonation_Library_View_Wrapper_User_RichContent_Holds,
new Intonation_Library_View_Wrapper_User_RichContent_Suggestions,
new Intonation_Library_View_Wrapper_User_RichContent_Selections,
new Intonation_Library_View_Wrapper_User_RichContent_Reviews,
new Intonation_Library_View_Wrapper_User_RichContent_Settings];
......
......@@ -58,7 +58,7 @@ class Intonation_Library_View_Wrapper_User_RichContent_ChangeImage extends Inton
protected function _cardify($image, $current) {
$url = $image->getUrl();
$selected = ($current == $url) ? ' border border-primary disabled shadow-lg selected' : '';
$selected = ($current == $url) ? ' border border-primary disabled shadow-lg selected btn btn-primary' : '';
return $this->_view->div(['class' => 'card shadow-sm' . $selected],
$this->_view->tagAnchor($this->_view->url(['controller' => 'abonne',
......
<?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_Library_View_Wrapper_User_RichContent_NewSuggestion extends Intonation_Library_View_Wrapper_User_RichContent_Suggestions {
protected
$_form,
$_preferences,
$_records;
public function setForm($form) {
$this->_form = $form;
return $this;
}
public function setPreferences($preferences) {
$this->_preferences = $preferences;
return $this;
}
public function setRecords($records) {
$this