@model Telerik.Web.Mvc.GridModel<RecurringPaymentModel>
@using Telerik.Web.Mvc.UI

@{
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;
}
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Administration/Content/images/ico-sales.png")" alt="" />
        @T("Admin.RecurringPayments")
    </div>
    <div class="options">
        
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid<RecurringPaymentModel>(Model.Data)
                    .Name("recurringpayments-grid")
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.CycleLength)
                            .Width(50);
                        columns.Bound(x => x.CyclePeriodStr)
                            .Width(100)
                            .Centered();
                        columns.Bound(x => x.IsActive)
                            .Width(100)
                            .Template(x => x.IsActive.ToString().ToLower())
                            .Centered();
                        columns.Bound(x => x.StartDate)
                            .Width(100)
                            .Centered();
                        columns.Bound(x => x.NextPaymentDate)
                            .Width(100);
                        columns.Bound(x => x.TotalCycles)
                            .Width(50);
                        columns.Bound(x => x.CyclesRemaining)
                            .Width(50);
                        columns.Bound(x => x.Id)
                            .Width(50)
                            .Centered()
                            .Template(x => Html.ActionLink(T("Admin.Common.Edit").Text, "Edit", new { id = x.Id }))
                            .ClientTemplate("<a href=\"Edit/<#= Id #>\">" + T("Admin.Common.Edit").Text + "</a>")
                            .Title(T("Admin.Common.Edit").Text);
                    })
                    .Pageable(settings => settings.Total(Model.Total).PageSize(gridPageSize).Position(GridPagerPosition.Both))
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("List", "RecurringPayment"))
                    .EnableCustomBinding(true))
        </td>
    </tr>
</table>