1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

[API] share to admin permission

This commit is contained in:
zming
2017-08-25 20:15:50 +08:00
parent b460d89f5a
commit 160e0b3027
11 changed files with 293 additions and 33 deletions

View File

@@ -3,8 +3,9 @@ define([
'underscore',
'backbone',
'common',
'app/views/widgets/hl-item-view'
], function($, _, Backbone, Common, HLItemView) {
'app/views/widgets/hl-item-view',
'app/views/share',
], function($, _, Backbone, Common, HLItemView, ShareView) {
'use strict';
var SharedRepoView = HLItemView.extend({
@@ -14,13 +15,28 @@ define([
mobileTemplate: _.template($('#shared-repo-mobile-tmpl').html()),
events: {
'click .unshare-btn': 'removeShare'
'click .unshare-btn': 'removeShare',
'click .repo-share-btn': 'share',
},
initialize: function() {
HLItemView.prototype.initialize.call(this);
},
share: function() {
var options = {
'is_repo_owner': true,
'user_perm': 'rw',
'repo_id': this.model.get('id'),
'repo_encrypted': this.model.get('encrypted'),
'is_dir': true,
'dirent_path': '/',
'obj_name': this.model.get('name')
};
new ShareView(options);
return false;
},
removeShare: function(e) {
var _this = this,
success_callback = function(data) {