From 6b5c26f8b48d9ca5edfc0a24ef33771ab1c08bf1 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 2 Oct 2011 23:05:31 +0200 Subject: [PATCH] About page in config, base --- couchpotato/static/scripts/page/settings.js | 68 +++++++++++++++++++++++++++++ couchpotato/static/style/main.css | 4 ++ 2 files changed, 72 insertions(+) diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index 46558f2..1103567 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -675,3 +675,71 @@ Option.Directory = new Class({ return self.input.get('text'); } }); + + +var AboutSettingTab = new Class({ + + tab: '', + content: '', + + initialize: function(){ + var self = this; + + App.addEvent('load', self.addSettings.bind(self)) + + }, + + addSettings: function(){ + var self = this; + + self.settings = App.getPage('Settings') + self.settings.addEvent('create', function(){ + var tab = self.settings.createTab('about', { + 'label': 'About', + 'name': 'about' + }); + + self.tab = tab.tab; + self.content = tab.content; + + self.createAbout(); + + }) + + }, + + /** + * Profiles + */ + createAbout: function(){ + var self = this; + + var non_core_profiles = Object.filter(self.profiles, function(profile){ return !profile.isCore() }); + var count = Object.getLength(non_core_profiles); + + self.settings.createGroup({ + 'label': 'About CouchPotato' + }).inject(self.content).adopt( + new Element('a.button.red', { + 'text': 'Shutdown', + 'events': { + 'click': function(){ + Api.request('app.shutdown'); + } + } + }), + new Element('a.button.orange', { + 'text': 'Restart', + 'events': { + 'click': function(){ + Api.request('app.restart'); + } + } + }) + ); + + } + +}); + +window.About = new AboutSettingTab(); diff --git a/couchpotato/static/style/main.css b/couchpotato/static/style/main.css index 93e9787..3c61bd4 100644 --- a/couchpotato/static/style/main.css +++ b/couchpotato/static/style/main.css @@ -136,6 +136,10 @@ form { border-bottom: 1px solid rgba(0,0,0,0.25); cursor: pointer; } + .button.red { background-color: #ff0000; } + .button.green { background-color: #2aa300; } + .button.orange { background-color: #ffa200; } + .button.yellow { background-color: #ffe400; } /*** Icons ***/ .icon {