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

Last change on this file since 17302 was 17302, checked in by rvelices, 12 years ago

merge-r17295 from branch 2.4 feature 2708: in admin, display allowed custom derivatives and ability to delete them

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