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

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