1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

fix after payment update calendar

This commit is contained in:
Sylvain 2017-02-21 14:48:59 +01:00
parent 3db55019c9
commit fe6f85eb7c
3 changed files with 11 additions and 26 deletions

View File

@ -281,13 +281,13 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
### PRIVATE STATIC CONSTANTS ###
# Slot already booked by the current user
# Slot free to be booked
FREE_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::MACHINE_COLOR %>'
# Slot already booked by another user
UNAVAILABLE_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::MACHINE_IS_RESERVED_BY_USER %>'
# Slot free to be booked
# Slot already booked by the current user
BOOKED_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::IS_RESERVED_BY_CURRENT_USER %>'
@ -509,7 +509,7 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
# @param reservation {Object}
##
$scope.afterPayment = (reservation)->
angular.forEach $scope.eventsReserved, (machineSlot, key) ->
angular.forEach $scope.events.reserved, (machineSlot, key) ->
machineSlot.is_reserved = true
machineSlot.can_modify = true
if $scope.currentUser.role isnt 'admin'
@ -521,9 +521,9 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
machineSlot.borderColor = UNAVAILABLE_SLOT_BORDER_COLOR
updateMachineSlot(machineSlot, reservation, $scope.ctrl.member)
machineSlot.backgroundColor = 'white'
$scope.paidMachineSlots = $scope.eventsReserved
$scope.paidMachineSlots = $scope.events.reserved
$scope.eventsReserved = []
$scope.events.reserved = []
$scope.coupon.applied = null
if $scope.selectedPlan

View File

@ -1,15 +1,3 @@
### PRIVATE STATIC CONSTANTS ###
# Slot already booked by the current user
FREE_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::MACHINE_COLOR %>'
# Slot already booked by another user
UNAVAILABLE_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::MACHINE_IS_RESERVED_BY_USER %>'
# Slot free to be booked
BOOKED_SLOT_BORDER_COLOR = '<%= AvailabilityHelper::IS_RESERVED_BY_CURRENT_USER %>'
Application.Directives.directive 'cart', [ '$rootScope', '$uibModal', 'dialogs', 'growl', 'Auth', 'Price', 'Wallet', 'CustomAsset', 'Slot', 'helpers', '_t'
, ($rootScope, $uibModal, dialogs, growl, Auth, Price, Wallet, CustomAsset, Slot, helpers, _t) ->
{
@ -34,9 +22,6 @@ Application.Directives.directive 'cart', [ '$rootScope', '$uibModal', 'dialogs',
settings: '='
templateUrl: '<%= asset_path "shared/_cart.html" %>'
link: ($scope, element, attributes) ->
$scope.paidMachineSlots = null
## will store the user's plan if he choosed to buy one
$scope.selectedPlan = null

View File

@ -43,6 +43,11 @@
<cart slot="selectedEvent"
slot-selection-time="selectionTime"
events="events"
user="ctrl.member"
mode-plans="plansAreShown"
plan="selectedPlan"
plan-selection-time="planSelectionTime"
settings="settings"
on-slot-added-to-cart="markSlotAsAdded"
on-slot-removed-from-cart="markSlotAsRemoved"
on-slot-start-to-modify="markSlotAsModifying"
@ -50,12 +55,7 @@
on-slot-modify-cancel="cancelModifyMachineSlot"
on-slot-modify-unselect="changeModifyMachineSlot"
on-slot-cancel-success="markSlotAsRemoved"
user="ctrl.member"
mode-plans="plansAreShown"
plan="selectedPlan"
plan-selection-time="planSelectionTime"
after-payment="afterPayment"
settings="settings"></cart>
after-payment="afterPayment"></cart>
<uib-alert type="warning m">
<p class="text-sm">