diff --git a/couchpotato/static/scripts/combined.base.min.js b/couchpotato/static/scripts/combined.base.min.js index a37a2a1..34a23db 100644 --- a/couchpotato/static/scripts/combined.base.min.js +++ b/couchpotato/static/scripts/combined.base.min.js @@ -239,6 +239,7 @@ var CouchPotato = new Class({ }, createLayout: function() { var self = this; + self.hide_update = !!App.options && App.options.webui_feature && App.options.webui_feature.hide_menuitem_update; self.block.header = new BlockBase(); self.c.adopt($(self.block.header).addClass("header").adopt(self.block.navigation = new BlockHeader(self, {}), self.block.search = new BlockSearch(self, {}), self.support = new Element("a.donate.icon-donate", { href: "https://couchpota.to/support/", @@ -252,11 +253,6 @@ var CouchPotato = new Class({ text: "About CouchPotato", href: App.createUrl("settings/about") }), new Element("a", { - text: "Check for Updates", - events: { - click: self.checkForUpdate.bind(self, null) - } - }), new Element("a", { text: "Settings", href: App.createUrl("settings/general") }), new Element("a", { @@ -273,6 +269,14 @@ var CouchPotato = new Class({ click: self.shutdownQA.bind(self) } }) ]; + if (!self.hide_update) { + setting_links.splice(1, 0, new Element("a", { + text: "Check for Updates", + events: { + click: self.checkForUpdate.bind(self, null) + } + })); + } setting_links.each(function(a) { self.block.more.addLink(a); }); @@ -2019,7 +2023,7 @@ var AboutSettingTab = new Class({ self.createAbout(); }); self.settings.default_action = "about"; - self.hide_dirs = !!App.options && App.options.hide_about_dirs; + self.hide_dirs = !!App.options && App.options.webui_feature && App.options.webui_feature.hide_about_dirs; }, createAbout: function() { var self = this; diff --git a/couchpotato/static/scripts/couchpotato.js b/couchpotato/static/scripts/couchpotato.js index a68591d..6f5c184 100644 --- a/couchpotato/static/scripts/couchpotato.js +++ b/couchpotato/static/scripts/couchpotato.js @@ -121,6 +121,10 @@ createLayout: function(){ var self = this; + // TODO : sorry, it's a crutch... Need to move self.hide_update initialization to appropriate place.. + // WebUI Feature: + self.hide_update = !! App.options && App.options.webui_feature && App.options.webui_feature.hide_menuitem_update; + self.block.header = new BlockBase(); self.c.adopt( @@ -150,12 +154,6 @@ 'href': App.createUrl('settings/about') }), new Element('a', { - 'text': 'Check for Updates', - 'events': { - 'click': self.checkForUpdate.bind(self, null) - } - }), - new Element('a', { 'text': 'Settings', 'href': App.createUrl('settings/general') }), @@ -177,6 +175,15 @@ }) ]; + if (!self.hide_update){ + setting_links.splice(1, 0, new Element('a', { + 'text': 'Check for Updates', + 'events': { + 'click': self.checkForUpdate.bind(self, null) + } + })); + }; + setting_links.each(function(a){ self.block.more.addLink(a); }); diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js index e40453a..aad5079 100644 --- a/couchpotato/static/scripts/page/about.js +++ b/couchpotato/static/scripts/page/about.js @@ -28,7 +28,8 @@ var AboutSettingTab = new Class({ }); self.settings.default_action = 'about'; - self.hide_dirs = !! App.options && App.options.hide_about_dirs; + // WebUI Feature: + self.hide_dirs = !! App.options && App.options.webui_feature && App.options.webui_feature.hide_about_dirs; }, createAbout: function(){ diff --git a/couchpotato/templates/index.html b/couchpotato/templates/index.html index e2b85ec..872a947 100644 --- a/couchpotato/templates/index.html +++ b/couchpotato/templates/index.html @@ -86,7 +86,10 @@ 'data_dir': {{ json_encode(Env.get('data_dir', unicode = True)) }}, 'pid': {{ json_encode(Env.getPid()) }}, 'userscript_version': {{ json_encode(fireEvent('userscript.get_version', single = True)) }}, - 'hide_about_dirs' : {{ json_encode( Env.setting('hide_about_dirs', default=False, section = 'core', type='bool') ) }} + 'webui_feature': { + 'hide_about_dirs' : {{ json_encode( Env.setting('hide_about_dirs', default=False, section = 'webui_feature', type='bool') ) }}, + 'hide_menuitem_update' : {{ json_encode( Env.setting('hide_menuitem_update', default=False, section = 'webui_feature', type='bool') ) }}, + } }); })