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

Last change on this file since 13683 was 13683, checked in by plg, 9 years ago

feature 2598: add sizes XXS and XS

new label for sizes

On picture.php, the current size is "checked" and javascript refreshed when switched (with jQuery)

jQuery loaded by default on header.tpl (already loaded by thumbnails.tpl)

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