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

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

feature 2588: bugfix on picture.tpl (derivative switchlink)

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