2011-04-21 06:20:39 +02:00
|
|
|
@model List<NzbDrone.Web.Models.HistoryModel>
|
|
|
|
@using NzbDrone.Web.Models
|
|
|
|
@section TitleContent{
|
2011-04-22 22:48:05 +02:00
|
|
|
History
|
2011-04-21 06:20:39 +02:00
|
|
|
}
|
|
|
|
@section ActionMenu{
|
2011-08-22 04:56:04 +02:00
|
|
|
<ul class="sub-menu">
|
2011-08-22 03:00:12 +02:00
|
|
|
<li>@Ajax.ActionLink("Trim History", "Trim", "History", new AjaxOptions{ OnSuccess = "reloadHistoryGrid" })</li>
|
|
|
|
<li>@Ajax.ActionLink("Purge History", "Purge", "History", new AjaxOptions { OnSuccess = "reloadHistoryGrid"})</li>
|
2011-08-06 04:04:35 +02:00
|
|
|
</ul>
|
2011-04-21 06:20:39 +02:00
|
|
|
}
|
2011-08-27 02:59:51 +02:00
|
|
|
|
2011-09-29 03:58:23 +02:00
|
|
|
<link href="../../Content/Grid.css" rel="stylesheet" type="text/css" />
|
2011-08-27 02:59:51 +02:00
|
|
|
|
2011-04-21 06:20:39 +02:00
|
|
|
@section MainContent{
|
2011-05-20 00:59:30 +02:00
|
|
|
<div class="grid-container">
|
|
|
|
@{Html.Telerik().Grid<HistoryModel>().Name("history")
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(c => c.Indexer)
|
|
|
|
.ClientTemplate("<center><img alt='<#= Indexer #>' src='" + Url.Content("~/Content/Images/Indexers/") + "<#= Indexer #>.png' /></center>")
|
|
|
|
.Title("")
|
|
|
|
.Width(20);
|
2011-08-31 02:15:22 +02:00
|
|
|
columns.Bound(c => c.SeriesTitle)
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
|
|
|
"><#= SeriesTitle #></a>")
|
|
|
|
.Title("Series Title");
|
2011-05-20 00:59:30 +02:00
|
|
|
columns.Bound(c => c.SeasonNumber).Title("Season").Width(1);
|
|
|
|
columns.Bound(c => c.EpisodeNumber).Title("Episode").Width(1);
|
|
|
|
columns.Bound(c => c.EpisodeTitle).Title("Episode Title");
|
|
|
|
columns.Bound(c => c.Quality).Title("Quality").Width(50);
|
|
|
|
columns.Bound(c => c.Date).Title("Grabbed on");
|
2011-08-27 02:59:51 +02:00
|
|
|
columns.Bound(c => c.HistoryId)
|
|
|
|
.Title("Actions")
|
|
|
|
.ClientTemplate("<a href=\"../History/Delete?historyId=<#= HistoryId #>\" onclick=\"deleteHistoryRow(<#= HistoryId #>); return false;\"><img src='../../Content/Images/X.png' alt='Delete' title='Delete from History' class='searchImage' /></a>" +
|
|
|
|
"<a href=\"../History/Redownload?historyId=<#= HistoryId #>&episodeId=<#= EpisodeId #>\" onclick=\"redownload(<#= HistoryId #>, <#= EpisodeId #>); return false;\"><img src='../../Content/Images/Downloading.png' alt='Redownload' title='Redownload Episode' class='searchImage' /></a>")
|
|
|
|
.Width("40");
|
2011-05-20 00:59:30 +02:00
|
|
|
})
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
|
|
|
"<fieldset>" +
|
|
|
|
"<div><b>Overview: </b><#= EpisodeOverview #></div>" +
|
|
|
|
"<div><b>NZB Title: </b><#= NzbTitle #></div>" +
|
|
|
|
"<div><b>Proper: </b><#= IsProper #></div>" +
|
|
|
|
"</fieldset>"
|
|
|
|
))
|
|
|
|
.DataBinding(data => data.Ajax().Select("_AjaxBinding", "History"))
|
|
|
|
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.Date).Descending()).Enabled(true))
|
|
|
|
.Pageable(
|
|
|
|
c =>
|
|
|
|
c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
|
|
|
|
.Render();}
|
|
|
|
</div>
|
2011-04-22 22:48:05 +02:00
|
|
|
}
|
2011-08-06 04:04:35 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2011-08-27 02:59:51 +02:00
|
|
|
deleteHistoryRowUrl = '../History/Delete';
|
|
|
|
redownloadUrl = '../History/Redownload';
|
2011-08-06 04:04:35 +02:00
|
|
|
|
2011-08-22 03:00:12 +02:00
|
|
|
function reloadHistoryGrid() {
|
2011-08-27 02:59:51 +02:00
|
|
|
var grid = $('#history').data('tGrid');
|
|
|
|
grid.rebind();
|
2011-09-03 01:34:39 +02:00
|
|
|
grid.sort("Date-desc");
|
2011-08-27 02:59:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function deleteHistoryRow(historyId) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: deleteHistoryRowUrl,
|
|
|
|
data: jQuery.param({ historyId: historyId }),
|
|
|
|
success: function () {
|
|
|
|
reloadHistoryGrid();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-08-06 04:04:35 +02:00
|
|
|
|
2011-08-27 02:59:51 +02:00
|
|
|
function redownload(historyId, episodeId) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: redownloadUrl,
|
|
|
|
data: jQuery.param({ historyId: historyId, episodeId: episodeId }),
|
|
|
|
success: function () {
|
|
|
|
reloadHistoryGrid();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-08-06 04:04:35 +02:00
|
|
|
</script>
|