Moved SeasonFolderFormat to NamingConfig

Moved UseSeasonFolder to UI only (add series)
This commit is contained in:
Mark McDowall
2013-11-20 21:34:38 -08:00
parent 9d94c4490f
commit 3db97e9d11
18 changed files with 147 additions and 112 deletions
@@ -1,4 +1,4 @@
<select class="span2 x-starting-season">
<select class="starting-season x-starting-season">
{{#each this}}
{{#if_eq seasonNumber compare="0"}}
<option value="{{seasonNumber}}">Specials</option>
+17 -3
View File
@@ -22,6 +22,7 @@ define(
ui: {
qualityProfile: '.x-quality-profile',
rootFolder : '.x-root-folder',
seasonFolder : '.x-season-folder',
addButton : '.x-add',
overview : '.x-overview',
startingSeason: '.x-starting-season'
@@ -30,7 +31,8 @@ define(
events: {
'click .x-add' : '_addSeries',
'change .x-quality-profile': '_qualityProfileChanged',
'change .x-root-folder' : '_rootFolderChanged'
'change .x-root-folder' : '_rootFolderChanged',
'change .x-season-folder' : '_seasonFolderChanged'
},
initialize: function () {
@@ -51,6 +53,7 @@ define(
var defaultQuality = Config.getValue(Config.Keys.DefaultQualityProfileId);
var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId);
var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true);
if (QualityProfiles.get(defaultQuality)) {
this.ui.qualityProfile.val(defaultQuality);
@@ -60,6 +63,8 @@ define(
this.ui.rootFolder.val(defaultRoot);
}
this.ui.seasonFolder.prop('checked', useSeasonFolder);
var minSeasonNotZero = _.min(_.reject(this.model.get('seasons'), { seasonNumber: 0 }), 'seasonNumber');
if (minSeasonNotZero) {
@@ -91,15 +96,24 @@ define(
if (options.key === Config.Keys.DefaultQualityProfileId) {
this.ui.qualityProfile.val(options.value);
}
else if (options.key === Config.Keys.DefaultRootFolderId) {
this.ui.rootFolder.val(options.value);
}
else if (options.key === Config.Keys.UseSeasonFolder) {
this.ui.seasonFolder.prop('checked', options.value);
}
},
_qualityProfileChanged: function () {
Config.setValue(Config.Keys.DefaultQualityProfileId, this.ui.qualityProfile.val());
},
_seasonFolderChanged: function () {
Config.setValue(Config.Keys.UseSeasonFolder, this.ui.seasonFolder.prop('checked'));
},
_rootFolderChanged: function () {
var rootFolderValue = this.ui.rootFolder.val();
if (rootFolderValue === 'addNew') {
@@ -125,16 +139,17 @@ define(
var quality = this.ui.qualityProfile.val();
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
var startingSeason = this.ui.startingSeason.val();
var seasonFolder = this.ui.seasonFolder.prop('checked');
this.model.set('qualityProfileId', quality);
this.model.set('rootFolderPath', rootFolderPath);
this.model.setSeasonPass(startingSeason);
this.model.set('seasonFolder', seasonFolder);
var self = this;
SeriesCollection.add(this.model);
var promise = this.model.save();
promise.done(function () {
@@ -159,7 +174,6 @@ define(
}
});
AsValidatedView.apply(view);
return view;
@@ -32,6 +32,14 @@
{{> StartingSeasonSelectionPartial seasons}}
{{> QualityProfileSelectionPartial qualityProfiles}}
<label class="checkbox-button" title="Use season folders">
<input type="checkbox" class="x-season-folder"/>
<div class="btn btn-primary btn-icon-only">
<i class="icon-folder-close"></i>
</div>
</label>
<span class="btn btn-success x-add add-series pull-right"> Add
<i class="icon-plus"></i>
</span>
+13 -1
View File
@@ -91,6 +91,18 @@
.add-series {
margin-left : 20px;
}
.checkbox {
width : 100px;
margin-left : 0px;
display : inline-block;
padding-top : 0px;
margin-bottom : 0px;
}
.starting-season {
width: 140px;
}
}
}
@@ -129,4 +141,4 @@ li.add-new:hover {
overflow: auto;
max-height: 300px;
}
}
}
+2 -1
View File
@@ -9,7 +9,8 @@ define(
},
Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId',
DefaultRootFolderId: 'DefaultRootFolderId'
DefaultRootFolderId: 'DefaultRootFolderId',
UseSeasonFolder: 'UseSeasonFolder'
},
getValueBoolean: function (key, defaultValue) {
+28
View File
@@ -0,0 +1,28 @@
@import "Bootstrap/variables";
@import "Bootstrap/mixins";
.checkbox-button div {
display: none;
}
@media only screen {
.checkbox-button {
input {
position: absolute;
opacity: 0;
z-index: 5;
}
div {
display: block;
}
.btn {
.buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
}
input:first-of-type:checked ~ .btn {
.buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
}
}
}
+1
View File
@@ -7,6 +7,7 @@
@import "Backgrid/backgrid";
@import "prefixer";
@import "icons";
@import "checkbox-button";
@import "spinner";
@import "legend";
@import "../Shared/Styles/clickable";
@@ -104,6 +104,17 @@
</div>
</div>
<div class="control-group">
<label class="control-label">Season Folder Format</label>
<div class="controls">
<input type="text" placeholder="Season {season}" name="seasonFolderFormat"/>
<span class="help-inline">
<i class="icon-question-sign" title="How should season folders be named? Please see the wiki for customization options"/>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Single Episode Example</label>
@@ -1,7 +1,7 @@
<fieldset>
<fieldset class="advanced-setting">
<legend>Folders</legend>
<div class="control-group advanced-setting">
<div class="control-group">
<label class="control-label">Create empty series folders</label>
<div class="controls">
@@ -21,33 +21,4 @@
</span>
</div>
</div>
<!--TODO: Remove this and move it to Add Series-->
<div class="control-group">
<label class="control-label">Use Season Folder</label>
<div class="controls">
<label class="checkbox toggle well">
<input type="checkbox" name="useSeasonFolder"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label">Season Folder Format</label>
<div class="controls">
<input type="text" placeholder="Season {season}" name="seasonFolderFormat"/>
<span class="help-inline">
<i class="icon-question-sign" title="How should season folders be named? Please see the wiki for customization options"/>
</span>
</div>
</div>
</fieldset>