2012-05-10 18:53:37 +02:00
@model IEnumerable<NzbDrone.Web.Models.MissingEpisodeModel>
@using DataTables.Mvc.Core
2011-12-09 05:57:23 +01:00
@using NzbDrone.Web.Helpers
2012-05-10 18:53:37 +02:00
@using SortDirection = DataTables.Mvc.Core.Enum.SortDirection
2012-02-11 01:48:20 +01:00
@{ViewBag.Title = "Missing";}
2012-03-02 06:02:42 +01:00
2011-10-22 01:33:54 +02:00
@section ActionMenu{
<ul class="sub-menu">
2012-03-13 22:04:42 +01:00
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null, new { Title = "Check for newly released downloads" })</li>
<li>@Ajax.ActionLink("Start Backlog Search", "BacklogSearch", "Command",null, null, new { title = "Search and download all missing episodes"})</li>
<li>@Ajax.ActionLink("Start Recent Backlog Search", "RecentBacklogSearch", "Command", null, null, new { title = "Search and download missing episodes that aired in the last 30 days" })</li>
2012-07-08 01:33:37 +02:00
<li>@Ajax.ActionLink("Force Past Week Backlog Search", "PastWeekBacklogSearch", "Command", null, null, new { title = "Search and download missing episodes that aired in the last 7 days (Ignores backlog search settings)" })</li>
2011-10-22 01:33:54 +02:00
</ul>
}
2012-05-10 18:53:37 +02:00
@Html.GridHtml("missingGrid", "dataTablesGrid")
2012-02-11 01:48:20 +01:00
@section Scripts
{
2012-05-10 18:53:37 +02:00
@( Html.GridScriptForModel("#missingGrid")
.Paginate(true)
.PageLength(20)
.ChangePageLength(false)
.Filter(true)
.Sort(true)
.PaginationType("four_button")
.AddColumn(new Column().DataProperty("return seriesTitle(source, type, val);", true).Title("Series Title"))
.AddColumn(new Column().DataProperty("EpisodeNumbering").Width("80px").Sortable(false).Title("Episode"))
.AddColumn(new Column().DataProperty("EpisodeTitle").Sortable(false).Title("Episode Title"))
.AddColumn(new Column().DataProperty("return airDate(source, type, val);", true).Width("150px").Title("Air Date"))
.AddColumn(new Column().DataProperty("EpisodeId").Width("40px").Sortable(false).RenderFunction("return actions(row);"))
.AddColumn(new Column().DataProperty("Details").Sortable(false).Visible(false).RenderFunction("return details(row);"))
.AddSorting(3, SortDirection.Desc)
2012-09-26 17:51:02 +02:00
.Language(new Language().EmptyTable("No missing episodes found").ZeroRecords("No missing episodes match the filter"))
2012-05-10 18:53:37 +02:00
)
2012-02-09 02:05:16 +01:00
2012-05-10 18:53:37 +02:00
<script type="text/javascript">
function seriesTitle (source, type, val) {
// 'display' and 'filter' use our fancy naming
if (type === 'display' || type === 'filter') {
2012-10-22 09:05:27 +02:00
return "<a href='/series/details/" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
2012-05-10 18:53:37 +02:00
}
// 'sort' and 'type' both just use the raw data
return source["SeriesTitleSorter"];
}
function airDate (source, type, val) {
// 'display' and 'filter' use our fancy naming
if (type === 'display' || type === 'filter') {
2012-12-06 02:54:09 +01:00
return source["AirDate"];
2012-05-10 18:53:37 +02:00
}
// 'sort' and 'type' both just use the raw data
2012-12-06 02:54:09 +01:00
return source["AirDateSorter"];
2012-05-10 18:53:37 +02:00
}
2012-10-11 04:59:35 +02:00
function actions(row) {
var link = '@Ajax.IconActionLink("icon-search gridAction", "", "Search", "Episode", new { EpisodeId = "REPLACE" }, null, new { title = "Search for episode" })';
2012-05-10 18:53:37 +02:00
link = link.replace("REPLACE", row.aData["EpisodeId"]);
return link;
}
function details (row) {
var result = "<b>Overview: </b>" + row.aData["Overview"] + "<br/>";
return result;
}
2012-02-11 01:48:20 +01:00
</script>
}