mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
delete unused myhome.js, group.js, organization.js, redirect home/my/ to /
This commit is contained in:
@@ -92,7 +92,6 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
### lib (replace the old `repo` urls) ###
|
### lib (replace the old `repo` urls) ###
|
||||||
# url(r'^lib/(?P<repo_id>[-0-9a-f]{36})/dir/(?P<path>.*)$', view_lib_dir, name='view_lib_dir'),
|
# url(r'^lib/(?P<repo_id>[-0-9a-f]{36})/dir/(?P<path>.*)$', view_lib_dir, name='view_lib_dir'),
|
||||||
url(r'^libs/$', libraries, name='libraries'),
|
|
||||||
url(r'^lib/(?P<repo_id>[-0-9a-f]{36})/file/(?P<path>.*)$', view_lib_file, name='view_lib_file'),
|
url(r'^lib/(?P<repo_id>[-0-9a-f]{36})/file/(?P<path>.*)$', view_lib_file, name='view_lib_file'),
|
||||||
# url(r'^home/my/lib/(?P<repo_id>[-0-9a-f]{36})/dir/(?P<path>.*)$', myhome_lib, name='myhome_lib'),
|
# url(r'^home/my/lib/(?P<repo_id>[-0-9a-f]{36})/dir/(?P<path>.*)$', myhome_lib, name='myhome_lib'),
|
||||||
|
|
||||||
|
@@ -1120,24 +1120,7 @@ def get_virtual_repos_by_owner(request):
|
|||||||
@login_required
|
@login_required
|
||||||
@user_mods_check
|
@user_mods_check
|
||||||
def myhome(request):
|
def myhome(request):
|
||||||
username = request.user.username
|
return HttpResponseRedirect(reverse('libraries'))
|
||||||
|
|
||||||
# options
|
|
||||||
if request.cloud_mode and request.user.org is None:
|
|
||||||
allow_public_share = False
|
|
||||||
else:
|
|
||||||
allow_public_share = True
|
|
||||||
sub_lib_enabled = UserOptions.objects.is_sub_lib_enabled(username)
|
|
||||||
guide_enabled = UserOptions.objects.is_user_guide_enabled(username)
|
|
||||||
max_upload_file_size = get_max_upload_file_size()
|
|
||||||
|
|
||||||
return render_to_response('myhome.html', {
|
|
||||||
"allow_public_share": allow_public_share,
|
|
||||||
"guide_enabled": guide_enabled,
|
|
||||||
"sub_lib_enabled": sub_lib_enabled,
|
|
||||||
'enable_upload_folder': settings.ENABLE_UPLOAD_FOLDER,
|
|
||||||
'max_upload_file_size': max_upload_file_size,
|
|
||||||
}, context_instance=RequestContext(request))
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@user_mods_check
|
@user_mods_check
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
define([
|
|
||||||
'app/routers/group'
|
|
||||||
], function(Router){
|
|
||||||
app.router = new Router();
|
|
||||||
Backbone.history.start();
|
|
||||||
});
|
|
@@ -1,6 +0,0 @@
|
|||||||
define([
|
|
||||||
'app/routers/myhome'
|
|
||||||
], function(Router){
|
|
||||||
app.router = new Router();
|
|
||||||
Backbone.history.start();
|
|
||||||
});
|
|
@@ -1,6 +0,0 @@
|
|||||||
define([
|
|
||||||
'app/routers/organization'
|
|
||||||
], function(Router){
|
|
||||||
app.router = new Router();
|
|
||||||
Backbone.history.start();
|
|
||||||
});
|
|
@@ -1,46 +0,0 @@
|
|||||||
/*global define*/
|
|
||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'backbone',
|
|
||||||
'app/collections/group-repos',
|
|
||||||
'app/views/group'
|
|
||||||
], function($, Backbone, Repos, GroupView) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var GroupRouter = Backbone.Router.extend({
|
|
||||||
routes: {
|
|
||||||
'lib/:repo_id(/*path)': 'showDir',
|
|
||||||
|
|
||||||
'recent-changes': 'showRecentChanges',
|
|
||||||
|
|
||||||
// Default
|
|
||||||
'*actions': 'defaultAction'
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
this.groupView = new GroupView();
|
|
||||||
},
|
|
||||||
|
|
||||||
showDir: function(repo_id, path) {
|
|
||||||
if (path) {
|
|
||||||
path = '/' + path;
|
|
||||||
} else {
|
|
||||||
path = '/';
|
|
||||||
}
|
|
||||||
this.groupView.showDir(repo_id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
showRecentChanges: function() {
|
|
||||||
console.log('recent changes');
|
|
||||||
this.groupView.showChanges();
|
|
||||||
},
|
|
||||||
|
|
||||||
defaultAction: function(actions){
|
|
||||||
// We have no matching route, lets just log what the URL was
|
|
||||||
console.log('No route:', actions);
|
|
||||||
this.groupView.showRepoList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return GroupRouter;
|
|
||||||
});
|
|
@@ -1,77 +0,0 @@
|
|||||||
/*global define*/
|
|
||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'backbone',
|
|
||||||
'app/collections/repos',
|
|
||||||
'app/views/myhome'
|
|
||||||
], function($, Backbone, Repos, MyHomeView) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var MyHomeRouter = Backbone.Router.extend({
|
|
||||||
routes: {
|
|
||||||
'my-libs': 'showMyRepos',
|
|
||||||
'my-libs/lib/:repo_id(/*path)': 'showMyRepoDir',
|
|
||||||
'my-sub-libs': 'showMySubRepos',
|
|
||||||
'my-sub-libs/lib/:repo_id(/*path)': 'showMySubRepoDir',
|
|
||||||
'shared-libs': 'showSharedRepos',
|
|
||||||
'shared-libs/lib/:repo_id(/*path)': 'showSharedRepoDir',
|
|
||||||
|
|
||||||
// Default
|
|
||||||
'*actions': 'defaultAction'
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
this.myHomeView = new MyHomeView();
|
|
||||||
},
|
|
||||||
|
|
||||||
showMyRepos: function() {
|
|
||||||
this.myHomeView.showMyRepos();
|
|
||||||
},
|
|
||||||
|
|
||||||
showMySubRepos: function() {
|
|
||||||
console.log("show My Sub Repos");
|
|
||||||
this.myHomeView.showMySubRepos();
|
|
||||||
},
|
|
||||||
|
|
||||||
showSharedRepos: function() {
|
|
||||||
console.log("show shared repos");
|
|
||||||
this.myHomeView.showSharedRepos();
|
|
||||||
},
|
|
||||||
|
|
||||||
showMyRepoDir: function(repo_id, path) {
|
|
||||||
if (path) {
|
|
||||||
path = '/' + path;
|
|
||||||
} else {
|
|
||||||
path = '/';
|
|
||||||
}
|
|
||||||
this.myHomeView.showDir('my-libs', repo_id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
showMySubRepoDir: function(repo_id, path) {
|
|
||||||
if (path) {
|
|
||||||
path = '/' + path;
|
|
||||||
} else {
|
|
||||||
path = '/';
|
|
||||||
}
|
|
||||||
this.myHomeView.showDir('my-sub-libs', repo_id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
showSharedRepoDir: function(repo_id, path) {
|
|
||||||
if (path) {
|
|
||||||
path = '/' + path;
|
|
||||||
} else {
|
|
||||||
path = '/';
|
|
||||||
}
|
|
||||||
this.myHomeView.showDir('shared-libs', repo_id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
defaultAction: function(actions) {
|
|
||||||
// We have no matching route, lets just log what the URL was
|
|
||||||
console.log('No route:', actions);
|
|
||||||
|
|
||||||
this.myHomeView.showMyRepos();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return MyHomeRouter;
|
|
||||||
});
|
|
@@ -1,35 +0,0 @@
|
|||||||
/*global define*/
|
|
||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'backbone',
|
|
||||||
'app/views/organization'
|
|
||||||
], function($, Backbone, OrganizationView) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var OrganizationRouter = Backbone.Router.extend({
|
|
||||||
routes: {
|
|
||||||
'lib/:repo_id(/*path)': 'showDir',
|
|
||||||
// Default
|
|
||||||
'*actions': 'defaultAction'
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
this.orgView = new OrganizationView();
|
|
||||||
},
|
|
||||||
|
|
||||||
showDir: function(repo_id, path) {
|
|
||||||
if (path) {
|
|
||||||
path = '/' + path;
|
|
||||||
} else {
|
|
||||||
path = '/';
|
|
||||||
}
|
|
||||||
this.orgView.showDir(repo_id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
defaultAction: function(){
|
|
||||||
this.orgView.showPublicRepos();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return OrganizationRouter;
|
|
||||||
});
|
|
@@ -1,34 +0,0 @@
|
|||||||
/*global define*/
|
|
||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'backbone'
|
|
||||||
], function($, Backbone) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var MyHomeRouter = Backbone.Router.extend({
|
|
||||||
routes: {
|
|
||||||
'libs/:id(/*path)': 'showDirents',
|
|
||||||
|
|
||||||
// Default
|
|
||||||
'*actions': 'defaultAction'
|
|
||||||
},
|
|
||||||
|
|
||||||
showDirents: function(id, path){
|
|
||||||
console.log("Repo route has been called.." + "id:" + id + " path:" + path);
|
|
||||||
// if (!app.myHomePage) // XXX: is it good ?
|
|
||||||
// app.myHomePage = new app.MyHomePage();
|
|
||||||
|
|
||||||
// app.myHomePage.trigger('showDirents', id, path);
|
|
||||||
},
|
|
||||||
|
|
||||||
defaultAction: function(actions){
|
|
||||||
// We have no matching route, lets just log what the URL was
|
|
||||||
console.log('No route:', actions);
|
|
||||||
// app.myHomePage = new app.MyHomePage();
|
|
||||||
// app.myHomePage.showRepoList();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return MyHomeRouter;
|
|
||||||
});
|
|
Reference in New Issue
Block a user