1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/frontend/templates/admin/plans/_form.html

160 lines
9.2 KiB
HTML
Raw Normal View History

<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}">
<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"
required="required"/>
<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}">
<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"
required="required"
ng-disabled="method == 'PATCH'">
<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>
<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}">
<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"
required="required"
ng-disabled="method == 'PATCH'">
<option value="all" translate>{{ 'app.shared.plan.transversal_all_groups' }}</option>
2016-03-23 18:39:41 +01:00
<optgroup label="Groupes">
<option ng-repeat="group in groups" ng-value="group.id" ng-selected="plan.group_id == group.id">{{group.name}}</option>
2016-03-23 18:39:41 +01:00
</optgroup>
</select>
<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>
<div class="form-group" ng-class="{'has-error': planForm['plan[interval]'].$dirty && planForm['plan[interval]'].$invalid}">
<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'"
required="required">
<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>
<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}">
<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'"
required="required"
min="1"/>
<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}">
<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>
<span class="help-block" ng-show="planForm['plan[amount]'].$dirty && planForm['plan[amount]'].$error.required" translate>{{ 'app.shared.plan.price_is_required' }}</span>
2016-03-23 18:39:41 +01:00
</div>
</div>
<div class="form-group">
<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">
{{ '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">
<label for="plan[is_rolling]" class="control-label m-r-md">{{ 'app.shared.plan.rolling_subscription' | translate }} *</label>
2016-03-23 18:39:41 +01:00
<input bs-switch
ng-model="plan.is_rolling"
2016-03-23 18:39:41 +01:00
id="plan[is_rolling]"
ng-if="method != 'PATCH'"
type="checkbox"
class="form-control"
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
2016-03-23 18:39:41 +01:00
switch-animate="true"
ng-true-value="'true'"
ng-false-value="'false'"/>
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>
<input type="hidden" name="plan[is_rolling]" value="{{plan.is_rolling}}"/>
2016-03-23 18:39:41 +01:00
<span class="help-block">
{{ '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>
<!-- 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"/>
<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>
<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]"
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" />
<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">
<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>
<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>
</div>