2019-12-17 12:40:36 +01:00
|
|
|
<h2 translate>{{ 'app.shared.plan.general_information' }}</h2>
|
2016-03-23 18:39:41 +01:00
|
|
|
<input type="hidden" name="_method" value="{{method}}">
|
|
|
|
|
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[base_name]'].$dirty && planForm['plan[base_name]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[base_name]">{{ 'app.shared.plan.name' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<input type="text" id="plan[base_name]"
|
|
|
|
name="plan[base_name]"
|
|
|
|
class="form-control"
|
|
|
|
ng-maxlength="24"
|
|
|
|
ng-model="plan.base_name"
|
2021-03-24 18:24:03 +01:00
|
|
|
required="true"/>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block error" ng-show="planForm['plan[base_name]'].$dirty && planForm['plan[base_name]'].$error.required" translate>{{ 'app.shared.plan.name_is_required' }}</span>
|
|
|
|
<span class="help-block error" ng-show="planForm['plan[base_name]'].$dirty && planForm['plan[base_name]'].$error.maxlength" translate>{{ 'app.shared.plan.name_length_must_be_less_than_24_characters' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[type]'].$dirty && planForm['plan[type]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[type]">{{ 'app.shared.plan.type' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<select id="plan[type]"
|
|
|
|
name="plan[type]"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="plan.type"
|
2021-03-24 18:24:03 +01:00
|
|
|
required="true"
|
2016-03-23 18:39:41 +01:00
|
|
|
ng-disabled="method == 'PATCH'">
|
2019-12-18 13:04:38 +01:00
|
|
|
<option value="Plan" ng-selected="plan.type == 'Plan'" translate>{{ 'app.shared.plan.standard' }}</option>
|
|
|
|
<option value="PartnerPlan" ng-selected="plan.type == 'PartnerPlan'" translate>{{ 'app.shared.plan.partner' }}</option>
|
2016-03-23 18:39:41 +01:00
|
|
|
</select>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block error" ng-show="planForm['plan[type]'].$dirty && planForm['plan[type]'].$error.required" translate>{{ 'app.shared.plan.type_is_required' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[group_id]'].$dirty && planForm['plan[group_id]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[group_id]">{{ 'app.shared.plan.group' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<select id="plan[group_id]"
|
|
|
|
name="plan[group_id]"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="plan.group_id"
|
2021-03-24 18:24:03 +01:00
|
|
|
required="true"
|
2020-09-23 15:21:20 +02:00
|
|
|
ng-if="method !== 'PATCH'"
|
|
|
|
ng-options="item.id as translateLabel(item, 'name') group by translateLabel(item, 'category') for item in groups track by item.id">
|
2016-03-23 18:39:41 +01:00
|
|
|
</select>
|
2020-09-23 15:21:20 +02:00
|
|
|
<input type="text"
|
|
|
|
id="plan[group_id]"
|
|
|
|
ng-value="selectedGroup()"
|
|
|
|
ng-if="method == 'PATCH'"
|
|
|
|
class="form-control"
|
|
|
|
disabled />
|
|
|
|
<input type="hidden"
|
|
|
|
name="plan[group_id]"
|
|
|
|
ng-value="plan.group_id"
|
|
|
|
ng-if="method == 'PATCH'"/>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="planForm['plan[group_id]'].$dirty && planForm['plan[group_id]'].$error.required" translate>{{ 'app.shared.plan.group_is_required' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
|
2021-06-08 17:26:40 +02:00
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[plan_category_id]'].$dirty && planForm['plan[group_id]'].$invalid}">
|
2021-06-09 13:03:58 +02:00
|
|
|
<label for="plan[plan_category_id]">{{ 'app.shared.plan.category' | translate }}</label>
|
2021-06-08 17:26:40 +02:00
|
|
|
<select id="plan[plan_category_id]"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="plan.plan_category_id"
|
2021-06-09 09:47:56 +02:00
|
|
|
ng-options="cat.id as cat.name for cat in planCategories">
|
2021-06-08 17:26:40 +02:00
|
|
|
</select>
|
|
|
|
<input type="hidden"
|
|
|
|
name="plan[plan_category_id]"
|
|
|
|
ng-value="plan.plan_category_id"/>
|
|
|
|
</div>
|
2016-03-23 18:39:41 +01:00
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[interval]'].$dirty && planForm['plan[interval]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[interval]">{{ 'app.shared.plan.period' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<select id="plan[interval]"
|
|
|
|
name="plan[interval]"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="plan.interval"
|
|
|
|
ng-disabled="method == 'PATCH'"
|
2021-03-24 18:24:03 +01:00
|
|
|
required="true">
|
2019-12-17 12:40:36 +01:00
|
|
|
<option value="week" ng-selected="plan.interval == 'week'" translate>{{ 'app.shared.plan.week' }}</option>
|
|
|
|
<option value="month" ng-selected="plan.interval == 'month'" translate>{{ 'app.shared.plan.month' }}</option>
|
|
|
|
<option value="year" ng-selected="plan.interval == 'year'" translate>{{ 'app.shared.plan.year' }}</option>
|
2016-03-23 18:39:41 +01:00
|
|
|
</select>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="planForm['plan[interval]'].$dirty && planForm['plan[interval]'].$error.required" translate>{{ 'app.shared.plan.period_is_required' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group" ng-class="{'has-error': planForm['plan[interval_count]'].$dirty && planForm['plan[interval_count]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[interval]">{{ 'app.shared.plan.number_of_periods' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<input id="plan[interval_count]"
|
|
|
|
name="plan[interval_count]"
|
|
|
|
class="form-control"
|
|
|
|
type="number"
|
|
|
|
ng-model="plan.interval_count"
|
|
|
|
ng-disabled="method == 'PATCH'"
|
2021-03-24 18:24:03 +01:00
|
|
|
required="true"
|
2016-03-23 18:39:41 +01:00
|
|
|
min="1"/>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="planForm['plan[interval_count]'].$dirty && planForm['plan[interval_count]'].$error.required" translate>{{ 'app.shared.plan.number_of_periods_is_required' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="input-group" ng-class="{'has-error': planForm['plan[amount]'].$dirty && planForm['plan[amount]'].$invalid}">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[amount]">{{ 'app.shared.plan.subscription_price' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon">{{currencySymbol}}</span>
|
|
|
|
<input id="plan[amount]"
|
|
|
|
name="plan[amount]"
|
|
|
|
type="number"
|
|
|
|
class="form-control"
|
|
|
|
ng-required="true"
|
|
|
|
ng-model="plan.amount"/>
|
|
|
|
</div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="planForm['plan[amount]'].$dirty && planForm['plan[amount]'].$error.required" translate>{{ 'app.shared.plan.price_is_required' }}</span>
|
2020-10-27 13:06:37 +01:00
|
|
|
<span class="help-block alert alert-warning" ng-if="method == 'PATCH'">
|
|
|
|
<i class="fa fa-warning"></i>
|
|
|
|
{{ 'app.shared.plan.edit_amount_info' | translate }}
|
|
|
|
</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label translate>{{ 'app.shared.plan.visual_prominence_of_the_subscription' }}</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<input ng-model="plan.ui_weight"
|
|
|
|
type="number"
|
|
|
|
name="plan[ui_weight]"
|
|
|
|
class="form-control">
|
|
|
|
<span class="help-block">
|
2019-12-17 12:40:36 +01:00
|
|
|
{{ 'app.shared.plan.on_the_subscriptions_page_the_most_prominent_subscriptions_will_be_placed_at_the_top_of_the_list' | translate }}
|
|
|
|
{{ 'app.shared.plan.an_evelated_number_means_a_higher_prominence' | translate }}
|
2016-03-23 18:39:41 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="input-group m-t-md">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[is_rolling]" class="control-label m-r-md">{{ 'app.shared.plan.rolling_subscription' | translate }} *</label>
|
2020-10-27 13:06:37 +01:00
|
|
|
<switch id="plan[is_rolling]" checked="plan.is_rolling" on-change="toggleIsRolling" class-name="'v-middle'" ng-if="plan && method != 'PATCH'"></switch>
|
2020-02-18 15:49:08 +01:00
|
|
|
<span ng-if="method == 'PATCH'">{{ (plan.is_rolling ? 'app.shared.buttons.yes' : 'app.shared.buttons.no') | translate }}</span>
|
2017-03-15 12:50:19 +01:00
|
|
|
<input type="hidden" name="plan[is_rolling]" value="{{plan.is_rolling}}"/>
|
2016-03-23 18:39:41 +01:00
|
|
|
<span class="help-block">
|
2019-12-17 12:40:36 +01:00
|
|
|
{{ 'app.shared.plan.a_rolling_subscription_will_begin_the_day_of_the_first_training' | translate }}
|
|
|
|
{{ 'app.shared.plan.otherwise_it_will_begin_as_soon_as_it_is_bought' | translate }}
|
2016-03-23 18:39:41 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2020-10-27 13:06:37 +01:00
|
|
|
<div class="input-group m-t-md">
|
|
|
|
<label for="plan[monthly_payment]" class="control-label m-r-md">{{ 'app.shared.plan.monthly_payment' | translate }} *</label>
|
2021-02-10 14:19:14 +01:00
|
|
|
<switch id="plan[monthly_payment]" disabled="plan.interval === 'week'" checked="plan.monthly_payment" on-change="toggleMonthlyPayment" class-name="'v-middle'" ng-if="plan && method != 'PATCH'"></switch>
|
2020-10-27 13:06:37 +01:00
|
|
|
<span ng-if="method == 'PATCH'">{{ (plan.monthly_payment ? 'app.shared.buttons.yes' : 'app.shared.buttons.no') | translate }}</span>
|
|
|
|
<input type="hidden" id="plan_monthly_input" name="plan[monthly_payment]" value="{{plan.monthly_payment}}" />
|
|
|
|
<span class="help-block" translate>{{ 'app.shared.plan.monthly_payment_info' }}</span>
|
|
|
|
</div>
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2021-03-08 14:09:11 +01:00
|
|
|
<div class="input-group m-t-md plan-description-input">
|
2021-03-03 17:21:06 +01:00
|
|
|
<label for="plan[description]" class="control-label m-r-md" translate>{{ 'app.shared.plan.description' }}</label>
|
|
|
|
<div class="medium-editor-input">
|
2021-03-22 11:32:04 +01:00
|
|
|
<div ng-model="plan.description"
|
|
|
|
medium-editor
|
|
|
|
options='{
|
|
|
|
"placeholder": "{{ "app.shared.plan.type_a_short_description" | translate }}",
|
|
|
|
"buttons": ["bold", "italic", "anchor", "unorderedlist", "header2" ],
|
|
|
|
"targetBlank": true,
|
|
|
|
}'>
|
2021-03-03 17:21:06 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<input type="hidden" id="plan[description]" name="plan[description]" value="{{plan.description}}" />
|
|
|
|
</div>
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
<!-- PDF description attachement -->
|
|
|
|
<input type="hidden" ng-model="plan.plan_file_attributes.id" name="plan[plan_file_attributes][id]" ng-value="plan.plan_file_attributes.id" />
|
|
|
|
<input type="hidden" ng-model="plan.plan_file_attributes._destroy" name="plan[plan_file_attributes][_destroy]" ng-value="plan.plan_file_attributes._destroy"/>
|
2019-12-17 12:40:36 +01:00
|
|
|
<label class="m-t-md" translate>{{ 'app.shared.plan.information_sheet' }}</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<div class="fileinput input-group" data-provides="fileinput" ng-class="fileinputClass(plan.plan_file_attributes)">
|
|
|
|
<div class="form-control" data-trigger="fileinput">
|
|
|
|
<i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename">{{file.attachment || plan.plan_file_attributes.attachment_identifier}}</span>
|
|
|
|
</div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new" translate>{{ 'app.shared.plan.attach_an_information_sheet' }}</span>
|
2019-12-17 18:06:56 +01:00
|
|
|
<span class="fileinput-exists" translate>{{ 'app.shared.buttons.change' }}</span><input type="file"
|
2016-03-23 18:39:41 +01:00
|
|
|
name="plan[plan_file_attributes][attachment]"
|
2020-06-02 17:57:24 +02:00
|
|
|
accept="image/jpeg,image/gif,image/png,application/pdf"></span>
|
2016-03-23 18:39:41 +01:00
|
|
|
<a class="input-group-addon btn btn-danger fileinput-exists" data-dismiss="fileinput" ng-click="deleteFile(file || plan.plan_file_attributes)"><i class="fa fa-trash-o"></i></a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group m-t-md" ng-show="plan.type == 'PartnerPlan' && method != 'PATCH'">
|
|
|
|
<input type="hidden" ng-model="plan.partnerId" name="plan[partner_id]" ng-value="plan.partnerId" />
|
2019-12-17 12:40:36 +01:00
|
|
|
<label for="plan[partner_id]">{{ 'app.shared.plan.notified_partner' | translate }} *</label>
|
2016-03-23 18:39:41 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<select class="form-control"
|
|
|
|
ng-model="plan.partnerId"
|
|
|
|
ng-options="p.id as (p.name + ' <'+p.email+'>') for p in partners"
|
|
|
|
id="plan[partner_id]">
|
|
|
|
<option value=""></option>
|
|
|
|
</select>
|
|
|
|
<span class="input-group-btn">
|
2019-12-17 12:40:36 +01:00
|
|
|
<button class="btn btn-default" type="button" ng-click="openPartnerNewModal()"><i class="fa fa-user-plus"></i> {{ 'app.shared.plan.new_user' | translate }}</button>
|
2016-03-23 18:39:41 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" translate>{{ 'app.shared.plan.as_part_of_a_partner_subscription_some_notifications_may_be_sent_to_this_user' }}</span>
|
2016-03-23 18:39:41 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group" ng-show="plan.partners">
|
|
|
|
<label>Partenaire notifié</label>
|
|
|
|
<span ng-repeat="partner in plan.partners">
|
|
|
|
<input type="text" class="form-control" disabled value="{{ partner.first_name}} {{partner.last_name }}">
|
|
|
|
</span>
|
2016-10-07 11:11:58 +02:00
|
|
|
</div>
|