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.

Migrate CreateOrUpdate.Bids.cshtml to AdminShared (ARCH-001 Phase 2)

KrzysztofPajak8625051c58f4
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Bids.cshtml b/src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
similarity index 65%
rename from src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
rename to src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
index 9f69a153a..5b40f6618 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
+++ b/src/Web/Grand.Web.AdminShared/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
@@ -1,15 +1,32 @@
-@model ProductModel
+@model ProductModel
@inject AdminAreaSettings adminAreaSettings
+@{
+ var area = ViewContext.RouteData.Values["area"]?.ToString();
+}
@if (!string.IsNullOrEmpty(Model.Id))
{
<input asp-for="AuctionEnded" type="hidden"/>
<div class="panel panel-default">
- <vc:admin-widget widget-zone="product_details_bids_top" additional-data="Model"/>
+ @if (Scope.ResourceKeyPrefix == "Vendor")
+ {
+ <vc:vendor-widget widget-zone="vendor_product_details_bids_top" additional-data="Model"/>
+ }
+ else
+ {
+ <vc:admin-widget widget-zone="product_details_bids_top" additional-data="Model"/>
+ }
<div class="panel-body">
<div id="bids-grid"></div>
</div>
- <vc:admin-widget widget-zone="product_details_bids_bottom" additional-data="Model"/>
+ @if (Scope.ResourceKeyPrefix == "Vendor")
+ {
+ <vc:vendor-widget widget-zone="vendor_product_details_bids_bottom" additional-data="Model"/>
+ }
+ else
+ {
+ <vc:admin-widget widget-zone="product_details_bids_bottom" additional-data="Model"/>
+ }
</div>
<script>
$(document).ready(function () {
@@ -17,12 +34,12 @@
dataSource: {
transport: {
read: {
- url: "@Html.Raw(Url.Action("ListBids", "Product", new { productId = Model.Id, area = Constants.AreaAdmin }))",
+ url: "@Html.Raw(Url.Action("ListBids", "Product", new { productId = Model.Id, area = area }))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken,
}, destroy: {
- url: "@Html.Raw(Url.Action("BidDelete", "Product", new { area = Constants.AreaAdmin }))",
+ url: "@Html.Raw(Url.Action("BidDelete", "Product", new { area = area }))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
@@ -59,28 +76,28 @@
scrollable: false,
columns: [{
field: "Date",
- title: "@Loc["Admin.Catalog.Products.Bids.Date"]",
+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.Bids.Date"]",
width: 200,
type: "date",
template: "#= kendo.toString(kendo.parseDate(Date, 'yyyy-MM-dd'), 'MM/dd/yyyy h:mm tt') #"
}, {
field: "CustomerId",
- title: "@Loc["Admin.Catalog.Products.Bids.CustomerId"]",
+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.Bids.CustomerId"]",
width: 200,
template: '# if(Email) {# <a href="@Url.Action("Edit", "Customer")/#=CustomerId#">#=Email#</a> #} #'
}, {
field: "Amount",
- title: "@Loc["Admin.Catalog.Products.Bids.Amount"]",
+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.Bids.Amount"]",
width: 200
}, {
field: "OrderId",
- title: "@Loc["Admin.Catalog.Products.Bids.OrderId"]",
+ title: "@Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.Bids.OrderId"]",
width: 200,
- template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = Constants.AreaAdmin })/#=OrderId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a> #} #'
+ template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = area })/#=OrderId#"><i class="fa fa-search"></i> @Loc[$"{Scope.ResourceKeyPrefix}.Common.View"]</a> #} #'
}, {
command: [{
name: "destroy",
- text: "@Loc["Admin.Common.Delete"]"
+ text: "@Loc[$"{Scope.ResourceKeyPrefix}.Common.Delete"]"
}],
width: 100
}]
@@ -91,6 +108,6 @@
else
{
<div class="note note-info">
- @Loc["Admin.Catalog.Products.Bids.SaveBeforeEdit"]
+ @Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.Bids.SaveBeforeEdit"]
</div>
-}
\ No newline at end of file
+}
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
deleted file mode 100644
index f831e021f..000000000
--- a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
+++ /dev/null
@@ -1,96 +0,0 @@
-@model ProductModel
-@inject AdminAreaSettings adminAreaSettings
-@if (!string.IsNullOrEmpty(Model.Id))
-{
- <input asp-for="AuctionEnded" type="hidden"/>
-
- <div class="panel panel-default">
- <vc:admin-widget widget-zone="product_details_bids_top" additional-data="Model"/>
- <div class="panel-body">
- <div id="bids-grid"></div>
- </div>
- <vc:admin-widget widget-zone="product_details_bids_bottom" additional-data="Model"/>
- </div>
- <script>
- $(document).ready(function () {
- $("#bids-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListBids", "Product", new { productId = Model.Id, area = Constants.AreaStore }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken,
- }, destroy: {
- url: "@Html.Raw(Url.Action("BidDelete", "Product", new { area = Constants.AreaStore }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- }
- },
- schema: {
- data: "Data",
- total: "Total",
- errors: "Errors",
- model: {
- id: "Id",
- ProductId: "ProductId"
- }
- },
- 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: false,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Date",
- title: "@Loc["Admin.Catalog.Products.Bids.Date"]",
- width: 200,
- type: "date",
- template: "#= kendo.toString(kendo.parseDate(Date, 'yyyy-MM-dd'), 'MM/dd/yyyy h:mm tt') #"
- }, {
- field: "CustomerId",
- title: "@Loc["Admin.Catalog.Products.Bids.CustomerId"]",
- width: 200,
- template: '# if(Email) {# <a href="@Url.Action("Edit", "Customer")/#=CustomerId#">#=Email#</a> #} #'
- }, {
- field: "Amount",
- title: "@Loc["Admin.Catalog.Products.Bids.Amount"]",
- width: 200
- }, {
- field: "OrderId",
- title: "@Loc["Admin.Catalog.Products.Bids.OrderId"]",
- width: 200,
- template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = Constants.AreaStore })/#=OrderId#"><i class="fa fa-search"></i> @Loc["Admin.Common.View"]</a> #} #'
- }, {
- command: [{
- name: "destroy",
- text: "@Loc["Admin.Common.Delete"]"
- }],
- width: 100
- }]
- });
- });
- </script>
-}
-else
-{
- <div class="note note-info">
- @Loc["Admin.Catalog.Products.Bids.SaveBeforeEdit"]
- </div>
-}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Bids.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
deleted file mode 100644
index 6b4a5fba0..000000000
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/Partials/CreateOrUpdate.Bids.cshtml
+++ /dev/null
@@ -1,96 +0,0 @@
-@model ProductModel
-@inject AdminAreaSettings adminAreaSettings
-@if (!string.IsNullOrEmpty(Model.Id))
-{
- <input asp-for="AuctionEnded" type="hidden"/>
-
- <div class="panel panel-default">
- <vc:vendor-widget widget-zone="vendor_product_details_bids_top" additional-data="Model"/>
- <div class="panel-body">
- <div id="bids-grid"></div>
- </div>
- <vc:vendor-widget widget-zone="vendor_product_details_bids_bottom" additional-data="Model"/>
- </div>
- <script>
- $(document).ready(function () {
- $("#bids-grid").kendoGrid({
- dataSource: {
- transport: {
- read: {
- url: "@Html.Raw(Url.Action("ListBids", "Product", new { productId = Model.Id, area = Constants.AreaVendor }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken,
- }, destroy: {
- url: "@Html.Raw(Url.Action("BidDelete", "Product", new { area = Constants.AreaVendor }))",
- type: "POST",
- dataType: "json",
- data: addAntiForgeryToken
- }
- },
- schema: {
- data: "Data",
- total: "Total",
- errors: "Errors",
- model: {
- id: "Id",
- ProductId: "ProductId"
- }
- },
- 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: false,
- mode: "inline"
- },
- scrollable: false,
- columns: [{
- field: "Date",
- title: "@Loc["Vendor.Catalog.Products.Bids.Date"]",
- width: 200,
- type: "date",
- template: "#= kendo.toString(kendo.parseDate(Date, 'yyyy-MM-dd'), 'MM/dd/yyyy h:mm tt') #"
- }, {
- field: "CustomerId",
- title: "@Loc["Vendor.Catalog.Products.Bids.CustomerId"]",
- width: 200,
- template: '# if(Email) {# <a href="@Url.Action("Edit", "Customer")/#=CustomerId#">#=Email#</a> #} #'
- }, {
- field: "Amount",
- title: "@Loc["Vendor.Catalog.Products.Bids.Amount"]",
- width: 200
- }, {
- field: "OrderId",
- title: "@Loc["Vendor.Catalog.Products.Bids.OrderId"]",
- width: 200,
- template: '# if(OrderId) {# <a class="btn btn-sm btn-default" href="@Url.Action("Edit", "Order", new { area = Constants.AreaVendor })/#=OrderId#"><i class="fa fa-search"></i> @Loc["Vendor.Common.View"]</a> #} #'
- }, {
- command: [{
- name: "destroy",
- text: "@Loc["Vendor.Common.Delete"]"
- }],
- width: 100
- }]
- });
- });
- </script>
-}
-else
-{
- <div class="note note-info">
- @Loc["Vendor.Catalog.Products.Bids.SaveBeforeEdit"]
- </div>
-}
\ No newline at end of file