source: extensions/Slimi/template/thumbnails.tpl @ 31810

Last change on this file since 31810 was 28586, checked in by Miklfe, 10 years ago

Compatibilité avec Slim

File size: 3.4 KB
Line 
1{define_derivative name='carousel' width='300' height='350' min_width='350'}
2{php}
3    global $page, $template;
4    $template->assign('cat_name', $page['category']['name']);
5       
6{/php}
7{footer_script}{literal}
8(function($) {
9        $(document).ready(function(){
10       
11                var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)),
12                        start;
13               
14                if (isTouch==true){
15                start="";
16                }else{
17                start="onStart";
18                };
19               
20                $("div.carousel").smoothDivScroll({
21                        autoScrollingMode: start,
22                        touchScrolling: true,
23                        autoScrollingStep: {/literal}{$Slimi.carousel_speed}{literal},
24                        manualContinuousScrolling: true,
25                        mousewheelScrolling: "allDirections",
26               
27                });     
28                               
29                $("div.carousel").bind("mouseover", function() {
30                        $(this).smoothDivScroll("stopAutoScrolling");
31                }).bind("mouseout", function() {
32                        $(this).smoothDivScroll("startAutoScrolling");
33                });     
34       
35               
36        });
37})(jQuery);
38{/literal}{/footer_script}
39
40{if (($Slimi.lytebox_slimi)==1)}
41{footer_script}{literal}
42(function($) {
43        $(document).ready(function(){
44                $('.fancybox').fancybox({
45                        helpers : {
46                                title : {
47                                        type : 'over'
48                                },
49                        },     
50                        afterLoad: function() {
51                        $("div.carousel").smoothDivScroll("stopAutoScrolling");
52                        },
53                        afterClose: function() {
54                        $("div.carousel").smoothDivScroll("startAutoScrolling");
55                        }
56                });             
57               
58        });
59})(jQuery);
60{/literal}{/footer_script}
61{/if}
62
63        <div class="carousel">
64                        {if !empty($category_thumbnails)}
65                        {foreach from=$category_thumbnails item=cat}
66                                                <div class="illustration">
67                                                        <a href="{$cat.URL}">
68                                                                <img src="{$pwg->derivative_url($carousel, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}" min-width="{$carousel->max_width()}" height="{$carousel->max_height()-22}"/>
69                                                       
70                                                <div class="CatMPdescription">
71                                                        <h3>
72                                                                {$cat.NAME}
73                                                        </h3>
74                                                        <div>
75                                                                {$cat.CAPTION_NB_IMAGES}
76                                                </div>
77                                                        </div> 
78                                                </a>
79                                                </div>
80                        {/foreach}
81                        {/if}
82                                {foreach from=$thumbnails item=thumbnail}
83                                {assign var=derivative value=$pwg->derivative($carousel, $thumbnail.src_image)}
84                                        <div class="illustration">
85                                <a href="{if (($Slimi.lytebox_slimi)==1)}{$thumbnail.path}"  class="fancybox" data-fancybox-group="gallery"{else}{$thumbnail.URL}"{/if} title="{$thumbnail.NAME|strip_tags:false|replace:'\'':'&#39;'|replace:'"':'&quot;'}">   
86                                <img class="thumbnail" src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" height="{$carousel->max_height()-22}"/>
87                                                {if $SHOW_THUMBNAIL_CAPTION }
88                                                        <div class="CatMPdescription">
89                                                                <H3>
90                                                                        {$thumbnail.NAME}
91                                                                        {if !empty($thumbnail.icon_ts)}
92                                                                                <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
93                                                                        {/if}
94                                                                </h3>
95                                                                {if isset($thumbnail.NB_COMMENTS) or isset($thumbnail.NB_HITS)}
96                                                                        <div>
97                                                                        {if isset($thumbnail.NB_COMMENTS)}
98                                                                                <p class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
99                                                                                        {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
100                                                                                </p>
101                                                                        {/if}
102                                                                        {if isset($thumbnail.NB_HITS)}
103                                                                                <p class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
104                                                                                        {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
105                                                                                </p>
106                                                                        {/if}
107                                                                        </div>
108                                                                {/if}
109                                                        </div>
110                                                {/if}
111                                                </a>   
112                                        </div> 
113                                {/foreach}
114        </div>
115
Note: See TracBrowser for help on using the repository browser.