Browse Source

Some more profile setting fixes

pull/51/merge
Ruud 14 years ago
parent
commit
65c517f653
  1. 22
      couchpotato/core/plugins/profile/static/profile.css
  2. 36
      couchpotato/core/plugins/quality/static/quality.js

22
couchpotato/core/plugins/profile/static/profile.css

@ -92,30 +92,21 @@
} }
#profile_ordering .head {
float: left;
}
#profile_ordering .head span {
margin: 0 10px 0 -5px;
}
#profile_ordering ul { #profile_ordering ul {
clear: both;
float: left; float: left;
margin-left: 20%; margin: 0;
width: 275px; width: 275px;
padding: 0;
} }
#profile_ordering li { #profile_ordering li {
clear: both;
overflow: hidden;
cursor: grab; cursor: grab;
cursor: -moz-grab; cursor: -moz-grab;
cursor: -webkit-grab; cursor: -webkit-grab;
border-bottom: 1px solid rgba(255,255,255,0.2); border-bottom: 1px solid rgba(255,255,255,0.2);
padding: 0 5px; padding: 0 5px;
} }
#profile_ordering li:last-child { border: 0; }
#profile_ordering li .check { #profile_ordering li .check {
margin: 2px 10px 0 0; margin: 2px 10px 0 0;
@ -134,3 +125,10 @@
width: 20px; width: 20px;
float: right; float: right;
} }
#profile_ordering .formHint {
clear: none;
float: right;
width: 250px;
margin: 0;
}

36
couchpotato/core/plugins/quality/static/quality.js

@ -59,27 +59,29 @@ var QualityBase = new Class({
createProfiles: function(){ createProfiles: function(){
var self = this; 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({ self.settings.createGroup({
'label': 'Quality Profiles', 'label': 'Quality Profiles',
'description': 'Create your own profiles with multiple qualities.' 'description': 'Create your own profiles with multiple qualities.'
}).inject(self.content).adopt( }).inject(self.content).adopt(
self.profile_container = new Element('div.container'),
new Element('a.add_new_profile', { new Element('a.add_new_profile', {
'text': 'Create a new quality profile', 'text': count > 0 ? 'Create another quality profile' : 'Click here to create a quality profile.',
'events': { 'events': {
'click': function(){ 'click': function(){
var profile = self.createProfilesClass(); var profile = self.createProfilesClass();
$(profile).inject(self.profile_container, 'top') $(profile).inject(self.profile_container)
} }
} }
}), })
self.profile_container = new Element('div.container') );
)
// Add profiles, that aren't part of the core (for editing) // Add profiles, that aren't part of the core (for editing)
Object.each(self.profiles, function(profile){ Object.each(non_core_profiles, function(profile){
if(!profile.isCore()) $(profile).inject(self.profile_container)
$(profile).inject(self.profile_container, 'top') });
})
}, },
@ -96,22 +98,17 @@ var QualityBase = new Class({
var profile_list; var profile_list;
var group = self.settings.createGroup({ var group = self.settings.createGroup({
'label': 'Profile Order', 'label': 'Profile Defaults'
'description': 'Change the order the profiles are in the dropdown list.'
}).adopt( }).adopt(
new Element('.ctrlHolder#profile_ordering').adopt( new Element('.ctrlHolder#profile_ordering').adopt(
new Element('label[text=Order]'), new Element('label[text=Order]'),
new Element('.head').adopt( profile_list = new Element('ul'),
new Element('span.show[text=Show]'), new Element('p.formHint', {
new Element('span.profile_label[text=Profile]') 'html': 'Change the order the profiles are in the dropdown list. Uncheck to hide it completely.<br />First one will be default.'
), })
profile_list = new Element('ul')
) )
).inject(self.content) ).inject(self.content)
Object.each(self.profiles, function(profile){ Object.each(self.profiles, function(profile){
var check; var check;
new Element('li', {'data-id': profile.data.id}).adopt( new Element('li', {'data-id': profile.data.id}).adopt(
@ -152,7 +149,6 @@ var QualityBase = new Class({
hidden[nr] = +!el.getElement('input[type=checkbox]').get('checked'); hidden[nr] = +!el.getElement('input[type=checkbox]').get('checked');
}); });
p(ids, hidden);
Api.request('profile.save_order', { Api.request('profile.save_order', {
'data': { 'data': {
'ids': ids, 'ids': ids,

Loading…
Cancel
Save