Skip to content

Commit

Permalink
Fix duplicate gift frequency.
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Dec 23, 2024
1 parent 4aa30f6 commit 43e03ac
Showing 1 changed file with 40 additions and 124 deletions.
164 changes: 40 additions & 124 deletions src/app/productConfig/productConfigForm/productConfigForm.tpl.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<form novalidate name="$ctrl.itemConfigForm" ng-submit="$ctrl.saveGiftToCart()">
<div class="row">
<span class="u-floatRight" style="margin-top: -16px">
Secure
<i class="fas fa-lock ml--">
</i>
</span>
</div>
<div class="row">
<div class="col-sm-6">
<h4 id="product-config-header" class="give-gift-header" translate>
Expand Down Expand Up @@ -73,62 +66,50 @@ <h4 class="panel-title border-bottom-small" translate>
<p translate>{{'GIFT_IN_CART_ERROR'}}</p>
</div>

<div ng-if="$ctrl.errorForcedUserToLogout" class="alert alert-warning" role="alert">
<p translate>{{'FORCED_USER_TO_LOGOUT'}}</p>
</div>

<h4 class="panel-title border-bottom-small" translate>
{{'GIFT_AMOUNT'}}
</h4>
<div class="panel-body p0">
<fieldset aria-label="Suggested Gift Amounts. Tab for Custom Amount">
<div class="button-group" ng-if="$ctrl.useSuggestedAmounts">
<div ng-repeat="suggested in $ctrl.suggestedAmounts | orderBy:'order'">
<input
type="radio"
name="suggestedAmount"
id="sa-{{$index}}"
ng-click="$ctrl.changeAmount(suggested.amount)"
ng-class=" {'active': !$ctrl.customInputActive && $ctrl.itemConfig.AMOUNT === suggested.amount}"
/>
<label for="sa-{{$index}}">
<span class="amount-box">{{$ctrl.suggestedAmount(suggested.amount)}}</span>
<span class="amount-description">{{suggested.label}}</span>
<h4 class="panel-title border-bottom-small" translate>
{{'GIFT_AMOUNT'}}
</h4>
<div ng-if="$ctrl.useSuggestedAmounts">
<div class="radio radio-custom-amount"
ng-repeat="suggested in $ctrl.suggestedAmounts | orderBy:'order'">
<label>
<input name="suggestedAmount"
type="radio"
ng-click="$ctrl.changeAmount(suggested.amount)"
ng-checked="!$ctrl.customInputActive && $ctrl.itemConfig.AMOUNT === suggested.amount" />
{{$ctrl.suggestedAmount(suggested.amount)}} {{suggested.label}}
</label>
</div>
<div class="custom-amount-button" ng-class="{'has-error': ($ctrl.itemConfigForm.amount | showErrors)}">
<div class="input-prepend">
<span class="input-prepend-text">$</span>
<div class="radio radio-custom-amount form-inline" ng-class="{'has-error': ($ctrl.itemConfigForm.amount | showErrors)}">
<div class="form-group">
<label>
<input name="suggestedAmount"
type="radio"
ng-checked="$ctrl.customInputActive" />
<input class="form-control form-control-subtle"
name="amount"
type="text"
step="1"
tabindex="-1"
ng-model="$ctrl.customAmount"
ng-change="$ctrl.changeCustomAmount($ctrl.customAmount)"
ng-focus="$ctrl.customInputActive = true;"
ng-required="$ctrl.customInputActive"
placeholder="{{'OTHER_PLACEHOLDER' | translate}}" />
</label>
<div role="alert" ng-messages="$ctrl.itemConfigForm.amount.$error"
ng-if="($ctrl.itemConfigForm.amount | showErrors)">
<div class="help-block" ng-message="pattern" translate>{{'VALID_DOLLAR_AMOUNT_ERROR'}}</div>
<div class="help-block" ng-message="required" translate>{{'AMOUNT_EMPTY_ERROR'}}</div>
<div class="help-block" ng-message="minimum" translate translate-values="{currencyLimit: (1 | currency)}">{{'AMOUNT_MIN_ERROR'}}</div>
<div class="help-block" ng-message="maximum" translate translate-values="{currencyLimit: (10000000 | currency)}">
{{'AMOUNT_MAX_ERROR'}}
</div>
</div>
</div>
<label for="ca">
<input
name="suggestedAmount"
type="radio"
ng-checked="$ctrl.customInputActive"
/>
<input
name="amount"
type="text"
id="ca"
step="1"
tabindex="-1"
ng-model="$ctrl.customAmount"
ng-change="$ctrl.changeCustomAmount($ctrl.customAmount)"
ng-focus="$ctrl.customInputActive = true;"
ng-required="$ctrl.customInputActive"
placeholder="{{'OTHER_PLACEHOLDER' | translate}}" />
</label>
</div>
<div
role="alert"
ng-messages="$ctrl.itemConfigForm.amount.$error"
ng-if="($ctrl.itemConfigForm.amount | showErrors)">
<div class="help-block" ng-message="pattern" translate>{{'VALID_DOLLAR_AMOUNT_ERROR'}}</div>
<div class="help-block" ng-message="required" translate>{{'AMOUNT_EMPTY_ERROR'}}</div>
<div class="help-block" ng-message="minimum" translate translate-values="{currencyLimit: (1 | currency)}">{{'AMOUNT_MIN_ERROR'}}</div>
<div class="help-block" ng-message="maximum" translate translate-values="{currencyLimit: (10000000 | currency)}">{{'AMOUNT_MAX_ERROR'}}</div>
</div>
</div>
</div>

