|
|
@ -11,38 +11,43 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@section MainContent{
|
|
|
|
@section MainContent{
|
|
|
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
|
|
|
<div class="grid-container">
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
|
|
|
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
|
|
|
.TableHtmlAttributes(new { @class = "Grid" })
|
|
|
|
.DataBinding(data => data.Ajax()
|
|
|
|
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
|
|
|
.Select("_AjaxSeriesGrid", "Series")
|
|
|
|
.DataBinding(data => data.Ajax()
|
|
|
|
.Update("_SaveAjaxSeriesEditing", "Series")
|
|
|
|
.Select("_AjaxSeriesGrid", "Series")
|
|
|
|
.Delete("_DeleteAjaxSeriesEditing", "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);
|
|
|
|
|
|
|
|
|
|
|
|
.Columns(columns =>
|
|
|
|
})
|
|
|
|
{
|
|
|
|
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
|
|
|
columns.Bound(o => o.Title)
|
|
|
|
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
|
|
|
|
.ClientTemplate("<a href=" +
|
|
|
|
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
|
|
|
|
Url.Action("Details", "Series", new {seriesId = "<#= SeriesId #>"}) +
|
|
|
|
.ClientEvents(clientEvents => { clientEvents.OnEdit("grid_edit");
|
|
|
|
"><#= Title #></a>");
|
|
|
|
clientEvents.OnDataBinding("grid_bind");
|
|
|
|
columns.Bound(o => o.SeasonsCount).Title("Seasons")
|
|
|
|
clientEvents.OnDataBound("grid_bound");
|
|
|
|
.ClientTemplate("<a href=# onclick=\"openSeasonEditor(<#= SeriesId #>, \'<#= Title #>\'); return false;\"><#= SeasonsCount #></a>");
|
|
|
|
})
|
|
|
|
columns.Bound(o => o.QualityProfileName).Title("Quality");
|
|
|
|
.Render();}
|
|
|
|
columns.Bound(o => o.Status);
|
|
|
|
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
|
|
|
|
columns.Bound(o => o.AirsDayOfWeek);
|
|
|
|
</div>
|
|
|
|
columns.Bound(o => o.Path);
|
|
|
|
|
|
|
|
columns.Command(commands =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
commands.Edit().ButtonType(GridButtonType.Image);
|
|
|
|
|
|
|
|
commands.Delete().ButtonType(GridButtonType.Image);
|
|
|
|
|
|
|
|
}).Title("Actions").Width(80);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.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"))
|
|
|
|
|
|
|
|
.Render();}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
@ -55,6 +60,14 @@
|
|
|
|
.center();
|
|
|
|
.center();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function grid_bind(args) {
|
|
|
|
|
|
|
|
$('.grid-container').children('.grid-loader').stop().css("top", "0px").fadeIn('slow');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function grid_bound(args) {
|
|
|
|
|
|
|
|
$('.grid-container').children('.grid-loader').stop().fadeOut('slow');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openSeasonEditor(seriesId, seriesName) {
|
|
|
|
function openSeasonEditor(seriesId, seriesName) {
|
|
|
|
windowElement = null;
|
|
|
|
windowElement = null;
|
|
|
|
windowElement = $.telerik.window.create({
|
|
|
|
windowElement = $.telerik.window.create({
|
|
|
|