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

add 'group settings'

This commit is contained in:
llj
2016-01-06 16:28:26 +08:00
parent 0ee41ce8f3
commit e9150cf555
10 changed files with 852 additions and 8 deletions

View File

@@ -6,9 +6,10 @@ define([
'app/collections/group-repos',
'app/views/group-repo',
'app/views/add-group-repo',
'app/views/group-members'
'app/views/group-members',
'app/views/group-settings'
], function($, _, Backbone, Common, GroupRepos, GroupRepoView,
AddGroupRepoView, GroupMembersView) {
AddGroupRepoView, GroupMembersView, GroupSettingsView) {
'use strict';
var GroupView = Backbone.View.extend({
@@ -18,6 +19,7 @@ define([
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
events: {
'click #group-settings-icon': 'toggleSettingsPanel',
'click #group-members-icon': 'toggleMembersPanel',
'click .repo-create': 'createRepo',
'click .by-name': 'sortByName',
@@ -39,6 +41,7 @@ define([
this.dirView = options.dirView;
this.membersView = new GroupMembersView();
this.settingsView = new GroupSettingsView();
},
addOne: function(repo, collection, options) {
@@ -190,6 +193,21 @@ define([
this.$emptyTip.hide();
},
showSettings: function() {
this.settingsView.show({
'group_id': this.group_id
});
},
toggleSettingsPanel: function() {
var panel_id = this.settingsView.el.id;
if ($('#' + panel_id + ':visible').length) { // the panel is shown
this.settingsView.hide();
} else {
this.showSettings();
}
},
showMembers: function() {
this.membersView.show({'group_id': this.group_id});
},