sonarr-repo-only/NzbDrone.Web/Views/Missing/Index.cshtml

69 lines
3.4 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 00:48:20 +00:00
@{ViewBag.Title = "Missing";}
2012-03-02 05:02:42 +00:00
@section ActionMenu{
<ul class="sub-menu">
2012-03-13 21:04:42 +00: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 00:48:20 +00: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)
)
<script type="text/javascript">
function seriesTitle (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"];
}
function airDate (source, type, val) {
// 'display' and 'filter' use our fancy naming
if (type === 'display' || type === 'filter') {
return source["AirDateString"];
}
// 'sort' and 'type' both just use the raw data
return source["AirDate"];
}
function actions (row) {
var link = '@Ajax.ImageActionLink("../../Content/Images/Search.png", new { title = "Search for Episode", alt = "Search", @class = "gridAction" }, "Search", "Episode", new { episodeId = "REPLACE" }, null, null)';
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 00:48:20 +00:00
</script>
}