2011-05-10 08:32:33 +02:00
|
|
|
@using NzbDrone.Core.Repository;
|
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
2011-05-19 05:37:26 +02:00
|
|
|
|
2011-04-21 09:14:47 +02:00
|
|
|
@section TitleContent{
|
|
|
|
Series
|
|
|
|
}
|
|
|
|
|
|
|
|
@section ActionMenu{
|
|
|
|
@{Html.RenderPartial("SubMenu");}
|
|
|
|
}
|
|
|
|
|
|
|
|
@section MainContent{
|
2011-05-19 05:37:26 +02:00
|
|
|
<div class="grid-container">
|
|
|
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
|
|
|
.DataBinding(data => data.Ajax()
|
|
|
|
.Select("_AjaxSeriesGrid", "Series")
|
|
|
|
.Update("_SaveAjaxSeriesEditing", "Series")
|
|
|
|
.Delete("_DeleteAjaxSeriesEditing", "Series"))
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(o => o.Title)
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
Url.Action("Details", "Series", new {seriesId = "<#= SeriesId #>"}) +
|
|
|
|
"><#= Title #></a>");
|
|
|
|
columns.Bound(o => o.SeasonsCount).Title("Seasons")
|
|
|
|
.ClientTemplate("<a href=# onclick=\"openSeasonEditor(<#= SeriesId #>, \'<#= Title #>\'); return false;\"><#= SeasonsCount #></a>");
|
|
|
|
columns.Bound(o => o.QualityProfileName).Title("Quality");
|
|
|
|
columns.Bound(o => o.Status);
|
|
|
|
columns.Bound(o => o.AirsDayOfWeek);
|
|
|
|
columns.Bound(o => o.Path);
|
|
|
|
columns.Command(commands =>
|
|
|
|
{
|
|
|
|
commands.Edit().ButtonType(GridButtonType.Image);
|
|
|
|
commands.Delete().ButtonType(GridButtonType.Image);
|
|
|
|
}).Title("Actions").Width(80);
|
2011-05-10 08:32:33 +02:00
|
|
|
|
2011-05-19 05:37:26 +02:00
|
|
|
})
|
|
|
|
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
|
|
|
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
|
|
|
|
.ClientEvents(clientEvents => { clientEvents.OnEdit("grid_edit");
|
|
|
|
clientEvents.OnDataBinding("grid_bind");
|
|
|
|
clientEvents.OnDataBound("grid_bound");
|
|
|
|
})
|
|
|
|
.Render();}
|
|
|
|
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
|
|
|
|
</div>
|
2011-04-21 09:14:47 +02:00
|
|
|
}
|
2011-05-12 04:53:19 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2011-05-16 08:27:02 +02:00
|
|
|
var windowElement;
|
|
|
|
|
2011-05-12 04:53:19 +02:00
|
|
|
function grid_edit(args) {
|
|
|
|
$(args.form)
|
|
|
|
.closest(".t-window")
|
|
|
|
.data("tWindow")
|
|
|
|
.center();
|
|
|
|
}
|
2011-05-16 08:27:02 +02:00
|
|
|
|
|
|
|
function openSeasonEditor(seriesId, seriesName) {
|
|
|
|
windowElement = null;
|
|
|
|
windowElement = $.telerik.window.create({
|
|
|
|
title: "<b>Season Editor: " + seriesName + "</b>",
|
|
|
|
contentUrl: '@Url.Action("SeasonEditor", "Series")' + '/?seriesId=' + seriesId,
|
|
|
|
width: 360,
|
|
|
|
height: 400,
|
|
|
|
modal: true,
|
|
|
|
resizable: false,
|
|
|
|
draggable: true,
|
|
|
|
scrollable: true
|
|
|
|
});
|
|
|
|
|
|
|
|
windowElement.data('tWindow').center();
|
|
|
|
}
|
|
|
|
|
|
|
|
function closeSeasonEditor() {
|
|
|
|
$('#form').remove();
|
|
|
|
var window = windowElement.data("tWindow");
|
|
|
|
window.close();
|
|
|
|
}
|
2011-05-12 04:53:19 +02:00
|
|
|
</script>
|