mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
improved who can see this photo display
git-svn-id: http://piwigo.org/svn/trunk@24837 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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;}
|
||||
@@ -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;}
|
||||
@@ -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}>✔ </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}>✔ </span>
|
||||
<a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
</dd>
|
||||
</div></div>
|
||||
</div>
|
||||
{/if}
|
||||
{/strip}
|
||||
</dl>
|
||||
|
||||
@@ -378,10 +378,6 @@ TD.calDayCellFull, TD.calDayCellEmpty {
|
||||
margin-bottom:5px;
|
||||
}
|
||||
|
||||
.relSwitchBox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#theImage {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user