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 TierPriceEditPopup.cshtml to AdminShared (ARCH-001 Phase 2)

KrzysztofPajake64ad0cfa08a
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml b/src/Web/Grand.Web.AdminShared/Views/Product/TierPriceEditPopup.cshtml
similarity index 84%
rename from src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml
rename to src/Web/Grand.Web.AdminShared/Views/Product/TierPriceEditPopup.cshtml
index 6cfd03c6f..dcd4d740e 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Product/TierPriceEditPopup.cshtml
+++ b/src/Web/Grand.Web.AdminShared/Views/Product/TierPriceEditPopup.cshtml
@@ -2,12 +2,13 @@
@{
Layout = "";
+ var area = ViewContext.RouteData.Values["area"]?.ToString();
//page title
- ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.Edit"];
+ ViewBag.Title = Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.TierPrices.Edit"];
}
-<form id="TierPriceEditPopup" asp-area="@Constants.AreaAdmin" asp-controller="Product" asp-action="TierPriceEditPopup"
+<form id="TierPriceEditPopup" asp-area="@area" asp-controller="Product" asp-action="TierPriceEditPopup"
asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
@@ -18,7 +19,7 @@
<div class="x_title">
<div class="caption">
<i class="fa fa-cube"></i>
- @Loc["Admin.Catalog.Products.TierPrices.Edit"]
+ @Loc[$"{Scope.ResourceKeyPrefix}.Catalog.Products.TierPrices.Edit"]
</div>
</div>
<div class="x_content form">
diff --git a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml b/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml
deleted file mode 100644
index c27cac08c..000000000
--- a/src/Web/Grand.Web.Store/Areas/Store/Views/Product/TierPriceEditPopup.cshtml
+++ /dev/null
@@ -1,61 +0,0 @@
-@model ProductModel.TierPriceModel
-
-@{
- Layout = "";
-
- //page title
- ViewBag.Title = Loc["Admin.Catalog.Products.TierPrices.Edit"];
-}
-
-<form id="TierPriceEditPopup" asp-area="@Constants.AreaStore" asp-controller="Product" asp-action="TierPriceEditPopup"
- asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
- asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
- asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
-
- <div class="row">
- <div class="col-md-12">
- <div class="x_panel light form-fit">
- <div class="x_title">
- <div class="caption">
- <i class="fa fa-cube"></i>
- @Loc["Admin.Catalog.Products.TierPrices.Edit"]
- </div>
- </div>
- <div class="x_content form">
- <partial name="Partials/CreateOrUpdateTierPrice" model="Model"/>
- </div>
- </div>
- </div>
- </div>
- <script>
- var mfp = $.magnificPopup.instance;
- $("#TierPriceEditPopup").submit(function (e) {
- e.preventDefault();
- var form = $(this);
- var url = form.attr('action');
- $.ajax({
- type: "POST",
- url: url,
- data: form.serialize(),
- success: function (data) {
- if (data == "") {
- mfp.close();
- $('#btnRefreshTierPrices').click();
- } else {
- $.magnificPopup.open({
- items: {
- src: data,
- type: 'inline'
- },
- callbacks: {
- open: function () {
- $('.mfp-wrap').removeAttr('tabindex');
- }
- }
- });
- }
- }
- });
- });
- </script>
-</form>
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/TierPriceEditPopup.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/TierPriceEditPopup.cshtml
deleted file mode 100644
index fc5ae7807..000000000
--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/Product/TierPriceEditPopup.cshtml
+++ /dev/null
@@ -1,61 +0,0 @@
-@model ProductModel.TierPriceModel
-
-@{
- Layout = "";
-
- //page title
- ViewBag.Title = Loc["Vendor.Catalog.Products.TierPrices.Edit"];
-}
-
-<form id="TierPriceEditPopup" asp-area="@Constants.AreaVendor" asp-controller="Product" asp-action="TierPriceEditPopup"
- asp-route-ProductId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ProductId"])"
- asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
- asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">
-
- <div class="row">
- <div class="col-md-12">
- <div class="x_panel light form-fit">
- <div class="x_title">
- <div class="caption">
- <i class="fa fa-cube"></i>
- @Loc["Vendor.Catalog.Products.TierPrices.Edit"]
- </div>
- </div>
- <div class="x_content form">
- <partial name="Partials/CreateOrUpdateTierPrice" model="Model"/>
- </div>
- </div>
- </div>
- </div>
- <script>
- var mfp = $.magnificPopup.instance;
- $("#TierPriceEditPopup").submit(function (e) {
- e.preventDefault();
- var form = $(this);
- var url = form.attr('action');
- $.ajax({
- type: "POST",
- url: url,
- data: form.serialize(),
- success: function (data) {
- if (data == "") {
- mfp.close();
- $('#btnRefreshTierPrices').click();
- } else {
- $.magnificPopup.open({
- items: {
- src: data,
- type: 'inline'
- },
- callbacks: {
- open: function () {
- $('.mfp-wrap').removeAttr('tabindex');
- }
- }
- });
- }
- }
- });
- });
- </script>
-</form>
\ No newline at end of file