mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-30 11:24:21 +01:00
135 lines
7.3 KiB
HTML
135 lines
7.3 KiB
HTML
<div class="form-group" ng-class="{'has-error': couponForm['coupon[name]'].$dirty && couponForm['coupon[name]'].$invalid}">
|
|
<label for="coupon[name]">{{ 'app.shared.coupon.name' | translate }} *</label>
|
|
<input type="text" id="coupon[name]"
|
|
name="coupon[name]"
|
|
class="form-control"
|
|
ng-model="coupon.name"
|
|
required="true"/>
|
|
<span class="help-block error" ng-show="couponForm['coupon[name]'].$dirty && couponForm['coupon[name]'].$error.required" translate>{{ 'app.shared.coupon.name_is_required' }}</span>
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': couponForm['coupon[code]'].$dirty && couponForm['coupon[code]'].$invalid}">
|
|
<label for="coupon[code]">{{ 'app.shared.coupon.code' | translate }} *</label>
|
|
<input type="text" id="coupon[code]"
|
|
name="coupon[code]"
|
|
class="form-control"
|
|
ng-model="coupon.code"
|
|
ng-pattern="/^[A-Z0-9\-]+$/"
|
|
ng-disabled="mode == 'EDIT'"
|
|
required="true"/>
|
|
<span class="help-block error" ng-show="couponForm['coupon[code]'].$dirty && couponForm['coupon[code]'].$error.required" translate>{{ 'app.shared.coupon.code_is_required' }}</span>
|
|
<span class="help-block error" ng-show="couponForm['coupon[code]'].$dirty && couponForm['coupon[code]'].$error.pattern" translate>{{ 'app.shared.coupon.code_must_be_composed_of_capital_letters_digits_and_or_dashes' }}</span>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="coupon[type]">{{ 'app.shared.coupon.kind_of_coupon' | translate }} *</label>
|
|
<select id="coupon[type]"
|
|
name="coupon[type]"
|
|
class="form-control"
|
|
ng-model="coupon.type"
|
|
ng-disabled="mode == 'EDIT'"
|
|
required="true">
|
|
<option value="percent_off" translate>{{ 'app.shared.coupon.percentage' }}</option>
|
|
<option value="amount_off" translate>{{ 'app.shared.coupon.amount' }}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': couponForm['coupon[percent_off]'].$dirty && couponForm['coupon[percent_off]'].$invalid}" ng-show="coupon.type == 'percent_off'">
|
|
<label for="coupon[percent_off]">{{ 'app.shared.coupon.percent_off' | translate }} *</label>
|
|
<div class="input-group">
|
|
<input type="number" id="coupon[percent_off]"
|
|
name="coupon[percent_off]"
|
|
class="form-control"
|
|
ng-model="coupon.percent_off"
|
|
min="0"
|
|
max="100"
|
|
ng-disabled="mode == 'EDIT'"
|
|
ng-required="coupon.type == 'percent_off'"/>
|
|
<span class="input-group-addon"><i class="fa fa-percent"></i></span>
|
|
</div>
|
|
<span class="help-block error" ng-show="couponForm['coupon[percent_off]'].$dirty && couponForm['coupon[percent_off]'].$error.required" translate>{{ 'app.shared.coupon.percent_off_is_required' }}</span>
|
|
<span class="help-block error" ng-show="couponForm['coupon[percent_off]'].$dirty && (couponForm['coupon[percent_off]'].$error.min || couponForm['coupon[percent_off]'].$error.max)" translate>{{ 'app.shared.coupon.percentage_must_be_between_0_and_100' }}</span>
|
|
</div>
|
|
|
|
|
|
<div class="form-group" ng-class="{'has-error': couponForm['coupon[amount_off]'].$dirty && couponForm['coupon[amount_off]'].$invalid}" ng-show="coupon.type == 'amount_off'">
|
|
<div class="input-group">
|
|
<span class="input-group-addon">{{currencySymbol}}</span>
|
|
<input type="number" id="coupon[amount_off]"
|
|
name="coupon[amount_off]"
|
|
class="form-control"
|
|
ng-model="coupon.amount_off"
|
|
min="0"
|
|
ng-disabled="mode == 'EDIT'"
|
|
ng-required="coupon.type == 'amount_off'"/>
|
|
</div>
|
|
<span class="help-block error" ng-show="couponForm['coupon[percent_off]'].$dirty && couponForm['coupon[percent_off]'].$error.required" translate>{{ 'app.shared.coupon.percent_off_is_required' }}</span>
|
|
<span class="help-block error" ng-show="couponForm['coupon[percent_off]'].$dirty && (couponForm['coupon[percent_off]'].$error.min || couponForm['coupon[percent_off]'].$error.max)" translate>{{ 'app.shared.coupon.percentage_must_be_between_0_and_100' }}</span>
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': couponForm['coupon[validity_per_user]'].$dirty && couponForm['coupon[validity_per_user]'].$invalid}">
|
|
<label for="coupon[validity_per_user]">{{ 'app.shared.coupon.validity_per_user' | translate }} *</label>
|
|
<select id="coupon[validity_per_user]"
|
|
name="coupon[validity_per_user]"
|
|
class="form-control"
|
|
ng-model="coupon.validity_per_user"
|
|
required="true"
|
|
ng-disabled="mode == 'EDIT'"
|
|
ng-options="validityName(validity) for validity in validities">
|
|
</select>
|
|
<span class="help-block error" ng-show="couponForm['coupon[validity_per_user]'].$dirty && couponForm['coupon[validity_per_user]'].$error.required" translate>{{ 'app.shared.coupon.validity_per_user_is_required' }}</span>
|
|
</div>
|
|
<p class="alert alert-warning" ng-show="coupon.validity_per_user == 'once'" translate>{{ 'app.shared.coupon.warn_validity_once' }}</p>
|
|
<p class="alert alert-warning" ng-show="coupon.validity_per_user == 'forever'" translate>{{ 'app.shared.coupon.warn_validity_forever' }}</p>
|
|
|
|
<div class="form-group" ng-class="{'has-error': errors['valid_until']}">
|
|
<label for="coupon[valid_until]" translate>{{ 'app.shared.coupon.valid_until' }}</label>
|
|
<div class="input-group">
|
|
<input type="text" id="coupon[valid_until]"
|
|
name="coupon[valid_until]"
|
|
class="form-control"
|
|
ng-model="coupon.valid_until"
|
|
uib-datepicker-popup="{{datePicker.format}}"
|
|
datepicker-options="datePicker.options"
|
|
is-open="datePicker.opened"
|
|
min-date="datePicker.minDate"
|
|
ng-click="toggleDatePicker($event)"/>
|
|
<span class="input-group-btn">
|
|
<button type="button" class="btn btn-default" ng-click="toggleDatePicker($event)" ng-disabled="mode == 'EDIT'"><i class="fa fa-calendar"></i></button>
|
|
</span>
|
|
</div>
|
|
<span class="help-block error" ng-show="errors['valid_until']">{{ errors['valid_until'].join(' ; ') }}</span>
|
|
|
|
<span class="text-info text-xs">
|
|
<i class="fa fa-lightbulb-o"></i> {{ 'app.shared.coupon.leave_empty_for_no_limit' | translate }}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': couponForm['coupon[max_usages]'].$dirty && couponForm['coupon[max_usages]'].$invalid}">
|
|
<label for="coupon[max_usages]">{{ 'app.shared.coupon.max_usages' | translate }}</label>
|
|
<input type="number" id="coupon[max_usages]"
|
|
name="coupon[max_usages]"
|
|
class="form-control"
|
|
ng-model="coupon.max_usages"
|
|
ng-disabled="mode == 'EDIT'"
|
|
min="0"/>
|
|
<span class="help-block error" ng-show="couponForm['coupon[max_usages]'].$dirty && couponForm['coupon[max_usages]'].$error.min" translate>{{ 'app.shared.coupon.max_usages_must_be_equal_or_greater_than_0' }}</span>
|
|
|
|
<span class="text-info text-xs">
|
|
<i class="fa fa-lightbulb-o"></i> {{ 'app.shared.coupon.leave_empty_for_no_limit' | translate }}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="coupon[active]" translate>{{ 'app.shared.coupon.enabled' }}</label>
|
|
<input bs-switch
|
|
ng-model="coupon.active"
|
|
id="coupon[active]"
|
|
type="checkbox"
|
|
class="form-control"
|
|
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
|
|
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
|
|
switch-animate="true" />
|
|
<input type="hidden" name="coupon[active]" value="{{coupon.active}}"/>
|
|
</div>
|