2011-12-10 08:05:17 +03:00
|
|
|
@model List<HistoryModel>
|
2012-01-30 04:38:44 +03:00
|
|
|
@using NzbDrone.Common
|
2011-04-21 07:20:39 +03:00
|
|
|
@using NzbDrone.Web.Models
|
2011-12-09 07:57:23 +03:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-12-10 08:05:17 +03:00
|
|
|
@{ViewBag.Title = "History";}
|
2011-04-21 07:20:39 +03:00
|
|
|
@section ActionMenu{
|
2011-08-22 05:56:04 +03:00
|
|
|
<ul class="sub-menu">
|
2011-12-01 08:25:01 +03: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 05:04:35 +03:00
|
|
|
</ul>
|
2011-04-21 07:20:39 +03:00
|
|
|
}
|
2011-12-09 07:57:23 +03:00
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
@Html.IncludeCss("Grid.css")
|
|
|
|
}
|
2011-12-01 08:25:01 +03: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);
|
|
|
|
columns.Bound(c => c.SeriesTitle)
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
|
|
|
"><#= SeriesTitle #></a>")
|
|
|
|
.Title("Series Title");
|
2011-12-08 09:28:52 +03:00
|
|
|
columns.Bound(c => c.SeasonNumber).Title("Season #").Width(50);
|
|
|
|
columns.Bound(c => c.EpisodeNumber).Title("Episode #").Width(50);
|
2011-12-01 08:25:01 +03:00
|
|
|
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");
|
|
|
|
columns.Bound(c => c.HistoryId)
|
|
|
|
.Title("Actions")
|
2011-12-15 11:47:32 +03:00
|
|
|
.ClientTemplate(Ajax.ImageActionLink("../../Content/Images/X.png", new { Alt = "Delete", Title = "Delete from history", @class = "searchImage" }, "Delete", "History", new { HistoryId = "<#= HistoryId #>" }, new AjaxOptions { OnSuccess = "reloadHistoryGrid" }, null).ToString() +
|
|
|
|
Ajax.ImageActionLink("../../Content/Images/Downloading.png", new { Alt = "Redownload", Title = "Redownlod Episode", @class = "searchImage" }, "Redownload", "History", new { HistoryId = "<#= HistoryId #>", EpisodeId = "<#= EpisodeId #>" }, new AjaxOptions { OnSuccess = "reloadHistoryGrid" }, null).ToString())
|
2011-12-01 08:25:01 +03:00
|
|
|
.Width("40");
|
|
|
|
})
|
|
|
|
.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))
|
2012-01-30 04:38:44 +03:00
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
{
|
|
|
|
if (EnviromentProvider.IsProduction)
|
|
|
|
clientEvents.OnError("grid_onError");
|
|
|
|
})
|
2011-12-01 08:25:01 +03:00
|
|
|
.Render();}
|
|
|
|
</div>
|
2011-08-06 05:04:35 +03:00
|
|
|
<script type="text/javascript">
|
2011-08-27 03:59:51 +03:00
|
|
|
deleteHistoryRowUrl = '../History/Delete';
|
|
|
|
redownloadUrl = '../History/Redownload';
|
2011-08-06 05:04:35 +03:00
|
|
|
|
2011-08-22 04:00:12 +03:00
|
|
|
function reloadHistoryGrid() {
|
2011-08-27 03:59:51 +03:00
|
|
|
var grid = $('#history').data('tGrid');
|
2011-11-10 19:22:52 +03:00
|
|
|
grid.ajaxRequest();
|
2011-08-27 03:59:51 +03:00
|
|
|
}
|
2011-12-01 08:25:01 +03:00
|
|
|
</script>
|