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

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

"home url" is not always absolute with host name + html compaction - through removal of unused attributes, some white spaces ...

  • Property svn:eol-style set to LF
File size: 13.6 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 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                        <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>
221                {else}
222                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
223                {/if}
224                </dd>
225        </div>
226{/if}
227
228{if isset($rating)}
229        <div id="rating" class="imageInfo">
230                <dt>
231                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
232                </dt>
233                <dd>
234                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
235                        <div>
236                        {foreach from=$rating.marks item=mark name=rate_loop}
237                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
238                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
239                        {else}
240                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
241                        {/if}
242                        {/foreach}
243                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
244                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
245                        {footer_script}
246                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
247                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
248                                        onSuccess : function(rating) {ldelim}
249                                                var e = document.getElementById("updateRate");
250                                                if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
251                                                e = document.getElementById("ratingScore");
252                                                if (e) e.innerHTML = rating.score;
253                                                e = document.getElementById("ratingCount");
254                                                if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
255                                        {rdelim}{rdelim} );
256                        {/footer_script}
257                        {/strip}
258                        </div>
259                        </form>
260                </dd>
261        </div>
262{/if}
263
264{if $display_info.privacy_level and isset($available_permission_levels)}
265        <div id="Privacy" class="imageInfo"><div class="relSwitchBox">
266                <dt><a id="privacyLevelLink" href="javascript:togglePrivacyLevelBox()">{'Who can see this photo?'|@translate}</a></dt>
267                <dd>
268{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
269{footer_script require='jquery'}
270{literal}function setPrivacyLevel(rootUrl, id, level)
271{
272var y = new PwgWS(rootUrl);
273y.callService(
274        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
275        {
276                method: "POST",
277                onFailure: function(num, text) { alert(num + " " + text); },
278                onSuccess: function(result) {
279                          jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
280                          jQuery('#levelCheck'+level).css('visibility','visible');
281                }
282        }
283        );
284}
285function togglePrivacyLevelBox()
286{
287        var elt = document.getElementById("privacyLevelBox"),
288                ePos = document.getElementById("privacyLevelLink");
289        if (elt.style.display == "none")
290        {
291                elt.style.left = (ePos.offsetLeft)+"px";
292                elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
293                elt.style.display="block";
294        }
295        else
296                elt.style.display="none";
297}
298{/literal}
299{/footer_script}
300
301                        <div id="privacyLevelBox" class="switchBox" onclick="togglePrivacyLevelBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e==this||togglePrivacyLevelBox()">
302                                {foreach from=$available_permission_levels item=label key=level}
303                                        <span id="levelCheck{$level}" class="switchCheck" {if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
304                                        <a id="switchLevel{$level}" href="javascript:setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
305                                {/foreach}
306                        </div>
307
308                </dd>
309        </div></div>
310{/if}
311{/strip}
312</dl>
313
314{if isset($metadata)}
315<dl id="Metadata" class="imageInfoTable">
316{foreach from=$metadata item=meta}
317        <h3>{$meta.TITLE}</h3>
318        {foreach from=$meta.lines item=value key=label}
319                <div class="imageInfo">
320                        <dt>{$label}</dt>
321                        <dd>{$value}</dd>
322                </div>
323        {/foreach}
324{/foreach}
325</dl>
326{/if}
327</div>
328</div>
329
330{if isset($COMMENT_COUNT)}
331<div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div>
332        <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
333
334        <div id="pictureComments">
335                {if isset($comment_add)}
336                <div id="commentAdd">
337                        <h4>{'Add a comment'|@translate}</h4>
338                        <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
339                                {if $comment_add.SHOW_AUTHOR}
340                                        <p><label>{'Author'|@translate} :</label></p>
341                                        <p><input type="text" name="author"></p>
342                                        <p><label>{'Comment'|@translate} :</label></p>
343                                {/if}
344                                <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
345                                <p><input type="hidden" name="key" value="{$comment_add.KEY}">
346                                        <input type="submit" value="{'Submit'|@translate}"></p>
347                        </form>
348                </div>
349                {/if}
350                {if isset($comments)}
351                <div id="pictureCommentList">
352                        {if (($COMMENT_COUNT > 2) || !empty($navbar))}
353                                <div id="pictureCommentNavBar">
354                                        {if $COMMENT_COUNT > 2}
355                                                <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
356                                        {/if}
357                                        {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
358                                </div>
359                        {/if}
360                        {include file='comment_list.tpl'}
361                </div>
362                {/if}
363                <div style="clear:both"></div>
364        </div>
365
366</div>
367{/if}{*comments*}
368
369{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
370
371</div>
Note: See TracBrowser for help on using the repository browser.