source: trunk/themes/elegant/template/picture.tpl @ 13730

Last change on this file since 13730 was 13730, checked in by Zaphod, 12 years ago

feature 2587: theme elegant, new version

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