diff --git a/couchpotato/core/_base/_core/__init__.py b/couchpotato/core/_base/_core/__init__.py
index f48b157..ff2bd07 100644
--- a/couchpotato/core/_base/_core/__init__.py
+++ b/couchpotato/core/_base/_core/__init__.py
@@ -6,6 +6,7 @@ def start():
config = [{
'name': 'core',
+ 'order': 1,
'groups': [
{
'tab': 'general',
diff --git a/couchpotato/core/downloaders/blackhole/__init__.py b/couchpotato/core/downloaders/blackhole/__init__.py
index a958ecd..3231c48 100644
--- a/couchpotato/core/downloaders/blackhole/__init__.py
+++ b/couchpotato/core/downloaders/blackhole/__init__.py
@@ -5,6 +5,7 @@ def start():
config = [{
'name': 'blackhole',
+ 'order': 30,
'groups': [
{
'tab': 'downloaders',
diff --git a/couchpotato/core/plugins/automation/__init__.py b/couchpotato/core/plugins/automation/__init__.py
index 550da5d..8f7d80b 100644
--- a/couchpotato/core/plugins/automation/__init__.py
+++ b/couchpotato/core/plugins/automation/__init__.py
@@ -5,6 +5,7 @@ def start():
config = [{
'name': 'automation',
+ 'order': 30,
'groups': [
{
'tab': 'automation',
diff --git a/couchpotato/core/plugins/manage/__init__.py b/couchpotato/core/plugins/manage/__init__.py
index 4aa9fe8..30f6ea6 100644
--- a/couchpotato/core/plugins/manage/__init__.py
+++ b/couchpotato/core/plugins/manage/__init__.py
@@ -7,10 +7,9 @@ config = [{
'name': 'manage',
'groups': [
{
- 'tab': 'renamer',
+ 'tab': 'manage',
'label': 'movie library manager',
'description': 'Add your existing movie folders.',
- 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/plugins/movie/static/list.js b/couchpotato/core/plugins/movie/static/list.js
index ddfb5cd..7669221 100644
--- a/couchpotato/core/plugins/movie/static/list.js
+++ b/couchpotato/core/plugins/movie/static/list.js
@@ -116,7 +116,7 @@ var MovieList = new Class({
'change': self.search.bind(self)
}
}),
- self.navigation_menu = new Element('div.menu').adopt(
+ self.navigation_menu = new Element('div.more_menu').adopt(
self.navigation_menu_ul = new Element('ul'),
self.navigation_menu_toggle = new Element('a.button.onlay', {
'events': {
diff --git a/couchpotato/core/plugins/movie/static/movie.css b/couchpotato/core/plugins/movie/static/movie.css
index 5baa02d..4b414ae 100644
--- a/couchpotato/core/plugins/movie/static/movie.css
+++ b/couchpotato/core/plugins/movie/static/movie.css
@@ -315,7 +315,7 @@
z-index: 2;
top: 0;
padding: 100px 60px 7px;
- width: 1082px;
+ width: 1080px;
margin: 0 -60px;
box-shadow: 0 20px 20px -22px rgba(0,0,0,0.1);
}
@@ -326,7 +326,7 @@
background: #4e5969;
}
-.movies .alph_nav ul {
+.movies .alph_nav ul.numbers, .movies .alph_nav ul.actions {
list-style: none;
padding: 0 0 1px;
margin: 0;
@@ -334,7 +334,7 @@
user-select: none;
}
- .movies .alph_nav li {
+ .movies .alph_nav .numbers li, .movies .alph_nav .actions li {
display: inline-block;
vertical-align: top;
width: 22px;
@@ -452,63 +452,11 @@
margin: 0 10px 0 0;
}
- .movies .alph_nav .menu {
+ .movies .alph_nav .more_menu {
float: right;
}
- .movies .alph_nav .menu > a {
- display: block;
- background: url('../images/sprite.png') no-repeat center -137px;
- height: 25px;
- width: 25px;
- border: 1px solid rgba(0,0,0,0.3);
- }
-
- .movies .alph_nav .menu ul:before {
- content: ' ';
- height: 0;
- position: absolute;
- width: 0;
- border: 6px solid transparent;
- border-bottom-color: rgba(0,0,0,0.8);
- margin: -16px 0 0 147px;
- }
-
- .movies .alph_nav .menu ul {
- display: none;
- border: 1px solid #333;
- background: rgba(0,0,0,0.8);
- border-radius: 3px;
- padding: 4px;
- position: absolute;
- z-index: 9;
- margin: 32px 0 0 -145px;
- width: 185px;
- box-shadow: 0 10px 20px -10px rgba(0,0,0,0.4);
+ .movies .alph_nav .more_menu > a {
+ background-position: center -157px;
}
- .movies .alph_nav .menu ul.show {
- display: block;
- }
- .movies .alph_nav .menu ul li {
- width: 100%;
- height: auto;
- }
-
- .movies .alph_nav .menu ul li a {
- display: block;
- border-bottom: 1px solid rgba(255,255,255,0.2);
- padding: 0 10px;
- box-shadow: none;
- font-weight: normal;
- font-size: 11px;
- text-transform: uppercase;
- letter-spacing: 1px;
- }
-
- .movies .alph_nav .menu ul li:last-child a {
- border: none;
- color: #fff;
- }
- .movies .alph_nav .menu ul li a:hover {
- background: rgba(255,255,255,0.1);
- }
\ No newline at end of file
+
\ No newline at end of file
diff --git a/couchpotato/core/plugins/quality/static/quality.js b/couchpotato/core/plugins/quality/static/quality.js
index 87a2b5a..314ca57 100644
--- a/couchpotato/core/plugins/quality/static/quality.js
+++ b/couchpotato/core/plugins/quality/static/quality.js
@@ -39,10 +39,10 @@ var QualityBase = new Class({
self.settings = App.getPage('Settings')
self.settings.addEvent('create', function(){
- var tab = self.settings.createTab('profile', {
+ var tab = self.settings.createSubTab('profile', {
'label': 'Quality',
'name': 'profile'
- });
+ }, self.settings.tabs.searcher ,'searcher');
self.tab = tab.tab;
self.content = tab.content;
diff --git a/couchpotato/core/plugins/renamer/__init__.py b/couchpotato/core/plugins/renamer/__init__.py
index ab2cd89..b1b5339 100644
--- a/couchpotato/core/plugins/renamer/__init__.py
+++ b/couchpotato/core/plugins/renamer/__init__.py
@@ -24,6 +24,7 @@ rename_options = {
config = [{
'name': 'renamer',
+ 'order': 40,
'description': 'Move and rename your downloaded movies to your movie directory.',
'groups': [
{
diff --git a/couchpotato/core/plugins/searcher/__init__.py b/couchpotato/core/plugins/searcher/__init__.py
index 14a4376..8e0f2cf 100644
--- a/couchpotato/core/plugins/searcher/__init__.py
+++ b/couchpotato/core/plugins/searcher/__init__.py
@@ -6,6 +6,7 @@ def start():
config = [{
'name': 'searcher',
+ 'order': 20,
'groups': [
{
'tab': 'searcher',
diff --git a/couchpotato/core/plugins/subtitle/__init__.py b/couchpotato/core/plugins/subtitle/__init__.py
index 88728bd..903e934 100644
--- a/couchpotato/core/plugins/subtitle/__init__.py
+++ b/couchpotato/core/plugins/subtitle/__init__.py
@@ -8,7 +8,9 @@ config = [{
'groups': [
{
'tab': 'renamer',
+ 'subtab': 'subtitles',
'name': 'subtitle',
+ 'label': 'Download subtitles after rename',
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/plugins/trailer/__init__.py b/couchpotato/core/plugins/trailer/__init__.py
index 49b0cb9..033df08 100644
--- a/couchpotato/core/plugins/trailer/__init__.py
+++ b/couchpotato/core/plugins/trailer/__init__.py
@@ -7,8 +7,10 @@ config = [{
'name': 'trailer',
'groups': [
{
- 'tab': 'metadata',
+ 'tab': 'renamer',
+ 'subtab': 'trailer',
'name': 'trailer',
+ 'label': 'Download trailer after rename',
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/plugins/userscript/static/userscript.js b/couchpotato/core/plugins/userscript/static/userscript.js
index 63f5fc9..0e2d768 100644
--- a/couchpotato/core/plugins/userscript/static/userscript.js
+++ b/couchpotato/core/plugins/userscript/static/userscript.js
@@ -62,34 +62,18 @@ var UserscriptSettingTab = new Class({
self.settings = App.getPage('Settings')
self.settings.addEvent('create', function(){
- var tab = self.settings.createTab('userscript', {
- 'label': 'Userscript',
- 'name': 'userscript'
- });
-
- self.tab = tab.tab;
- self.content = tab.content;
-
- self.createUserscript();
+ self.settings.createGroup({
+ 'label': 'Install the Userscript'
+ }).inject(self.settings.tabs.automation.content, 'top').adopt(
+ new Element('a', {
+ 'text': 'Install userscript',
+ 'href': Api.createUrl('userscript.get')+'couchpotato.user.js',
+ 'target': '_self'
+ })
+ );
});
- },
-
- createUserscript: function(){
- var self = this;
-
-
- self.settings.createGroup({
- 'label': 'Install the Userscript'
- }).inject(self.content).adopt(
- new Element('a', {
- 'text': 'Install userscript',
- 'href': Api.createUrl('userscript.get')+'couchpotato.user.js',
- 'target': '_self'
- })
- );
-
}
});
diff --git a/couchpotato/core/plugins/wizard/static/wizard.js b/couchpotato/core/plugins/wizard/static/wizard.js
index 74d2b4d..c4edd0d 100644
--- a/couchpotato/core/plugins/wizard/static/wizard.js
+++ b/couchpotato/core/plugins/wizard/static/wizard.js
@@ -29,7 +29,7 @@ Page.Wizard = new Class({
},
'finish': {
'title': 'Finish Up',
- 'description': 'Are you done? Did you fill in everything or as much as possible? Yes, ok gogogo!',
+ 'description': 'Are you done? Did you fill in everything as much as possible? Yes, ok gogogo!',
'content': new Element('div').adopt(
new Element('a.button.green', {
'text': 'I\'m ready to start the awesomeness, wow this button is big and green!',
@@ -115,7 +115,14 @@ Page.Wizard = new Class({
if(tab_navigation && group_container){
tab_navigation.inject(tabs); // Tab navigation
self.el.getElement('.tab_'+group).inject(group_container); // Tab content
- if(self.headers[group]) tab_navigation.getElement('a').set('text', (self.headers[group].label || group).capitalize());
+ if(self.headers[group]){
+ var a = tab_navigation.getElement('a');
+ a.set('text', (self.headers[group].label || group).capitalize());
+ var url_split = a.get('href').split('wizard')[1].split('/');
+ if(url_split.length > 3)
+ a.set('href', a.get('href').replace(url_split[url_split.length-3]+'/', ''));
+
+ }
}
else {
new Element('li.t_'+group).adopt(
@@ -161,7 +168,7 @@ Page.Wizard = new Class({
if(nr == 0)
func();
-
+
var ss = new ScrollSpy( {
min: function(){
var c = g.getCoordinates();
diff --git a/couchpotato/core/providers/metadata/mediabrowser/__init__.py b/couchpotato/core/providers/metadata/mediabrowser/__init__.py
index 35b8427..c061ce3 100644
--- a/couchpotato/core/providers/metadata/mediabrowser/__init__.py
+++ b/couchpotato/core/providers/metadata/mediabrowser/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'mediabrowser',
'groups': [
{
- 'tab': 'metadata',
+ 'tab': 'renamer',
+ 'subtab': 'metadata',
'name': 'mediabrowser_metadata',
'label': 'MediaBrowser',
'description': 'Enable metadata MediaBrowser can understand',
diff --git a/couchpotato/core/providers/metadata/sonyps3/__init__.py b/couchpotato/core/providers/metadata/sonyps3/__init__.py
index 88c6167..002b848 100644
--- a/couchpotato/core/providers/metadata/sonyps3/__init__.py
+++ b/couchpotato/core/providers/metadata/sonyps3/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'sonyps3',
'groups': [
{
- 'tab': 'metadata',
+ 'tab': 'renamer',
+ 'subtab': 'metadata',
'name': 'sonyps3_metadata',
'label': 'Sony PS3',
'description': 'Enable metadata your Playstation 3 can understand',
diff --git a/couchpotato/core/providers/metadata/wdtv/__init__.py b/couchpotato/core/providers/metadata/wdtv/__init__.py
index edb9cc2..b3dab6e 100644
--- a/couchpotato/core/providers/metadata/wdtv/__init__.py
+++ b/couchpotato/core/providers/metadata/wdtv/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'wdtv',
'groups': [
{
- 'tab': 'metadata',
+ 'tab': 'renamer',
+ 'subtab': 'metadata',
'name': 'wdtv_metadata',
'label': 'WDTV',
'description': 'Enable metadata WDTV can understand',
diff --git a/couchpotato/core/providers/metadata/xbmc/__init__.py b/couchpotato/core/providers/metadata/xbmc/__init__.py
index d4ff12a..2a9510e 100644
--- a/couchpotato/core/providers/metadata/xbmc/__init__.py
+++ b/couchpotato/core/providers/metadata/xbmc/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'xbmc',
'groups': [
{
- 'tab': 'metadata',
+ 'tab': 'renamer',
+ 'subtab': 'metadata',
'name': 'xbmc_metadata',
'label': 'XBMC',
'description': 'Enable metadata XBMC can understand',
diff --git a/couchpotato/core/providers/movie/themoviedb/__init__.py b/couchpotato/core/providers/movie/themoviedb/__init__.py
index 31441fc..66ac536 100644
--- a/couchpotato/core/providers/movie/themoviedb/__init__.py
+++ b/couchpotato/core/providers/movie/themoviedb/__init__.py
@@ -10,7 +10,7 @@ config = [{
'tab': 'providers',
'name': 'tmdb',
'label': 'TheMovieDB',
- 'advanced': True,
+ 'hidden': True,
'description': 'Used for all calls to TheMovieDB.',
'options': [
{
diff --git a/couchpotato/core/providers/nzb/moovee/__init__.py b/couchpotato/core/providers/nzb/moovee/__init__.py
index 8d86be1..f2f85d1 100644
--- a/couchpotato/core/providers/nzb/moovee/__init__.py
+++ b/couchpotato/core/providers/nzb/moovee/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'moovee',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': '#alt.binaries.moovee',
'description': 'SD movies only',
'options': [
diff --git a/couchpotato/core/providers/nzb/mysterbin/__init__.py b/couchpotato/core/providers/nzb/mysterbin/__init__.py
index 07be1d4..0c75955 100644
--- a/couchpotato/core/providers/nzb/mysterbin/__init__.py
+++ b/couchpotato/core/providers/nzb/mysterbin/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'mysterbin',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'Mysterbin',
'description': '',
'options': [
diff --git a/couchpotato/core/providers/nzb/newzbin/__init__.py b/couchpotato/core/providers/nzb/newzbin/__init__.py
index ea0c27d..4ebd849 100644
--- a/couchpotato/core/providers/nzb/newzbin/__init__.py
+++ b/couchpotato/core/providers/nzb/newzbin/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'newzbin',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'newzbin',
'wizard': True,
'options': [
diff --git a/couchpotato/core/providers/nzb/newznab/__init__.py b/couchpotato/core/providers/nzb/newznab/__init__.py
index f963e00..212c984 100644
--- a/couchpotato/core/providers/nzb/newznab/__init__.py
+++ b/couchpotato/core/providers/nzb/newznab/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'newznab',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'newznab',
'description': 'Enable multiple NewzNab providers such as NZB.su',
'wizard': True,
diff --git a/couchpotato/core/providers/nzb/nzbclub/__init__.py b/couchpotato/core/providers/nzb/nzbclub/__init__.py
index 18f4e33..9c14e10 100644
--- a/couchpotato/core/providers/nzb/nzbclub/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbclub/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'nzbclub',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'NZBClub',
'description': '',
'options': [
diff --git a/couchpotato/core/providers/nzb/nzbindex/__init__.py b/couchpotato/core/providers/nzb/nzbindex/__init__.py
index cf3139c..8a3261b 100644
--- a/couchpotato/core/providers/nzb/nzbindex/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbindex/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'nzbindex',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'nzbindex',
'description': 'Free provider, but less accurate.',
'options': [
diff --git a/couchpotato/core/providers/nzb/nzbmatrix/__init__.py b/couchpotato/core/providers/nzb/nzbmatrix/__init__.py
index 84d1707..82b6ef6 100644
--- a/couchpotato/core/providers/nzb/nzbmatrix/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbmatrix/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'nzbmatrix',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'nzbmatrix',
'label': 'NZBMatrix',
'wizard': True,
diff --git a/couchpotato/core/providers/nzb/nzbs/__init__.py b/couchpotato/core/providers/nzb/nzbs/__init__.py
index bd9f9a3..2ca8917 100644
--- a/couchpotato/core/providers/nzb/nzbs/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbs/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'nzbs',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'nzbs',
'description': 'Id and Key can be found on your nzbs.org RSS page.',
'wizard': True,
diff --git a/couchpotato/core/providers/nzb/x264/__init__.py b/couchpotato/core/providers/nzb/x264/__init__.py
index ef0e2f2..152be00 100644
--- a/couchpotato/core/providers/nzb/x264/__init__.py
+++ b/couchpotato/core/providers/nzb/x264/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'x264',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': '#alt.binaries.hdtv.x264',
'description': 'HD movies only',
'options': [
diff --git a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py
index e88ac81..6514643 100644
--- a/couchpotato/core/providers/torrent/kickasstorrents/__init__.py
+++ b/couchpotato/core/providers/torrent/kickasstorrents/__init__.py
@@ -7,7 +7,8 @@ config = [{
'name': 'kickasstorrents',
'groups': [
{
- 'tab': 'providers',
+ 'tab': 'searcher',
+ 'subtab': 'providers',
'name': 'KickAssTorrents',
'options': [
{
diff --git a/couchpotato/static/images/sprite.png b/couchpotato/static/images/sprite.png
index 60cc5e8..1d96a56 100644
Binary files a/couchpotato/static/images/sprite.png and b/couchpotato/static/images/sprite.png differ
diff --git a/couchpotato/static/scripts/block/more.js b/couchpotato/static/scripts/block/more.js
new file mode 100644
index 0000000..d0926d0
--- /dev/null
+++ b/couchpotato/static/scripts/block/more.js
@@ -0,0 +1,54 @@
+Block.More = new Class({
+
+ Extends: BlockBase,
+
+ create: function(){
+ var self = this;
+
+ self.el = new Element('div.more_menu').adopt(
+ self.more_option_ul = new Element('ul').adopt(
+ new Element('li').adopt(
+ new Element('a.orange', {
+ 'text': 'Restart',
+ 'events': {
+ 'click': App.restart.bind(App)
+ }
+ })
+ ),
+ new Element('li').adopt(
+ new Element('a.red', {
+ 'text': 'Shutdown',
+ 'events': {
+ 'click': App.shutdown.bind(App)
+ }
+ })
+ )
+ ),
+ new Element('a.button.onlay', {
+ 'events': {
+ 'click': function(){
+ self.more_option_ul.toggleClass('show')
+
+ if(self.more_option_ul.hasClass('show'))
+ this.addEvent('outerClick', function(){
+ self.more_option_ul.removeClass('show')
+ this.removeEvents('outerClick');
+ })
+ else
+ this.removeEvents('outerClick');
+
+ }
+ }
+ })
+ )
+
+ },
+
+ addLink: function(tab, position){
+ var self = this
+
+ return new Element('li').adopt(tab).inject(self.more_option_ul, position || 'bottom')
+
+ }
+
+});
\ No newline at end of file
diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js
index 8fbd00c..380d5fe 100644
--- a/couchpotato/static/scripts/couchpotato.js
+++ b/couchpotato/static/scripts/couchpotato.js
@@ -59,13 +59,14 @@ var CouchPotato = new Class({
$(self.block.header).addClass('header').adopt(
new Element('div').adopt(
self.block.navigation = new Block.Navigation(self, {}),
- self.block.search = new Block.Search(self, {})
+ self.block.search = new Block.Search(self, {}),
+ self.block.more = new Block.More(self, {})
)
),
self.content = new Element('div.content'),
self.block.footer = new Block.Footer(self, {})
);
-
+
new ScrollSpy({
min: 10,
onLeave: function(){
@@ -108,7 +109,7 @@ var CouchPotato = new Class({
try {
var page = self.pages[page_name] || self.pages.Wanted;
- page.open(action, params);
+ page.open(action, params, current_url);
page.show();
}
catch(e){
@@ -150,7 +151,7 @@ var CouchPotato = new Class({
var self = this;
(function(){
-
+
Api.request('app.available', {
'onFailure': function(){
self.checkAvailable.delay(1000, self);
@@ -161,7 +162,7 @@ var CouchPotato = new Class({
self.fireEvent('load');
}
});
-
+
}).delay(delay || 0)
},
@@ -214,7 +215,7 @@ var Route = new Class({
self.page = (url.length > 0) ? url.shift() : self.defaults.page
self.action = (url.length > 0) ? url.shift() : self.defaults.action
- self.params = self.defaults.params
+ self.params = Object.merge({}, self.defaults.params);
if(url.length > 1){
var key
url.each(function(el, nr){
@@ -226,6 +227,9 @@ var Route = new Class({
}
})
}
+ else if(url.length == 1){
+ self.params[url] = true;
+ }
return self
},
diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js
index 20ebcb2..000500b 100644
--- a/couchpotato/static/scripts/page/about.js
+++ b/couchpotato/static/scripts/page/about.js
@@ -39,6 +39,36 @@ var AboutSettingTab = new Class({
one_day = 1000*60*60*24;
self.settings.createGroup({
+ 'label': 'About This CouchPotato',
+ 'name': 'variables'
+ }).inject(self.content).adopt(
+ new Element('dl.info').adopt(
+ new Element('dt[text=Version]'),
+ self.version_text = new Element('dd.version', {
+ 'text': 'Getting version...',
+ 'events': {
+ 'click': self.checkForUpdate.bind(self),
+ 'mouseenter': function(){
+ this.set('text', 'Check for updates')
+ },
+ 'mouseleave': function(){
+ self.fillVersion(Updater.getInfo())
+ }
+ }
+ }),
+ new Element('dt[text=Directories]'),
+ new Element('dd', {'text': App.getOption('app_dir')}),
+ new Element('dd', {'text': App.getOption('data_dir')}),
+ new Element('dt[text=Startup Args]'),
+ new Element('dd', {'html': App.getOption('args')}),
+ new Element('dd', {'html': App.getOption('options')})
+ )
+ );
+
+ if(!self.fillVersion(Updater.getInfo()))
+ Updater.addEvent('loaded', self.fillVersion.bind(self))
+
+ self.settings.createGroup({
'name': 'Help Support CouchPotato'
}).inject(self.content).adopt(
new Element('div.usenet').adopt(
@@ -78,56 +108,6 @@ var AboutSettingTab = new Class({
})
);
-
- self.settings.createGroup({
- 'label': 'About This CouchPotato',
- 'name': 'variables'
- }).inject(self.content).adopt(
- new Element('dl.info').adopt(
- new Element('dt[text=Version]'),
- self.version_text = new Element('dd.version', {
- 'text': 'Getting version...',
- 'events': {
- 'click': self.checkForUpdate.bind(self),
- 'mouseenter': function(){
- this.set('text', 'Check for updates')
- },
- 'mouseleave': function(){
- self.fillVersion(Updater.getInfo())
- }
- }
- }),
- new Element('dt[text=Directories]'),
- new Element('dd', {'text': App.getOption('app_dir')}),
- new Element('dd', {'text': App.getOption('data_dir')}),
- new Element('dt[text=Startup Args]'),
- new Element('dd', {'html': App.getOption('args')}),
- new Element('dd', {'html': App.getOption('options')})
- )
- );
-
- if(!self.fillVersion(Updater.getInfo()))
- Updater.addEvent('loaded', self.fillVersion.bind(self))
-
- self.settings.createGroup({
- 'name': 'actions'
- }).inject(self.content).adopt(
- new Element('div').adopt(
- new Element('a.button.red', {
- 'text': 'Shutdown',
- 'events': {
- 'click': App.shutdown.bind(App)
- }
- }),
- new Element('a.button.orange', {
- 'text': 'Restart',
- 'events': {
- 'click': App.restart.bind(App)
- }
- })
- )
- );
-
},
fillVersion: function(json){
diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js
index c4dede3..0a15efe 100644
--- a/couchpotato/static/scripts/page/settings.js
+++ b/couchpotato/static/scripts/page/settings.js
@@ -8,6 +8,21 @@ Page.Settings = new Class({
tabs: {},
current: 'about',
+ has_tab: false,
+
+ initialize: function(options){
+ var self = this;
+ self.parent(options);
+
+ // Add to more menu
+ if(self.name == 'settings')
+ App.getBlock('more').addLink(new Element('a', {
+ 'href': App.createUrl(self.name),
+ 'text': self.name.capitalize(),
+ 'title': self.title
+ }), 'top')
+
+ },
open: function(action, params){
var self = this;
@@ -40,8 +55,26 @@ Page.Settings = new Class({
var c = 'active';
var t = self.tabs[tab_name] || self.tabs[self.action] || self.tabs.general;
+
+ // Subtab
+ var subtab = null
+ Object.each(self.params, function(param, subtab_name){
+ subtab = subtab_name;
+ })
+
+ self.el.getElements('li.'+c+' , .tab_content.'+c).each(function(active){
+ active.removeClass(c);
+ });
+
+ if (t.subtabs[subtab]){
+ t.tab[a](c);
+ t.subtabs[subtab].tab[a](c);
+ t.subtabs[subtab].content[a](c);
+ }
+ else {
t.tab[a](c);
t.content[a](c);
+ }
return t
},
@@ -107,10 +140,20 @@ Page.Settings = new Class({
new Form.Check(self.advanced_toggle);
// Add content to tabs
+ var options = [];
Object.each(json.options, function(section, section_name){
+ section['section_name'] = section_name;
+ options.include(section);
+ })
+
+ options.sort(function(a, b){
+ return (a.order || 100) - (b.order || 100)
+ }).each(function(section){
+ var section_name = section.section_name;
// Add groups to content
section.groups.sortBy('order').each(function(group){
+ if(group.hidden) return;
if(self.wizard_only && !group.wizard)
return;
@@ -118,17 +161,28 @@ Page.Settings = new Class({
// Create tab
if(!self.tabs[group.tab] || !self.tabs[group.tab].groups)
self.createTab(group.tab, {});
+ var content_container = self.tabs[group.tab].content
+
+ // Create subtab
+ if(group.subtab){
+ if (!self.tabs[group.tab].subtabs[group.subtab])
+ self.createSubTab(group.subtab, {}, self.tabs[group.tab], group.tab);
+ var content_container = self.tabs[group.tab].subtabs[group.subtab].content
+ }
// Create the group
if(!self.tabs[group.tab].groups[group.name]){
var group_el = self.createGroup(group)
- .inject(self.tabs[group.tab].content)
+ .inject(content_container)
.addClass('section_'+section_name);
self.tabs[group.tab].groups[group.name] = group_el
}
// Add options to group
- group.options.sortBy('order').each(function(option){
+ group.options.sort(function(a, b){
+ return (a.order || 100) - (b.order || 100)
+ }).each(function(option){
+ if(option.hidden) return;
var class_name = (option.type || 'string').capitalize();
var input = new Option[class_name](section_name, option.name, self.getValue(section_name, option.name), option);
input.inject(self.tabs[group.tab].groups[group.name]);
@@ -164,6 +218,7 @@ Page.Settings = new Class({
self.tabs[tab_name] = Object.merge(self.tabs[tab_name], {
'tab': tab_el,
+ 'subtabs': {},
'content': new Element('div.tab_content.tab_'+tab_name).inject(self.containers),
'groups': {}
})
@@ -172,11 +227,43 @@ Page.Settings = new Class({
},
+ createSubTab: function(tab_name, tab, parent_tab, parent_tab_name){
+ var self = this;
+
+ if(parent_tab.subtabs[tab_name])
+ return parent_tab.subtabs[tab_name]
+
+ if(!parent_tab.subtabs_el)
+ parent_tab.subtabs_el = new Element('ul.subtabs').inject(parent_tab.tab);
+
+ var label = (tab.label || tab.name || tab_name).capitalize()
+ var tab_el = new Element('li.t_'+tab_name).adopt(
+ new Element('a', {
+ 'href': App.createUrl(self.name+'/'+parent_tab_name+'/'+tab_name),
+ 'text': label
+ }).adopt()
+ ).inject(parent_tab.subtabs_el);
+
+ if(!parent_tab.subtabs[tab_name])
+ parent_tab.subtabs[tab_name] = {
+ 'label': label
+ }
+
+ parent_tab.subtabs[tab_name] = Object.merge(parent_tab.subtabs[tab_name], {
+ 'tab': tab_el,
+ 'content': new Element('div.tab_content.tab_'+tab_name).inject(self.containers),
+ 'groups': {}
+ });
+
+ return parent_tab.subtabs[tab_name]
+
+ },
+
createGroup: function(group){
var self = this;
var group_el = new Element('fieldset', {
- 'class': (group.advanced ? 'inlineLabels advanced' : 'inlineLabels') + ' group_' + (group.name || '')
+ 'class': (group.advanced ? 'inlineLabels advanced' : 'inlineLabels') + ' group_' + (group.name || '') + ' subtab_' + (group.subtab || '')
}).adopt(
new Element('h2', {
'text': (group.label || group.name).capitalize()
diff --git a/couchpotato/static/style/main.css b/couchpotato/static/style/main.css
index a3e5616..808da17 100644
--- a/couchpotato/static/style/main.css
+++ b/couchpotato/static/style/main.css
@@ -175,7 +175,7 @@ body > .spinner, .mask{
}
.header .navigation {
display: inline-block;
- width: 75%;
+ width: 66.7%;
}
.header .navigation ul {
margin: 0;
@@ -196,10 +196,12 @@ body > .spinner, .mask{
}
.header .navigation li:first-child a { padding-left: 10px; }
.header .navigation li a.logLink { font-size: 13px; padding: 23px 20px 15px; }
- .header .navigation li a#showConfig {
- background: url('../../media/images/gear.png') no-repeat center;
- height: 35px;
- width: 10px;
+ .header .navigation li.tab_settings {
+ }
+ .header .navigation li.tab_settings a {
+ background: url('../images/gear.png') no-repeat center;
+ width: 35px;
+ text-indent: -1000px;
}
.header .navigation li span {
@@ -236,6 +238,14 @@ body > .spinner, .mask{
}
.header:hover .navigation .backtotop { color: #fff; }
+ .header .more_menu {
+ float: right;
+ margin-top: 20px;
+ }
+
+ .header .more_menu .red { color: red; }
+ .header .more_menu .orange { color: orange; }
+
.header .message.update {
text-align: center;
position: relative;
@@ -436,3 +446,70 @@ body > .spinner, .mask{
margin-top: 20px;
background-color: #4c5766;
}
+
+
+ .more_menu > a {
+ display: block;
+ background: url('../images/sprite.png') no-repeat center -137px;
+ height: 25px;
+ width: 25px;
+ border: 1px solid rgba(0,0,0,0.3);
+ }
+
+ .more_menu ul {
+ display: none;
+ border: 1px solid #333;
+ background: rgba(0,0,0,0.8);
+ border-radius: 3px;
+ padding: 4px !important;
+ position: absolute;
+ z-index: 9;
+ margin: 32px 0 0 -145px;
+ width: 185px;
+ box-shadow: 0 10px 20px -10px rgba(0,0,0,0.4);
+ list-style: none;
+ text-align: center;
+ }
+
+ .more_menu ul:before {
+ content: ' ';
+ height: 0;
+ position: relative;
+ width: 0;
+ border: 6px solid transparent;
+ border-bottom-color: rgba(0,0,0,0.8);
+ display: block;
+ top: -16px;
+ left: 146px;
+ }
+ .more_menu ul.show {
+ display: block;
+ }
+ .more_menu ul li {
+ width: 100%;
+ height: auto;
+ }
+
+ .more_menu ul li a {
+ display: block;
+ border-bottom: 1px solid rgba(255,255,255,0.2);
+ box-shadow: none;
+ font-weight: normal;
+ font-size: 11px;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ padding: 3px 0;
+ color: #fff;
+ }
+
+ .more_menu ul li:first-child {
+ margin-top: -12px;
+ }
+
+ .more_menu ul li:last-child a {
+ border: none;
+ color: #fff;
+ }
+ .more_menu ul li a:hover {
+ background: rgba(255,255,255,0.1);
+ }
\ No newline at end of file
diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css
index e1b31f5..40ae470 100644
--- a/couchpotato/static/style/page/settings.css
+++ b/couchpotato/static/style/page/settings.css
@@ -16,7 +16,7 @@
.page.settings .tabs {
float: left;
width: 20%;
- font-size: 25px;
+ font-size: 20px;
text-align: right;
list-style: none;
padding: 40px 0;
@@ -39,11 +39,41 @@
.page.settings .tabs a {
display: block;
padding: 11px 15px;
- color: #fff;
+ font-weight: normal;
+ transition: all 0.1s ease-in-out;
+ color: rgba(255, 255, 255, 0.8);
}
- .page.settings .tabs .active a {
- background: #4e5969;
+ .page.settings .tabs a:hover, .page.settings .tabs .active a {
+ background: rgb(78, 89, 105);
+ font-weight: bold;
+ font-size: 25px;
+ color: #fff;
+ }
+
+ .page.settings .tabs .subtabs {
+ list-style: none;
+ padding: 0;
+ overflow: hidden;
+ transition: all 1s ease-in-out;
+ max-height: 0;
}
+ .page.settings .tabs > .active .subtabs {
+ max-height: 300px;
+ }
+
+ .page.settings .tabs .subtabs a {
+ font-size: 15px;
+ padding: 1px 15px;
+ font-weight: normal;
+ color: rgba(255, 255, 255, 0.8);
+ background: rgba(78, 89, 105, 0.4);
+ }
+
+ .page.settings .tabs .subtabs .active a {
+ font-weight: bold;
+ color: #fff;
+ background: rgb(78, 89, 105);
+ }
.page.settings .containers {
diff --git a/couchpotato/templates/_desktop.html b/couchpotato/templates/_desktop.html
index 0f6ab5b..acd49b2 100644
--- a/couchpotato/templates/_desktop.html
+++ b/couchpotato/templates/_desktop.html
@@ -29,6 +29,7 @@
+