mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-06 01:08:21 +01:00
use plant.base_name instands of plan.name
This commit is contained in:
parent
a9901fccb2
commit
1c54e54c17
@ -956,14 +956,14 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
});
|
});
|
||||||
$scope.tagsName = localizedList(tags);
|
$scope.tagsName = localizedList(tags);
|
||||||
if ($scope.isOnlySubscriptions && $scope.selectedPlans.length > 0) {
|
if ($scope.isOnlySubscriptions && $scope.selectedPlans.length > 0) {
|
||||||
$scope.plansName = localizedList($scope.selectedPlans);
|
$scope.plansName = localizedList($scope.selectedPlans, 'base_name');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const localizedList = function (items) {
|
const localizedList = function (items, attr = 'name') {
|
||||||
if (items.length === 0) return `<span class="text-gray text-italic">${_t('app.admin.calendar.none')}</span>`;
|
if (items.length === 0) return `<span class="text-gray text-italic">${_t('app.admin.calendar.none')}</span>`;
|
||||||
|
|
||||||
const names = items.map(function (i) { return $sce.trustAsHtml(`<strong>${i.name}</strong>`); });
|
const names = items.map(function (i) { return $sce.trustAsHtml(`<strong>${i[attr]}</strong>`); });
|
||||||
if (items.length > 1) return names.slice(0, -1).join(', ') + ` ${_t('app.admin.calendar.and')} ` + names[names.length - 1];
|
if (items.length > 1) return names.slice(0, -1).join(', ') + ` ${_t('app.admin.calendar.and')} ` + names[names.length - 1];
|
||||||
|
|
||||||
return names[0];
|
return names[0];
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
<div class="font-sbold">{{::g.name}}</div>
|
<div class="font-sbold">{{::g.name}}</div>
|
||||||
<ul class="m-n" ng-repeat="plan in g.plans">
|
<ul class="m-n" ng-repeat="plan in g.plans">
|
||||||
<li>
|
<li>
|
||||||
{{::plan.name}}
|
{{::plan.base_name}}
|
||||||
<span class="btn btn-warning btn-xs" ng-click="removePlan(plan)" ><i class="fa fa-times red"></i></span>
|
<span class="btn btn-warning btn-xs" ng-click="removePlan(plan)" ><i class="fa fa-times red"></i></span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -149,7 +149,7 @@
|
|||||||
<div ng-repeat="group in plansClassifiedByGroup">
|
<div ng-repeat="group in plansClassifiedByGroup">
|
||||||
<div class="text-center font-sbold">{{::group.name}}</div>
|
<div class="text-center font-sbold">{{::group.name}}</div>
|
||||||
<label class="checkbox m-l-md" ng-repeat="plan in group.plans">
|
<label class="checkbox m-l-md" ng-repeat="plan in group.plans">
|
||||||
<input type="checkbox" ng-click="toggleSelectPlan(plan)" ng-model="selectedPlansBinding[plan.id]"> {{::plan.name}}</span>
|
<input type="checkbox" ng-click="toggleSelectPlan(plan)" ng-model="selectedPlansBinding[plan.id]"> {{::plan.base_name}}</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<div ng-repeat="group in slot.plansGrouped">
|
<div ng-repeat="group in slot.plansGrouped">
|
||||||
<div class="font-sbold">{{::group.name}}</div>
|
<div class="font-sbold">{{::group.name}}</div>
|
||||||
<ul class="m-n" ng-repeat="plan in group.plans">
|
<ul class="m-n" ng-repeat="plan in group.plans">
|
||||||
<li>{{::plan.name}}</li>
|
<li>{{::plan.base_name}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<div ng-repeat="group in slot.plansGrouped">
|
<div ng-repeat="group in slot.plansGrouped">
|
||||||
<div class="font-sbold">{{::group.name}}</div>
|
<div class="font-sbold">{{::group.name}}</div>
|
||||||
<ul class="m-n" ng-repeat="plan in group.plans">
|
<ul class="m-n" ng-repeat="plan in group.plans">
|
||||||
<li>{{::plan.name}}</li>
|
<li>{{::plan.base_name}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,7 @@ class CartItem::Subscription < CartItem::BaseItem
|
|||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name
|
||||||
@plan.name
|
@plan.base_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_object
|
def to_object
|
||||||
|
@ -132,6 +132,6 @@ class Plan < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_gateway_product
|
def update_gateway_product
|
||||||
PaymentGatewayService.new.create_or_update_product(Plan.name, id)
|
PaymentGatewayService.new.create_or_update_product(Plan.base_name, id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,7 +57,7 @@ class Subscription < ApplicationRecord
|
|||||||
operator_profile_id: operator_profile_id,
|
operator_profile_id: operator_profile_id,
|
||||||
total: 0
|
total: 0
|
||||||
)
|
)
|
||||||
invoice.invoice_items.push InvoiceItem.new(amount: 0, description: plan.name, object: od)
|
invoice.invoice_items.push InvoiceItem.new(amount: 0, description: plan.base_name, object: od)
|
||||||
invoice.save
|
invoice.save
|
||||||
|
|
||||||
if save
|
if save
|
||||||
|
@ -175,7 +175,7 @@ class InvoicesService
|
|||||||
|
|
||||||
invoice.invoice_items.push InvoiceItem.new(
|
invoice.invoice_items.push InvoiceItem.new(
|
||||||
amount: payment_details[:elements][:plan],
|
amount: payment_details[:elements][:plan],
|
||||||
description: subscription.plan.name,
|
description: subscription.plan.base_name,
|
||||||
object: subscription,
|
object: subscription,
|
||||||
main: main
|
main: main
|
||||||
)
|
)
|
||||||
|
@ -249,7 +249,7 @@ class PaymentScheduleService
|
|||||||
|
|
||||||
invoice.invoice_items.push InvoiceItem.new(
|
invoice.invoice_items.push InvoiceItem.new(
|
||||||
amount: payment_details[:subscription],
|
amount: payment_details[:subscription],
|
||||||
description: subscription.plan.name,
|
description: subscription.plan.base_name,
|
||||||
object: subscription,
|
object: subscription,
|
||||||
main: main
|
main: main
|
||||||
)
|
)
|
||||||
|
@ -57,6 +57,7 @@ json.array!(@members) do |member|
|
|||||||
json.plan do
|
json.plan do
|
||||||
json.id member.subscription.plan.id
|
json.id member.subscription.plan.id
|
||||||
json.name member.subscription.plan.name
|
json.name member.subscription.plan.name
|
||||||
|
json.base_name member.subscription.plan.base_name
|
||||||
json.interval member.subscription.plan.interval
|
json.interval member.subscription.plan.interval
|
||||||
json.amount member.subscription.plan.amount ? (member.subscription.plan.amount / 100.0) : 0
|
json.amount member.subscription.plan.amount ? (member.subscription.plan.amount / 100.0) : 0
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description t('.subscription_PLAN_has_been_subscribed_by_USER_html',
|
json.description t('.subscription_PLAN_has_been_subscribed_by_USER_html',
|
||||||
PLAN: notification.attached_object.plan.name,
|
PLAN: notification.attached_object.plan.base_name,
|
||||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'))
|
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'))
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description _t('.subscription_PLAN_of_the_member_USER_has_been_extended_FREE_until_DATE_html',
|
json.description _t('.subscription_PLAN_of_the_member_USER_has_been_extended_FREE_until_DATE_html',
|
||||||
{
|
{
|
||||||
PLAN: notification.attached_object.plan.name,
|
PLAN: notification.attached_object.plan.base_name,
|
||||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'),
|
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'),
|
||||||
FREE: notification.get_meta_data(:free_days).to_s,
|
FREE: notification.get_meta_data(:free_days).to_s,
|
||||||
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
||||||
}) # messageFormat
|
}) # messageFormat
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description t('.you_have_subscribed_to_PLAN_html',
|
json.description t('.you_have_subscribed_to_PLAN_html',
|
||||||
PLAN: notification.attached_object.plan.name)
|
PLAN: notification.attached_object.plan.base_name)
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description t('.your_subscription_PLAN_was_successfully_cancelled_html',
|
json.description t('.your_subscription_PLAN_was_successfully_cancelled_html',
|
||||||
PLAN: notification.attached_object.plan.name)
|
PLAN: notification.attached_object.plan.base_name)
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description _t('.your_subscription_PLAN_has_been_extended_FREE_until_DATE_html',
|
json.description _t('.your_subscription_PLAN_has_been_extended_FREE_until_DATE_html',
|
||||||
{
|
{
|
||||||
PLAN: notification.attached_object.plan.name,
|
PLAN: notification.attached_object.plan.base_name,
|
||||||
FREE: notification.get_meta_data(:free_days).to_s,
|
FREE: notification.get_meta_data(:free_days).to_s,
|
||||||
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
||||||
}) # messageFormat
|
}) # messageFormat
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
json.title notification.notification_type
|
json.title notification.notification_type
|
||||||
json.description t('.subscription_partner_PLAN_has_been_subscribed_by_USER_html',
|
json.description t('.subscription_partner_PLAN_has_been_subscribed_by_USER_html',
|
||||||
{
|
{
|
||||||
PLAN: notification.attached_object.plan.name,
|
PLAN: notification.attached_object.plan.base_name,
|
||||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user')
|
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user')
|
||||||
}) # messageFormat
|
}) # messageFormat
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user