mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-03-01 23:29:23 +01:00
using the <plan-card> component in embedded plans view
This commit is contained in:
parent
187cb9f06d
commit
f2c81a634a
@ -620,13 +620,24 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$stat
|
|||||||
* @param plan {Object} the plan to subscribe
|
* @param plan {Object} the plan to subscribe
|
||||||
*/
|
*/
|
||||||
$scope.selectPlan = function (plan) {
|
$scope.selectPlan = function (plan) {
|
||||||
// toggle selected plan
|
setTimeout(() => {
|
||||||
if ($scope.selectedPlan !== plan) {
|
// toggle selected plan
|
||||||
$scope.selectedPlan = plan;
|
if ($scope.selectedPlan !== plan) {
|
||||||
} else {
|
$scope.selectedPlan = plan;
|
||||||
$scope.selectedPlan = null;
|
} else {
|
||||||
}
|
$scope.selectedPlan = null;
|
||||||
return $scope.planSelectionTime = new Date();
|
}
|
||||||
|
$scope.planSelectionTime = new Date();
|
||||||
|
$scope.$apply();
|
||||||
|
}, 50);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the provided plan is currently selected
|
||||||
|
* @param plan {Object} Resource plan
|
||||||
|
*/
|
||||||
|
$scope.isSelected = function (plan) {
|
||||||
|
return $scope.selectedPlan === plan;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -517,13 +517,24 @@ Application.Controllers.controller('ReserveSpaceController', ['$scope', '$stateP
|
|||||||
* @param plan {Object} the plan to subscribe
|
* @param plan {Object} the plan to subscribe
|
||||||
*/
|
*/
|
||||||
$scope.selectPlan = function (plan) {
|
$scope.selectPlan = function (plan) {
|
||||||
// toggle selected plan
|
setTimeout(() => {
|
||||||
if ($scope.selectedPlan !== plan) {
|
// toggle selected plan
|
||||||
$scope.selectedPlan = plan;
|
if ($scope.selectedPlan !== plan) {
|
||||||
} else {
|
$scope.selectedPlan = plan;
|
||||||
$scope.selectedPlan = null;
|
} else {
|
||||||
}
|
$scope.selectedPlan = null;
|
||||||
return $scope.planSelectionTime = new Date();
|
}
|
||||||
|
$scope.planSelectionTime = new Date();
|
||||||
|
$scope.$apply();
|
||||||
|
}, 50);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the provided plan is currently selected
|
||||||
|
* @param plan {Object} Resource plan
|
||||||
|
*/
|
||||||
|
$scope.isSelected = function (plan) {
|
||||||
|
return $scope.selectedPlan === plan;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -307,13 +307,24 @@ Application.Controllers.controller('ReserveTrainingController', ['$scope', '$sta
|
|||||||
* @param plan {Object} the plan to subscribe
|
* @param plan {Object} the plan to subscribe
|
||||||
*/
|
*/
|
||||||
$scope.selectPlan = function (plan) {
|
$scope.selectPlan = function (plan) {
|
||||||
// toggle selected plan
|
setTimeout(() => {
|
||||||
if ($scope.selectedPlan !== plan) {
|
// toggle selected plan
|
||||||
$scope.selectedPlan = plan;
|
if ($scope.selectedPlan !== plan) {
|
||||||
} else {
|
$scope.selectedPlan = plan;
|
||||||
$scope.selectedPlan = null;
|
} else {
|
||||||
}
|
$scope.selectedPlan = null;
|
||||||
return $scope.planSelectionTime = new Date();
|
}
|
||||||
|
$scope.planSelectionTime = new Date();
|
||||||
|
$scope.$apply();
|
||||||
|
}, 50);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the provided plan is currently selected
|
||||||
|
* @param plan {Object} Resource plan
|
||||||
|
*/
|
||||||
|
$scope.isSelected = function (plan) {
|
||||||
|
return $scope.selectedPlan === plan;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,20 +11,12 @@
|
|||||||
ng-class="{'col-md-12 col-lg-12':(plansGroup.plans.filter(filterDisabledPlans).length % 2 == 1 && key == plansGroup.plans.filter(filterDisabledPlans).length-1)}"
|
ng-class="{'col-md-12 col-lg-12':(plansGroup.plans.filter(filterDisabledPlans).length % 2 == 1 && key == plansGroup.plans.filter(filterDisabledPlans).length-1)}"
|
||||||
ng-repeat="(key, plan) in plansGroup.plans.filter(filterDisabledPlans) | orderBy:'interval'">
|
ng-repeat="(key, plan) in plansGroup.plans.filter(filterDisabledPlans) | orderBy:'interval'">
|
||||||
|
|
||||||
<h3 class="title">{{ plan.base_name }}</h3>
|
<plan-card plan="plan"
|
||||||
|
user="ctrl.member"
|
||||||
<div class="content">
|
operator="currentUser"
|
||||||
<div class="wrap">
|
on-select-plan="selectPlan"
|
||||||
<div class="price">
|
is-selected="isSelected(plan)">
|
||||||
<div class="amount">{{plan.amount | currency}}</div>
|
</plan-card>
|
||||||
<span class="period">{{ plan.interval | planIntervalFilter: plan.interval_count }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cta-button">
|
|
||||||
<button class="btn btn-default rounded" ng-click="selectPlan(plan)" ng-class="{'bg-yellow': selectedPlan.id == plan.id}" translate>{{ 'app.shared.plan_subscribe.subscribe_online' }}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user