Browse Source

Merge pull request #5939 from maxkoryukov/feature/hidden-update

Feature "Hide update item in menu"
pull/6004/merge
Ruud Burger 9 years ago
parent
commit
59e1d11bc6
  1. 16
      couchpotato/static/scripts/combined.base.min.js
  2. 19
      couchpotato/static/scripts/couchpotato.js
  3. 3
      couchpotato/static/scripts/page/about.js
  4. 5
      couchpotato/templates/index.html

16
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);
});
@ -2018,7 +2022,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;

19
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);
});

3
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(){

5
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') ) }},
}
});
})

Loading…
Cancel
Save