<div data-toggle="buttons"
ng-class="{'has-error': ($ctrl.itemConfigForm.amount | showErrors)}"
ng-if="!$ctrl.useSuggestedAmounts">
Expand Down Expand Up @@ -165,72 +146,7 @@ <h4 class="panel-title border-bottom-small" translate>
</div>
</div>
</div>
</fieldset>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'GIFT_FREQUENCY'}}
</h4>
<div class="panel-body">
<div data-toggle="buttons">
<label class="btn btn-radio btn-wide"
ng-repeat-start="f in $ctrl.productData.frequencies | orderBy: $ctrl.frequencyOrder track by $index"
ng-if="f.name !== 'SEMIANNUAL'"
ng-class="{'active': f.name === $ctrl.productData.frequency}"
ng-click="$ctrl.changeFrequency(f)">
<span class="giftsum-about giftsum-title" ng-switch="f.name">
<span ng-switch-when="NA" translate>{{'SINGLE_GIFT'}}</span>
<span ng-switch-default>{{f.display}}</span>
</span>
</label>
<span ng-repeat-end></span>
</div>
<loading inline="true" ng-if="$ctrl.changingFrequency" class="mt-- text-center">
<translate>{{'CHANGING_FREQUENCY'}}</translate>
</loading>
</div><!-- // panel-body -->
</div><!-- // panel -->
<div ng-if="$ctrl.productData.frequency !== 'NA'" class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt0 pt-" translate>
{{'RECURRING_START'}}
</h4>
<div class="panel-body pt0">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<label>
<span translate>{{'MONTH'}}</span>
<select class="form-control form-control-subtle"
ng-model="$ctrl.itemConfig['RECURRING_START_MONTH']"
ng-options="(m | date:'MM') as (m | date:'MMMM, yyyy') for m in $ctrl.possibleTransactionMonths($ctrl.nextDrawDate)"
ng-change="$ctrl.changeStartDay($ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'])">
</select>
</label>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label>
<span translate>{{'DAY'}}</span>
<select class="form-control form-control-subtle"
ng-model="$ctrl.itemConfig['RECURRING_DAY_OF_MONTH']"
ng-options="o as (o | ordinal) for o in $ctrl.possibleTransactionDays($ctrl.itemConfig['RECURRING_START_MONTH'], $ctrl.nextDrawDate)"
ng-change="$ctrl.changeStartDay($ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'])">
</select>
</label>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label translate>{{'GIFT_START_DATE'}}</label>
<div class="form-group">
{{$ctrl.startMonth( $ctrl.itemConfig['RECURRING_DAY_OF_MONTH'], $ctrl.itemConfig['RECURRING_START_MONTH'], $ctrl.nextDrawDate ).format('ll')}}
</div>
</div>
</div>
</div><!-- // panel -->
</div>
<div class="panel panel-default give-modal-panel">
<h4 class="panel-title border-bottom-small mt" translate>
{{'GIFT_FREQUENCY'}}
Expand Down

0 comments on commit 43e03ac

Please sign in to comment.