+
-
-
+
+
-
{{ plan.base_name }}
+
{{ plan.base_name }}
-
+
+
+
+
+ {{ 'app.public.plans.your_subscription_expires_on_the_DATE' | translate:{DATE:(ctrl.member.subscription.expired_at | amDateFormat:'L' )} }}
+
-
-
-
-
- {{ 'app.public.plans.your_subscription_expires_on_the_DATE' | translate:{DATE:(ctrl.member.subscription.expired_at | amDateFormat:'L' )} }}
-
-
-
+
+
+ {{ 'app.public.plans.no_plans' }}
diff --git a/app/models/plan.rb b/app/models/plan.rb
index cc108cb81..1316c4452 100644
--- a/app/models/plan.rb
+++ b/app/models/plan.rb
@@ -59,13 +59,15 @@ class Plan < ApplicationRecord
def create_machines_prices
Machine.all.each do |machine|
- Price.create(priceable: machine, plan: self, group_id: group_id, amount: 0)
+ default_price = Price.find_by(priceable: machine, plan: nil, group_id: group_id)&.amount || 0
+ Price.create(priceable: machine, plan: self, group_id: group_id, amount: default_price)
end
end
def create_spaces_prices
Space.all.each do |space|
- Price.create(priceable: space, plan: self, group_id: group_id, amount: 0)
+ default_price = Price.find_by(priceable: space, plan: nil, group_id: group_id)&.amount || 0
+ Price.create(priceable: space, plan: self, group_id: group_id, amount: default_price)
end
end
diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml
index efbc65756..2442f1ff9 100644
--- a/config/locales/app.public.en.yml
+++ b/config/locales/app.public.en.yml
@@ -240,6 +240,7 @@ en:
i_already_subscribed: "I already subscribed"
more_information: "More information"
your_subscription_expires_on_the_DATE: "Your subscription expires on the {DATE}"
+ no_plans: "No plans are available for your group"
my_group: "My group"
his_group: "{GENDER, select, male{His} female{Her} other{Its}} group"
he_wants_to_change_group: "{ROLE, select, member{I want} other{The user wants}} to change group"
diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml
index e2b5000d0..54a7308fe 100644
--- a/config/locales/app.public.fr.yml
+++ b/config/locales/app.public.fr.yml
@@ -240,6 +240,7 @@ fr:
i_already_subscribed: "Je suis déjà abonné"
more_information: "Plus d'infos"
your_subscription_expires_on_the_DATE: "Votre abonnement expire au {DATE}"
+ no_plans: "Aucun abonnement n'est disponible pour votre groupe"
my_group: "Mon groupe"
his_group: "Son groupe"
he_wants_to_change_group: "{ROLE, select, member{Je veux} other{L'utilisateur veut}} changer de groupe"