2012-02-23 23:31:50 +01:00
@using NzbDrone.Web.Helpers
2012-09-19 09:32:34 +02:00
@model IEnumerable<NzbDrone.Web.Models.SeriesModel>
2012-02-27 05:47:49 +01:00
@{ViewBag.Title = "Series Editor";}
2012-02-23 23:31:50 +01:00
@section HeaderContent
{
@Html.IncludeCss("Settings.css")
2012-09-15 05:24:34 +02:00
@Html.IncludeCss("SeriesEditor.css")
2012-02-23 23:31:50 +01:00
}
2012-07-15 06:27:40 +02:00
@section ActionMenu
{
<ul class="sub-menu">
<li>@Ajax.ActionLink("Force Refresh", "ForceRefreshAll", "Command", null, null, new { Title = "Refresh episode and series information and scan for new episodes for all series" })</li>
2012-07-21 06:46:16 +02:00
<li>@Ajax.ActionLink("Rename All Series", "RenameAllSeries", "Episode", null, new AjaxOptions { Confirm = "Are you sure you want to rename all series?" }, new { Title = "Rename all series monitored by NzbDrone" })</li>
2012-07-15 06:27:40 +02:00
</ul>
}
2012-09-19 09:07:19 +02:00
@using (Html.BeginForm("Editor", "Series", FormMethod.Post, new { id = "SeriesEditor", name = "SeriesEditor" }))
2012-02-23 23:31:50 +01:00
{
2012-09-15 05:24:34 +02:00
<table id="seriesEditorGrid" class="dataTable dataTablesGrid no-details">
2012-02-23 23:31:50 +01:00
<thead>
2012-09-15 05:24:34 +02:00
<tr>
<th width="14px">@Html.CheckBox("editToggleMaster", false, new { @class = "editToggleMaster" })</th>
<th>Title</th>
<th width="125px;">Quality</th>
2012-09-19 09:07:19 +02:00
<th width="90px">Monitored</th>
<th width="110px">Season Folder</th>
<th width="110px">Backlog Status</th>
2012-09-20 17:37:40 +02:00
<th width="80px" title="Custom Start Date">Start Date</th>
2012-09-23 07:21:20 +02:00
<th width="300px">Path</th>
<th style="width: 10px"></th>
2012-09-15 05:24:34 +02:00
</tr>
2012-02-23 23:31:50 +01:00
</thead>
<tbody>
@foreach (var series in Model)
{
2012-02-27 05:47:49 +01:00
Html.RenderPartial("EditorItem", series);
2012-02-23 23:31:50 +01:00
}
</tbody>
2012-09-15 05:24:34 +02:00
<tfoot>
<tr>
<th></th>
<th class="editing-count"></th>
<th>
@Html.DropDownList("masterQualitySelector", (SelectList)ViewData["MasterProfileSelectList"], new { @class = "footer-control-quality masterSelector master-quality", disabled = true })
</th>
<th>
2012-09-19 09:07:19 +02:00
@Html.DropDownList("masterMonitored", (SelectList)ViewData["BoolSelectList"], new { @class = "footer-control-boolean masterSelector master-monitored", disabled = true })
2012-09-15 05:24:34 +02:00
</th>
<th>
2012-09-19 09:07:19 +02:00
@Html.DropDownList("masterSeasonFolder", (SelectList)ViewData["BoolSelectList"], new { @class = "footer-control-boolean masterSelector master-season-folder", disabled = true })
2012-09-15 05:24:34 +02:00
</th>
<th>
@Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "footer-control masterSelector master-backlog-setting", disabled = true })
</th>
2012-09-19 09:07:19 +02:00
<th>
2012-09-20 17:37:40 +02:00
@Html.TextBox("masterStartDate", "" , new { type = "date", @class = "footer-control-start-date masterSelector master-start-date jQuery-datepicker", disabled = true })
2012-09-19 09:07:19 +02:00
</th>
2012-09-15 05:24:34 +02:00
<th>
<button id="series-editor-save" type="submit" class="save_button" disabled="disabled" title="Commit the settings from your series above to the database">
Save Changes
</button>
2012-09-23 07:21:20 +02:00
2012-09-15 05:24:34 +02:00
</th>
</tr>
</tfoot>
2012-09-23 07:21:20 +02:00
</table>
@Html.CheckBox("highlightEnded", true)
<label for="highlightEnded">Highlight Ended</label>
2011-05-10 08:32:33 +02:00
}
2012-02-23 23:31:50 +01:00
@section Scripts
{
<script type="text/javascript">
$(document).ready(function() {
$('#seriesEditorGrid').removeClass('hidden-grid');
oTable = $('.dataTablesGrid').dataTable({
"bShowAll": false,
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
2012-09-23 07:21:20 +02:00
"bSort": true,
2012-02-23 23:31:50 +01:00
"bInfo": false,
2012-09-23 07:21:20 +02:00
"bAutoWidth": false,
"aaSorting": [[1, 'asc']],
"aoColumns": [
{ "bSortable": false },
{ "bSortable": true },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": true }
]
2012-02-23 23:31:50 +01:00
});
2012-09-15 05:24:34 +02:00
new FixedHeader(oTable, { "top": true, "left": false, "right": false, "bottom": true });
$('.editToggle').enableCheckboxRangeSelection();
2012-09-23 07:21:20 +02:00
$(document).ready(function () {
var cookieValue = $.cookie("highlightEnded");
if (cookieValue == "true") {
$('#highlightEnded').attr('checked', true);
toggleHighlightEnded(true);
}
else {
$('#highlightEnded').attr('checked', false);
toggleHighlightEnded(false);
}
$('#highlightEnded').button();
});
$('#highlightEnded').on('change', function () {
var checked = $(this).attr('checked');
toggleHighlightEnded(checked);
toggleHighlightEndedCookie(checked);
});
function toggleHighlightEnded(highlight) {
var ended = $('tr[data-status="Ended"]');
ended.each(function () {
if (highlight) {
$(this).addClass('series-ended');
}
else {
$(this).removeClass('series-ended');
}
});
}
function toggleHighlightEndedCookie(highlight) {
if (highlight)
$.cookie("highlightEnded", true, { expires: 365 });
else
$.cookie("highlightEnded", false, { expires: 365 });
}
2012-02-23 23:31:50 +01:00
});
2012-02-27 05:47:49 +01:00
$(document).on('change', '.editToggleMaster', function () {
2012-02-23 23:31:50 +01:00
var toggle = $(this).prop('checked');
$('.editToggle').each(function () {
$(this).prop('checked', toggle);
});
});
2012-02-27 05:47:49 +01:00
$(document).on('change', '.editToggle, .editToggleMaster', function () {
var selectedCount = $('.editToggle:checked');
if (selectedCount.length > 0) {
$('.masterSelector').each(function () {
$(this).attr("disabled", false);
});
2012-09-15 05:24:34 +02:00
$('.editing-count').text(selectedCount.length + ' series have been selected for editing');
2012-02-27 05:47:49 +01:00
if (selectedCount.length === 1) {
2012-09-15 05:24:34 +02:00
$('.editing-count').text(selectedCount.length + ' series has been selected for editing');
2012-02-27 05:47:49 +01:00
}
}
else {
$('.masterSelector').each(function () {
$(this).attr("disabled", true);
2012-09-15 05:24:34 +02:00
$('.editing-count').text('');
2012-02-27 05:47:49 +01:00
});
}
});
2012-09-15 05:24:34 +02:00
$(document).on('change', '#masterQualitySelector', function () {
var profileId = $(this).val();
if (profileId === -10)
return;
var selected = $('.editToggle:checked');
selected.each(function () {
$(this).parent('td').parent('.seriesEditRow').find('.quality').val(profileId);
});
});
$(document).on('change', '#masterMonitored', function () {
var monitored = $(this).val();
2012-02-27 05:47:49 +01:00
2012-09-15 05:24:34 +02:00
if (monitored === -10)
return;
var monitoredBool = true;
if (monitored != 1)
monitoredBool = false;
2012-02-23 23:31:50 +01:00
var selected = $('.editToggle:checked');
2012-09-15 05:24:34 +02:00
selected.each(function () {
$(this).parent('td').parent('.seriesEditRow').find('.monitored').prop('checked', monitoredBool);
});
});
$(document).on('change', '#masterSeasonFolder', function () {
var seasonFolder = $(this).val();
2012-02-23 23:31:50 +01:00
2012-09-15 05:24:34 +02:00
if (seasonFolder === -10)
return;
2012-02-23 23:31:50 +01:00
2012-09-15 05:24:34 +02:00
var seasonFolderBool = true;
if (seasonFolder != 1)
seasonFolderBool = false;
2012-02-23 23:31:50 +01:00
2012-09-15 05:24:34 +02:00
var selected = $('.editToggle:checked');
2012-02-23 23:31:50 +01:00
2012-09-15 05:24:34 +02:00
selected.each(function () {
$(this).parent('td').parent('.seriesEditRow').find('.seasonFolder').prop('checked', seasonFolderBool);
2012-02-23 23:31:50 +01:00
});
});
2012-09-15 05:24:34 +02:00
$(document).on('change', '#masterBacklogSetting', function () {
var backlogStatus = $(this).val();
if (backlogStatus === -10)
return;
var selected = $('.editToggle:checked');
selected.each(function () {
$(this).parent('td').parent('.seriesEditRow').find('.backlogSetting').val(backlogStatus);
});
});
2012-09-20 17:37:40 +02:00
$(document).on('change', '#masterStartDate', function () {
var startDate = $(this).val();
2012-09-19 09:07:19 +02:00
var selected = $('.editToggle:checked');
selected.each(function () {
2012-09-20 17:37:40 +02:00
$(this).parent('td').parent('.seriesEditRow').find('.start-date').val(startDate);
2012-09-19 09:07:19 +02:00
});
});
2012-09-15 05:24:34 +02:00
$(document).on('click', '#series-editor-save', function () {
$('#SeriesEditor').submit();
});
2012-02-23 23:31:50 +01:00
</script>
}