mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
Fix: Series Editor enhancements to make it more straight forward.
Fix: History and Missing Grids now link to Seriesi/Details.
This commit is contained in:
parent
f342b31271
commit
24dae1927f
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
|
using NzbDrone.Core.Helpers;
|
||||||
using NzbDrone.Core.Jobs;
|
using NzbDrone.Core.Jobs;
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
using NzbDrone.Web.Models;
|
using NzbDrone.Web.Models;
|
||||||
@ -33,6 +34,7 @@ public JsonResult AjaxBinding()
|
|||||||
EpisodeTitle = h.Episode.Title,
|
EpisodeTitle = h.Episode.Title,
|
||||||
EpisodeOverview = h.Episode.Overview,
|
EpisodeOverview = h.Episode.Overview,
|
||||||
SeriesTitle = h.SeriesTitle,
|
SeriesTitle = h.SeriesTitle,
|
||||||
|
SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle),
|
||||||
NzbTitle = h.NzbTitle,
|
NzbTitle = h.NzbTitle,
|
||||||
Quality = h.Quality.ToString(),
|
Quality = h.Quality.ToString(),
|
||||||
IsProper = h.IsProper,
|
IsProper = h.IsProper,
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
using NzbDrone.Core;
|
using NzbDrone.Core;
|
||||||
|
using NzbDrone.Core.Helpers;
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
using NzbDrone.Web.Models;
|
using NzbDrone.Web.Models;
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ public ActionResult Index()
|
|||||||
EpisodeTitle = e.Title,
|
EpisodeTitle = e.Title,
|
||||||
Overview = e.Overview,
|
Overview = e.Overview,
|
||||||
SeriesTitle = e.Series.Title,
|
SeriesTitle = e.Series.Title,
|
||||||
|
SeriesTitleSorter = SortHelper.SkipArticles(e.Series.Title),
|
||||||
AirDate = e.AirDate.Value.ToString("MM/dd/yyyy"),
|
AirDate = e.AirDate.Value.ToString("MM/dd/yyyy"),
|
||||||
AirDateString = e.AirDate.Value.ToBestDateString()
|
AirDateString = e.AirDate.Value.ToBestDateString()
|
||||||
});
|
});
|
||||||
|
@ -133,19 +133,19 @@ public ActionResult Details(int seriesId)
|
|||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult SeriesEditor()
|
public ActionResult Editor()
|
||||||
{
|
{
|
||||||
var profiles = _qualityProvider.All();
|
var profiles = _qualityProvider.All();
|
||||||
ViewData["QualityProfiles"] = profiles;
|
ViewData["QualityProfiles"] = profiles;
|
||||||
|
|
||||||
//Create the select lists
|
//Create the select lists
|
||||||
var masterProfiles = profiles.ToList();
|
var masterProfiles = profiles.ToList();
|
||||||
masterProfiles.Insert(0, new QualityProfile {QualityProfileId = -10, Name = "Unchanged"});
|
masterProfiles.Insert(0, new QualityProfile {QualityProfileId = -10, Name = "Select..."});
|
||||||
ViewData["MasterProfileSelectList"] = new SelectList(masterProfiles, "QualityProfileId", "Name");
|
ViewData["MasterProfileSelectList"] = new SelectList(masterProfiles, "QualityProfileId", "Name");
|
||||||
|
|
||||||
ViewData["BoolSelectList"] = new SelectList(new List<KeyValuePair<int, string>>
|
ViewData["BoolSelectList"] = new SelectList(new List<KeyValuePair<int, string>>
|
||||||
{
|
{
|
||||||
new KeyValuePair<int, string>(-10, "Unchanged"),
|
new KeyValuePair<int, string>(-10, "Select..."),
|
||||||
new KeyValuePair<int, string>(1, "True"),
|
new KeyValuePair<int, string>(1, "True"),
|
||||||
new KeyValuePair<int, string>(0, "False")
|
new KeyValuePair<int, string>(0, "False")
|
||||||
}, "Key", "Value"
|
}, "Key", "Value"
|
||||||
@ -161,7 +161,7 @@ public ActionResult SeriesEditor()
|
|||||||
ViewData["BacklogSettingTypes"] = backlogSettingTypes;
|
ViewData["BacklogSettingTypes"] = backlogSettingTypes;
|
||||||
|
|
||||||
var masterBacklogList = backlogSettingTypes.ToList();
|
var masterBacklogList = backlogSettingTypes.ToList();
|
||||||
masterBacklogList.Insert(0, new KeyValuePair<int, string>(-10, "Unchanged"));
|
masterBacklogList.Insert(0, new KeyValuePair<int, string>(-10, "Select..."));
|
||||||
ViewData["MasterBacklogSettingSelectList"] = new SelectList(masterBacklogList, "Key", "Value");
|
ViewData["MasterBacklogSettingSelectList"] = new SelectList(masterBacklogList, "Key", "Value");
|
||||||
|
|
||||||
var series = _seriesProvider.GetAllSeries().OrderBy(o => SortHelper.SkipArticles(o.Title));
|
var series = _seriesProvider.GetAllSeries().OrderBy(o => SortHelper.SkipArticles(o.Title));
|
||||||
@ -170,7 +170,7 @@ public ActionResult SeriesEditor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public JsonResult SaveSeriesEditor(List<Series> series)
|
public JsonResult SaveEditor(List<Series> series)
|
||||||
{
|
{
|
||||||
//Save edits
|
//Save edits
|
||||||
if (series == null || series.Count == 0)
|
if (series == null || series.Count == 0)
|
||||||
|
@ -8,6 +8,7 @@ public class HistoryModel
|
|||||||
public int HistoryId { get; set; }
|
public int HistoryId { get; set; }
|
||||||
public int SeriesId { get; set; }
|
public int SeriesId { get; set; }
|
||||||
public string SeriesTitle { get; set; }
|
public string SeriesTitle { get; set; }
|
||||||
|
public string SeriesTitleSorter { get; set; }
|
||||||
public string EpisodeNumbering { get; set; }
|
public string EpisodeNumbering { get; set; }
|
||||||
public string EpisodeTitle { get; set; }
|
public string EpisodeTitle { get; set; }
|
||||||
public string EpisodeOverview { get; set; }
|
public string EpisodeOverview { get; set; }
|
||||||
|
@ -9,6 +9,7 @@ public class MissingEpisodeModel
|
|||||||
public int SeriesId { get; set; }
|
public int SeriesId { get; set; }
|
||||||
public int EpisodeId { get; set; }
|
public int EpisodeId { get; set; }
|
||||||
public string SeriesTitle { get; set; }
|
public string SeriesTitle { get; set; }
|
||||||
|
public string SeriesTitleSorter { get; set; }
|
||||||
public string EpisodeNumbering { get; set; }
|
public string EpisodeNumbering { get; set; }
|
||||||
public string EpisodeTitle { get; set; }
|
public string EpisodeTitle { get; set; }
|
||||||
public string AirDate { get; set; }
|
public string AirDate { get; set; }
|
||||||
|
@ -479,10 +479,10 @@
|
|||||||
<Content Include="Views\Settings\Misc.cshtml" />
|
<Content Include="Views\Settings\Misc.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Series\SeriesEditor.cshtml" />
|
<Content Include="Views\Series\Editor.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Series\SeriesEditorItem.cshtml" />
|
<Content Include="Views\Series\EditorItem.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Settings\DownloadClient.cshtml" />
|
<Content Include="Views\Settings\DownloadClient.cshtml" />
|
||||||
|
@ -66,7 +66,15 @@
|
|||||||
return "<img src='/Content/Images/Indexers/" + row.aData['Indexer'] + ".png' alt=" + row.aData["Indexer"] + ">";
|
return "<img src='/Content/Images/Indexers/" + row.aData['Indexer'] + ".png' alt=" + row.aData["Indexer"] + ">";
|
||||||
}
|
}
|
||||||
}, //Image
|
}, //Image
|
||||||
{ sWidth: 'auto', "mDataProp": "SeriesTitle" }, //Series Title
|
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
||||||
|
// 'display' and 'filter' use our fancy naming
|
||||||
|
if (type === 'display' || type === 'filter') {
|
||||||
|
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
||||||
|
}
|
||||||
|
// 'sort' and 'type' both just use the raw data
|
||||||
|
return source["SeriesTitleSorter"];
|
||||||
|
}
|
||||||
|
}, //Series Title
|
||||||
{ sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering
|
{ sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering
|
||||||
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
||||||
{ sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality
|
{ sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality
|
||||||
|
@ -68,7 +68,15 @@
|
|||||||
"iDisplayLength": 20,
|
"iDisplayLength": 20,
|
||||||
"sPaginationType": "four_button",
|
"sPaginationType": "four_button",
|
||||||
"aoColumns": [
|
"aoColumns": [
|
||||||
{ sWidth: 'auto', "mDataProp": "SeriesTitle" }, //Series Title
|
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
||||||
|
// 'display' and 'filter' use our fancy naming
|
||||||
|
if (type === 'display' || type === 'filter') {
|
||||||
|
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
||||||
|
}
|
||||||
|
// 'sort' and 'type' both just use the raw data
|
||||||
|
return source["SeriesTitleSorter"];
|
||||||
|
}
|
||||||
|
}, //Series Title
|
||||||
{ sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering
|
{ sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering
|
||||||
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
||||||
{ sWidth: '150px', "mDataProp": function (source, type, val) {
|
{ sWidth: '150px', "mDataProp": function (source, type, val) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
@using NzbDrone.Web.Helpers
|
@using NzbDrone.Web.Helpers
|
||||||
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
||||||
@{ViewBag.Title = "NzbDrone";}
|
@{ViewBag.Title = "Series Editor";}
|
||||||
|
|
||||||
@section HeaderContent
|
@section HeaderContent
|
||||||
{
|
{
|
||||||
@ -33,10 +33,23 @@
|
|||||||
td .backlogSetting {
|
td .backlogSetting {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#stylized, .settingsForm {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#stylized {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#changesOverview {
|
||||||
|
margin-top: 15px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
}
|
}
|
||||||
|
|
||||||
@using (Html.BeginForm("SaveSeriesEditor", "Series", FormMethod.Post, new { id = "SeriesEditor", name = "SeriesEditor" }))
|
@using (Html.BeginForm("SaveEditor", "Series", FormMethod.Post, new { id = "SeriesEditor", name = "SeriesEditor" }))
|
||||||
{
|
{
|
||||||
<table id ="seriesEditorGrid" class="dataTable dataTablesGrid no-details">
|
<table id ="seriesEditorGrid" class="dataTable dataTablesGrid no-details">
|
||||||
<thead>
|
<thead>
|
||||||
@ -52,7 +65,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@foreach (var series in Model)
|
@foreach (var series in Model)
|
||||||
{
|
{
|
||||||
Html.RenderPartial("SeriesEditorItem", series);
|
Html.RenderPartial("EditorItem", series);
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -63,26 +76,27 @@
|
|||||||
<label class="labelClass">Quality Profile
|
<label class="labelClass">Quality Profile
|
||||||
<span class="small">Which Quality Profile should NzbDrone use to download episodes?</span>
|
<span class="small">Which Quality Profile should NzbDrone use to download episodes?</span>
|
||||||
</label>
|
</label>
|
||||||
@Html.DropDownList("masterQualitySelector", (SelectList)ViewData["MasterProfileSelectList"], new { @class = "inputClass" })
|
@Html.DropDownList("masterQualitySelector", (SelectList)ViewData["MasterProfileSelectList"], new { @class = "inputClass masterSelector", disabled = true })
|
||||||
<label class="labelClass">Monitored
|
<label class="labelClass">Monitored
|
||||||
<span class="small">Should NzbDrone download episodes for this series?</span>
|
<span class="small">Should NzbDrone download episodes for this series?</span>
|
||||||
</label>
|
</label>
|
||||||
@Html.DropDownList("masterMonitored", (SelectList)ViewData["BoolSelectList"], new { @class = "inputClass" })
|
@Html.DropDownList("masterMonitored", (SelectList)ViewData["BoolSelectList"], new { @class = "inputClass masterSelector", disabled = true })
|
||||||
<label class="labelClass">Use Season Folder
|
<label class="labelClass">Use Season Folder
|
||||||
<span class="small">Should downloaded episodes be stored in season folders?</span>
|
<span class="small">Should downloaded episodes be stored in season folders?</span>
|
||||||
</label>
|
</label>
|
||||||
@Html.DropDownList("masterSeasonFolder", (SelectList)ViewData["BoolSelectList"], new { @class = "inputClass" })
|
@Html.DropDownList("masterSeasonFolder", (SelectList)ViewData["BoolSelectList"], new { @class = "inputClass masterSelector", disabled = true })
|
||||||
<label class="labelClass">Backlog Status
|
<label class="labelClass">Backlog Status
|
||||||
<span class="small">Should NzbDrone perform backlog searches for this series?</span>
|
<span class="small">Should NzbDrone perform backlog searches for this series?</span>
|
||||||
</label>
|
</label>
|
||||||
@Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "inputClass" })
|
@Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "inputClass masterSelector", disabled = true })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="changesOverview" style="border-color: transparent;">
|
||||||
|
<h1><div id="editingCount"></div></h1>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button id="updateSelected" title="Update the selected series with the settings above">Update Selected</button>
|
|
||||||
|
|
||||||
<button type="submit" class="save_button" disabled="disabled" title="Commit the settings from your series above to the database">
|
<button type="submit" class="save_button" disabled="disabled" title="Commit the settings from your series above to the database">
|
||||||
Save Changes</button>
|
Save Changes</button>
|
||||||
</div>
|
</div>
|
||||||
@ -105,14 +119,37 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.editToggleMaster').live('change', function () {
|
$(document).on('change', '.editToggleMaster', function () {
|
||||||
var toggle = $(this).prop('checked');
|
var toggle = $(this).prop('checked');
|
||||||
$('.editToggle').each(function () {
|
$('.editToggle').each(function () {
|
||||||
$(this).prop('checked', toggle);
|
$(this).prop('checked', toggle);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#updateSelected').live('click', function () {
|
$(document).on('change', '.editToggle, .editToggleMaster', function () {
|
||||||
|
var selectedCount = $('.editToggle:checked');
|
||||||
|
|
||||||
|
if (selectedCount.length > 0) {
|
||||||
|
$('.masterSelector').each(function () {
|
||||||
|
$(this).attr("disabled", false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#editingCount').text(selectedCount.length + ' series have been selected for editing');
|
||||||
|
|
||||||
|
if (selectedCount.length === 1) {
|
||||||
|
$('#editingCount').text(selectedCount.length + ' series has been selected for editing');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
$('.masterSelector').each(function () {
|
||||||
|
$(this).attr("disabled", true);
|
||||||
|
$('#editingCount').text('');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('change', '.masterSelector', function () {
|
||||||
//Find selected values
|
//Find selected values
|
||||||
var profileId = $('#masterQualitySelector').val();
|
var profileId = $('#masterQualitySelector').val();
|
||||||
var monitored = $('#masterMonitored').val();
|
var monitored = $('#masterMonitored').val();
|
||||||
@ -146,10 +183,6 @@
|
|||||||
$(this).parent('td').parent('.seriesEditRow').find('.backlogSetting').val(backlogStatus);
|
$(this).parent('td').parent('.seriesEditRow').find('.backlogSetting').val(backlogStatus);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//Update all checked rows
|
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
@ -76,7 +76,7 @@
|
|||||||
<ul class="sub-menu">
|
<ul class="sub-menu">
|
||||||
<li>@Html.ActionLink("Add Series", "Index", "AddSeries")</li>
|
<li>@Html.ActionLink("Add Series", "Index", "AddSeries")</li>
|
||||||
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
||||||
<li>@Html.ActionLink("Series Editor", "SeriesEditor", "Series")</li>
|
<li>@Html.ActionLink("Series Editor", "Editor", "Series")</li>
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user