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.

2.0 KB
Raw Blame
@using Microsoft.AspNetCore.Mvc.Razor
@model CheckoutAttributeValueModel

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden"/>
<input asp-for="CheckoutAttributeId" type="hidden"/>
<input asp-for="DisplayColorSquaresRgb" type="hidden"/>

<partial name="Partials/WidgetZone.Value.Top" model="Model"/>

@{
    Func<int, HelperResult>
        template = @<div class="grand-fields">
                       <admin-field asp-for="@Model.Locales[item].Name"/>
                       <input type="hidden" asp-for="@Model.Locales[item].LanguageId"/>
                   </div>;
}

@* the product attribute value popup's layout: the localized name, the adjustments with their
   units, and Save as the popup's one primary action *@
<localized-editor localized-template="@template" name="checkoutattributevalue-localized" language-ids="@Model.Locales.Select(c => c.LanguageId).ToList()">
    <div class="grand-fields">
        <admin-field asp-for="Name"/>
    </div>
</localized-editor>

<div class="grand-fields grand-fields--2col">
    @if (Model.DisplayColorSquaresRgb)
    {
        <admin-field asp-for="ColorSquaresRgb">
            <admin-input asp-for="ColorSquaresRgb"/>
            <div id="color-picker"></div>
            <script type="text/javascript">
                $(document).ready(function(){
                    $('#color-picker').farbtastic('#@Html.IdFor(model => model.ColorSquaresRgb)');
                });
            </script>
        </admin-field>
    }
    <admin-field asp-for="PriceAdjustment" size="md" suffix="@Model.PrimaryStoreCurrencyCode"/>
    <admin-field asp-for="WeightAdjustment" size="md" suffix="@Model.BaseWeightIn"/>
    <admin-field asp-for="DisplayOrder" size="sm"/>
    <admin-field asp-for="IsPreSelected"/>
</div>
<partial name="Partials/WidgetZone.Value.Bottom" model="Model"/>
<div class="grand-popup__actions">
    <partial name="Partials/WidgetZone.ValueButtons" model="Model"/>
    <button class="btn btn-primary" type="submit" name="save">
        <i class="bi bi-check-lg"></i> @Loc["Admin.Common.Save"]
    </button>
</div>