1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

[feature] weekly plans

This commit is contained in:
Sylvain 2017-03-21 13:06:02 +01:00
parent 21560dd5d9
commit 5abc85ae0a
4 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,7 @@
ng-model="plan.interval"
ng-disabled="method == 'PATCH'"
required="required">
<option value="week" ng-selected="plan.interval == 'week'" translate>{{ 'plan_form.week' }}</option>
<option value="month" ng-selected="plan.interval == 'month'" translate>{{ 'plan_form.month' }}</option>
<option value="year" ng-selected="plan.interval == 'year'" translate>{{ 'plan_form.year' }}</option>
</select>

View File

@ -27,7 +27,7 @@ class Plan < ActiveRecord::Base
validates :amount, :group, :base_name, presence: true
validates :interval_count, numericality: { only_integer: true, greater_than_or_equal_to: 1 }
validates :interval, inclusion: { in: %w(year month) }
validates :interval, inclusion: { in: %w(year month week) }
def self.create_for_all_groups(plan_params)
plans = []

View File

@ -213,6 +213,7 @@ en:
period: "Period"
year: "Year"
month: "Month"
week: "Week"
period_is_required: "Period is required."
subscription_price: "Subscription price"
price_is_required: "Price is required."

View File

@ -213,6 +213,7 @@ fr:
period: "Période"
year: "Année"
month: "Mois"
week: "Semaine"
period_is_required: "La période est requise."
subscription_price: "Coût de l'abonnement"
price_is_required: "Le prix est requis."