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

Last change on this file since 13683 was 13683, checked in by plg, 12 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
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();
[13474]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">
[13683]55<div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
[13474]56{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
[13683]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>
[13474]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
[8757]66{strip}{if isset($U_SLIDESHOW_START)}
[8378]67        <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]68                <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
[8378]69        </a>
[8757]70{/if}{/strip}
71{strip}{if isset($U_METADATA)}
[8378]72        <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]73                <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
[8378]74        </a>
[8757]75{/if}{/strip}
76{strip}{if isset($current.U_DOWNLOAD)}
[12681]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>
[8378]79        </a>
[8757]80{/if}{/strip}
[8119]81{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
[8757]82{strip}{if isset($favorite)}
[8665]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">
[8774]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>
[8378]85        </a>
[8757]86{/if}{/strip}
87{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
[8378]88        <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]89                <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
[8378]90        </a>
[8757]91{/if}{/strip}
92{strip}{if isset($U_ADMIN)}
[8378]93        <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[12677]94                <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
[8378]95        </a>
[8757]96{/if}{/strip}
97{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
[8299]98{footer_script}
[2429]99{literal}function addToCadie(aElement, rootUrl, id)
100{
101if (aElement.disabled) return;
[8119]102aElement.disabled=true;
[2429]103var y = new PwgWS(rootUrl);
104y.callService(
[8119]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        );
[2429]111}{/literal}
[8299]112{/footer_script}
[12677]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>
[8378]115        </a>
[8757]116{/if}{/strip}{*caddie management END*}
[8378]117</div>
[8119]118
119        {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
[8757]120</div>{*<!-- imageToolBar -->*}
[859]121
[13474]122<div id="theImageAndInfos">
[12881]123<div id="theImage">
[2227]124{$ELEMENT_CONTENT}
125
126{if isset($COMMENT_IMG)}
[11062]127<p class="imageComment">{$COMMENT_IMG}</p>
[2227]128{/if}
129
[8378]130{if isset($U_SLIDESHOW_STOP)}
[859]131<p>
[8378]132        [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
[859]133</p>
[2227]134{/if}
135
[859]136</div>
137
[10804]138<div id="imageInfos">
[5293]139{if $DISPLAY_NAV_THUMB}
[8378]140{if isset($previous)}
[5021]141<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
[8378]142        <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
[859]143</a>
[2227]144{/if}
[8378]145{if isset($next)}
[5021]146<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
[8378]147        <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
[859]148</a>
[2227]149{/if}
[5293]150{/if}
[859]151
[8711]152<table id="standard" class="infoTable">
[8757]153{strip}
[8378]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}
[2480]220
[11893]221{if $display_info.rating_score and isset($rate_summary)}
[5108]222        <tr id="Average">
[11839]223                <td class="label">{'Rating score'|@translate}</td>
224                <td class="value">
[2594]225                {if $rate_summary.count}
[11839]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>
[2594]227                {else}
[11839]228                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
[2594]229                {/if}
230                </td>
231        </tr>
232{/if}
[8378]233
[2480]234{if isset($rating)}
[5108]235        <tr id="rating">
[2480]236                <td class="label">
[8665]237                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
[2480]238                </td>
239                <td class="value">
240                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
[8378]241                        <div>
[2480]242                        {foreach from=$rating.marks item=mark name=rate_loop}
243                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
[8378]244                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
[2480]245                        {else}
[8378]246                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
[2480]247                        {/if}
248                        {/foreach}
[8757]249                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[7975]250                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
[8378]251                        {footer_script}
252                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
253                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
[11839]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} );
[8378]262                        {/footer_script}
[8757]263                        {/strip}
[2480]264                        </div>
265                        </form>
266                </td>
267        </tr>
268{/if}
269
[8378]270{if $display_info.privacy_level and isset($available_permission_levels)}
[5108]271        <tr id="Privacy">
[6025]272                <td class="label">{'Who can see this photo?'|@translate}</td>
[8378]273                <td class="value">
[7975]274{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[8299]275{footer_script}
[2594]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        {
[4513]283                method: "POST",
[2594]284                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
285                onSuccess: function(result) { selectElement.disabled = false; }
286        }
287        );
288}{/literal}
[8299]289{/footer_script}
[8378]290        <select onchange="setPrivacyLevel(this, '{$ROOT_URL}', {$current.id}, this.options[selectedIndex].value)">
[6507]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}
[2594]294        </select>
295        </td></tr>
296{/if}
[8757]297{/strip}
[859]298</table>
299
[2227]300{if isset($metadata)}
[8711]301<table id="Metadata" class="infoTable2">
[2227]302{foreach from=$metadata item=meta}
[8378]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}
[2227]312{/foreach}
[859]313</table>
[2227]314{/if}
[10804]315</div>
[13474]316</div>
[859]317
[2227]318{if isset($COMMENT_COUNT)}
[859]319<div id="comments">
[8378]320        {if $COMMENT_COUNT > 0}
[2780]321                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
[13474]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>
[8378]327        {/if}
328        {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
[859]329
[2481]330        {if isset($comments)}
[3445]331                {include file='comment_list.tpl'}
[2481]332        {/if}
[859]333
[2481]334        {if isset($comment_add)}
[8378]335        <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
[2481]336        <fieldset>
[5021]337                <legend>{'Add a comment'|@translate}</legend>
[2481]338                {if $comment_add.SHOW_AUTHOR}
[5021]339                <label>{'Author'|@translate}<input type="text" name="author"></label>
[2481]340                {/if}
[5178]341                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
[3185]342                <input type="hidden" name="key" value="{$comment_add.KEY}">
[8774]343                <input type="submit" value="{'Submit'|@translate}">
[2481]344        </fieldset>
345        </form>
346        {/if}
[1167]347</div>
[8378]348{/if}{*comments*}
[2205]349
[2352]350{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
[10812]351
352</div>
Note: See TracBrowser for help on using the repository browser.