diff --git a/couchpotato/core/notifications/core/static/notification.js b/couchpotato/core/notifications/core/static/notification.js index be42b06..5af7657 100644 --- a/couchpotato/core/notifications/core/static/notification.js +++ b/couchpotato/core/notifications/core/static/notification.js @@ -31,11 +31,13 @@ var NotificationBase = new Class({ }, startTimer: function(){ - this.request.startTimer() + if(this.request) + this.request.startTimer() }, stopTimer: function(){ - this.request.stopTimer() + if(this.request) + this.request.stopTimer() }, notify: function(data){ diff --git a/couchpotato/core/plugins/updater/main.py b/couchpotato/core/plugins/updater/main.py index 0bd4f20..eb99b76 100644 --- a/couchpotato/core/plugins/updater/main.py +++ b/couchpotato/core/plugins/updater/main.py @@ -39,7 +39,7 @@ class Updater(Plugin): 'repo_name': self.repo_name, 'last_check': self.last_check, 'update_version': self.update_version, - 'version': self.getVersion(), + 'version': self.getVersion() }) def getVersion(self): @@ -48,7 +48,10 @@ class Updater(Plugin): try: output = self.repo.getHead() # Yes, please log.debug('Git version output: %s' % output.hash) - self.version = output.hash + self.version = { + 'hash': output.hash[:8], + 'date': output.getDate(), + } except Exception, e: log.error('Failed using GIT updater, running from source, you need to have GIT installed. %s' % e) return 'No GIT' diff --git a/couchpotato/core/plugins/updater/static/updater.js b/couchpotato/core/plugins/updater/static/updater.js index 623bacf..056627b 100644 --- a/couchpotato/core/plugins/updater/static/updater.js +++ b/couchpotato/core/plugins/updater/static/updater.js @@ -1,4 +1,6 @@ var UpdaterBase = new Class({ + + Implements: [Events], initialize: function(){ var self = this; @@ -18,6 +20,9 @@ var UpdaterBase = new Class({ self.timer = setTimeout(function(){ Api.request('updater.info', { 'onComplete': function(json){ + self.json = json; + self.fireEvent('loaded', [json]); + if(json.update_version){ self.createMessage(json); } @@ -30,6 +35,10 @@ var UpdaterBase = new Class({ }, (timeout || 0)) }, + + getInfo: function(){ + return this.json; + }, createMessage: function(data){ var self = this; diff --git a/couchpotato/core/providers/nzb/newznab/static/newznab.js b/couchpotato/core/providers/nzb/newznab/static/newznab.js index e82ec35..dc730a6 100644 --- a/couchpotato/core/providers/nzb/newznab/static/newznab.js +++ b/couchpotato/core/providers/nzb/newznab/static/newznab.js @@ -30,7 +30,7 @@ var MultipleNewznab = new Class({ self.values[nr][name] = value.trim(); }); - self.inputs[name].getParent().hide() + self.inputs[name].getParent().addClass('hide') self.inputs[name].addEvent('change', self.addEmpty.bind(self)) }); diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js index 73652ea..bdc009a 100644 --- a/couchpotato/static/scripts/page/about.js +++ b/couchpotato/static/scripts/page/about.js @@ -27,6 +27,8 @@ var AboutSettingTab = new Class({ }); + self.settings.default_action = 'about'; + }, createAbout: function(){ @@ -37,66 +39,89 @@ var AboutSettingTab = new Class({ one_day = 1000*60*60*24; self.settings.createGroup({ - 'label': 'About CouchPotato' + 'name': 'Help Support CouchPotato' }).inject(self.content).adopt( - new Element('dl.info').adopt( - new Element('dt[text=Version]'), - new Element('dd', {'text': Updater.info()}), - 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', {'text': App.getOption('args')}), - new Element('dd', {'html': App.getOption('options')}) - ), - new Element('div.shutdown').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) - } - }) - ), new Element('div.usenet').adopt( new Element('span', { 'text': 'Help support CouchPotato and save some money for yourself by signing up for an account at' }), new Element('a', { - 'href': 'https://usenetserver.com/partners/?a_aid=couchpotato&a_bid=3f357c6f', + 'href': 'https://usenetserver.com/partners/?a_aid=couchpotato&a_bid=3f357c6f', 'text': 'UsenetServer' }), + new Element('span[text=or]'), new Element('a', { - 'href': 'http://www.newshosting.com/partners/?a_aid=couchpotato&a_bid=a0b022df', + 'href': 'http://www.newshosting.com/partners/?a_aid=couchpotato&a_bid=a0b022df', 'text': 'Newshosting' }), new Element('span', { - 'text': 'For as low as $7.95 per month, you’ll get:' + 'text': '. For as low as $7.95 per month, you’ll get:' }), new Element('ul').adopt( - new Element('li[text=Unlimited downloads]'), - new Element('li[text=Uncapped speeds]'), - new Element('li[text=Free SSL Encrypted connections]'), new Element('li', { 'text': Math.ceil((today.getTime()-millennium.getTime())/(one_day))+" days retention" - }) + }), + new Element('li[text=No speed or download limits]'), + new Element('li[text=Free SSL Encrypted connections]') ) ), new Element('div.donate', { - 'html': '
' + + 'html': + 'Or, by me an instant (24 pack) Pepsi, for while I\'m coding ;)' + + '' + '' + '' + '' + - '
' + - 'I\'m building CouchPotato in my spare time, so if you want to buy me a Pepsi while I\'m coding, that would be awesome!' + '' }) ); + + self.settings.createGroup({ + 'label': 'About CouchPotato', + 'name': 'variables' + }).inject(self.content).adopt( + new Element('dl.info').adopt( + new Element('dt[text=Version]'), + self.version_text = new Element('dd', {'text': 'Getting version...'}), + 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', {'text': App.getOption('args')}), + new Element('dd', {'html': App.getOption('options')}) + ) + ); + + 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){ + if(!json) return; + var self = this; + var date = new Date(json.version.date * 1000); + self.version_text.set('text', json.version.hash + ' ('+date.toUTCString()+')'); } }); diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index 856ef3c..b1823f4 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -15,8 +15,8 @@ Page.Settings = new Class({ }, open: function(action, params){ - var self = this - self.action = action; + var self = this; + self.action = action == 'index' ? self.default_action : action; self.params = params; if(!self.data) @@ -32,7 +32,7 @@ Page.Settings = new Class({ if(self.current) self.toggleTab(self.current, true); - var tab = self.toggleTab(action) + var tab = self.toggleTab(action); self.current = tab == self.tabs.general ? 'general' : action; }, @@ -166,7 +166,7 @@ Page.Settings = new Class({ self.tabs[tab_name] = Object.merge(self.tabs[tab_name], { 'tab': tab_el, - 'content': new Element('div.tab_content').inject(self.containers), + 'content': new Element('div.tab_content.tab_'+tab_name).inject(self.containers), 'groups': {} }) diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css index ae93a2f..d991627 100644 --- a/couchpotato/static/style/page/settings.css +++ b/couchpotato/static/style/page/settings.css @@ -1,6 +1,7 @@ /* @override http://localhost:5000/static/style/page/settings.css http://192.168.1.20:5000/static/style/page/settings.css + http://127.0.0.1:5000/static/style/page/settings.css */ .page.settings:after { @@ -293,14 +294,11 @@ .page.settings .directory_list .actions:last-child > .save { background: #9dc156; } - - .page.settings .section_newznab { - - } .page.settings .section_newznab .head { margin: 0 0 0 60px; } + .page.settings .disabled .head { display: none; } .page.settings .section_newznab .head abbr { display: inline-block; font-weight: bold; @@ -316,6 +314,7 @@ padding-top: 2px; padding-bottom: 3px; } + .page.settings .section_newznab .ctrlHolder.hide { display: none; } .page.settings .section_newznab .ctrlHolder > * { margin: 0 10px 0 0; @@ -331,4 +330,72 @@ .page.settings .section_newznab .ctrlHolder.is_empty .delete, .page.settings .section_newznab .ctrlHolder.is_empty .use { visibility: hidden; -} \ No newline at end of file +} + + .page.settings .tab_about .usenet { + padding: 20px 30px 0; + font-size: 17px; + } + + .page.settings .tab_about .usenet a { + padding: 0 5px; + } + + .page.settings .tab_about .usenet ul { + float: left; + width: 50%; + margin: 10px 0; + padding: 0; + } + + .page.settings .tab_about .usenet li { + background: url('../../images/icon.check.png') no-repeat left center; + padding: 0 0 0 25px; + } + + .page.settings .tab_about .donate { + float: left; + width: 42%; + text-align: center; + font-size: 17px; + padding: 0 0 0 4%; + margin: 20px 0 0; + border-left: 1px solid #333; + box-shadow: -1px 0 0 rgba(255,255,255, 0.15); + -moz-box-shadow: -1px 0 0 rgba(255,255,255, 0.15); + -webkit-box-shadow: -1px 0 0 rgba(255,255,255, 0.15); + } + .page.settings .tab_about .donate form { + padding: 10px 0 0; + } + + .page.settings .tab_about .info { + padding: 20px 30px; + margin: 0; + overflow: hidden; + } + + .page.settings .tab_about .info dt { + clear: both; + float: left; + width: 17%; + font-weight: bold; + } + + .page.settings .tab_about .info dd { + float: right; + width: 80%; + padding: 0; + margin: 0; + font-style: italic; + } + + .page.settings .tab_about .group_actions > div { + padding: 30px; + text-align: center; + } + + .page.settings .tab_about .group_actions a { + margin: 0 10px; + font-size: 20px; + } \ No newline at end of file