2012-04-23 09:31:11 +03:00
@using DataTables.Mvc.Core
@using DataTables.Mvc.Core.Enum
@model NzbDrone.Web.Models.SearchDetailsModel
@{
ViewBag.Title = "Search Details";
}
<h2>@Model.DisplayName</h2>
@Html.GridHtml("searchDetailsGrid")
@section Scripts
{
2012-04-23 10:38:42 +03:00
@(Html.GridScriptFor(m => m.SearchHistoryItems, "#searchDetailsGrid")
2012-04-23 09:31:11 +03:00
.PageLength(20)
.ChangePageLength(false)
.AddColumn(new Column().Image("/Content/Images/Indexers/{Indexer}.png", new { alt = "{Indexer}", title = "{Indexer}" }, "{Indexer}").Sortable(false).Title("").Width("20px"))
.AddColumn(new Column().DataProperty("ReportTitle").Title("Report Title"))
2012-10-19 18:07:28 +03:00
.AddColumn(new Column().DataProperty("Success").Title("Successful").Width("100px"))
//.AddColumn(new Column().Image("/Content/Images/{Success}.png", new { alt = "{Success}", title = "{Success}", @class = "gridImage" }, "{Success}").Title("Successful").Width("100px"))
2012-04-23 09:31:11 +03:00
.AddColumn(new Column().DisplayAndSort("Quality", "QualityInt").Title("Quality").Width("80px"))
.AddColumn(new Column().DataProperty("SearchError").Title("Error"))
2012-04-23 21:20:32 +03:00
.AddColumn(new Column().DataProperty("return actionColumn(source, type, val);", true).Sortable(false).Searchable(false))
2012-07-06 04:01:25 +03:00
.AddColumn(new Column().DataProperty("Details").Sortable(false).Visible(false).RenderFunction("return details(row);"))
2012-09-26 18:51:02 +03:00
.AddSorting(3, DataTables.Mvc.Core.Enum.SortDirection.Desc)
.Language(new Language().EmptyTable("This seach yielded no results").ZeroRecords("No results match the filter")))
2012-04-23 09:31:11 +03:00
<script type="text/javascript">
2012-07-06 04:01:25 +03:00
function details(row) {
2012-04-23 09:31:11 +03:00
var result = "<a href=\"" + row.aData["NzbInfoUrl"] + "\">Nzb Info</a><br/>" +
"<b>Proper: </b>" + row.aData["Proper"] + " <br/>" +
"<b>Age: </b>" + row.aData["Age"] + " days<br/>" +
"<b>Size: </b>" + row.aData["Size"] + " <br/>" +
"<b>Language: </b>" + row.aData["Language"] + " <br/>";
return result;
}
function actionColumn(source, type, val) {
if (type === 'display' || type === 'filter') {
2012-10-19 18:07:28 +03:00
return '<a href="/SearchHistory/ForceDownload/' + source["Id"] + '" data-ajax="true" data-ajax-confirm="Are you sure?"><i class="icon-plus gridAction"></i></a>';
2012-04-23 09:31:11 +03:00
}
// 'sort' and 'type' both just use the raw data
return '';
}
</script>
}