mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
[grp lib] bugfix & improvement
This commit is contained in:
@@ -3166,8 +3166,7 @@ class GroupRepo(APIView):
|
|||||||
group_id = group.id
|
group_id = group.id
|
||||||
|
|
||||||
if not group.is_staff and not seafile_api.is_repo_owner(username, repo_id):
|
if not group.is_staff and not seafile_api.is_repo_owner(username, repo_id):
|
||||||
return api_error(status.HTTP_403_FORBIDDEN,
|
return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
|
||||||
'You do not have permission to delete repo.')
|
|
||||||
|
|
||||||
if seaserv.is_org_group(group_id):
|
if seaserv.is_org_group(group_id):
|
||||||
org_id = seaserv.get_org_id_by_group(group_id)
|
org_id = seaserv.get_org_id_by_group(group_id)
|
||||||
|
@@ -173,7 +173,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="empty-tips" style="margin-bottom:150px; display:none;">
|
<div class="empty-tips" style="margin-bottom:150px; display:none;">
|
||||||
<h2 class="alc">{% trans "No library is sharing to this group" %}</h2>
|
<h2 class="alc">{% trans "No library is shared to this group" %}</h2>
|
||||||
<p>{% blocktrans %}You can share libraries by clicking the "New Library" button above or the "Share" icon on your libraries list.{% endblocktrans %}</p>
|
<p>{% blocktrans %}You can share libraries by clicking the "New Library" button above or the "Share" icon on your libraries list.{% endblocktrans %}</p>
|
||||||
<p>{% trans "Libraries shared as writable can be downloaded and synced by other group members. Read only libraries can only be downloaded, updates by others will not be uploaded." %}</p>
|
<p>{% trans "Libraries shared as writable can be downloaded and synced by other group members. Read only libraries can only be downloaded, updates by others will not be uploaded." %}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -44,13 +44,21 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
unshare: function() {
|
unshare: function() {
|
||||||
|
var lib_name = this.model.get('name');
|
||||||
this.model.destroy({
|
this.model.destroy({
|
||||||
wait: true,
|
wait: true,
|
||||||
success: function(model, rep) {
|
success: function() {
|
||||||
Common.feedback(gettext('Success'), 'success', Common.SUCCESS_TIMOUT);
|
var msg = gettext('Successfully unshared {placeholder}').replace('{placeholder}', '<span class="op-target">' + Common.HTMLescape(lib_name) + '</span>');
|
||||||
|
Common.feedback(msg, 'success', Common.SUCCESS_TIMOUT);
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function(model, response) {
|
||||||
Common.feedback(gettext('Error'), 'error', Common.ERROR_TIMEOUT);
|
var err;
|
||||||
|
if (response.responseText) {
|
||||||
|
err = $.parseJSON(response.responseText).error_msg;
|
||||||
|
} else {
|
||||||
|
err = gettext("Failed. Please check the network.");
|
||||||
|
}
|
||||||
|
Common.feedback(err, 'error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user