@model RewardPointsSettingsModel

@using Nop.Core.Domain.Customers
@using Nop.Services

<div class="card-body">
    <div class="form-group row">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="PointsForPurchases_OverrideForStore" asp-input="PointsForPurchases_Amount" asp-input2="PointsForPurchases_Points" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="PointsForPurchases_Amount" />
        </div>
        <div class="col-md-9">
            <div class="form-text-row float-left margin-r-10">@T("Admin.Configuration.Settings.RewardPoints.Earning.Hint1")</div>
            <div class="float-left margin-r-10"><nop-editor asp-for="PointsForPurchases_Amount" asp-postfix="@Model.PrimaryStoreCurrencyCode" /></div>
            <div class="form-text-row float-left margin-r-10">@T("Admin.Configuration.Settings.RewardPoints.Earning.Hint2")</div>
            <div class="float-left margin-r-10"><nop-editor asp-for="PointsForPurchases_Points" /></div>
            <div class="form-text-row float-left margin-r-10">@T("Admin.Configuration.Settings.RewardPoints.Earning.Hint3")</div>
            <span asp-validation-for="PointsForPurchases_Amount"></span>
            <span asp-validation-for="PointsForPurchases_Points"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="PurchasesPointsValidity_OverrideForStore" asp-input="PurchasesPointsValidity" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="PurchasesPointsValidity" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="PurchasesPointsValidity" asp-postfix="@T("Admin.Configuration.Settings.RewardPoints.PurchasesPointsValidity.Postfix")" />
            <span asp-validation-for="PurchasesPointsValidity"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="MinOrderTotalToAwardPoints_OverrideForStore" asp-input="MinOrderTotalToAwardPoints" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="MinOrderTotalToAwardPoints" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="MinOrderTotalToAwardPoints" asp-postfix="@Model.PrimaryStoreCurrencyCode" />
            <span asp-validation-for="MinOrderTotalToAwardPoints"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="PointsForRegistration_OverrideForStore" asp-input="PointsForRegistration" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="PointsForRegistration" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="PointsForRegistration" />
            <span asp-validation-for="PointsForRegistration"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="RegistrationPointsValidity_OverrideForStore" asp-input="RegistrationPointsValidity" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="RegistrationPointsValidity" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="RegistrationPointsValidity" asp-postfix="@T("Admin.Configuration.Settings.RewardPoints.RegistrationPointsValidity.Postfix")" />
            <span asp-validation-for="RegistrationPointsValidity"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-label asp-for="ActivatePointsImmediately" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="ActivatePointsImmediately" />
            <span asp-validation-for="ActivatePointsImmediately"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting" id="pnl-activating-delay">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="ActivationDelay_OverrideForStore" asp-input="ActivationDelay" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="ActivationDelay" />
        </div>
        <div class="col-md-9">
            <div class="row">
                <div class="col-md-3">
                    <nop-editor asp-for="ActivationDelay" />
                    <span asp-validation-for="ActivationDelay"></span>
                </div>
                <div class="col-md-3">
                    <nop-select asp-for="ActivationDelayPeriodId" asp-items="@await (((RewardPointsActivatingDelayPeriod) Model.ActivationDelayPeriodId).ToSelectListAsync())" style="max-width: 200px;" />
                    <span asp-validation-for="ActivationDelayPeriodId"></span>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="DisplayHowMuchWillBeEarned_OverrideForStore" asp-input="DisplayHowMuchWillBeEarned" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="DisplayHowMuchWillBeEarned" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="DisplayHowMuchWillBeEarned" />
            <span asp-validation-for="DisplayHowMuchWillBeEarned"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-label asp-for="PointsAccumulatedForAllStores" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="PointsAccumulatedForAllStores" />
            <span asp-validation-for="PointsAccumulatedForAllStores"></span>
        </div>
    </div>
    <div class="form-group row advanced-setting">
        <div class="col-md-3">
            <nop-override-store-checkbox asp-for="PageSize_OverrideForStore" asp-input="PageSize" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
            <nop-label asp-for="PageSize" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="PageSize" />
            <span asp-validation-for="PageSize"></span>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $("#@Html.IdFor(model => model.ActivatePointsImmediately)").click(activatePointsImmediately);
        activatePointsImmediately();
    });

    function activatePointsImmediately() {
        if ($('#@Html.IdFor(model => model.ActivatePointsImmediately)').is(':checked'))
            $('#pnl-activating-delay').hideElement();
        else
            $('#pnl-activating-delay').showElement();
    }
</script>