Skip to content

Commit

Permalink
Merge branch 'dev' for release 2.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainbx committed Nov 29, 2016
2 parents 29f4974 + 25a668b commit aeb7708
Show file tree
Hide file tree
Showing 99 changed files with 2,229 additions and 654 deletions.
2 changes: 1 addition & 1 deletion .fabmanager-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4
2.4.5
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog Fab Manager

## v2.4.5 2016 November 29

- Ability to create coupons with cash amounts (previously only percentages were allowed)
- Improved error messages when something wrong append when paying a machine reservation by stripe
- Ability to display optional information message on event reservation page
- Fix a bug: misconfigured Twitter's ENV variables results in HTTP error 500
- Fix a bug: wallet is not debited when paying locally with a user who have invoices disabled
- Fix a bug: wrong error message about rounding inconsistency is logged on invoice generation
- Fix a bug: reservation calendar of a specific training shows availabilities for all trainings

## v2.4.4 2016 November 24

- Fix a bug: unable to rollback migration 20160906145713
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ See https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname-
TWITTER_NAME

Identifier of the Twitter account, from witch the last tweet will be fetched and displayed on the home page.
This value can be graphically overridden during the application's lifecycle in Admin/Customization/Home page/Twitter Feed.
It will also be used for [Twitter Card analytics](https://dev.twitter.com/cards/analytics).

TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_ACCESS_TOKEN & TWITTER_ACCESS_TOKEN_SECRET
Expand Down
5 changes: 3 additions & 2 deletions app/assets/javascripts/controllers/admin/coupons.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ userValidities = ['once', 'forever']
##
# Controller used in the coupon creation page
##
Application.Controllers.controller "NewCouponController", ["$scope", "$state",'Coupon', 'growl', '_t'
Application.Controllers.controller "NewCouponController", ["$scope", "$state", 'Coupon', 'growl', '_t'
, ($scope, $state, Coupon, growl, _t) ->

## Values for the coupon currently created
$scope.coupon =
active: true
type: 'percent_off'

## Options for the validity per user
$scope.validities = userValidities
Expand Down Expand Up @@ -57,7 +58,7 @@ Application.Controllers.controller "NewCouponController", ["$scope", "$state",'C
##
# Controller used in the coupon edition page
##
Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t'
Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t'
, ($scope, $state, Coupon, couponPromise, _t) ->

### PUBLIC SCOPE ###
Expand Down
15 changes: 4 additions & 11 deletions app/assets/javascripts/controllers/admin/events.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ Application.Controllers.controller "ShowEventReservationsController", ["$scope",
##
# Controller used in the event creation page
##
Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t'
, ($scope, $state, $locale, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) ->
Application.Controllers.controller "NewEventController", ["$scope", "$state", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t'
, ($scope, $state, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) ->
CSRF.setMetaTags()

## API URL where the form will be posted
Expand Down Expand Up @@ -425,10 +425,6 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$
{label: _t('every_year'), value: 'year'}
]

## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;


## Using the EventsController
new EventsController($scope, $state)
]
Expand All @@ -438,8 +434,8 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$
##
# Controller used in the events edition page
##
Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", "$locale", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise'
, ($scope, $state, $stateParams, $locale, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) ->
Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise'
, ($scope, $state, $stateParams, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) ->

### PUBLIC SCOPE ###

Expand All @@ -454,9 +450,6 @@ Application.Controllers.controller "EditEventController", ["$scope", "$state", "
## Retrieve the event details, in case of error the user is redirected to the events listing
$scope.event = eventPromise

## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;

## List of categories for the events
$scope.categories = categoriesPromise

Expand Down
5 changes: 1 addition & 4 deletions app/assets/javascripts/controllers/admin/members.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,7 @@ Application.Controllers.controller "EditMemberController", ["$scope", "$state",
modalInstance = $uibModal.open
animation: true,
templateUrl: '<%= asset_path "wallet/credit_modal.html" %>'
controller: ['$scope', '$uibModalInstance', 'Wallet', '$locale', ($scope, $uibModalInstance, Wallet, $locale) ->

## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM
controller: ['$scope', '$uibModalInstance', 'Wallet', ($scope, $uibModalInstance, Wallet) ->

##
# Modal dialog validation callback
Expand Down
16 changes: 4 additions & 12 deletions app/assets/javascripts/controllers/admin/plans.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class PlanController
##
# Controller used in the plan creation form
##
Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t', '$locale'
, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t, $locale) ->
Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t'
, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t) ->



Expand Down Expand Up @@ -119,10 +119,6 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal',
$scope.method = 'POST'


## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;



##
# Checks if the partner contact is a valid data. Used in the form validation process
Expand Down Expand Up @@ -187,8 +183,8 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal',
##
# Controller used in the plan edition form
##
Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', '$locale', 'Plan'
, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, $locale, Plan) ->
Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', 'Plan'
, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, Plan) ->



Expand All @@ -208,10 +204,6 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p
$scope.method = 'PATCH'


## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;



##
# If a parent plan was set ($scope.plan.parent), the prices will be copied from this parent plan into
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/controllers/admin/pricing.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
##
# Controller used in the prices edition page
##
Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', 'TrainingsPricing', '$filter', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t'
, ($scope, $state, $uibModal, TrainingsPricing, $filter, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) ->
Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t'
, ($scope, $state, $uibModal, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) ->

### PUBLIC SCOPE ###
## List of machines prices (not considering any plan)
Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/controllers/admin/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Application.Controllers.controller "SettingsController", ["$scope", 'Setting', '
$scope.trainingExplicationsAlert = { name: 'training_explications_alert', value: settingsPromise.training_explications_alert }
$scope.trainingInformationMessage = { name: 'training_information_message', value: settingsPromise.training_information_message}
$scope.subscriptionExplicationsAlert = { name: 'subscription_explications_alert', value: settingsPromise.subscription_explications_alert }
$scope.eventExplicationsAlert = {name: 'event_explications_alert', value: settingsPromise.event_explications_alert }
$scope.windowStart = { name: 'booking_window_start', value: settingsPromise.booking_window_start }
$scope.windowEnd = { name: 'booking_window_end', value: settingsPromise.booking_window_end }
$scope.mainColorSetting = { name: 'main_color', value: settingsPromise.main_color }
Expand Down Expand Up @@ -73,7 +74,7 @@ Application.Controllers.controller "SettingsController", ["$scope", 'Setting', '
$scope.cancelDelay =
name: 'booking_cancel_delay'
value: parseInt(settingsPromise.booking_cancel_delay)

$scope.enableReminder =
name: 'reminder_enable'
value: (settingsPromise.reminder_enable == 'true')
Expand Down
8 changes: 6 additions & 2 deletions app/assets/javascripts/controllers/application.coffee.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version'
, ($rootScope, $scope, $window, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) ->
Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", '$locale', "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version'
, ($rootScope, $scope, $window, $locale, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) ->



Expand All @@ -18,6 +18,10 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco
$scope.version =
version: ''

## currency symbol for the current locale (cf. angular-i18n)
$rootScope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;


##
# Set the current user to the provided value and initialize the session
# @param user {Object} Rails/Devise user
Expand Down
24 changes: 14 additions & 10 deletions app/assets/javascripts/controllers/events.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
tickets: {}
toReserve: false
amountTotal : 0
totalNoCoupon: 0
totalSeats: 0

## Discount coupon to apply to the basket, if any
Expand All @@ -172,6 +173,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
## Global config: delay in hours before a booking while changing the booking slot is forbidden
$scope.moveBookingDelay = parseInt(settingsPromise.booking_move_delay)

## Message displayed to the end user about rules that applies to events reservations
$scope.eventExplicationsAlert = settingsPromise.event_explications_alert



##
Expand Down Expand Up @@ -400,6 +404,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
r = mkReservation($scope.ctrl.member, $scope.reserve, $scope.event)
Price.compute mkRequestParams(r, $scope.coupon.applied), (res) ->
$scope.reserve.amountTotal = res.price
$scope.reserve.totalNoCoupon = res.price_without_coupon
else
$scope.reserve.amountTotal = null

Expand Down Expand Up @@ -560,9 +565,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
member: $scope.ctrl.member
coupon: ->
$scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$locale', '$filter', 'coupon',
($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $locale, $filter, coupon) ->
# user wallet amount
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$filter', 'coupon',
($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $filter, coupon) ->
# User's wallet amount
$scope.walletAmount = wallet.amount

# Price
Expand All @@ -574,8 +579,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
# Reservation
$scope.reservation = reservation

$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM

# Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number')

# Callback for the stripe payment authorization
Expand Down Expand Up @@ -616,9 +620,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
Wallet.getWalletByUser({user_id: reservation.user_id}).$promise
coupon: ->
$scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', '$locale', 'helpers', '$filter', 'coupon',
($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, $locale, helpers, $filter, coupon) ->
# user wallet amount
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon',
($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) ->
# User's wallet amount
$scope.walletAmount = wallet.amount

# Price
Expand All @@ -630,8 +634,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
# Reservation
$scope.reservation = reservation

$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM

# Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number')

# Button label
Expand Down Expand Up @@ -675,6 +678,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
$scope.event.nb_free_places = $scope.event.nb_free_places - reservation.total_booked_seats
resetEventReserve()
$scope.reserveSuccess = true
$scope.coupon.applied = null
$scope.reservations.push reservation
if $scope.currentUser.role == 'admin'
$scope.ctrl.member = null
Expand Down
Loading

0 comments on commit aeb7708

Please sign in to comment.