1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

Merge branch 'hotfix' for release 2.4.11

This commit is contained in:
Sylvain 2017-03-15 12:52:20 +01:00
commit d9cf6af21f
5 changed files with 17 additions and 4 deletions

View File

@ -1 +1 @@
2.4.10 2.4.11

View File

@ -1,5 +1,9 @@
# Changelog Fab Manager # Changelog Fab Manager
## v2.4.11 2017 March 15
- Fix a bug: editing and saving a plan, result in removing the rolling attribute
- [TODO DEPLOY] `rake fablab:fix:rolling_plans`
## v2.4.10 2017 January 9 ## v2.4.10 2017 January 9
- Optimized notifications system - Optimized notifications system

View File

@ -107,7 +107,7 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal',
interval: null interval: null
intervalCount: 0 intervalCount: 0
amount: null amount: null
isRolling: false is_rolling: false
partnerId: null partnerId: null
partnerContact: null partnerContact: null
ui_weight: 0 ui_weight: 0

View File

@ -99,7 +99,7 @@
<div class="input-group m-t-md"> <div class="input-group m-t-md">
<label for="plan[is_rolling]" class="control-label m-r-md">{{ 'rolling_subscription' | translate }} *</label> <label for="plan[is_rolling]" class="control-label m-r-md">{{ 'rolling_subscription' | translate }} *</label>
<input bs-switch <input bs-switch
ng-model="plan.isRolling" ng-model="plan.is_rolling"
id="plan[is_rolling]" id="plan[is_rolling]"
ng-if="method != 'PATCH'" ng-if="method != 'PATCH'"
type="checkbox" type="checkbox"
@ -110,7 +110,7 @@
ng-true-value="'true'" ng-true-value="'true'"
ng-false-value="'false'"/> ng-false-value="'false'"/>
<span ng-if="method == 'PATCH'">{{ (plan.is_rolling ? 'yes' : 'no') | translate }}</span> <span ng-if="method == 'PATCH'">{{ (plan.is_rolling ? 'yes' : 'no') | translate }}</span>
<input type="hidden" name="plan[is_rolling]" value="{{plan.isRolling}}"/> <input type="hidden" name="plan[is_rolling]" value="{{plan.is_rolling}}"/>
<span class="help-block"> <span class="help-block">
{{ 'a_rolling_subscription_will_begin_the_day_of_the_first_training' | translate }} {{ 'a_rolling_subscription_will_begin_the_day_of_the_first_training' | translate }}
{{ 'otherwise_it_will_begin_as_soon_as_it_is_bought' | translate }} {{ 'otherwise_it_will_begin_as_soon_as_it_is_bought' | translate }}

View File

@ -16,5 +16,14 @@ namespace :fablab do
e.save! e.save!
end end
end end
task rolling_plans: :environment do
Plan.where(is_rolling: nil).each do |p|
if p.is_rolling.nil? and p.is_rolling != false
p.is_rolling = true
p.save!
end
end
end
end end
end end