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

Last change on this file since 13736 was 13736, checked in by rvelices, 12 years ago
  • small js fixes on index/picture
  • i.php does not use derivatives.dat file anymore (obsolete file)
  • better selection of derivatives in picture.php
  • larger sharpen real range in image.class.php
  • Property svn:eol-style set to LF
File size: 13.1 KB
RevLine 
[8378]1{* Example of resizeable
[2721]2{include file='include/autosize.inc.tpl'}
3*}
[13474]4{if isset($MENUBAR)}{$MENUBAR}{/if}
5<div id="content" {if isset($MENUBAR)}class="contentWithMenu"{/if}>
[13074]6{if isset($errors) or not empty($infos)}
[12764]7{include file='infos_errors.tpl'}
[13074]8{/if}
[2902]9{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
10
[859]11<div id="imageHeaderBar">
[8378]12        <div class="browsePath">
[13474]13                {$SECTION_TITLE}<span class="browsePathSeparator">{$LEVEL_SEPARATOR}</span><h2>{$current.TITLE}</h2>
[8378]14        </div>
15        <div class="imageNumber">{$PHOTO}</div>
[859]16</div>
17
18<div id="imageToolBar">
[8378]19<div class="actionButtons">
[13474]20
21{if count($current.unique_derivatives)>1}
22{footer_script}{literal}
[13489]23function changeImgSrc(url,typeSave,typeMap)
[13474]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        }
[13683]32  jQuery('.derivativeChecked').hide();
33  jQuery('#derivativeChecked'+typeSave).show();
[13729]34  jQuery('#derivativeSiwtchBox .switchSelected').addClass('switchUnselected').removeClass('switchSelected');
35  jQuery('#derivativeName'+typeSave).addClass('switchSelected').removeClass('switchUnselected');
36    document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
[13474]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";
[13729]46                elt.style.left = (ePos.offsetLeft)+"px";
[13474]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>
[13736]56<div id="derivativeSwitchBox" class="switchBox" onclick="toggleDerivativeSwitchBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e.parentNode.parentNode==this||e==this||toggleDerivativeSwitchBox()">
[13683]57<div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
[13474]58{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
[13729]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>
[13474]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
[8757]74{strip}{if isset($U_SLIDESHOW_START)}
[8378]75        <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]76                <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
[8378]77        </a>
[8757]78{/if}{/strip}
79{strip}{if isset($U_METADATA)}
[8378]80        <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]81                <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
[8378]82        </a>
[8757]83{/if}{/strip}
84{strip}{if isset($current.U_DOWNLOAD)}
[12681]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>
[8378]87        </a>
[8757]88{/if}{/strip}
[8119]89{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
[8757]90{strip}{if isset($favorite)}
[8665]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">
[8774]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>
[8378]93        </a>
[8757]94{/if}{/strip}
95{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
[8378]96        <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]97                <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
[8378]98        </a>
[8757]99{/if}{/strip}
100{strip}{if isset($U_ADMIN)}
[8378]101        <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[12677]102                <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
[8378]103        </a>
[8757]104{/if}{/strip}
105{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
[8299]106{footer_script}
[2429]107{literal}function addToCadie(aElement, rootUrl, id)
108{
109if (aElement.disabled) return;
[8119]110aElement.disabled=true;
[2429]111var y = new PwgWS(rootUrl);
112y.callService(
[8119]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        );
[2429]119}{/literal}
[8299]120{/footer_script}
[12677]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>
[8378]123        </a>
[8757]124{/if}{/strip}{*caddie management END*}
[8378]125</div>
[8119]126
127        {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
[8757]128</div>{*<!-- imageToolBar -->*}
[859]129
[13474]130<div id="theImageAndInfos">
[12881]131<div id="theImage">
[2227]132{$ELEMENT_CONTENT}
133
134{if isset($COMMENT_IMG)}
[11062]135<p class="imageComment">{$COMMENT_IMG}</p>
[2227]136{/if}
137
[8378]138{if isset($U_SLIDESHOW_STOP)}
[859]139<p>
[8378]140        [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
[859]141</p>
[2227]142{/if}
143
[859]144</div>
145
[10804]146<div id="imageInfos">
[5293]147{if $DISPLAY_NAV_THUMB}
[8378]148{if isset($previous)}
[5021]149<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
[8378]150        <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
[859]151</a>
[2227]152{/if}
[8378]153{if isset($next)}
[5021]154<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
[8378]155        <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
[859]156</a>
[2227]157{/if}
[5293]158{/if}
[859]159
[8711]160<table id="standard" class="infoTable">
[8757]161{strip}
[8378]162        {if $display_info.author}
163        <tr id="Author">
164                <td class="label">{'Author'|@translate}</td>
165                <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
166        </tr>
167        {/if}
168        {if $display_info.created_on}
169        <tr id="datecreate">
170                <td class="label">{'Created on'|@translate}</td>
171                <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
172        </tr>
173        {/if}
174        {if $display_info.posted_on}
175        <tr id="datepost">
176                <td class="label">{'Posted on'|@translate}</td>
177                <td class="value">{$INFO_POSTED_DATE}</td>
178        </tr>
179        {/if}
180        {if $display_info.dimensions}
181        <tr id="Dimensions">
182                <td class="label">{'Dimensions'|@translate}</td>
183                <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
184        </tr>
185        {/if}
186        {if $display_info.file}
187        <tr id="File">
188                <td class="label">{'File'|@translate}</td>
189                <td class="value">{$INFO_FILE}</td>
190        </tr>
191        {/if}
192        {if $display_info.filesize}
193        <tr id="Filesize">
194                <td class="label">{'Filesize'|@translate}</td>
195                <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
196        </tr>
197        {/if}
198        {if $display_info.tags}
199        <tr id="Tags">
200                <td class="label">{'Tags'|@translate}</td>
201                <td class="value">
202                        {if isset($related_tags)}
203                                {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
204                        {/if}
205                </td>
206        </tr>
207        {/if}
208        {if $display_info.categories}
209        <tr id="Categories">
210                <td class="label">{'Albums'|@translate}</td>
211                <td class="value">
212                        {if isset($related_categories)}
213                        <ul>
214                                {foreach from=$related_categories item=cat}
215                                <li>{$cat}</li>
216                                {/foreach}
217                        </ul>
218                        {/if}
219                </td>
220        </tr>
221        {/if}
222        {if $display_info.visits}
223        <tr id="Visits">
224                <td class="label">{'Visits'|@translate}</td>
225                <td class="value">{$INFO_VISITS}</td>
226        </tr>
227        {/if}
[2480]228
[11893]229{if $display_info.rating_score and isset($rate_summary)}
[5108]230        <tr id="Average">
[11839]231                <td class="label">{'Rating score'|@translate}</td>
232                <td class="value">
[2594]233                {if $rate_summary.count}
[11839]234                        <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>
[2594]235                {else}
[11839]236                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
[2594]237                {/if}
238                </td>
239        </tr>
240{/if}
[8378]241
[2480]242{if isset($rating)}
[5108]243        <tr id="rating">
[2480]244                <td class="label">
[8665]245                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
[2480]246                </td>
247                <td class="value">
248                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
[8378]249                        <div>
[2480]250                        {foreach from=$rating.marks item=mark name=rate_loop}
251                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
[8378]252                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
[2480]253                        {else}
[8378]254                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
[2480]255                        {/if}
256                        {/foreach}
[8757]257                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[7975]258                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
[8378]259                        {footer_script}
260                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
261                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
[11839]262                                        onSuccess : function(rating) {ldelim}
263                                                var e = document.getElementById("updateRate");
264                                                if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
265                                                e = document.getElementById("ratingScore");
266                                                if (e) e.innerHTML = rating.score;
267                                                e = document.getElementById("ratingCount");
268                                                if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
269                                        {rdelim}{rdelim} );
[8378]270                        {/footer_script}
[8757]271                        {/strip}
[2480]272                        </div>
273                        </form>
274                </td>
275        </tr>
276{/if}
277
[8378]278{if $display_info.privacy_level and isset($available_permission_levels)}
[5108]279        <tr id="Privacy">
[6025]280                <td class="label">{'Who can see this photo?'|@translate}</td>
[8378]281                <td class="value">
[7975]282{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[8299]283{footer_script}
[2594]284{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
285{
286selectElement.disabled = true;
287var y = new PwgWS(rootUrl);
288y.callService(
289        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
290        {
[4513]291                method: "POST",
[2594]292                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
293                onSuccess: function(result) { selectElement.disabled = false; }
294        }
295        );
296}{/literal}
[8299]297{/footer_script}
[8378]298        <select onchange="setPrivacyLevel(this, '{$ROOT_URL}', {$current.id}, this.options[selectedIndex].value)">
[6507]299                {foreach from=$available_permission_levels item=label key=level}
300                <option label="{$label}" value="{$level}"{if $level == $current.level} selected="selected"{/if}>{$label}</option>
301                {/foreach}
[2594]302        </select>
303        </td></tr>
304{/if}
[8757]305{/strip}
[859]306</table>
307
[2227]308{if isset($metadata)}
[8711]309<table id="Metadata" class="infoTable2">
[2227]310{foreach from=$metadata item=meta}
[8378]311        <tr>
312                <th colspan="2">{$meta.TITLE}</th>
313        </tr>
314        {foreach from=$meta.lines item=value key=label}
315        <tr>
316                <td class="label">{$label}</td>
317                <td class="value">{$value}</td>
318        </tr>
319        {/foreach}
[2227]320{/foreach}
[859]321</table>
[2227]322{/if}
[10804]323</div>
[13474]324</div>
[859]325
[2227]326{if isset($COMMENT_COUNT)}
[859]327<div id="comments">
[8378]328        {if $COMMENT_COUNT > 0}
[2780]329                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
[13474]330                {if $COMMENT_COUNT > 2}
331                        <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow">{$COMMENTS_ORDER_TITLE}</a>
332                {/if}
333        {else}
334                <h3 class="noCommentText">{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
[8378]335        {/if}
336        {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
[859]337
[2481]338        {if isset($comments)}
[3445]339                {include file='comment_list.tpl'}
[2481]340        {/if}
[859]341
[2481]342        {if isset($comment_add)}
[8378]343        <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
[2481]344        <fieldset>
[5021]345                <legend>{'Add a comment'|@translate}</legend>
[2481]346                {if $comment_add.SHOW_AUTHOR}
[5021]347                <label>{'Author'|@translate}<input type="text" name="author"></label>
[2481]348                {/if}
[5178]349                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
[3185]350                <input type="hidden" name="key" value="{$comment_add.KEY}">
[8774]351                <input type="submit" value="{'Submit'|@translate}">
[2481]352        </fieldset>
353        </form>
354        {/if}
[1167]355</div>
[8378]356{/if}{*comments*}
[2205]357
[2352]358{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
[10812]359
360</div>
Note: See TracBrowser for help on using the repository browser.