2011-09-04 06:05:44 +03:00
|
|
|
@using NzbDrone.Core.Model
|
2011-12-10 08:05:17 +03:00
|
|
|
@{ViewBag.Title = "Misnamed";};
|
2011-09-04 06:05:44 +03:00
|
|
|
@section ActionMenu{
|
|
|
|
<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-09-04 06:05:44 +03:00
|
|
|
</ul>
|
|
|
|
}
|
|
|
|
<style>
|
|
|
|
.searchImage
|
|
|
|
{
|
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
padding: 1px;
|
|
|
|
margin: 2px;
|
|
|
|
@*border-width: 1px;
|
|
|
|
border-style: dashed;
|
|
|
|
border-color: lightgray;*@
|
|
|
|
}
|
|
|
|
|
|
|
|
.searchImage:hover
|
|
|
|
{
|
|
|
|
background-color: #065EFE;
|
|
|
|
}
|
|
|
|
</style>
|
2011-12-01 08:25:01 +03:00
|
|
|
<div class="grid-container">
|
|
|
|
@{Html.Telerik().Grid<MisnamedEpisodeModel>().Name("misnamed")
|
2011-09-04 06:05:44 +03:00
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(c => c.SeriesTitle)
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
|
|
|
"><#= SeriesTitle #></a>")
|
|
|
|
.Title("Series Title");
|
|
|
|
columns.Bound(c => c.CurrentName).Title("Current Name");
|
|
|
|
columns.Bound(c => c.ProperName).Title("Proper Name");
|
|
|
|
columns.Bound(c => c.EpisodeFileId)
|
|
|
|
.Title("Actions")
|
|
|
|
.Width("40");
|
|
|
|
})
|
|
|
|
.DataBinding(data => data.Ajax().Select("_AjaxBinding", "Misnamed"))
|
|
|
|
.Pageable(
|
|
|
|
c =>
|
|
|
|
c.PageSize(20).Position(GridPagerPosition.Bottom).Style(GridPagerStyles.NextPrevious))
|
|
|
|
.EnableCustomBinding(true)
|
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
{
|
|
|
|
clientEvents.OnDataBound("grid_dataBound");
|
|
|
|
})
|
|
|
|
.Render();}
|
2011-12-01 08:25:01 +03:00
|
|
|
</div>
|
2011-09-04 06:05:44 +03:00
|
|
|
<script type="text/javascript">
|
|
|
|
deleteHistoryRowUrl = '../History/Delete';
|
|
|
|
redownloadUrl = '../History/Redownload';
|
|
|
|
|
|
|
|
function reloadHistoryGrid() {
|
|
|
|
var grid = $('#history').data('tGrid');
|
|
|
|
grid.rebind();
|
|
|
|
grid.sort("Date-desc");
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteHistoryRow(historyId) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: deleteHistoryRowUrl,
|
|
|
|
data: jQuery.param({ historyId: historyId }),
|
|
|
|
success: function () {
|
|
|
|
reloadHistoryGrid();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function redownload(historyId, episodeId) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: redownloadUrl,
|
|
|
|
data: jQuery.param({ historyId: historyId, episodeId: episodeId }),
|
|
|
|
success: function () {
|
|
|
|
reloadHistoryGrid();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function grid_dataBound(e) {
|
|
|
|
var id = $(this).attr('id');
|
|
|
|
var lastButton = $('#' + id + ' .t-arrow-last');
|
|
|
|
lastButton.hide();
|
|
|
|
}
|
2011-12-01 08:25:01 +03:00
|
|
|
</script>
|