Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Admin panel - minor improvements

KrzysztofPajake6816b7942a0
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabActivityLog.cshtml
index 001a63063..57881cb7b 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabActivityLog.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabActivityLog.cshtml
@@ -68,3 +68,9 @@
});
</script>
}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabDocuments.cshtml
index 0fada6770..5eabfeb13 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabDocuments.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Brand/_CreateOrUpdate.TabDocuments.cshtml
@@ -1,71 +1,81 @@
@model BrandModel
@inject AdminAreaSettings adminAreaSettings
-<div class="panel panel-default">
- <vc:admin-widget widget-zone="brand_details_documents_top" additional-data="Model" />
- <div class="panel-body">
- <div id="brand-documents-grid"></div>
- </div>
- <div class="panel-footer">
- <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Brand, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+@if (!String.IsNullOrEmpty(Model.Id))
+{
+
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="brand_details_documents_top" additional-data="Model" />
+ <div class="panel-body">
+ <div id="brand-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Brand, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="brand_details_documents_bottom" additional-data="Model" />
</div>
- <vc:admin-widget widget-zone="brand_details_documents_bottom" additional-data="Model" />
-</div>
-<script>
-$(document).ready(function () {
- $("#brand-documents-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Brand, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
+ <script>
+ $(document).ready(function () {
+ $("#brand-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Brand, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
+ 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
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
- },
- 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
- },
- autoBind: false,
- pageable: {
- refresh: true,
- pageSizes: [@(adminAreaSettings.GridPageSizes)]
- },
- editable: {
- confirmation: true,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Number",
- title: "@Loc["Admin.Documents.Document.Fields.Number"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
- },
- {
- field: "Name",
- title: "@Loc["Admin.Documents.Document.Fields.Name"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
- }, {
- field: "Published",
- title: "@Loc["Admin.Documents.Document.Fields.Published"]",
- width: 100,
- minScreenWidth: 500,
- headerAttributes: { style: "text-align:center" },
- attributes: { style: "text-align:center" },
- template: '# if(Published) {# <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> #} #'
- }]
- });
-});
-</script>
\ No newline at end of file
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <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> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabActivityLog.cshtml
index 18bc48c7d..0520d094c 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabActivityLog.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabActivityLog.cshtml
@@ -1,7 +1,7 @@
@model CategoryModel
@inject AdminAreaSettings adminAreaSettings
@if (!String.IsNullOrEmpty(Model.Id))
-{
+{
<vc:admin-widget widget-zone="category_details_activity_top" additional-data="Model" />
<div class="panel panel-default">
<div class="panel-body">
@@ -67,4 +67,10 @@
});
});
</script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabDocuments.cshtml
index 3c59f7e16..8fc9e622c 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabDocuments.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/_CreateOrUpdate.TabDocuments.cshtml
@@ -1,71 +1,81 @@
@model CategoryModel
@inject AdminAreaSettings adminAreaSettings
-<div class="panel panel-default">
- <vc:admin-widget widget-zone="category_details_documents_top" additional-data="Model" />
- <div class="panel-body">
- <div id="category-documents-grid"></div>
- </div>
- <div class="panel-footer">
- <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Category, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+@if (!String.IsNullOrEmpty(Model.Id))
+{
+
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="category_details_documents_top" additional-data="Model" />
+ <div class="panel-body">
+ <div id="category-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Category, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="category_details_documents_bottom" additional-data="Model" />
</div>
- <vc:admin-widget widget-zone="category_details_documents_bottom" additional-data="Model" />
-</div>
-<script>
-$(document).ready(function () {
- $("#category-documents-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Category, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
+ <script>
+ $(document).ready(function () {
+ $("#category-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Category, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
+ 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
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
- },
- 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
- },
- autoBind: false,
- pageable: {
- refresh: true,
- pageSizes: [@(adminAreaSettings.GridPageSizes)]
- },
- editable: {
- confirmation: true,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Number",
- title: "@Loc["Admin.Documents.Document.Fields.Number"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
- },
- {
- field: "Name",
- title: "@Loc["Admin.Documents.Document.Fields.Name"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
- }, {
- field: "Published",
- title: "@Loc["Admin.Documents.Document.Fields.Published"]",
- width: 100,
- minScreenWidth: 500,
- headerAttributes: { style: "text-align:center" },
- attributes: { style: "text-align:center" },
- template: '# if(Published) {# <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> #} #'
- }]
- });
-});
-</script>
\ No newline at end of file
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <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> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabActivityLog.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabActivityLog.cshtml
index bd32854c8..72445a2bf 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabActivityLog.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabActivityLog.cshtml
@@ -68,3 +68,9 @@
});
</script>
}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabDocuments.cshtml
index 987440b2f..9861b42ce 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabDocuments.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Collection/_CreateOrUpdate.TabDocuments.cshtml
@@ -1,71 +1,81 @@
@model CollectionModel
@inject AdminAreaSettings adminAreaSettings
-<div class="panel panel-default">
- <vc:admin-widget widget-zone="collection_details_documents_top" additional-data="Model" />
- <div class="panel-body">
- <div id="collection-documents-grid"></div>
- </div>
- <div class="panel-footer">
- <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Collection, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+@if (!String.IsNullOrEmpty(Model.Id))
+{
+
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="collection_details_documents_top" additional-data="Model" />
+ <div class="panel-body">
+ <div id="collection-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Collection, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="collection_details_documents_bottom" additional-data="Model" />
</div>
- <vc:admin-widget widget-zone="collection_details_documents_bottom" additional-data="Model" />
-</div>
-<script>
-$(document).ready(function () {
- $("#collection-documents-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Collection, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
+ <script>
+ $(document).ready(function () {
+ $("#collection-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Collection, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
+ 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
},
- schema: {
- data: "Data",
- total: "Total",
- errors: "Errors",
- },
- error: function(e) {
- display_kendoui_grid_error(e);
- // Cancel the changes
- this.cancelChanges();
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
- pageSize: @(adminAreaSettings.DefaultGridPageSize),
- serverPaging: true,
- serverFiltering: true,
- serverSorting: true
- },
- autoBind: false,
- pageable: {
- refresh: true,
- pageSizes: [@(adminAreaSettings.GridPageSizes)]
- },
- editable: {
- confirmation: true,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Number",
- title: "@Loc["Admin.Documents.Document.Fields.Number"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ editable: {
+ confirmation: true,
+ mode: "inline"
},
- {
- field: "Name",
- title: "@Loc["Admin.Documents.Document.Fields.Name"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
- }, {
- field: "Published",
- title: "@Loc["Admin.Documents.Document.Fields.Published"]",
- width: 100,
- minScreenWidth: 500,
- headerAttributes: { style: "text-align:center" },
- attributes: { style: "text-align:center" },
- template: '# if(Published) {# <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> #} #'
- }]
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <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> #} #'
+ }]
+ });
});
-});
-</script>
\ No newline at end of file
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/_CreateOrUpdate.TabDocuments.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/_CreateOrUpdate.TabDocuments.cshtml
index df9996a0e..60da194c4 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/_CreateOrUpdate.TabDocuments.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Vendor/_CreateOrUpdate.TabDocuments.cshtml
@@ -1,71 +1,81 @@
@model VendorModel
@inject AdminAreaSettings adminAreaSettings
-<div class="panel panel-default">
- <vc:admin-widget widget-zone="vendor_details_documents_top" additional-data="Model" />
- <div class="panel-body">
- <div id="vendor-documents-grid"></div>
- </div>
- <div class="panel-footer">
- <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Vendor, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+@if (!String.IsNullOrEmpty(Model.Id))
+{
+
+ <div class="panel panel-default">
+ <vc:admin-widget widget-zone="vendor_details_documents_top" additional-data="Model" />
+ <div class="panel-body">
+ <div id="vendor-documents-grid"></div>
+ </div>
+ <div class="panel-footer">
+ <button type="button" class="k-button" onclick="location.href='@Url.Action("CreateDocument", "Document", new { ObjectId = Model.Id, Reference = (int)Reference.Vendor, area = Constants.AreaAdmin })'"><i class="fa fa-plus"></i>&nbsp;@Loc["Admin.Marketing.Document.Add"]</button>
+ </div>
+ <vc:admin-widget widget-zone="vendor_details_documents_bottom" additional-data="Model" />
</div>
- <vc:admin-widget widget-zone="vendor_details_documents_bottom" additional-data="Model" />
-</div>
-<script>
-$(document).ready(function () {
- $("#vendor-documents-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Vendor, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
+ <script>
+ $(document).ready(function () {
+ $("#vendor-documents-grid").kendoGrid({
+ dataSource: {
+ transport: {
+ read: {
+ url: "@Html.Raw(Url.Action("ListDocuments", "Document", new { reference = (int)Reference.Vendor, ObjectId = Model.Id, area = Constants.AreaAdmin }))",
+ 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
+ },
+ autoBind: false,
+ pageable: {
+ refresh: true,
+ pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
- },
- 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
- },
- autoBind: false,
- pageable: {
- refresh: true,
- pageSizes: [@(adminAreaSettings.GridPageSizes)]
- },
- editable: {
- confirmation: true,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Number",
- title: "@Loc["Admin.Documents.Document.Fields.Number"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
- },
- {
- field: "Name",
- title: "@Loc["Admin.Documents.Document.Fields.Name"]",
- template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
- }, {
- field: "Published",
- title: "@Loc["Admin.Documents.Document.Fields.Published"]",
- width: 100,
- minScreenWidth: 500,
- headerAttributes: { style: "text-align:center" },
- attributes: { style: "text-align:center" },
- template: '# if(Published) {# <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> #} #'
- }]
- });
-});
-</script>
\ No newline at end of file
+ editable: {
+ confirmation: true,
+ mode: "inline"
+ },
+ scrollable: false,
+ columns: [{
+ field: "Number",
+ title: "@Loc["Admin.Documents.Document.Fields.Number"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Number)#</a>',
+ },
+ {
+ field: "Name",
+ title: "@Loc["Admin.Documents.Document.Fields.Name"]",
+ template: '<a class="k-link" href="@Url.Action("EditDocument", "Document", new { area = Constants.AreaAdmin })/#=Id#">#=kendo.htmlEncode(Name)#</a>',
+ }, {
+ field: "Published",
+ title: "@Loc["Admin.Documents.Document.Fields.Published"]",
+ width: 100,
+ minScreenWidth: 500,
+ headerAttributes: { style: "text-align:center" },
+ attributes: { style: "text-align:center" },
+ template: '# if(Published) {# <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> #} #'
+ }]
+ });
+ });
+ </script>
+}
+else
+{
+ <div class="note note-info">
+ @Loc["Admin.Catalog.SaveBeforeEdit"]
+ </div>
+}
\ No newline at end of file
diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
index 1ebea76e2..3680e029e 100644
--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
@@ -3825,6 +3825,9 @@
<Resource Name="Admin.Catalog.ProductTags.Updated">
<Value>The product tag has been updated successfully.</Value>
</Resource>
+ <Resource Name="Admin.Catalog.SaveBeforeEdit">
+ <Value>You need to save the entity before you can edit it.</Value>
+ </Resource>
<Resource Name="admin.catalog.stores.fields.name">
<Value>Store name</Value>
</Resource>