ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Common/Roslyn.cshtml
@model bool
@inject AdminAreaSettings adminAreaSettings
@{
    //page title
    ViewBag.Title = T("Admin.System.Roslyn").Text;
}


<div class="row">
    <div class="col-md-12">
        <div class="x_panel light form-fit">
            <div class="x_title level-caption">
                <div class="caption level-caption">
                    <i class="fa fa-sitemap"></i>
                    @T("Admin.System.Roslyn")
                </div>
                <vc:admin-widget widget-zone="roslyn_buttons" additional-data="null" />
            </div>
            @if (!Model)
            {
                <div class="note note-success">
                    @T("Admin.System.Roslyn.Disabled")
                </div>
            }
            <div class="x_content">
                <vc:admin-widget widget-zone="roslyn_top" additional-data="null" />
                <div id="roslyn-grid"></div>
                <vc:admin-widget widget-zone="roslyn_bottom" additional-data="null" />
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $("#roslyn-grid").kendoGrid({
            dataSource: {
                transport: {
                    read: {
                        url: "@Html.Raw(Url.Action("Roslyn", "Common"))",
                        type: "POST",
                        dataType: "json",
                        data: addAntiForgeryToken
                    }
                },
                schema: {
                    data: "Data",
                    total: "Total",
                    errors: "Errors"
                },
                error: function(e) {
                    display_kendoui_grid_error(e);
                    // Cancel the changes
                    this.cancelChanges();
                },
                pageSize: @(adminAreaSettings.DefaultGridPageSize),
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
            pageable: {
                refresh: true,
                pageSizes: [@(adminAreaSettings.GridPageSizes)]
            },
            scrollable: false,
            columns: [{
                field: "FileName",
                title: "@T("Admin.System.Roslyn.FileName")",
                width: 100,
            },{
                field: "IsCompiled",
                title: "@T("Admin.System.Roslyn.IsCompiled")",
                width: 50,
                headerAttributes: { style: "text-align:center" },
                attributes: { style: "text-align:center" },
                template: '# if(IsCompiled) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #'
            }, {
                field: "Errors",
                title: "@T("Admin.System.Roslyn.Errors")",
                width: 500
            }]
        });
    });
</script>
