2012-02-23 23:31:50 +01:00
@using NzbDrone.Web.Helpers
@model IEnumerable<NzbDrone.Core.Repository.Series>
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-02-27 05:47:49 +01:00
@using (Html.BeginForm("SaveEditor", "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>
<th class="checkboxColumn">Monitored</th>
<th class="checkboxColumn">Season Folder</th>
<th width="100px">Backlog Status</th>
<th width="310px">Path</th>
</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>
@Html.DropDownList("masterMonitored", (SelectList)ViewData["BoolSelectList"], new { @class = "footer-control masterSelector master-monitored", disabled = true })
</th>
<th>
@Html.DropDownList("masterSeasonFolder", (SelectList)ViewData["BoolSelectList"], new { @class = "footer-control masterSelector master-season-folder", disabled = true })
</th>
<th>
@Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "footer-control masterSelector master-backlog-setting", disabled = true })
</th>
<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>
</th>
</tr>
</tfoot>
2012-02-23 23:31:50 +01:00
</table>
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,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
2012-09-15 05:24:34 +02:00
new FixedHeader(oTable, { "top": true, "left": false, "right": false, "bottom": true });
$('.editToggle').enableCheckboxRangeSelection();
//$('.master-quality option[value=-10]').text('Quality...');
//$('.master-monitored option[value=-10]').text('Monitored...');
//$('.master-season-folder option[value=-10]').text('Season Folder...');
//$('.master-backlog-setting option[value=-10]').text('Backlog Setting...');
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);
});
});
$(document).on('click', '#series-editor-save', function () {
$('#SeriesEditor').submit();
});
2012-02-23 23:31:50 +01:00
</script>
}