2011-05-19 01:10:25 +02:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-11-29 02:11:55 +01:00
|
|
|
@model NzbDrone.Web.Models.EpisodeNamingModel
|
2011-12-10 05:15:38 +01:00
|
|
|
@{ Layout = "~/Views/Shared/_ReferenceLayout.cshtml"; }
|
2011-07-01 22:33:03 +02:00
|
|
|
@section HeaderContent{
|
2011-12-09 05:57:23 +01:00
|
|
|
@Html.IncludeCss("Settings.css")
|
2011-07-01 22:33:03 +02:00
|
|
|
<style>
|
|
|
|
#examples
|
|
|
|
{
|
2011-11-29 02:11:55 +01:00
|
|
|
margin-top: 5px;
|
|
|
|
margin-bottom: 20px;
|
2011-11-26 21:42:42 +01:00
|
|
|
padding-left: 20px;
|
2011-07-01 22:33:03 +02:00
|
|
|
}
|
2011-11-29 02:11:55 +01:00
|
|
|
|
|
|
|
.settingsContainer
|
|
|
|
{
|
|
|
|
overflow: auto;
|
|
|
|
}
|
2011-07-01 22:33:03 +02:00
|
|
|
</style>
|
|
|
|
}
|
|
|
|
<div id="stylized">
|
2011-12-01 07:39:11 +01:00
|
|
|
@using (Html.BeginForm("SaveNaming", "Settings", FormMethod.Post, new { id = "NamingForm", name = "NamingForm", @class = "settingsForm" }))
|
2011-07-01 22:33:03 +02:00
|
|
|
{
|
2011-11-29 02:11:55 +01:00
|
|
|
<div class="settingsContainer">
|
2011-12-01 06:04:44 +01:00
|
|
|
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.SeriesName)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.SeriesName)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.SeriesName, new { @class = "inputClass checkClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.EpisodeName)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.EpisodeName)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.EpisodeName, new { @class = "inputClass checkClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.ReplaceSpaces)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.ReplaceSpaces)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.ReplaceSpaces, new { @class = "inputClass checkClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.AppendQuality)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.AppendQuality)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.AppendQuality, new { @class = "inputClass checkClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolders)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.SeasonFolders)</span>
|
|
|
|
</label>
|
|
|
|
@Html.CheckBoxFor(m => m.SeasonFolders, new { @class = "inputClass checkClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolderFormat)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.SeasonFolderFormat)</span>
|
|
|
|
</label>
|
|
|
|
@Html.TextBoxFor(m => m.SeasonFolderFormat, new { @class = "inputClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.SeparatorStyle)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.SeparatorStyle)</span>
|
|
|
|
</label>
|
|
|
|
@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles, new { @class = "inputClass selectClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.NumberStyle)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.NumberStyle)</span>
|
|
|
|
</label>
|
|
|
|
@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles, new { @class = "inputClass selectClass" })
|
|
|
|
<label class="labelClass">@Html.LabelFor(m => m.MultiEpisodeStyle)
|
|
|
|
<span class="small">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</span>
|
|
|
|
</label>
|
|
|
|
@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles, new { @class = "inputClass selectClass" })
|
2011-11-29 02:11:55 +01:00
|
|
|
</div>
|
2011-12-01 06:04:44 +01:00
|
|
|
<div id="examples">
|
|
|
|
<div id="singleEpisodeExample">
|
|
|
|
<b>Single Episode Example: </b><span class="result"></span>
|
|
|
|
</div>
|
|
|
|
<div id="multiEpisodeExample">
|
|
|
|
<b>Multi-Episode Example: </b><span class="result"></span>
|
|
|
|
</div>
|
2011-06-28 04:24:42 +02:00
|
|
|
</div>
|
2011-07-01 22:33:03 +02:00
|
|
|
|
2011-12-01 07:39:11 +01:00
|
|
|
<button type="submit" class="save_button" disabled="disabled">
|
2011-12-01 06:04:44 +01:00
|
|
|
Save</button>
|
2011-07-01 22:33:03 +02:00
|
|
|
}
|
2011-06-28 04:24:42 +02:00
|
|
|
</div>
|
|
|
|
@section Scripts{
|
2011-07-01 22:33:03 +02:00
|
|
|
<script type="text/javascript">
|
2011-08-31 02:15:22 +02:00
|
|
|
$(document).ready(function () {
|
|
|
|
createExamples();
|
|
|
|
});
|
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
$('#SeriesName').live('change', function () { createExamples(); });
|
|
|
|
$('#EpisodeName').live('change', function () { createExamples(); });
|
|
|
|
$('#ReplaceSpaces').live('change', function () { createExamples(); });
|
|
|
|
$('#AppendQuality').live('change', function () { createExamples(); });
|
|
|
|
$('#SeparatorStyle').live('change', function () { createExamples(); });
|
|
|
|
$('#NumberStyle').live('change', function () { createExamples(); });
|
|
|
|
$('#MultiEpisodeStyle').live('change', function () { createExamples(); });
|
|
|
|
|
|
|
|
function createExamples() {
|
|
|
|
createSingleEpisodeExample();
|
|
|
|
createMultiEpisodeExample();
|
|
|
|
}
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
function createSingleEpisodeExample() {
|
|
|
|
var result = '';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
var separator = ' - ';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($("#SeparatorStyle option:selected").val() == 1)
|
|
|
|
separator = ' ';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($('#SeriesName').attr('checked')) {
|
|
|
|
result += 'Series Name';
|
|
|
|
result += separator;
|
|
|
|
}
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
result += $("#NumberStyle option:selected").text();
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($('#EpisodeName').attr('checked')) {
|
|
|
|
result += separator;
|
|
|
|
result += 'Episode Name';
|
|
|
|
}
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($('#AppendQuality').attr('checked'))
|
|
|
|
result += ' [TV]';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($('#ReplaceSpaces').attr('checked'))
|
|
|
|
result = result.replace(/\s/g, '.');
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-11-29 02:11:55 +01:00
|
|
|
//result = '<b>Single Episode Example: </b>' + result;
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-11-29 02:11:55 +01:00
|
|
|
$('#singleEpisodeExample').children('.result').text(result);
|
2011-05-14 06:13:21 +02:00
|
|
|
}
|
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
function createMultiEpisodeExample() {
|
|
|
|
var result = '';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
var separator = ' - ';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($("#SeparatorStyle option:selected").val() == 1)
|
|
|
|
separator = ' ';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if ($('#SeriesName').attr('checked')) {
|
|
|
|
result += 'Series Name';
|
|
|
|
result += separator;
|
|
|
|
}
|
|
|
|
|
|
|
|
var numberStyle = $("#NumberStyle option:selected").text();
|
|
|
|
var numberId = $("#NumberStyle option:selected").val();
|
|
|
|
var style = $("#MultiEpisodeStyle option:selected").val();
|
|
|
|
|
|
|
|
result += numberStyle;
|
|
|
|
|
|
|
|
if (style == 0)
|
|
|
|
result += '-06';
|
|
|
|
|
|
|
|
if (style == 1) {
|
|
|
|
result += separator;
|
|
|
|
result += numberStyle.replace('5', '6');
|
|
|
|
}
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if (style == 2) {
|
|
|
|
if (numberId <= 1)
|
|
|
|
result += 'x06';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if (numberId == 2)
|
|
|
|
result += 'E06';
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if (numberId == 3)
|
|
|
|
result += 'e06';
|
|
|
|
}
|
2011-05-14 06:13:21 +02:00
|
|
|
|
2011-06-28 04:24:42 +02:00
|
|
|
if (style == 3) {
|
|
|
|
if (numberId <= 1)
|
|
|
|
result += '-x06';
|
|
|
|
|
|
|
|
if (numberId == 2)
|
|
|
|
result += '-E06';
|
|
|
|
|
|
|
|
if (numberId == 3)
|
|
|
|
result += '-e06';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($('#EpisodeName').attr('checked')) {
|
|
|
|
result += separator;
|
|
|
|
result += 'Episode Name';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($('#AppendQuality').attr('checked'))
|
|
|
|
result += ' [TV]';
|
|
|
|
|
|
|
|
if ($('#ReplaceSpaces').attr('checked'))
|
|
|
|
result = result.replace(/\s/g, '.');
|
|
|
|
|
2011-11-29 02:11:55 +01:00
|
|
|
//result = '<b>Multi-Episode Example: </b>' + result;
|
2011-06-28 04:24:42 +02:00
|
|
|
|
2011-11-29 02:11:55 +01:00
|
|
|
$('#multiEpisodeExample').children('.result').text(result);
|
2011-06-28 04:24:42 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
}
|