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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Migrate CreateOrUpdate.SimilarProducts.cshtml to AdminShared (ARCH-001 Phase 2)
KrzysztofPajak707e9a57c8a4
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml b/src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtmlsimilarity index 79%rename from src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtmlrename to src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtmlindex 79f2ffd1e..c982a474f 100644--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml+++ b/src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml@@ -1,17 +1,20 @@@model ProductModel+@{+ var area = ViewContext.RouteData.Values["area"]?.ToString();+}@if (!string.IsNullOrEmpty(Model.Id)){<div class="panel panel-default"><div class="panel-heading">- @Loc["Admin.Catalog.Products.SimilarProducts"]+ @Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.SimilarProducts"]</div><div class="panel-body"><div id="similarproducts-grid"></div></div><div class="panel-footer">- <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaAdmin })) " class="k-button"><i class="fa fa-plus"></i> @Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]</a>+ <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = area })) " class="k-button"><i class="fa fa-plus"></i> @Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.SimilarProducts.AddNew"]</a><input type="submit" id="btnRefreshSimilarProducts" style="display: none"/></div></div>@@ -35,19 +38,19 @@dataSource: {transport: {read: {- url: "@Html.Raw(Url.Action("SimilarProductList", "Product", new { productId = Model.Id, area = Constants.AreaAdmin }))",+ url: "@Html.Raw(Url.Action("SimilarProductList", "Product", new { productId = Model.Id, area = area }))",type: "POST",dataType: "json",data: addAntiForgeryToken},update: {- url:"@Html.Raw(Url.Action("SimilarProductUpdate", "Product", new { area = Constants.AreaAdmin }))",+ url:"@Html.Raw(Url.Action("SimilarProductUpdate", "Product", new { area = area }))",type: "POST",dataType: "json",data: addAntiForgeryToken},destroy: {- url: "@Html.Raw(Url.Action("SimilarProductDelete", "Product", new { area = Constants.AreaAdmin }))",+ url: "@Html.Raw(Url.Action("SimilarProductDelete", "Product", new { area = area }))",type: "POST",dataType: "json",data: addAntiForgeryToken@@ -94,11 +97,11 @@scrollable: false,columns: [{field: "Product2Name",- title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.Product"]",- template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaAdmin })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.SimilarProducts.Fields.Product"]",+ template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = area })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',}, {field: "DisplayOrder",- title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.DisplayOrder"]",+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.SimilarProducts.Fields.DisplayOrder"]",//integer formatformat: "{0:0}",width: 120,@@ -108,13 +111,13 @@command: [{name: "edit",text: {- edit: "@Loc["Admin.Common.Edit"]",- update: "@Loc["Admin.Common.Update"]",- cancel: "@Loc["Admin.Common.Cancel"]"+ edit: "@Loc[$"{Scope.ResourceKeyPrefix}.Common.Edit"]",+ update: "@Loc[$"{Scope.ResourceKeyPrefix}.Common.Update"]",+ cancel: "@Loc[$"{Scope.ResourceKeyPrefix}.Common.Cancel"]"}}, {name: "destroy",- text: "@Loc["Admin.Common.Delete"]"+ text: "@Loc[$"{Scope.ResourceKeyPrefix}.Common.Delete"]"}]}]});@@ -137,6 +140,6 @@else{<div class="note note-info">- @Loc["Admin.Catalog.Products.SimilarProducts.SaveBeforeEdit"]+ @Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.SimilarProducts.SaveBeforeEdit"]</div>}\ No newline at end of filediff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtmldeleted file mode 100644index 511a2fe09..000000000--- a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml+++ /dev/null@@ -1,142 +0,0 @@-@model ProductModel---@if (!string.IsNullOrEmpty(Model.Id))-{- <div class="panel panel-default">- <div class="panel-heading">- @Loc["Admin.Catalog.Products.SimilarProducts"]- </div>- <div class="panel-body">- <div id="similarproducts-grid"></div>- </div>- <div class="panel-footer">- <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaStore })) " class="k-button"><i class="fa fa-plus"></i> @Loc["Admin.Catalog.Products.SimilarProducts.AddNew"]</a>- <input type="submit" id="btnRefreshSimilarProducts" style="display: none"/>- </div>- </div>-- <script>- $(document).ready(function () {- $('#btnAddNewSimilarProduct').magnificPopup({- type: 'ajax',- settings: { cache: false, async: false },- midClick: true,- callbacks: {- parseAjax: function (mfpResponse) {- mfpResponse.data = $('<div></div>').html(mfpResponse.data);- },- ajaxContentAdded: function () {- $('.mfp-wrap').removeAttr('tabindex');- }- }- });- $("#similarproducts-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("SimilarProductList", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- },- update: {- url:"@Html.Raw(Url.Action("SimilarProductUpdate", "Product", new { area = Constants.AreaStore }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- },- destroy: {- url: "@Html.Raw(Url.Action("SimilarProductDelete", "Product", new { area = Constants.AreaStore }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors",- model: {- id: "Id",- fields: {- Product2Name: { editable: false, type: "string" },- DisplayOrder: {editable: true, type: "number" },- ProductId2: { editable: false, type: "string" }- }- }- },- requestEnd: function(e) {- if(e.type=="update") {- this.read();- }- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- numeric: false,- previousNext: false,- info: false- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "Product2Name",- title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.Product"]",- template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaStore })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',- }, {- field: "DisplayOrder",- title: "@Loc["Admin.Catalog.Products.SimilarProducts.Fields.DisplayOrder"]",- //integer format- format: "{0:0}",- width: 120,- headerAttributes: { style: "text-align:center" },- attributes: { style: "text-align:center" },- }, {- command: [{- name: "edit",- text: {- edit: "@Loc["Admin.Common.Edit"]",- update: "@Loc["Admin.Common.Update"]",- cancel: "@Loc["Admin.Common.Cancel"]"- }- }, {- name: "destroy",- text: "@Loc["Admin.Common.Delete"]"- }]- }]- });- });- </script>-- <script>- $(document).ready(function () {- $('#btnRefreshSimilarProducts').click(function () {- //refresh grid- var grid = $("#similarproducts-grid").data('kendoGrid');- grid.dataSource.read();-- //return false to don't reload a page- return false;- });- });- </script>-}-else-{- <div class="note note-info">- @Loc["Admin.Catalog.Products.SimilarProducts.SaveBeforeEdit"]- </div>-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtmldeleted file mode 100644index c6f1c40a6..000000000--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.SimilarProducts.cshtml+++ /dev/null@@ -1,142 +0,0 @@-@model ProductModel---@if (!string.IsNullOrEmpty(Model.Id))-{- <div class="panel panel-default">- <div class="panel-heading">- @Loc["Vendor.Catalog.Products.SimilarProducts"]- </div>- <div class="panel-body">- <div id="similarproducts-grid"></div>- </div>- <div class="panel-footer">- <a id="btnAddNewSimilarProduct" href="@(Url.Action("SimilarProductAddPopup", "Product", new { productId = Model.Id, btnId = "btnRefreshSimilarProducts", formId = "product-form", area = Constants.AreaVendor })) " class="k-button"><i class="fa fa-plus"></i> @Loc["Vendor.Catalog.Products.SimilarProducts.AddNew"]</a>- <input type="submit" id="btnRefreshSimilarProducts" style="display: none"/>- </div>- </div>-- <script>- $(document).ready(function () {- $('#btnAddNewSimilarProduct').magnificPopup({- type: 'ajax',- settings: { cache: false, async: false },- midClick: true,- callbacks: {- parseAjax: function (mfpResponse) {- mfpResponse.data = $('<div></div>').html(mfpResponse.data);- },- ajaxContentAdded: function () {- $('.mfp-wrap').removeAttr('tabindex');- }- }- });- $("#similarproducts-grid").kendoGrid({- dataSource: {- transport: {- read: {- url: "@Html.Raw(Url.Action("SimilarProductList", "Product", new { productId = Model.Id, area = Constants.AreaVendor }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- },- update: {- url:"@Html.Raw(Url.Action("SimilarProductUpdate", "Product", new { area = Constants.AreaVendor }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- },- destroy: {- url: "@Html.Raw(Url.Action("SimilarProductDelete", "Product", new { area = Constants.AreaVendor }))",- type: "POST",- dataType: "json",- data: addAntiForgeryToken- }- },- schema: {- data: "Data",- total: "Total",- errors: "Errors",- model: {- id: "Id",- fields: {- Product2Name: { editable: false, type: "string" },- DisplayOrder: {editable: true, type: "number" },- ProductId2: { editable: false, type: "string" }- }- }- },- requestEnd: function(e) {- if(e.type=="update") {- this.read();- }- },- error: function(e) {- display_kendoui_grid_error(e);- // Cancel the changes- this.cancelChanges();- },- serverPaging: true,- serverFiltering: true,- serverSorting: true- },- autoBind: false,- pageable: {- refresh: true,- numeric: false,- previousNext: false,- info: false- },- editable: {- confirmation: false,- mode: "inline"- },- scrollable: false,- columns: [{- field: "Product2Name",- title: "@Loc["Vendor.Catalog.Products.SimilarProducts.Fields.Product"]",- template: '<a class="k-link" href="@Url.Action("Edit", "Product", new { id = "", area = Constants.AreaVendor })/#=ProductId2#">#=kendo.htmlEncode(Product2Name)#</a>',- }, {- field: "DisplayOrder",- title: "@Loc["Vendor.Catalog.Products.SimilarProducts.Fields.DisplayOrder"]",- //integer format- format: "{0:0}",- width: 120,- headerAttributes: { style: "text-align:center" },- attributes: { style: "text-align:center" },- }, {- command: [{- name: "edit",- text: {- edit: "@Loc["Vendor.Common.Edit"]",- update: "@Loc["Vendor.Common.Update"]",- cancel: "@Loc["Vendor.Common.Cancel"]"- }- }, {- name: "destroy",- text: "@Loc["Vendor.Common.Delete"]"- }]- }]- });- });- </script>-- <script>- $(document).ready(function () {- $('#btnRefreshSimilarProducts').click(function () {- //refresh grid- var grid = $("#similarproducts-grid").data('kendoGrid');- grid.dataSource.read();-- //return false to don't reload a page- return false;- });- });- </script>-}-else-{- <div class="note note-info">- @Loc["Vendor.Catalog.Products.SimilarProducts.SaveBeforeEdit"]- </div>-}\ No newline at end of file