mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
fix unshare list
This commit is contained in:
@@ -3,20 +3,21 @@
|
||||
{% else %}
|
||||
<div id="ListShare">
|
||||
<div>
|
||||
<h2>{% trans 'About Roles : ' %}</h2>
|
||||
<h2 style="font-size:14px; margin-bottom:10px;"><b>{% trans 'About Roles : ' %}</b></h2>
|
||||
<p>
|
||||
{% trans 'Admin can edit shares, modify content' %}
|
||||
- {% trans 'Admin can edit shares, modify content' %}
|
||||
</p>
|
||||
<p>
|
||||
{% trans 'Editor can modify content' %}
|
||||
- {% trans 'Editor can modify content' %}
|
||||
</p>
|
||||
<p>
|
||||
{% trans 'Access user have readonly access' %}
|
||||
- {% trans 'Access user have readonly access' %}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-top:10px;">
|
||||
<form name="list_share_user">
|
||||
<input type="text" class="search" name="user" value="" style="width:120px" />
|
||||
<label for="use">{% trans 'Find a user' %} : </label>
|
||||
<input type="text" class="search" name="user" value="" style="width:180px" />
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
@@ -27,11 +28,11 @@
|
||||
<td>
|
||||
<img src="/skins/icons/user.png"/>
|
||||
</td>
|
||||
<td>
|
||||
<td style="width:150px;padding:5px;">
|
||||
{{ owner.getUser().get_display_name() }}
|
||||
<input type="hidden" name="usr_id" value="{{ owner.getUser().get_id() }}" />
|
||||
</td>
|
||||
<td>
|
||||
<td style="padding-right:10px;min-width:100px;">
|
||||
{% if user.get_id() == owner.getUser(user).get_id() %}
|
||||
{% if owner.getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
|
||||
{% trans 'You are Admin' %}
|
||||
@@ -51,10 +52,12 @@
|
||||
</select>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="deleter">
|
||||
<img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/>
|
||||
</a>
|
||||
<td style="width:15px">
|
||||
{% if user.get_id() != owner.getUser(user).get_id() %}
|
||||
<a href="#" class="deleter">
|
||||
<img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="#" class="notifier">
|
||||
<img src="/skins/prod/Push/Notify.png" title="{% trans 'Notify' %}"/>
|
||||
</a>
|
||||
@@ -85,6 +88,17 @@
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.deleter', $container).bind('click', function(){
|
||||
var owner = $(this).closest('.owner');
|
||||
var usr_id = owner.find('input[name="usr_id"]').val();
|
||||
|
||||
unShareWith(usr_id, function(data){
|
||||
owner.remove();
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
function shareWith(usr_id, role)
|
||||
@@ -119,6 +133,38 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function unShareWith(usr_id, callback)
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/lists/list/{{ list.getId() }}/unshare/' + usr_id + '/',
|
||||
dataType: 'json',
|
||||
data : {},
|
||||
beforeSend:function(){
|
||||
},
|
||||
success: function(data){
|
||||
if(data.success)
|
||||
{
|
||||
humane.info(data.message);
|
||||
callback(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
humane.error(data.message);
|
||||
}
|
||||
$dialog.refresh();
|
||||
return;
|
||||
},
|
||||
error: function(){
|
||||
return;
|
||||
},
|
||||
timeout: function(){
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$autocompleter.autocomplete({
|
||||
minLength: 2,
|
||||
|
Reference in New Issue
Block a user