mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +00:00
[hd] modified mine/shared/org ...pages
This commit is contained in:
@@ -10,23 +10,22 @@ define([
|
||||
'use strict';
|
||||
|
||||
var ReposView = Backbone.View.extend({
|
||||
el: $('#repo-tabs'),
|
||||
el: $('#my-own-repos'),
|
||||
|
||||
reposHdTemplate: _.template($('#my-repos-hd-tmpl').html()),
|
||||
|
||||
events: {
|
||||
'click .repo-create': 'createRepo',
|
||||
'click #my-own-repos .by-name': 'sortByName',
|
||||
'click #my-own-repos .by-time': 'sortByTime'
|
||||
'click .by-name': 'sortByName',
|
||||
'click .by-time': 'sortByTime'
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
this.$tabs = $('#repo-tabs');
|
||||
this.$table = this.$('#my-own-repos table');
|
||||
this.$table = this.$('table');
|
||||
this.$tableHead = $('thead', this.$table);
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
this.$loadingTip = $('.loading-tip', this.$tabs);
|
||||
this.$emptyTip = $('#my-own-repos .empty-tips');
|
||||
this.$loadingTip = this.$('.loading-tip');
|
||||
this.$emptyTip = this.$('.empty-tips');
|
||||
this.$repoCreateBtn = this.$('.repo-create');
|
||||
|
||||
this.repos = new RepoCollection();
|
||||
@@ -68,8 +67,7 @@ define([
|
||||
},
|
||||
|
||||
showMyRepos: function() {
|
||||
this.$tabs.show();
|
||||
$('#mylib-tab').parent().addClass('ui-state-active');
|
||||
this.$el.show();
|
||||
this.$table.hide();
|
||||
var $loadingTip = this.$loadingTip;
|
||||
$loadingTip.show();
|
||||
@@ -98,16 +96,11 @@ define([
|
||||
},
|
||||
|
||||
show: function() {
|
||||
this.$repoCreateBtn.show();
|
||||
this.showMyRepos();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.$repoCreateBtn.hide();
|
||||
this.$el.hide();
|
||||
this.$table.hide();
|
||||
this.$emptyTip.hide();
|
||||
$('#mylib-tab', this.$tabs).parent().removeClass('ui-state-active');
|
||||
},
|
||||
|
||||
createRepo: function() {
|
||||
|
@@ -9,17 +9,16 @@ define([
|
||||
'use strict';
|
||||
|
||||
var SharedReposView = Backbone.View.extend({
|
||||
el: $('#repo-tabs'),
|
||||
el: $('#repos-shared-to-me'),
|
||||
|
||||
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
|
||||
|
||||
initialize: function(options) {
|
||||
this.$tabs = $('#repo-tabs');
|
||||
this.$table = $('#repos-shared-to-me table');
|
||||
this.$table = this.$('table');
|
||||
this.$tableHead = $('thead', this.$table);
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
this.$loadingTip = $('.loading-tip', this.$tabs);
|
||||
this.$emptyTip = $('#repos-shared-to-me .empty-tips');
|
||||
this.$loadingTip = this.$('.loading-tip');
|
||||
this.$emptyTip = this.$('.empty-tips');
|
||||
|
||||
this.repos = new RepoCollection({type: 'shared'});
|
||||
this.listenTo(this.repos, 'add', this.addOne);
|
||||
@@ -55,8 +54,7 @@ define([
|
||||
},
|
||||
|
||||
showSharedRepos: function() {
|
||||
this.$tabs.show();
|
||||
$('#shared-lib-tab').parent().addClass('ui-state-active');
|
||||
this.$el.show();
|
||||
this.$table.hide();
|
||||
var $loadingTip = this.$loadingTip;
|
||||
$loadingTip.show();
|
||||
@@ -89,14 +87,11 @@ define([
|
||||
|
||||
hide: function() {
|
||||
this.$el.hide();
|
||||
this.$table.hide();
|
||||
this.$emptyTip.hide();
|
||||
$('#shared-lib-tab', this.$tabs).parent().removeClass('ui-state-active');
|
||||
},
|
||||
|
||||
events: {
|
||||
'click #repos-shared-to-me .by-name': 'sortByName',
|
||||
'click #repos-shared-to-me .by-time': 'sortByTime'
|
||||
'click .by-name': 'sortByName',
|
||||
'click .by-time': 'sortByTime'
|
||||
},
|
||||
|
||||
sortByName: function() {
|
||||
|
@@ -11,19 +11,18 @@ define([
|
||||
'use strict';
|
||||
|
||||
var ReposView = Backbone.View.extend({
|
||||
el: $('#repo-tabs'),
|
||||
el: $('#my-sub-repos'),
|
||||
|
||||
events: {
|
||||
'click #sub-lib-create': 'createRepo'
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
this.$tabs = $('#repo-tabs');
|
||||
this.$table = this.$('#my-sub-repos table');
|
||||
this.$table = this.$('table');
|
||||
this.$tableHead = $('thead', this.$table);
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
this.$loadingTip = $('.loading-tip', this.$tabs);
|
||||
this.$emptyTip = $('#my-sub-repos .empty-tips');
|
||||
this.$loadingTip = this.$('.loading-tip');
|
||||
this.$emptyTip = this.$('.empty-tips');
|
||||
|
||||
this.repos = new RepoCollection({type: 'sub'});
|
||||
this.listenTo(this.repos, 'add', this.addOne);
|
||||
@@ -54,8 +53,7 @@ define([
|
||||
},
|
||||
|
||||
showSubRepos: function() {
|
||||
this.$tabs.show();
|
||||
$('#sublib-tab').parent().addClass('ui-state-active');
|
||||
this.$el.show();
|
||||
this.$table.hide();
|
||||
var $loadingTip = this.$loadingTip;
|
||||
$loadingTip.show();
|
||||
@@ -83,16 +81,11 @@ define([
|
||||
},
|
||||
|
||||
show: function() {
|
||||
$('#sub-lib-create').show();
|
||||
this.showSubRepos();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
$('#sub-lib-create').hide();
|
||||
this.$el.hide();
|
||||
this.$table.hide();
|
||||
this.$emptyTip.hide();
|
||||
$('#sublib-tab', this.$tabs).parent().removeClass('ui-state-active');
|
||||
},
|
||||
|
||||
createRepo: function() {
|
||||
|
@@ -12,18 +12,16 @@ define([
|
||||
'use strict';
|
||||
|
||||
var OrganizationView = Backbone.View.extend({
|
||||
el: '#main',
|
||||
el: '#organization-repos',
|
||||
|
||||
reposHdTemplate: _.template($('#shared-repos-hd-tmpl').html()),
|
||||
|
||||
initialize: function(options) {
|
||||
|
||||
this.$reposDiv = $('#organization-repos');
|
||||
this.$table = $('#organization-repos table');
|
||||
this.$table = this.$('table');
|
||||
this.$tableHead = $('thead', this.$table);
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
this.$loadingTip = $('#organization-repos .loading-tip');
|
||||
this.$emptyTip = $('#organization-repos .empty-tips');
|
||||
this.$loadingTip = this.$('.loading-tip');
|
||||
this.$emptyTip = this.$('.empty-tips');
|
||||
|
||||
this.repos = new PubRepoCollection();
|
||||
this.listenTo(this.repos, 'add', this.addOne);
|
||||
@@ -55,10 +53,10 @@ define([
|
||||
},
|
||||
|
||||
events: {
|
||||
'click #organization-repos .share-existing': 'addRepo',
|
||||
'click #organization-repos .create-new': 'createRepo',
|
||||
'click #organization-repos .by-name': 'sortByName',
|
||||
'click #organization-repos .by-time': 'sortByTime'
|
||||
'click .share-existing': 'addRepo',
|
||||
'click .create-new': 'createRepo',
|
||||
'click .by-name': 'sortByName',
|
||||
'click .by-time': 'sortByTime'
|
||||
},
|
||||
|
||||
createRepo: function() {
|
||||
@@ -99,7 +97,7 @@ define([
|
||||
|
||||
showRepoList: function() {
|
||||
this.dirView.hide();
|
||||
this.$reposDiv.show();
|
||||
this.$el.show();
|
||||
var $loadingTip = this.$loadingTip;
|
||||
$loadingTip.show();
|
||||
var _this = this;
|
||||
@@ -127,7 +125,7 @@ define([
|
||||
},
|
||||
|
||||
hideRepoList: function() {
|
||||
this.$reposDiv.hide();
|
||||
this.$el.hide();
|
||||
},
|
||||
|
||||
showDir: function(repo_id, path) {
|
||||
|
@@ -16,6 +16,7 @@ define([
|
||||
this.default_cur_tab = 'mine';
|
||||
this.data = {
|
||||
'cur_tab': this.default_cur_tab,
|
||||
'mods_enabled': app.pageOptions.user_mods_enabled,
|
||||
'can_add_repo': app.pageOptions.can_add_repo,
|
||||
};
|
||||
this.render();
|
||||
|
Reference in New Issue
Block a user