ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Manufacturer/_CreateOrUpdate.TabActivityLog.cshtml
@model ManufacturerModel
@inject AdminAreaSettings adminAreaSettings
@if (!String.IsNullOrEmpty(Model.Id))
{
    <div class="panel panel-default">
        <vc:admin-widget widget-zone="manufacturer_activity_log_top" additional-data="Model" />
        <div class="panel-body">
            <div id="activitylog-grid"></div>
        </div>
        <vc:admin-widget widget-zone="manufacturer_activity_log_bottom" additional-data="Model" />
    </div>
    <script>
        $(document).ready(function () {
            $("#activitylog-grid").kendoGrid({
                dataSource: {
                    transport: {
                        read: {
                            url: "@Html.Raw(Url.Action("ListActivityLog", "Manufacturer", new { manufacturerId = Model.Id }))",
                            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)]
                },
                editable: {
                    confirmation: false,
                    mode: "inline"
                },
                scrollable: false,
                columns: [{
                    field: "ActivityLogTypeName",
                    title: "@T("Admin.Catalog.Manufacturers.ActivityLog.ActivityLogType")",
                }, {
                    field: "CustomerId",
                    title: "@T("Admin.Catalog.Manufacturers.ActivityLog.Customer")",
                    template: '<a href="@Url.Action("Edit", "Customer")/#=CustomerId#">#:CustomerEmail#</a>',
                    minScreenWidth: 500,
                }, {
                    field: "Comment",
                    title: "@T("Admin.Catalog.Manufacturers.ActivityLog.Comment")",
                    minScreenWidth: 750,
                }, {
                    field: "CreatedOn",
                    title: "@T("Admin.Catalog.Manufacturers.ActivityLog.CreatedOn")",
                    type: "date",
                    format: "{0:G}"
                }]
            });
        });
    </script>
}
