You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
209 lines
7.2 KiB
209 lines
7.2 KiB
14 years ago
|
@using NzbDrone.Web.Helpers
|
||
13 years ago
|
@model NzbDrone.Web.Models.EpisodeNamingModel
|
||
14 years ago
|
|
||
|
@section HeaderContent{
|
||
|
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
|
||
|
|
||
|
<style>
|
||
|
#examples
|
||
|
{
|
||
13 years ago
|
margin-top: 5px;
|
||
|
margin-bottom: 20px;
|
||
13 years ago
|
padding-left: 20px;
|
||
14 years ago
|
}
|
||
13 years ago
|
|
||
|
.settingsContainer
|
||
|
{
|
||
|
overflow: auto;
|
||
|
}
|
||
14 years ago
|
</style>
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
@section TitleContent{
|
||
13 years ago
|
Settings > Naming
|
||
14 years ago
|
}
|
||
|
|
||
|
@section ActionMenu{
|
||
|
@{Html.RenderPartial("SubMenu");}
|
||
|
}
|
||
|
|
||
|
@section MainContent{
|
||
|
<div id="stylized">
|
||
13 years ago
|
@using (Html.BeginForm("SaveNaming", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
|
||
14 years ago
|
{
|
||
13 years ago
|
<div class="settingsContainer">
|
||
14 years ago
|
@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" })
|
||
13 years ago
|
</div>
|
||
13 years ago
|
<div id ="examples">
|
||
13 years ago
|
<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>
|
||
14 years ago
|
</div>
|
||
14 years ago
|
|
||
13 years ago
|
<button type="submit" id="save_button" disabled="disabled">Save</button>
|
||
14 years ago
|
}
|
||
14 years ago
|
</div>
|
||
13 years ago
|
|
||
14 years ago
|
}
|
||
14 years ago
|
@section Scripts{
|
||
13 years ago
|
<script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script>
|
||
14 years ago
|
|
||
14 years ago
|
<script type="text/javascript">
|
||
13 years ago
|
$(document).ready(function () {
|
||
|
createExamples();
|
||
|
});
|
||
|
|
||
14 years ago
|
$('#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();
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
function createSingleEpisodeExample() {
|
||
|
var result = '';
|
||
14 years ago
|
|
||
14 years ago
|
var separator = ' - ';
|
||
14 years ago
|
|
||
14 years ago
|
if ($("#SeparatorStyle option:selected").val() == 1)
|
||
|
separator = ' ';
|
||
14 years ago
|
|
||
14 years ago
|
if ($('#SeriesName').attr('checked')) {
|
||
|
result += 'Series Name';
|
||
|
result += separator;
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
result += $("#NumberStyle option:selected").text();
|
||
14 years ago
|
|
||
14 years ago
|
if ($('#EpisodeName').attr('checked')) {
|
||
|
result += separator;
|
||
|
result += 'Episode Name';
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
if ($('#AppendQuality').attr('checked'))
|
||
|
result += ' [TV]';
|
||
14 years ago
|
|
||
14 years ago
|
if ($('#ReplaceSpaces').attr('checked'))
|
||
|
result = result.replace(/\s/g, '.');
|
||
14 years ago
|
|
||
13 years ago
|
//result = '<b>Single Episode Example: </b>' + result;
|
||
14 years ago
|
|
||
13 years ago
|
$('#singleEpisodeExample').children('.result').text(result);
|
||
14 years ago
|
}
|
||
|
|
||
14 years ago
|
function createMultiEpisodeExample() {
|
||
|
var result = '';
|
||
14 years ago
|
|
||
14 years ago
|
var separator = ' - ';
|
||
14 years ago
|
|
||
14 years ago
|
if ($("#SeparatorStyle option:selected").val() == 1)
|
||
|
separator = ' ';
|
||
14 years ago
|
|
||
14 years ago
|
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');
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
if (style == 2) {
|
||
|
if (numberId <= 1)
|
||
|
result += 'x06';
|
||
14 years ago
|
|
||
14 years ago
|
if (numberId == 2)
|
||
|
result += 'E06';
|
||
14 years ago
|
|
||
14 years ago
|
if (numberId == 3)
|
||
|
result += 'e06';
|
||
|
}
|
||
14 years ago
|
|
||
14 years ago
|
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, '.');
|
||
|
|
||
13 years ago
|
//result = '<b>Multi-Episode Example: </b>' + result;
|
||
14 years ago
|
|
||
13 years ago
|
$('#multiEpisodeExample').children('.result').text(result);
|
||
14 years ago
|
}
|
||
|
</script>
|
||
|
}
|