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.

Refactor input elements for readability and maintainability

supportb37d9bc854ca
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
index bb7883905..b2bac2cf8 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
@@ -171,7 +171,9 @@
if (item.DownloadActivationType == DownloadActivationType.Manually)
{
<div>
- <input type="submit" name="btnPvActivateDownload@(item.Id)" @(item.IsDownloadActivated ? " value=" + Loc["Admin.Orders.Products.Download.Deactivate"] : " value=" + Loc["Admin.Orders.Products.Download.Activate"]) id="btnPvActivateDownload@(item.Id)" class="k-button" asp-action="ActivateDownloadItem" asp-route-orderItemId="@(item.Id)"/>
+ <input type="submit" name="btnPvActivateDownload@(item.Id)"
+ value="@(item.IsDownloadActivated ? Loc["Admin.Orders.Products.Download.Deactivate"] : Loc["Admin.Orders.Products.Download.Activate"])"
+ id="btnPvActivateDownload@(item.Id)" class="k-button" asp-action="ActivateDownloadItem" asp-route-orderItemId="@(item.Id)"/>
<hr/>
</div>
}
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/Restrictions.TabCountry.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/Restrictions.TabCountry.cshtml
index 4969b140b..683beef53 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/Restrictions.TabCountry.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/Restrictions.TabCountry.cshtml
@@ -61,9 +61,10 @@
@foreach (var sm in Model.AvailableShippingMethods)
{
var restricted = Model.Restricted.ContainsKey(c.Id) && Model.Restricted[c.Id][sm.Id];
+ var checkedValue = restricted ? "checked" : null;
<td style="text-align:center">
<label class='mt-checkbox mt-checkbox-outline control control-checkbox'>
- <input id="restrict_@(sm.Id)" class="restrict_@(sm.Id)" type="checkbox" value="@(c.Id)" name="restrict_@(sm.Id)" @(restricted ? " checked=checked" : null)/>
+ <input id="restrict_@(sm.Id)" class="restrict_@(sm.Id)" type="checkbox" value="@(c.Id)" name="restrict_@(sm.Id)" @checkedValue />
<div class="control__indicator"></div>
</label>
</td>