1
0
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:
llj
2015-04-22 15:01:07 +08:00
committed by Daniel Pan
parent 4cb39ba0f4
commit ed4447150d
3 changed files with 14 additions and 7 deletions

View File

@@ -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)

View File

@@ -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>

View File

@@ -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');
} }
}); });
}, },