Skip to content
Snippets Groups Projects
Commit 7d3c3f15 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #64573 improve intonation rendering

parent 2a43592d
Branches
Tags
3 merge requests!3297WIP: Master,!3037Master,!2988Dev#64573 templates pour l interface publique libraire bootstrap
Pipeline #5614 failed with stage
in 27 minutes and 46 seconds
......@@ -157,7 +157,7 @@ class IndexController extends ZendAfi_Controller_Action {
session_write_close();
$this->_helper->getHelper('viewRenderer')->setNoRender();
if (!$url = urldecode($this->_getParam('url')))
if (!$url = $this->_getParam('url'))
return $this->_response->setHttpResponseCode(404);
try {
......
......@@ -93,7 +93,8 @@ p > i {
position: absolute;
top: 0;
max-height: 100%;
overflow-y: scroll;
overflow-y: hidden;
width: 100%;
}
.no_overflow {
......@@ -193,4 +194,16 @@ pre {
left: 0 !important;
right: 0 !important;
margin: auto !important;
}
.no_background {
background: none !important;
}
.no_border {
border: none !important;
}
.no_shadow {
box-shadow: none !important;
}
\ No newline at end of file
......@@ -44,13 +44,10 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'position_fixed_top_right',
'position_fixed_mid_left',
'position_fixed_mid_right',
'transparent',
'card',
'col',
'container-fluid',
'row',
'mr-auto',
'ml-auto'
'no_background',
'no_border',
'no_shadow',
'no_overflow',
],
'hydrating_mapping' => ['div id site_web_wrapper' => 'container align-self-center',
......@@ -95,12 +92,12 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'3' => 'class fas fa-compact-disc',
'4' => 'class fas fa-video',
'5' => 'class fas fa-keyboard',
'8' => 'class fas fa-align-left',
'8' => 'class fas fa-bullhorn',
'9' => 'class fas fa-rss-square',
'10' => 'class fas fa-link'],
'icons_map_library' => ['author' => 'class fas fa-user',
'search_more' => 'class fas fa-search'],
'search_more' => 'class fas fa-list'],
'icons_map_utils' => ['image_place_holder' => '/library/templates/Intonation/Assets/images/image_place_holder.png',
'previous' => 'class fas fa-chevron-left',
......
......@@ -56,7 +56,7 @@ class Intonation_Library_Widget_Carousel_Article_View extends Intonation_Library
protected function _getLinkToAllTitle() {
return $this->_('Voir les documents de la boite "%s" dans le résultat de recherche', $this->titre);
return $this->_('Voir tous les articles de la boite "%s" dans une liste', $this->titre);
}
......
......@@ -56,7 +56,8 @@ class Intonation_View_Cardify extends ZendAfi_View_Helper_BaseHelper {
$img = $this->view->tagImg($this->view->url(['module' => 'opac',
'controller' => 'index',
'action' => 'picture',
'url' => $element->getPicture()], null, true),
'url' => $element->getPicture(),
'hidde' => 'extension'], null, true),
['class' => 'd-block text-center img_as_background',
'alt' => '']);
......
......@@ -56,7 +56,9 @@ class Intonation_View_RenderCarousel extends ZendAfi_View_Helper_BaseHelper {
protected function _carouselInner($collection, $id) {
$html = array_filter($collection->injectInto([], function($html, $element)
{
$html [] = $this->_cardify($element, $html);
$html [] = $this->_tag('div',
$this->view->cardify($element),
['class' => 'carousel-item'. (0 == count($html) ? ' active' : '')]);
return $html;
}));
......@@ -66,43 +68,6 @@ class Intonation_View_RenderCarousel extends ZendAfi_View_Helper_BaseHelper {
}
protected function _cardify($element, $content) {
return $this->_tag('div',
$this->view->tagImg($this->view->url(['module' => 'opac',
'controller' => 'index',
'action' => 'picture',
'url' => $element->getPicture()], null, true),
['class' => 'd-block min_h_500',
'alt' => ''])
. $this->_tag('div',
$this->_card($element),
['class' => 'card-block card-img-overlay text-center']),
['class' => 'carousel-item text-center' . (empty($content) ? ' active' : '')]);
}
protected function _card($element) {
$info = $this->_tag('p',
$element->getExplicitTitle(),
['class' => 'lead']);
$doc_type = Class_Template::current()
->getIco($this->view,
$element->getDocType(),
'doc_types',
['class' => 'ico_xl',
'alt' => $this->_('Type de document : %s', $element->getDocTypeLabel())]);
$content = $info . $doc_type;
return $this->view->tagAnchor($element->getUrl(),
$content,
['class' => 'card-link',
'title' => $element->getLinkTitle()]);
}
protected function _carouselControl($id) {
return $this->_tag('a',
Class_Template::current()->getIco($this->view, 'previous', 'utils', ['class' => 'ico_xl'])
......
......@@ -25,7 +25,8 @@ class Intonation_View_RenderMultipleCarousel extends ZendAfi_View_Helper_BaseHel
public function renderMultipleCarousel($collection) {
$id = 'carousel_' . md5(rand(1000, 9999));
$content = $this->_carouselInner($collection, $id)
$content = $this->_indicators(ceil($collection->count() / 3), $id)
. $this->_carouselInner($collection, $id)
. ((3 < $collection->count())
? $this->_carouselControl($id)
: '');
......@@ -80,4 +81,20 @@ class Intonation_View_RenderMultipleCarousel extends ZendAfi_View_Helper_BaseHel
'role' => 'button',
'class' => 'carousel-control-next']);
}
}
\ No newline at end of file
protected function _indicators($count, $id) {
$lis = [];
for ($i = 0; $i < $count; $i++)
$lis [] = $this->_tag('li',
'',
['class' => (($i == 0) ? 'active' : ''),
'data-target' => '#' . $id,
'data-slide-to' => $i]);
return $this->_tag('ol',
implode($lis),
['class' => 'carousel-indicators']);
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment