sélection d'article en page sommaire validé
This commit is contained in:
parent
33c6064744
commit
abacabe89d
@ -73,6 +73,75 @@ ensuite inclusion en statique pour la gestion du cache indépendante - à vérif
|
|||||||
</div>
|
</div>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
<B_selection>
|
||||||
|
<div class="liste articles emissions emissions_selectionaccueil">
|
||||||
|
<h2>[(#CONFIG{libreavous/selectionaccueiltitre}|sinon{<:libreavous:selection_d_emissions:>}) ]<span class="controlcarousel"><span class="avant disabled"></span><span class="ensuite"></span></span></h2>
|
||||||
|
<div class="owl-theme owl-carousel [ (#TOTAL_BOUCLE|>={3}|oui)owlselectionaccueil]">
|
||||||
|
<BOUCLE_selection(ARTICLES){id_article IN #CONFIG{libreavous/selectionaccueil}|picker_selected{article}}>
|
||||||
|
<div data-item="#COMPTEUR_BOUCLE"><INCLURE{fond=inclure/resume/emission,id_article} /></div>
|
||||||
|
</BOUCLE_selection>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[(#TOTAL_BOUCLE|>={3}|oui)
|
||||||
|
<script>
|
||||||
|
jQuery(function($){
|
||||||
|
var owl = $('.owl-carousel');
|
||||||
|
owl.owlCarousel({
|
||||||
|
loop:false,
|
||||||
|
margin:30,
|
||||||
|
items: 3,
|
||||||
|
slideBy: 3,
|
||||||
|
dots: false,
|
||||||
|
nav: false,
|
||||||
|
onTranslated: callback,
|
||||||
|
responsive : {
|
||||||
|
// breakpoint from 0 up
|
||||||
|
0 : {
|
||||||
|
items: 1,
|
||||||
|
},
|
||||||
|
// breakpoint from 480 up
|
||||||
|
560 : {
|
||||||
|
items: 2,
|
||||||
|
},
|
||||||
|
// breakpoint from 768 up
|
||||||
|
768 : {
|
||||||
|
items: 3,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Go to the next item
|
||||||
|
$('.ensuite').click(function() {
|
||||||
|
owl.trigger('next.owl.carousel');
|
||||||
|
})
|
||||||
|
// Go to the previous item
|
||||||
|
$('.avant').click(function() {
|
||||||
|
owl.trigger('prev.owl.carousel');
|
||||||
|
// owl.trigger('prev.owl.carousel', [100]);
|
||||||
|
})
|
||||||
|
function callback(event) {
|
||||||
|
var totalItems = $('.owl-item').length;
|
||||||
|
var firstitemactive = $('.owl-item.active').first().find('div').attr('data-item');
|
||||||
|
var lastitemactive = $('.owl-item.active').last().find('div').attr('data-item');
|
||||||
|
if (lastitemactive == totalItems) {
|
||||||
|
$('.ensuite').addClass('disabled');
|
||||||
|
}
|
||||||
|
if (lastitemactive < totalItems) {
|
||||||
|
$('.ensuite').removeClass('disabled');
|
||||||
|
}
|
||||||
|
if (firstitemactive == 1) {
|
||||||
|
$('.avant').addClass('disabled');
|
||||||
|
}
|
||||||
|
if (firstitemactive > 1) {
|
||||||
|
$('.avant').removeClass('disabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
]
|
||||||
|
</div>
|
||||||
|
</B_selection>
|
||||||
|
|
||||||
|
|
||||||
<INCLURE{fond=inclure/liste/emissions-precedentes,ajax,env,nb=6,prochaine=#GET{prochaine}} />
|
<INCLURE{fond=inclure/liste/emissions-precedentes,ajax,env,nb=6,prochaine=#GET{prochaine}} />
|
||||||
|
|
||||||
[(#MODELE{bouton,lienobjet=rubrique,lienidobjet=1,class=center taille130,texte=Toutes les émissions})]
|
[(#MODELE{bouton,lienobjet=rubrique,lienidobjet=1,class=center taille130,texte=Toutes les émissions})]
|
||||||
|
@ -1,147 +0,0 @@
|
|||||||
#CACHE{0}
|
|
||||||
|
|
||||||
<BOUCLE_annonce(ARTICLES){page=annonce}>
|
|
||||||
<article class="annonce texte_accueil">
|
|
||||||
<header class="cartouche">
|
|
||||||
|
|
||||||
<h1><span class="#EDIT{titre} article__titre">[(#TITRE)]</span>[
|
|
||||||
<small class="#EDIT{soustitre} soustitre">(#SOUSTITRE)</small>
|
|
||||||
]</h1>
|
|
||||||
|
|
||||||
</header>
|
|
||||||
[(#PS|oui)<div class="flex flex2">]
|
|
||||||
<div class="main">
|
|
||||||
[<div class="chapo #EDIT{chapo}">(#CHAPO|image_reduire{800,*})</div>]
|
|
||||||
[<div class="texte #EDIT{texte}">(#TEXTE|image_reduire{800,*})</div>]
|
|
||||||
[</div><div class="aside">
|
|
||||||
<div class="ps #EDIT{ps}">(#PS|image_reduire{400,*})</div>
|
|
||||||
</div>]
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</article>
|
|
||||||
</BOUCLE_annonce>
|
|
||||||
[(#REM)
|
|
||||||
15h15 = horaire de publication = date de publication de l'article
|
|
||||||
15h30 = horaire de début = pour l'instant dans le code
|
|
||||||
17h00 = horaire de fin = pour l'instant dans le code
|
|
||||||
]
|
|
||||||
<BOUCLE_emissions(RUBRIQUES){composition=emissions}>[(#REM)
|
|
||||||
on détermine la dernière émission même si la date est dans le futur, forcée par statut=publie
|
|
||||||
]<BOUCLE_quand(ARTICLES){id_rubrique}{!par date}{statut=publie}{0,1}>[(#REM)
|
|
||||||
on connait la date de publication, donc on determine début_emission et fin_emission
|
|
||||||
ensuite inclusion en statique pour la gestion du cache indépendante - à vérifier...
|
|
||||||
]
|
|
||||||
[(#SET{debut_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour|libreavous_aveczerod) ]15:30:00})]
|
|
||||||
[(#SET{fin_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour|libreavous_aveczerod) ]17:00:00})]
|
|
||||||
|
|
||||||
[(#ENV{date}|<={#GET{fin_emission}}|oui) [(#REM) inclure l'émission prochaine et en cours ]
|
|
||||||
#INCLURE{fond=inclure/emission_encours,env,id_article,debut_emission=#GET{debut_emission},fin_emission=#GET{fin_emission}}#SET{prochaine,#ID_ARTICLE}
|
|
||||||
][(#ENV{date}|>={#GET{fin_emission}}|oui) [(#REM) inclure la dernière émission ]
|
|
||||||
#INCLURE{fond=inclure/derniere_emission,debut_emission=#GET{debut_emission},fin_emission=#GET{fin_emission},emission_heroine=oui}
|
|
||||||
]
|
|
||||||
|
|
||||||
</BOUCLE_quand>
|
|
||||||
</BOUCLE_emissions>
|
|
||||||
|
|
||||||
<B_accueil>
|
|
||||||
<article class="texte_accueil">
|
|
||||||
<BOUCLE_accueil(ARTICLES){page=accueil}>
|
|
||||||
<h2 class="visuallyhidden">#TITRE</h2>
|
|
||||||
<div class="flex flex2">
|
|
||||||
<div class="main">
|
|
||||||
[<div class="#EDIT{chapo} chapo surlignable">(#CHAPO|adaptive_images{#CONST{_CONTENT_WIDTH}})</div>]
|
|
||||||
[<div class="#EDIT{texte} texte surlignable">(#TEXTE|adaptive_images{#CONST{_CONTENT_WIDTH}})</div>]
|
|
||||||
</div>
|
|
||||||
[<aside class="aside">
|
|
||||||
<div class="#EDIT{ps} ps surlignable">(#PS|adaptive_images{#CONST{_CONTENT_WIDTH}})</div>
|
|
||||||
</aside>]
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
[<div class="notes"><h2><:info_notes:></h2>(#NOTES)</div>]
|
|
||||||
</footer>
|
|
||||||
</BOUCLE_accueil>
|
|
||||||
</article>
|
|
||||||
</B_accueil>
|
|
||||||
[<div id="descriptif_site_spip" class="#EDIT{meta-descriptif_site} texte_accueil">(#DESCRIPTIF_SITE_SPIP)</div>]
|
|
||||||
[(#DESCRIPTIF_SITE_SPIP|non)<div class="texte_accueil">#NOM_SITE_SPIP</div>]
|
|
||||||
<//B_accueil>
|
|
||||||
|
|
||||||
[(#GET{prochaine}|oui)
|
|
||||||
<div class="derniere_emission">
|
|
||||||
<h2><:libreavous:derniere_emission:></h2>
|
|
||||||
<INCLURE{fond=inclure/derniere_emission,prochaine=#GET{prochaine}} />
|
|
||||||
</div>
|
|
||||||
]
|
|
||||||
|
|
||||||
<B_selection>
|
|
||||||
<div class="liste articles emissions emissions_selectionaccueil">
|
|
||||||
<h2>[(#CONFIG{libreavous/selectionaccueiltitre}|sinon{<:libreavous:selection_d_emissions:>}) ]<span class="controlcarousel"><span class="avant disabled"></span><span class="ensuite"></span></span></h2>
|
|
||||||
<div class="owl-theme owl-carousel [ (#TOTAL_BOUCLE|>={3}|oui)owlselectionaccueil]">
|
|
||||||
<BOUCLE_selection(ARTICLES){id_article IN #CONFIG{libreavous/selectionaccueil}|picker_selected{article}}>
|
|
||||||
<div data-item="#COMPTEUR_BOUCLE"><INCLURE{fond=inclure/resume/emission,id_article} /></div>
|
|
||||||
</BOUCLE_selection>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
[(#TOTAL_BOUCLE|>={3}|oui)
|
|
||||||
<script>
|
|
||||||
jQuery(function($){
|
|
||||||
var owl = $('.owl-carousel');
|
|
||||||
owl.owlCarousel({
|
|
||||||
loop:false,
|
|
||||||
margin:30,
|
|
||||||
items: 3,
|
|
||||||
slideBy: 3,
|
|
||||||
dots: false,
|
|
||||||
nav: false,
|
|
||||||
onTranslated: callback,
|
|
||||||
responsive : {
|
|
||||||
// breakpoint from 0 up
|
|
||||||
0 : {
|
|
||||||
items: 1,
|
|
||||||
},
|
|
||||||
// breakpoint from 480 up
|
|
||||||
560 : {
|
|
||||||
items: 2,
|
|
||||||
},
|
|
||||||
// breakpoint from 768 up
|
|
||||||
768 : {
|
|
||||||
items: 3,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Go to the next item
|
|
||||||
$('.ensuite').click(function() {
|
|
||||||
owl.trigger('next.owl.carousel');
|
|
||||||
})
|
|
||||||
// Go to the previous item
|
|
||||||
$('.avant').click(function() {
|
|
||||||
owl.trigger('prev.owl.carousel');
|
|
||||||
// owl.trigger('prev.owl.carousel', [100]);
|
|
||||||
})
|
|
||||||
function callback(event) {
|
|
||||||
var totalItems = $('.owl-item').length;
|
|
||||||
var firstitemactive = $('.owl-item.active').first().find('div').attr('data-item');
|
|
||||||
var lastitemactive = $('.owl-item.active').last().find('div').attr('data-item');
|
|
||||||
if (lastitemactive == totalItems) {
|
|
||||||
$('.ensuite').addClass('disabled');
|
|
||||||
}
|
|
||||||
if (lastitemactive < totalItems) {
|
|
||||||
$('.ensuite').removeClass('disabled');
|
|
||||||
}
|
|
||||||
if (firstitemactive == 1) {
|
|
||||||
$('.avant').addClass('disabled');
|
|
||||||
}
|
|
||||||
if (firstitemactive > 1) {
|
|
||||||
$('.avant').removeClass('disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
]
|
|
||||||
</div>
|
|
||||||
</B_selection>
|
|
||||||
|
|
||||||
|
|
||||||
<INCLURE{fond=inclure/liste/emissions-precedentes,ajax,env,nb=6,prochaine=#GET{prochaine}} />
|
|
||||||
|
|
||||||
[(#MODELE{bouton,lienobjet=rubrique,lienidobjet=1,class=center taille130,texte=Toutes les émissions})]
|
|
Loading…
Reference in New Issue
Block a user