aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/template/picture.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/template/picture.tpl')
-rw-r--r--themes/default/template/picture.tpl114
1 files changed, 49 insertions, 65 deletions
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index eacb81beb..f64e04856 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -1,11 +1,11 @@
-{* Example of resizeable
-{include file='include/autosize.inc.tpl'}
-*}
+{combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'}
{if isset($MENUBAR)}{$MENUBAR}{/if}
<div id="content"{if isset($MENUBAR)} class="contentWithMenu"{/if}>
+
{if isset($errors) or not empty($infos)}
{include file='infos_errors.tpl'}
{/if}
+
{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
<div id="imageHeaderBar">
@@ -17,6 +17,7 @@
<div id="imageToolBar">
<div class="imageNumber">{$PHOTO}</div>
{include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
+
<div class="actionButtons">
{if isset($current.unique_derivatives) && count($current.unique_derivatives)>1}
{footer_script require='jquery'}{literal}
@@ -30,26 +31,18 @@ function changeImgSrc(url,typeSave,typeMap)
theImg.useMap = "#map"+typeMap;
}
jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden');
- jQuery('#derivativeChecked'+typeSave).css('visibility','visible');
+ jQuery('#derivativeChecked'+typeMap).css('visibility','visible');
document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
}
-jQuery("#derivativeSwitchLink").click(function() {
- var elt = jQuery("#derivativeSwitchBox");
- elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
- .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true))
- .toggle();
-});
-jQuery("#derivativeSwitchBox").on("mouseleave click", function() {
- jQuery(this).hide();
-});
+(SwitchBox=window.SwitchBox||[]).push("#derivativeSwitchLink", "#derivativeSwitchBox");
{/literal}{/footer_script}
{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-sizes">&nbsp;</span><span class="pwg-button-text">{'Photo sizes'|@translate}</span>
+ <span class="pwg-icon pwg-icon-sizes"></span><span class="pwg-button-text">{'Photo sizes'|@translate}</span>
</a>
<div id="derivativeSwitchBox" class="switchBox">
<div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
{foreach from=$current.unique_derivatives item=derivative key=derivative_type}
- <span class="switchCheck" id="derivativeChecked{$derivative_type}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span>
+ <span class="switchCheck" id="derivativeChecked{$derivative->get_type()}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/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>
@@ -63,33 +56,34 @@ jQuery("#derivativeSwitchBox").on("mouseleave click", function() {
{/if}
{strip}{if isset($U_SLIDESHOW_START)}
<a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
+ <span class="pwg-icon pwg-icon-slideshow"></span><span class="pwg-button-text">{'slideshow'|@translate}</span>
</a>
{/if}{/strip}
{strip}{if isset($U_METADATA)}
<a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
+ <span class="pwg-icon pwg-icon-camera-info"></span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
</a>
{/if}{/strip}
{strip}{if isset($current.U_DOWNLOAD)}
<a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-save"> </span><span class="pwg-button-text">{'Download'|@translate}</span>
+ <span class="pwg-icon pwg-icon-save"></span><span class="pwg-button-text">{'Download'|@translate}</span>
</a>
{/if}{/strip}
+{if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if}
{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
{strip}{if isset($favorite)}
<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">
- <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"> </span><span class="pwg-button-text">{'Favorites'|@translate}</span>
+ <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"></span><span class="pwg-button-text">{'Favorites'|@translate}</span>
</a>
{/if}{/strip}
{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
- <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
+ <a id="cmdSetRepresentative" href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
+ <span class="pwg-icon pwg-icon-representative"></span><span class="pwg-button-text">{'representative'|@translate}</span>
</a>
{/if}{/strip}
{strip}{if isset($U_PHOTO_ADMIN)}
- <a href="{$U_PHOTO_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
- <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
+ <a id="cmdEditPhoto" href="{$U_PHOTO_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
+ <span class="pwg-icon pwg-icon-edit"></span><span class="pwg-button-text">{'Edit'|@translate}</span>
</a>
{/if}{/strip}
{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
@@ -134,15 +128,23 @@ y.callService(
{if $DISPLAY_NAV_THUMB}
<div class="navThumbs">
{if isset($previous)}
- <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE|@escape}" rel="prev">
+ <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE_ESC}" rel="prev">
<span class="thumbHover prevThumbHover"></span>
- <img src="{$previous.derivatives.square->get_url()}" alt="{$previous.TITLE|@escape}">
+ <img src="{$previous.derivatives.square->get_url()}" alt="{$previous.TITLE_ESC}">
+ </a>
+ {elseif isset($U_UP)}
+ <a class="navThumb" id="linkPrev" href="{$U_UP}" title="{'Thumbnails'|@translate}">
+ <div class="thumbHover">{'First Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
</a>
{/if}
{if isset($next)}
- <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE|@escape}" rel="next">
+ <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE_ESC}" rel="next">
<span class="thumbHover nextThumbHover"></span>
- <img src="{$next.derivatives.square->get_url()}" alt="{$next.TITLE|@escape}">
+ <img src="{$next.derivatives.square->get_url()}" alt="{$next.TITLE_ESC}">
+ </a>
+ {elseif isset($U_UP)}
+ <a class="navThumb" id="linkNext" href="{$U_UP}" title="{'Thumbnails'|@translate}">
+ <div class="thumbHover">{'Last Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
</a>
{/if}
</div>
@@ -218,12 +220,7 @@ y.callService(
<dt>{'Rating score'|@translate}</dt>
<dd>
{if $rate_summary.count}
- {if $rate_summary.count == 1}
- {assign var='rate_text' value='%d rate'|@translate}
- {else}
- {assign var='rate_text' value='%d rates'|@translate}
- {/if}
- <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$pwg->sprintf($rate_text, $rate_summary.count)})</span>
+ <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:'%d rate':'%d rates'})</span>
{else}
<span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
{/if}
@@ -274,51 +271,38 @@ y.callService(
{/if}
{if $display_info.privacy_level and isset($available_permission_levels)}
- <div id="Privacy" class="imageInfo"><div class="relSwitchBox">
- <dt><a id="privacyLevelLink" href="javascript:togglePrivacyLevelBox()">{'Who can see this photo?'|@translate}</a></dt>
+ <div id="Privacy" class="imageInfo">
+ <dt>{'Who can see this photo?'|@translate}</dt>
<dd>
+ <div>
+ <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a>
+ </div>
{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
-{footer_script require='jquery'}
-{literal}function setPrivacyLevel(rootUrl, id, level)
-{
-var y = new PwgWS(rootUrl);
-y.callService(
- "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
+{footer_script require='jquery'}{strip}
+function setPrivacyLevel(id, level){
+(new PwgWS('{$ROOT_URL}')).callService(
+ "pwg.images.setPrivacyLevel", { image_id:id, level:level},
{
method: "POST",
onFailure: function(num, text) { alert(num + " " + text); },
onSuccess: function(result) {
jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
- jQuery('#levelCheck'+level).css('visibility','visible');
+ jQuery('#switchLevel'+level).prev('.switchCheck').css('visibility','visible');
+ jQuery('#privacyLevelLink').text(jQuery('#switchLevel'+level).text());
}
}
);
}
-function togglePrivacyLevelBox()
-{
- var elt = document.getElementById("privacyLevelBox"),
- ePos = document.getElementById("privacyLevelLink");
- if (elt.style.display == "none")
- {
- elt.style.left = (ePos.offsetLeft)+"px";
- elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
- elt.style.display="block";
- }
- else
- elt.style.display="none";
-}
-{/literal}
-{/footer_script}
-
- <div id="privacyLevelBox" class="switchBox" onclick="togglePrivacyLevelBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e==this||togglePrivacyLevelBox()">
+(SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");
+{/strip}{/footer_script}
+ <div id="privacyLevelBox" class="switchBox" style="display:none">
{foreach from=$available_permission_levels item=label key=level}
- <span id="levelCheck{$level}" class="switchCheck" {if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
- <a id="switchLevel{$level}" href="javascript:setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
+ <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
+ <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
{/foreach}
</div>
-
</dd>
- </div></div>
+ </div>
{/if}
{/strip}
</dl>
@@ -341,7 +325,7 @@ function togglePrivacyLevelBox()
{if isset($COMMENT_COUNT)}
<div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div>
- <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
+ <h3>{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}</h3>
<div id="pictureComments">
{if isset($comment_add)}
@@ -353,7 +337,7 @@ function togglePrivacyLevelBox()
<p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
{/if}
{if $comment_add.SHOW_EMAIL}
- <p><label for="email">{'Email'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
+ <p><label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
<p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
{/if}
<p><label for="website_url">{'Website'|@translate} :</label></p>