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

<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Administration/Content/images/ico-promotions.png")" alt="" />
        @T("Admin.Promotions.Feeds")
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid<PromotionFeedModel>()
                    .Name("feeds-grid")
                    .DataKeys(x =>
                    {
                        x.Add(y => y.SystemName).RouteKey("systemName");
                    })
                    .BindTo(Model.Data)
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.FriendlyName).Width(250).ReadOnly();
                        columns.Template(
                                @<div>
                                    @Html.ActionLink(T("Admin.Promotions.Feeds.Configure").Text, "ConfigureMethod", new { systemName = @item.SystemName })
                                </div>
                            )
                            .ClientTemplate("<a href=\"ConfigureMethod?systemName=<#= SystemName #>\">" + T("Admin.Promotions.Feeds.Configure").Text + "</a>")
                            .Width(100)
                            .Centered()
                            .Title(T("Admin.Promotions.Feeds.Configure").Text);
                        columns.Bound(x => x.SystemName).Width(250).ReadOnly();
                    })
                    .DataBinding(dataBinding =>
                    {
                        dataBinding.Ajax().Select("List", "PromotionFeed");
                    })
                    .EnableCustomBinding(true))
        </td>
    </tr>
</table>
