source: trunk/themes/default/template/picture.tpl @ 13782

Last change on this file since 13782 was 13782, checked in by plg, 12 years ago

feature 2600: less info displayed by default

On picture.php, if there is no data, hide author/tags/date creation/dimensions/filesize

By default on picture.php, do not show file/filesize/dimensions

By default on index.php, hide the "filter" icon in the menubar, hide the "flat" icon (the concept is complex to understand)

  • Property svn:eol-style set to LF
File size: 14.1 KB
Line 
1{* Example of resizeable
2{include file='include/autosize.inc.tpl'}
3*}
4{if isset($MENUBAR)}{$MENUBAR}{/if}
5<div id="content" {if isset($MENUBAR)}class="contentWithMenu"{/if}>
6{if isset($errors) or not empty($infos)}
7{include file='infos_errors.tpl'}
8{/if}
9{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
10
11<div id="imageHeaderBar">
12        <div class="browsePath">
13                {$SECTION_TITLE}<span class="browsePathSeparator">{$LEVEL_SEPARATOR}</span><h2>{$current.TITLE}</h2>
14        </div>
15</div>
16
17<div id="imageToolBar">
18<div class="imageNumber">{$PHOTO}</div>
19{include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
20<div class="actionButtons">
21
22{if count($current.unique_derivatives)>1}
23{footer_script require='jquery'}{literal}
24function changeImgSrc(url,typeSave,typeMap)
25{
26        var theImg = document.getElementById("theMainImage");
27        if (theImg)
28        {
29                theImg.removeAttribute("width");theImg.removeAttribute("height");
30                theImg.src = url;
31                theImg.useMap = "#map"+typeMap;
32        }
33        jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden');
34        jQuery('#derivativeChecked'+typeSave).css('visibility','visible');
35        document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
36}
37
38function toggleDerivativeSwitchBox()
39{
40        var elt = document.getElementById("derivativeSwitchBox"),
41                ePos = document.getElementById("derivativeSwitchLink");
42        if (elt.style.display==="none")
43        {
44                elt.style.left = (ePos.offsetLeft)+"px";
45                elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
46                elt.style.display="";
47        }
48        else
49                elt.style.display="none";
50}
51jQuery("#derivativeSwitchBox").on('mouseleave click', function() {
52        this.style.display="none";
53}
54);
55{/literal}{/footer_script}
56{strip}<a id="derivativeSwitchLink" href="javascript:toggleDerivativeSwitchBox()" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
57<span class="pwg-icon pwg-icon-sizes">&nbsp;</span><span class="pwg-button-text">{'Photo sizes'|@translate}</span></a>
58<div id="derivativeSwitchBox" class="switchBox" style="display:none">
59<div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
60{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
61<span class="switchCheck" id="derivativeChecked{$derivative_type}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span> 
62<a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')">
63        {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span>
64</a><br>
65{/foreach}
66{if isset($U_ORIGINAL)}
67<a href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" rel="nofollow">{'Original'|@translate}</a>
68{/if}
69</div>
70{/strip}{/if}
71
72
73{strip}{if isset($U_SLIDESHOW_START)}
74        <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
75                <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
76        </a>
77{/if}{/strip}
78{strip}{if isset($U_METADATA)}
79        <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
80                <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
81        </a>
82{/if}{/strip}
83{strip}{if isset($current.U_DOWNLOAD)}
84        <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
85                <span class="pwg-icon pwg-icon-save"> </span><span class="pwg-button-text">{'Download'|@translate}</span>
86        </a>
87{/if}{/strip}
88{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
89{strip}{if isset($favorite)}
90        <a href="{$favorite.U_FAVORITE}" title="{if $favorite.IS_FAVORITE}{'delete this photo from your favorites'|@translate}{else}{'add this photo to your favorites'|@translate}{/if}" class="pwg-state-default pwg-button" rel="nofollow">
91                <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"> </span><span class="pwg-button-text">{'Favorites'|@translate}</span>
92        </a>
93{/if}{/strip}
94{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
95        <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
96                <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
97        </a>
98{/if}{/strip}
99{strip}{if isset($U_ADMIN)}
100        <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
101                <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
102        </a>
103{/if}{/strip}
104{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
105{footer_script}
106{literal}function addToCadie(aElement, rootUrl, id)
107{
108if (aElement.disabled) return;
109aElement.disabled=true;
110var y = new PwgWS(rootUrl);
111y.callService(
112        "pwg.caddie.add", {image_id: id} ,
113        {
114                onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
115                onSuccess: function(result) { aElement.disabled = false; }
116        }
117        );
118}{/literal}
119{/footer_script}
120        <a href="{$U_CADDIE}" onclick="addToCadie(this, '{$ROOT_URL}', {$current.id}); return false;" title="{'Add to caddie'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
121                <span class="pwg-icon pwg-icon-caddie-add"> </span><span class="pwg-button-text">{'Caddie'|@translate}</span>
122        </a>
123{/if}{/strip}{*caddie management END*}
124</div>
125</div>{*<!-- imageToolBar -->*}
126
127<div id="theImageAndInfos">
128<div id="theImage">
129{$ELEMENT_CONTENT}
130
131{if isset($COMMENT_IMG)}
132<p class="imageComment">{$COMMENT_IMG}</p>
133{/if}
134
135{if isset($U_SLIDESHOW_STOP)}
136<p>
137        [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
138</p>
139{/if}
140
141</div><!--
142
143--><div id="infoSwitcher"></div><!--
144--><div id="imageInfos">
145{if $DISPLAY_NAV_THUMB}
146        <div class="navThumbs">
147                {if isset($previous)}
148                        <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
149                                <span class="thumbHover prevThumbHover">&nbsp;</span>
150                                <img src="{$previous.derivatives.square->get_url()}" alt="{$previous.TITLE}">
151                        </a>
152                {/if}
153                {if isset($next)}
154                        <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
155                                <span class="thumbHover nextThumbHover">&nbsp;</span>
156                                <img src="{$next.derivatives.square->get_url()}" alt="{$next.TITLE}">
157                        </a>
158                {/if}
159        </div>
160{/if}
161
162<dl id="standard" class="imageInfoTable infoTable">
163{strip}
164        {if $display_info.author and isset($INFO_AUTHOR)}
165        <div id="Author" class="imageInfo">
166                <dt>{'Author'|@translate}</dt>
167                <dd>{$INFO_AUTHOR}</dd>
168        </div>
169        {/if}
170        {if $display_info.created_on and isset($INFO_CREATION_DATE)}
171        <div id="datecreate" class="imageInfo">
172                <dt>{'Created on'|@translate}</dt>
173                <dd>{$INFO_CREATION_DATE}</dd>
174        </div>
175        {/if}
176        {if $display_info.posted_on}
177        <div id="datepost" class="imageInfo">
178                <dt>{'Posted on'|@translate}</dt>
179                <dd>{$INFO_POSTED_DATE}</dd>
180        </div>
181        {/if}
182        {if $display_info.dimensions and isset($INFO_DIMENSIONS)}
183        <div id="Dimensions" class="imageInfo">
184                <dt>{'Dimensions'|@translate}</dt>
185                <dd>{$INFO_DIMENSIONS}</dd>
186        </div>
187        {/if}
188        {if $display_info.file}
189        <div id="File" class="imageInfo">
190                <dt>{'File'|@translate}</dt>
191                <dd>{$INFO_FILE}</dd>
192        </div>
193        {/if}
194        {if $display_info.filesize and isset($INFO_FILESIZE)}
195        <div id="Filesize" class="imageInfo">
196                <dt>{'Filesize'|@translate}</dt>
197                <dd>{$INFO_FILESIZE}</dd>
198        </div>
199        {/if}
200        {if $display_info.tags and isset($related_tags)}
201        <div id="Tags" class="imageInfo">
202                <dt>{'Tags'|@translate}</dt>
203                <dd>
204                {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
205                </dd>
206        </div>
207        {/if}
208        {if $display_info.categories and isset($related_categories)}
209        <div id="Categories"  class="imageInfo">
210                <dt>{'Albums'|@translate}</dt>
211                <dd>
212                        <ul>
213                                {foreach from=$related_categories item=cat}
214                                <li>{$cat}</li>
215                                {/foreach}
216                        </ul>
217                </dd>
218        </div>
219        {/if}
220        {if $display_info.visits}
221        <div id="Visits" class="imageInfo">
222                <dt>{'Visits'|@translate}</dt>
223                <dd>{$INFO_VISITS}</dd>
224        </div>
225        {/if}
226
227{if $display_info.rating_score and isset($rate_summary)}
228        <div id="Average" class="imageInfo">
229                <dt>{'Rating score'|@translate}</dt>
230                <dd>
231                {if $rate_summary.count}
232                        <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})</span>
233                {else}
234                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
235                {/if}
236                </dd>
237        </div>
238{/if}
239
240{if isset($rating)}
241        <div id="rating" class="imageInfo">
242                <dt>
243                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
244                </dt>
245                <dd>
246                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
247                        <div>
248                        {foreach from=$rating.marks item=mark name=rate_loop}
249                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
250                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
251                        {else}
252                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
253                        {/if}
254                        {/foreach}
255                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
256                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
257                        {footer_script}
258                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
259                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
260                                        onSuccess : function(rating) {ldelim}
261                                                var e = document.getElementById("updateRate");
262                                                if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
263                                                e = document.getElementById("ratingScore");
264                                                if (e) e.innerHTML = rating.score;
265                                                e = document.getElementById("ratingCount");
266                                                if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
267                                        {rdelim}{rdelim} );
268                        {/footer_script}
269                        {/strip}
270                        </div>
271                        </form>
272                </dd>
273        </div>
274{/if}
275
276{if $display_info.privacy_level and isset($available_permission_levels)}
277        <div id="Privacy" class="imageInfo"><div class="relSwitchBox">
278                <dt><a id="privacyLevelLink" href="javascript:togglePrivacyLevelBox()">{'Who can see this photo?'|@translate}</a></dt>
279                <dd>
280{combine_script id='core.scripts' require='jquery' load='async' path='themes/default/js/scripts.js'}
281{footer_script}
282{literal}function setPrivacyLevel(rootUrl, id, level)
283{
284var y = new PwgWS(rootUrl);
285y.callService(
286        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
287        {
288                method: "POST",
289                onFailure: function(num, text) { alert(num + " " + text); },
290                onSuccess: function(result) {
291                          jQuery('.levelCheck').hide();
292                          jQuery('#levelCheck'+level).show();
293                          jQuery('#privacyLevelBox .switchSelected').css('visibility','hidden');
294                          jQuery('#switchLevel'+level).css('visibility','visible');
295                }
296        }
297        );
298}
299function togglePrivacyLevelBox()
300{
301        var elt = document.getElementById("privacyLevelBox"),
302                ePos = document.getElementById("privacyLevelLink");
303        if (elt.style.display == "none")
304        {
305                elt.style.left = (ePos.offsetLeft)+"px";
306                elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
307                elt.style.display="";
308        }
309        else
310                elt.style.display="none";
311}
312{/literal}
313{/footer_script}
314       
315                        <div id="privacyLevelBox" class="switchBox" onclick="togglePrivacyLevelBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e==this||togglePrivacyLevelBox()">
316                                {foreach from=$available_permission_levels item=label key=level}
317                                        <span id="levelCheck{$level}" class="levelCheck switchCheck" {if $level != $current.level}style="visibility:hidden"{/if}>&#x2714; </span>
318                                        <a id="switchLevel{$level}" {if $level == $current.level}class="switchSelected"{else}class="switchUnselected"{/if} href="javascript:setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
319                                {/foreach}
320                        </div>
321
322                </dd>
323        </div></div>
324{/if}
325{/strip}
326</dl>
327
328{if isset($metadata)}
329<dl id="Metadata" class="imageInfoTable infoTable2">
330{foreach from=$metadata item=meta}
331        <h3>{$meta.TITLE}</h3>
332        {foreach from=$meta.lines item=value key=label}
333                <div class="imageInfo">
334                        <dt>{$label}</dt>
335                        <dd>{$value}</dd>
336                </div>
337        {/foreach}
338{/foreach}
339</dl>
340{/if}
341</div>
342</div>
343
344{if isset($COMMENT_COUNT)}
345<div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div>
346        {if $COMMENT_COUNT > 0}
347                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
348        {else}
349                <h3><span class="noCommentText">{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</span></h3>
350        {/if}
351       
352        <div id="pictureComments">
353                {if isset($comment_add)}
354                        <div id="commentAdd">
355                                <h4>{'Add a comment'|@translate}</h4>
356                                <form  method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment" >
357                                        {if $comment_add.SHOW_AUTHOR}
358                                                <p><label>{'Author'|@translate}&nbsp;:</label></p>
359                                                <p><input type="text" name="author" /></p>
360                                        {/if}
361                                        <p><label>{'Comment'|@translate}&nbsp;:</label></p>
362                                        <p><textarea name="content" id="contentid" rows="10" cols="50">{$comment_add.CONTENT}</textarea></p>
363                                        <p><input type="hidden" name="key" value="{$comment_add.KEY}" />
364                                           <input class="submit" type="submit" value="{'Submit'|@translate}"></p>
365                                </form>
366                        </div>
367                {/if}
368                {if isset($comments)}
369                        <div id="pictureCommentList">
370                                {if (($COMMENT_COUNT > 2) || !empty($navbar))}
371                                        <div id="pictureCommentNavBar">
372                                                {if $COMMENT_COUNT > 2}
373                                                        <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
374                                                {/if}
375                                                {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
376                                        </div>
377                                {/if}
378                                {include file='comment_list.tpl'}
379                        </div>
380                {/if}
381                <div style="clear: both;"></div>
382        </div>
383
384</div>
385{/if}{*comments*}
386
387{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
388
389</div>
Note: See TracBrowser for help on using the repository browser.