chargeafter-rnd_chargeafter-plugin-for-nopcommerce/Nop.Plugin.Payments.ChargeAfter/Areas/Admin/Views/Configure.cshtml
@model Nop.Plugin.Payments.ChargeAfter.Models.ConfigurationModel
@{
    // ReSharper disable once Razor.LayoutNotResolved
    Layout = "_ConfigurePlugin";
}

@await Component.InvokeAsync("StoreScopeConfiguration")

<form asp-controller="PaymentChargeAfter" asp-action="Configure" method="post" autocomplete="off">
    <div class="form-group row">
        <div class="col-md-3">
            <div class="onoffswitch">
                <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="advanced-settings-mode" checked="@Model.EnableAdvancedSetting">
                <label class="onoffswitch-label" for="advanced-settings-mode">
                    <span class="onoffswitch-inner"
                          data-locale-basic="@T("Admin.Configuration.Settings.Mode.Basic")"
                          data-locale-advanced="@T("Admin.Configuration.Settings.Mode.Advanced")"></span>
                    <span class="onoffswitch-switch"></span>
                </label>
            </div>
        </div>
        <div class="col-md-9">
            <div class="float-right">
                <button type="submit" name="save" class="btn btn-primary">
                    <i class="far fa-save"></i>
                    @T("Admin.Common.Save")
                </button>
            </div>
        </div>
    </div>

    <script>
        function checkAdvancedSettingsMode(advanced) {
            if (advanced) {
                $("body").addClass("advanced-settings-mode");
                $("body").removeClass("basic-settings-mode");
            } else {
                $("body").removeClass("advanced-settings-mode");
                $("body").addClass("basic-settings-mode");
            }
        }

        checkAdvancedSettingsMode($("#advanced-settings-mode").is(':checked'));
        $(document).ready(function () {
            $("#advanced-settings-mode").click(function () {
                checkAdvancedSettingsMode($(this).is(':checked'));
                saveUserPreferences('@(Url.Action("SavePreferenceMode", "PaymentChargeAfter"))', '', $(this).is(':checked'));
                ensureDataTablesRendered();
            });
        });
    </script>

    <div class="cards-group">
        <div class="card card-default">
            <div class="card-header">
                @T("Plugins.Payments.ChargeAfter.Header.Payment")
            </div>
            <div class="card-body">
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="ProductionPublicKey_OverrideForStore" asp-input="ProductionPublicKey" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="ProductionPublicKey" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="ProductionPublicKey" />
                        <span asp-validation-for="ProductionPublicKey"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="ProductionPrivateKey_OverrideForStore" asp-input="ProductionPrivateKey" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="ProductionPrivateKey" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="ProductionPrivateKey" asp-value="@Model.ProductionPrivateKey" html-attributes="@(new { value = Model.ProductionPrivateKey })" />
                        <span asp-validation-for="ProductionPrivateKey"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="UseProduction_OverrideForStore" asp-input="UseProduction" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="UseProduction" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="UseProduction" />
                        <span asp-validation-for="UseProduction"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="SandboxPublicKey_OverrideForStore" asp-input="SandboxPublicKey" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="SandboxPublicKey" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="SandboxPublicKey" />
                        <span asp-validation-for="SandboxPublicKey"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="SandboxPrivateKey_OverrideForStore" asp-input="SandboxPrivateKey" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="SandboxPrivateKey" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="SandboxPrivateKey" asp-value="@Model.SandboxPrivateKey" html-attributes="@(new { value = Model.SandboxPrivateKey })" />
                        <span asp-validation-for="SandboxPrivateKey"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="TypeTransaction_OverrideForStore" asp-input="TypeTransaction" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="TypeTransaction" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="TypeTransaction" asp-items="Model.TypeTransactionValues" />
                        <span asp-validation-for="TypeTransaction"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="card card-default">
            <div class="card-header">
                @T("Plugins.Payments.ChargeAfter.Header.Checkout")
            </div>
            <div class="card-body">
                @if (Model.TypeCheckoutBrand <= 0)
                {
                    Model.TypeCheckoutBrand = (int)Nop.Plugin.Payments.ChargeAfter.Domain.Promo.CheckoutBrandType.MediumGeneric;
                }
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="TypeCheckoutBrand_OverrideForStore" asp-input="TypeCheckoutBrand" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="TypeCheckoutBrand" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="TypeCheckoutBrand" asp-items="Model.TypeCheckoutBrandValues" />
                        <span asp-validation-for="TypeCheckoutBrand"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="card card-default">
            <div class="card-header">
                @T("Plugins.Payments.ChargeAfter.Header.PromoLineOfCredit")
            </div>
            <div class="card-body">
                @if (string.IsNullOrEmpty(Model.FinancingPageUrlLineOfCreditPromo))
                {
                    Model.EnableLineOfCreditPromo = true;
                    Model.TypeLineOfCreditPromo = (int)Nop.Plugin.Payments.ChargeAfter.Domain.Promo.LineOfCreditType.ProductWidgetLineOfCredit; 
                    Model.FinancingPageUrlLineOfCreditPromo = "/";
                }
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableLineOfCreditPromo_OverrideForStore" asp-input="EnableLineOfCreditPromo" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableLineOfCreditPromo" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableLineOfCreditPromo" />
                        <span asp-validation-for="EnableLineOfCreditPromo"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="TypeLineOfCreditPromo_OverrideForStore" asp-input="TypeLineOfCreditPromo" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="TypeLineOfCreditPromo" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="TypeLineOfCreditPromo" asp-items="Model.TypeLineOfCreditPromoValues" />
                        <span asp-validation-for="TypeLineOfCreditPromo"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="FinancingPageUrlLineOfCreditPromo_OverrideForStore" asp-input="FinancingPageUrlLineOfCreditPromo" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="FinancingPageUrlLineOfCreditPromo" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="FinancingPageUrlLineOfCreditPromo" />
                        <span asp-validation-for="FinancingPageUrlLineOfCreditPromo"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="card card-default advanced-setting">
            <div class="card-header">
                @T("Plugins.Payments.ChargeAfter.Header.PromoSimple")
            </div>
            <div class="card-body">
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableSimplePromoBeforeContent_OverrideForStore" asp-input="EnableSimplePromoBeforeContent" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableSimplePromoBeforeContent" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableSimplePromoBeforeContent" />
                        <span asp-validation-for="EnableSimplePromoBeforeContent"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="WidgetTypeSimplePromoBeforeContentId_OverrideForStore" asp-input="WidgetTypeSimplePromoBeforeContentId" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="WidgetTypeSimplePromoBeforeContentValues" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="WidgetTypeSimplePromoBeforeContentId" asp-items="Model.WidgetTypeSimplePromoBeforeContentValues" />
                        <span asp-validation-for="WidgetTypeSimplePromoBeforeContentId"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableSimplePromoAfterContent_OverrideForStore" asp-input="EnableSimplePromoAfterContent" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableSimplePromoAfterContent" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableSimplePromoAfterContent" />
                        <span asp-validation-for="EnableSimplePromoAfterContent"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="WidgetTypeSimplePromoAfterContentId_OverrideForStore" asp-input="WidgetTypeSimplePromoAfterContentId" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="WidgetTypeSimplePromoAfterContentValues" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="WidgetTypeSimplePromoAfterContentId" asp-items="Model.WidgetTypeSimplePromoAfterContentValues" />
                        <span asp-validation-for="WidgetTypeSimplePromoAfterContentId"></span>
                    </div>
                </div>
                <hr />
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableSimplePromoProductBeforeContent_OverrideForStore" asp-input="EnableSimplePromoProductBeforeContent" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableSimplePromoProductBeforeContent" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableSimplePromoProductBeforeContent" />
                        <span asp-validation-for="EnableSimplePromoProductBeforeContent"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="WidgetTypeSimplePromoProductBeforeContentId_OverrideForStore" asp-input="WidgetTypeSimplePromoProductBeforeContentId" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="WidgetTypeSimplePromoProductBeforeContentValues" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="WidgetTypeSimplePromoProductBeforeContentId" asp-items="Model.WidgetTypeSimplePromoProductBeforeContentValues" />
                        <span asp-validation-for="WidgetTypeSimplePromoProductBeforeContentId"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableSimplePromoProductAfterTitle_OverrideForStore" asp-input="EnableSimplePromoProductAfterTitle" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableSimplePromoProductAfterTitle" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableSimplePromoProductAfterTitle" />
                        <span asp-validation-for="EnableSimplePromoProductAfterTitle"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="WidgetTypeSimplePromoProductAfterTitleId_OverrideForStore" asp-input="WidgetTypeSimplePromoProductAfterTitleId" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="WidgetTypeSimplePromoProductAfterTitleValues" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="WidgetTypeSimplePromoProductAfterTitleId" asp-items="Model.WidgetTypeSimplePromoProductAfterTitleValues" />
                        <span asp-validation-for="WidgetTypeSimplePromoProductAfterTitleId"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="EnableSimplePromoProductAfterDesc_OverrideForStore" asp-input="EnableSimplePromoProductAfterDesc" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="EnableSimplePromoProductAfterDesc" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="EnableSimplePromoProductAfterDesc" />
                        <span asp-validation-for="EnableSimplePromoProductAfterDesc"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="WidgetTypeSimplePromoProductAfterDescId_OverrideForStore" asp-input="WidgetTypeSimplePromoProductAfterDescId" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="WidgetTypeSimplePromoProductAfterDescValues" />
                    </div>
                    <div class="col-md-9">
                        <nop-select asp-for="WidgetTypeSimplePromoProductAfterDescId" asp-items="Model.WidgetTypeSimplePromoProductAfterDescValues" />
                        <span asp-validation-for="WidgetTypeSimplePromoProductAfterDescId"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>