diff --git a/library/Class/CriteresRecherche.php b/library/Class/CriteresRecherche.php index 412266f80a634187c96e028b98052a49228173cc..9238946c141327ae317c9bebe1a515940fdc7e0d 100644 --- a/library/Class/CriteresRecherche.php +++ b/library/Class/CriteresRecherche.php @@ -24,12 +24,12 @@ class Class_CriteresRecherche { const SORT_RELEVANCE = '*', - SORT_TITLE = 'alpha_titre', - SORT_AUTHOR = 'alpha_auteur', - SORT_PUBLICATION = 'annee desc', - SORT_DOCTYPE = 'type_doc,alpha_titre', - SORT_NOVELTY = 'date_creation desc', - SORT_VIEWS = 'nb_visu desc', + SORT_TITLE = 'alpha_titre ASC', + SORT_AUTHOR = 'alpha_auteur ASC', + SORT_PUBLICATION = 'annee DESC', + SORT_DOCTYPE = 'type_doc ASC,alpha_titre ASC', + SORT_NOVELTY = 'date_creation DESC', + SORT_VIEWS = 'nb_visu DESC', SORT_RANDOM = 'RAND()', MAX_PAGE_SIZE = 50; diff --git a/library/templates/Intonation/Assets/css/intonation.css b/library/templates/Intonation/Assets/css/intonation.css index c94ee93ab9dcb3cfc83c8a1f715e854cbb0274d6..e317978c22b68cd81fcdcd8509f0a0118a564e60 100644 --- a/library/templates/Intonation/Assets/css/intonation.css +++ b/library/templates/Intonation/Assets/css/intonation.css @@ -134,25 +134,18 @@ p > i { } .multiple_carousel .carousel-inner .carousel-item.active:not(.carousel-item-right):not(.carousel-item-left), -.multiple_carousel .carousel-inner .carousel-item.active:not(.carousel-item-right):not(.carousel-item-left) + .carousel-item, -.multiple_carousel .carousel-inner .carousel-item.active:not(.carousel-item-right):not(.carousel-item-left) + .carousel-item + .carousel-item, -.multiple_carousel .carousel-inner .carousel-item.active:not(.carousel-item-right):not(.carousel-item-left) + .carousel-item + .carousel-item + .carousel-item { +.multiple_carousel .carousel-inner .carousel-item.active:not(.carousel-item-right):not(.carousel-item-left) ~ .carousel-item { transition: none; } -.multiple_carousel .carousel-inner .carousel-item-next, -.multiple_carousel .carousel-inner .carousel-item-prev { +.multiple_carousel .carousel-inner .carousel-item-next { position: relative; transform: translate3d(0, 0, 0); } - /* left or forward direction */ .multiple_carousel .active.carousel-item-left + .carousel-item-next.carousel-item-left, -.multiple_carousel .carousel-item-next.carousel-item-left + .carousel-item, -.multiple_carousel .carousel-item-next.carousel-item-left + .carousel-item + .carousel-item, -.multiple_carousel .carousel-item-next.carousel-item-left + .carousel-item + .carousel-item + .carousel-item, -.multiple_carousel .carousel-item-next.carousel-item-left + .carousel-item + .carousel-item + .carousel-item + .carousel-item { +.multiple_carousel .carousel-item-next.carousel-item-left ~ .carousel-item { position: relative; transform: translate3d(-100%, 0, 0); visibility: visible; @@ -161,11 +154,13 @@ p > i { /* farthest right hidden item must be abso position for animations */ .multiple_carousel .carousel-inner .carousel-item-prev.carousel-item-right { position: absolute; - top: 0; - left: 0; - z-index: -1; +** top: 0; +** left: 0; +** z-index: -1; display: block; visibility: visible; + transform: translate3d(-100%, 0, 0); + transition: none; } /* right or prev direction */ diff --git a/library/templates/Intonation/Library/Widget/Carousel/Record/View.php b/library/templates/Intonation/Library/Widget/Carousel/Record/View.php index 77d8069f6422c253e3d676247ab1c1e99d66ced5..5e5977560fb745bf18c64811587fa611aa65996e 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Record/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Record/View.php @@ -34,10 +34,10 @@ class Intonation_Library_Widget_Carousel_Record_View extends Zendafi_View_Helper $selection_id = $this->_settings->getIdPanier(); if ('selection' == $order && !$selection_id) - $order = Class_CriteresRecherche::SORT_TITLE; + $order = Class_CriteresRecherche::SORT_RANDOM; $params = ['limit' => 100, - 'order' => 'url_image="no", url_image="", ' . $order]; + 'order' => new Zend_Db_Expr('url_image="no", url_image="", ' . $order)]; if ($domain = Class_Catalogue::find($this->_settings->getIdCatalogue())) $params ['where'] = $domain->asWhere(); diff --git a/library/templates/Intonation/View/RenderMultipleCarousel.php b/library/templates/Intonation/View/RenderMultipleCarousel.php index 79cd8dea7caab701fd42ec540407143dc39f8d4b..c319d0e0089eeb071a98d871df152ac0a1f45d7b 100644 --- a/library/templates/Intonation/View/RenderMultipleCarousel.php +++ b/library/templates/Intonation/View/RenderMultipleCarousel.php @@ -28,9 +28,11 @@ class Intonation_View_RenderMultipleCarousel extends ZendAfi_View_Helper_BaseHel . $this->_carouselControl($id); Class_ScriptLoader::getInstance() - ->addJqueryReady(sprintf('$("#%1$s").on("slid.bs.carousel", function() { - $("#%1$s .carousel-item:last").filter(".active").insertBefore($("#%1$s .carousel-item:first")); + ->addJqueryReady(sprintf(' +$("#%1$s .carousel-item:last").insertBefore($("#%1$s .carousel-item:first")); +$("#%1$s").on("slid.bs.carousel", function() { $("#%1$s .carousel-item:last").prev().filter(".active").siblings(":first").insertAfter($("#%1$s .carousel-item:last")); + $("#%1$s .carousel-item:last").prev().prev().filter(".active").siblings(":first").insertAfter($("#%1$s .carousel-item:last")); $("#%1$s .carousel-item:first").filter(".active").siblings(":last").insertBefore($("#%1$s .carousel-item:first")); });', $id)); @@ -49,7 +51,7 @@ class Intonation_View_RenderMultipleCarousel extends ZendAfi_View_Helper_BaseHel { $html [] = $this->_tag('div', $this->view->cardify($element), - ['class' => 'carousel-item col-12 col-sm-4' . (1 == count($html) ? ' active' : '')]); + ['class' => 'carousel-item col-12 col-sm-4' . (0 == count($html) ? ' active' : '')]); return $html; })); diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index 91752a38fcd38b34b340c4f5c9eb175a0beccb4d..f1658f4104874a358d2ac970110967763efb9f70 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -1530,7 +1530,8 @@ class TemplatesRecordsWidgetTest extends TemplatesIntonationTestCase { ->setProfileId(72) ->load()); $widget - ->setNewDatas(['display_mode' => 'multiple_carousel']) + ->setNewDatas(['order' => 'alpha_titre ASC', + 'display_mode' => 'multiple_carousel']) ->updateProfile(); $this->fixture('Class_Notice',