Dashboard

This commit is contained in:
Ruud
2013-03-04 23:11:13 +01:00
parent 1267cdac4d
commit 1e1abf407c
17 changed files with 654 additions and 219 deletions
+10 -3
View File
@@ -3,7 +3,7 @@ var CouchPotato = new Class({
Implements: [Events, Options],
defaults: {
page: 'wanted',
page: 'home',
action: 'index',
params: {}
},
@@ -135,7 +135,7 @@ var CouchPotato = new Class({
self.current_page.hide()
try {
var page = self.pages[page_name] || self.pages.Wanted;
var page = self.pages[page_name] || self.pages.Home;
page.open(action, params, current_url);
page.show();
}
@@ -342,7 +342,14 @@ var Route = new Class({
parse: function(){
var self = this;
var path = History.getPath().replace(Api.getOption('url'), '/').replace(App.getOption('base_url'), '/')
var rep = function(pa){
return pa.replace(Api.getOption('url'), '/').replace(App.getOption('base_url'), '/')
}
var path = rep(History.getPath())
if(path == '/' && location.hash){
path = rep(location.hash.replace('#', '/'))
}
self.current = path.replace(/^\/+|\/+$/g, '')
var url = self.current.split('/')
+91
View File
@@ -0,0 +1,91 @@
Page.Home = new Class({
Extends: PageBase,
name: 'home',
title: 'Manage new stuff for things and such',
indexAction: function(param){
var self = this;
if(self.soon_list)
return
// Snatched
self.available_list = new MovieList({
'navigation': false,
'identifier': 'snatched',
'load_more': false,
'view': 'list',
'actions': MovieActions,
'title': 'Snatched & Available',
'filter': {
'release_status': 'snatched,available'
}
});
// Downloaded
// self.downloaded_list = new MovieList({
// 'navigation': false,
// 'identifier': 'downloaded',
// 'load_more': false,
// 'view': 'titles',
// 'filter': {
// 'release_status': 'done',
// 'order': 'release_order'
// }
// });
// self.el.adopt(
// new Element('h2', {
// 'text': 'Just downloaded'
// }),
// $(self.downloaded_list)
// );
// Comming Soon
self.soon_list = new MovieList({
'navigation': false,
'identifier': 'soon',
'limit': 24,
'title': 'Soon',
'filter': {
'random': true
},
'load_more': false,
'view': 'thumbs',
'api_call': 'dashboard.soon'
});
self.el.adopt(
$(self.available_list),
$(self.soon_list)
);
// Suggest
// self.suggestion_list = new MovieList({
// 'navigation': false,
// 'identifier': 'suggestions',
// 'limit': 6,
// 'load_more': false,
// 'view': 'thumbs',
// 'api_call': 'suggestion.suggest'
// });
// self.el.adopt(
// new Element('h2', {
// 'text': 'You might like'
// }),
// $(self.suggestion_list)
// );
// Recent
// Snatched
// Renamed
// Added
// Free space
// Shortcuts
}
})
+3 -1
View File
@@ -27,7 +27,9 @@ Page.Manage = new Class({
self.list = new MovieList({
'identifier': 'manage',
'status': 'done',
'filter': {
'release_status': 'done'
},
'actions': MovieActions,
'menu': [self.refresh_button, self.refresh_quick],
'on_empty_element': new Element('div.empty_manage').adopt(