1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/NzbDrone.Web/Views/Series/Index.cshtml
Mark McDowall c5ea0dee17 Removed Edit page and Delete (w/o AJAX) from Series Controller.
Series grid now shows seasons count without counting season 0 (specials).
2011-05-11 22:21:48 -07:00

54 lines
2.3 KiB
Plaintext

@using NzbDrone.Core.Repository;
@using NzbDrone.Web.Models;
@model IEnumerable<NzbDrone.Core.Repository.Series>
@section TitleContent{
Series
}
@section ActionMenu{
@{Html.RenderPartial("SubMenu");}
}
@section MainContent{
@{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");
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);
})
.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">
function grid_edit(args) {
$(args.form)
.closest(".t-window")
.data("tWindow")
.center();
}
</script>