1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-23 02:05:27 +02:00
Sonarr/NzbDrone.Web/Views/Missing/Index.cshtml

70 lines
3.5 KiB
Plaintext
Raw Normal View History

@model IEnumerable<NzbDrone.Web.Models.MissingEpisodeModel>
@using DataTables.Mvc.Core
@using NzbDrone.Web.Helpers
@using SortDirection = DataTables.Mvc.Core.Enum.SortDirection
2012-02-11 03:48:20 +03:00
@{ViewBag.Title = "Missing";}
2012-03-02 08:02:42 +03:00
@section ActionMenu{
<ul class="sub-menu">
2012-03-14 00:04:42 +03: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>
<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>
</ul>
}
@Html.GridHtml("missingGrid", "dataTablesGrid")
2012-02-11 03:48:20 +03:00
@section Scripts
{
@( 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)
.Language(new Language().EmptyTable("No missing episodes found").ZeroRecords("No missing episodes match the filter"))
)
<script type="text/javascript">
function seriesTitle (source, type, val) {
// 'display' and 'filter' use our fancy naming
if (type === 'display' || type === 'filter') {
2012-10-22 10:05:27 +03:00
return "<a href='/series/details/" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
}
// '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') {
return source["AirDate"];
}
// 'sort' and 'type' both just use the raw data
return source["AirDateSorter"];
}
2012-10-11 05:59:35 +03:00
function actions(row) {
var link = '@Ajax.IconActionLink("icon-search gridAction", "", "Search", "Episode", new { EpisodeId = "REPLACE" }, null, new { title = "Search for episode" })';
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 03:48:20 +03:00
</script>
}