aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2013-10-10 20:29:39 +0000
committerrvelices <rv-github@modusoptimus.com>2013-10-10 20:29:39 +0000
commit902781cabb56ee9b06bcf70058e46dddf7cb11a7 (patch)
tree1c966c00c3d87fb9f806973e49b00038e7b568e8
parentd03bb10888c14f0122c1e2ddb5aa9ed290573b05 (diff)
improved who can see this photo display
git-svn-id: http://piwigo.org/svn/trunk@24837 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--themes/default/fix-ie5-ie6.css1
-rw-r--r--themes/default/fix-ie7.css1
-rw-r--r--themes/default/template/picture.tpl47
-rw-r--r--themes/default/theme.css4
4 files changed, 17 insertions, 36 deletions
diff --git a/themes/default/fix-ie5-ie6.css b/themes/default/fix-ie5-ie6.css
index 7d5442095..4c2f7e96e 100644
--- a/themes/default/fix-ie5-ie6.css
+++ b/themes/default/fix-ie5-ie6.css
@@ -69,5 +69,4 @@ H1, #theHeader {
.imageInfo {display:block; line-height:16px;}
.imageInfo dt {display:block; text-align:left; font-weight:bold; padding-right:0.5em;}
.imageInfo dd {display:block; text-align:left; font-weight:normal;}
-.relSwitchBox {position:static;}
#imageInfos dd { margin: 0 0 5px 20px;} \ No newline at end of file
diff --git a/themes/default/fix-ie7.css b/themes/default/fix-ie7.css
index 479f39f7a..fb77bfcc2 100644
--- a/themes/default/fix-ie7.css
+++ b/themes/default/fix-ie7.css
@@ -26,5 +26,4 @@
.imageInfo {display:block; line-height:16px;}
.imageInfo dt {display:block; text-align:left; font-weight:bold; padding-right:0.5em;}
.imageInfo dd {display:block; text-align:left; font-weight:normal;}
-.relSwitchBox {position:static;}
#imageInfos dd { margin: 0 0 5px 20px;} \ No newline at end of file
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index 9db8e3f83..0759d14d4 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -271,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>
diff --git a/themes/default/theme.css b/themes/default/theme.css
index e2b74d6d0..e1fcfe4af 100644
--- a/themes/default/theme.css
+++ b/themes/default/theme.css
@@ -378,10 +378,6 @@ TD.calDayCellFull, TD.calDayCellEmpty {
margin-bottom:5px;
}
-.relSwitchBox {
- position: relative;
-}
-
#theImage {
text-align: center;
}