Browse Source

Some settings fixes

About tab styling
pull/62/head
Ruud 14 years ago
parent
commit
f248d5812b
  1. 6
      couchpotato/core/notifications/core/static/notification.js
  2. 7
      couchpotato/core/plugins/updater/main.py
  3. 9
      couchpotato/core/plugins/updater/static/updater.js
  4. 2
      couchpotato/core/providers/nzb/newznab/static/newznab.js
  5. 95
      couchpotato/static/scripts/page/about.js
  6. 8
      couchpotato/static/scripts/page/settings.js
  7. 77
      couchpotato/static/style/page/settings.css

6
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){

7
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'

9
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;

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

95
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': '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">' +
'html':
'Or, by me an instant (24 pack) Pepsi, for while I\'m coding ;)' +
'<form action="https://www.paypal.com/cgi-bin/webscr" method="post">' +
'<input type="hidden" name="cmd" value="_s-xclick">' +
'<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBUq4nmDbyDV07WGd0wijGKDf/OWNA7hd2NRaxTaCVyAoaZQEGE0DQuDUHBBk7/oqWTo5Rcp1XN0A0nbYkrajWgY21lzSivGrDlWys1UjZaq0JOI89WWcy4YJMWX8chjECxicmVvk2OWgI/SOe7fhHdK4BNhQZO9ccLpfxTi2XnEDELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI0YRtA8KWmG6AgZjKL/bDyL4JG3JN/GlKsb6863opfWLUjwJf7P7DeR10j0YZQds516TcRrSLqCSoII9KpivUUBCMknWmch8xUy4i0tyb26aNh3un7HQ6lVBQLGfnqVvKFC0iUNa6i0gTLufDKuVjzl+WkqqiOvgsg8rAE3IG2oYBCAAgzJbvyZkD4SoMr74pWAvQS19gwGG56JWNIdCy5eTXu6CCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLF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MAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMDcyNjA4NDA0NlowIwYJKoZIhvcNAQkEMRYEFICseROR67FmINx7sa6IYP7eCVoaMA0GCSqGSIb3DQEBAQUABIGAfDx2KDyUHT6ISrTSnqtVWUHJWGjtM2T41m464maJ6nH7pEu6JZUHf53vD7Ey7d0MLFmF3IfGyIw2zAGfyEJHldeluPccFLhDmrDbRdxM0D/zwtWrYUwVXKQ4v3rskdp0avadX9ZRWrQplJkVsJDcLvRY4P/EhScBiA5ughJS7xc=-----END PKCS7-----">' +
'<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">' +
'</form>' +
'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!'
'</form>'
})
);
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()+')');
}
});

8
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': {}
})

77
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;
}
}
.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;
}
Loading…
Cancel
Save