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 changes for customer attribute

KrzysztofPajakd67d89dd44a8
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerAttribute/_CreateOrUpdate.TabInfo.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerAttribute/_CreateOrUpdate.TabInfo.cshtml
index 3c448ac68..173fbe0f6 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerAttribute/_CreateOrUpdate.TabInfo.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/CustomerAttribute/_CreateOrUpdate.TabInfo.cshtml
@@ -5,8 +5,19 @@
$(document).ready(function () {
$("#@Html.IdFor(model => model.AttributeControlTypeId)").change(toggleAttributeControlType);
toggleAttributeControlType();
-
+ $("#@Html.IdFor(model => model.IsReadOnly)").click(toggleIsReadOnly);
+ toggleIsReadOnly();
});
+
+ function toggleIsReadOnly() {
+ if ($('#@Html.IdFor(model => model.IsReadOnly)').is(':checked')) {
+ $('#pnlIsRequired').hide();
+ } else {
+ $('#pnlIsRequired').show();
+ }
+
+ }
+
function toggleAttributeControlType() {
var selectedAttributeControlTypeId = $("#@Html.IdFor(model => model.AttributeControlTypeId)").val();
if (selectedAttributeControlTypeId == @(((int) AttributeControlType.TextBox).ToString()) || selectedAttributeControlTypeId == @(((int) AttributeControlType.Hidden).ToString())) {
@@ -48,23 +59,23 @@
</localized-editor>
<div class="form-body">
<div class="form-group">
- <admin-label asp-for="IsRequired" />
+ <admin-label asp-for="IsReadOnly" />
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
- <admin-input asp-for="IsRequired" />
+ <admin-input asp-for="IsReadOnly" />
<div class="control__indicator"></div>
</label>
- <span asp-validation-for="IsRequired"></span>
+ <span asp-validation-for="IsReadOnly"></span>
</div>
</div>
- <div class="form-group">
- <admin-label asp-for="IsReadOnly" />
+ <div class="form-group" id="pnlIsRequired">
+ <admin-label asp-for="IsRequired" />
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
- <admin-input asp-for="IsReadOnly" />
+ <admin-input asp-for="IsRequired" />
<div class="control__indicator"></div>
</label>
- <span asp-validation-for="IsReadOnly"></span>
+ <span asp-validation-for="IsRequired"></span>
</div>
</div>
<div class="form-group">