source: trunk/themes/default/template/thumbnails.tpl @ 20212

Last change on this file since 20212 was 20212, checked in by flop25, 11 years ago

bug:2820 & bug:2684
much better code : ability to pass max_requests to the js file like error_icon

  • Property svn:eol-style set to LF
File size: 2.2 KB
Line 
1{if !empty($thumbnails)}{strip}
2{*define_derivative name='derivative_params' width=160 height=90 crop=true*}
3{html_style}
4{*Set some sizes according to maximum thumbnail width and height*}
5.thumbnails SPAN,
6.thumbnails .wrap2 A,
7.thumbnails LABEL{ldelim}
8        width: {$derivative_params->max_width()+2}px;
9}
10
11.thumbnails .wrap2{ldelim}
12        height: {$derivative_params->max_height()+3}px;
13}
14{if $derivative_params->max_width() > 600}
15.thumbLegend {ldelim}font-size: 130%}
16{else}
17{if $derivative_params->max_width() > 400}
18.thumbLegend {ldelim}font-size: 110%}
19{else}
20.thumbLegend {ldelim}font-size: 90%}
21{/if}
22{/if}
23{/html_style}
24{footer_script}
25  var error_icon = "{$ROOT_URL}{$themeconf.icon_dir}/errors_small.png";
26  var max_requests = "{$maxRequests}";
27{/footer_script}
28{foreach from=$thumbnails item=thumbnail}
29{assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)}
30{if !$derivative->is_cached()}
31{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
32{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
33{/if}
34<li>
35        <span class="wrap1">
36                <span class="wrap2">
37                <a href="{$thumbnail.URL}">
38                        <img class="thumbnail" {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.icon_dir}/img_small.png" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
39                </a>
40                </span>
41                {if $SHOW_THUMBNAIL_CAPTION }
42                <span class="thumbLegend">
43                <span class="thumbName">{$thumbnail.NAME}</span>
44                {if !empty($thumbnail.icon_ts)}
45                <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
46                {/if}
47                {if isset($thumbnail.NB_COMMENTS)}
48                <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
49                <br>
50                {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
51                </span>
52                {/if}
53
54                {if isset($thumbnail.NB_HITS)}
55                <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
56                <br>
57                {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
58                </span>
59                {/if}
60                </span>
61                {/if}
62        </span>
63        </li>
64{/foreach}{/strip}
65{/if}
Note: See TracBrowser for help on using the repository browser.