diff --git a/CHANGELOG.md b/CHANGELOG.md index 6817c1448..c642ec563 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,15 @@ - Removed cross hack in full-calendar - Confirmation before slot delete - Confirmation and error handling while deleting an event +- Ability to disable groups, machines, plans, spaces and trainings +- Improved responsiveness of machines and spaces lists - Fix a typo: error message while creating a machine slot - Fix a bug: events pagination is bogus in admin's monitoring when selecting non default filter - Fix a bug: social sharing failed for projects with an underscore in their name - Fix a bug: html tags of events description not stripped when sharing on social network - Fix a bug: event, space, training or machine main image on description page is deformed on small devices +- Fix a bug: profile completion of non SSO-imported users trigger a fuzzy email +- Fix a bug: creation of negative credits - Updated test data to allow passing test suite ## v2.5.14 2017 September 12 diff --git a/app/assets/javascripts/controllers/admin/calendar.coffee.erb b/app/assets/javascripts/controllers/admin/calendar.coffee.erb index 2b0260deb..a69cbf5fe 100644 --- a/app/assets/javascripts/controllers/admin/calendar.coffee.erb +++ b/app/assets/javascripts/controllers/admin/calendar.coffee.erb @@ -309,13 +309,13 @@ Application.Controllers.controller 'CreateEventModalController', ["$scope", "$ui $scope.end = end ## machines list - $scope.machines = machinesPromise + $scope.machines = machinesPromise.filter (m) -> !m.disabled ## trainings list - $scope.trainings = trainingsPromise + $scope.trainings = trainingsPromise.filter (t) -> !t.disabled ## spaces list - $scope.spaces = spacesPromise + $scope.spaces = spacesPromise.filter (s) -> !s.disabled ## machines associated with the created slot $scope.selectedMachines = [] diff --git a/app/assets/javascripts/controllers/admin/groups.coffee.erb b/app/assets/javascripts/controllers/admin/groups.coffee.erb index 87fd816cc..4f3a36873 100644 --- a/app/assets/javascripts/controllers/admin/groups.coffee.erb +++ b/app/assets/javascripts/controllers/admin/groups.coffee.erb @@ -3,6 +3,15 @@ Application.Controllers.controller "GroupsController", ["$scope", 'groupsPromise ## List of users groups $scope.groups = groupsPromise + ## Default: we show only enabled groups + $scope.groupFiltering = 'enabled' + + ## Available options for filtering groups by status + $scope.filterDisabled = [ + 'enabled', + 'disabled', + 'all', + ] ## @@ -31,20 +40,20 @@ Application.Controllers.controller "GroupsController", ["$scope", 'groupsPromise ## # Saves a new group / Update an existing group to the server (form validation callback) # @param data {Object} group name - # @param [data] {number} group id, in case of update + # @param [id] {number} group id, in case of update ## $scope.saveGroup = (data, id) -> if id? Group.update {id: id}, { group: data }, (response) -> - growl.success(_t('changes_successfully_saved')) + growl.success(_t('group_form.changes_successfully_saved')) , (error) -> - growl.error(_t('an_error_occurred_while_saving_changes')) + growl.error(_t('group_form.an_error_occurred_while_saving_changes')) else Group.save { group: data }, (resp)-> - growl.success(_t('new_group_successfully_saved')) + growl.success(_t('group_form.new_group_successfully_saved')) $scope.groups[$scope.groups.length-1].id = resp.id , (error) -> - growl.error(_t('an_error_occurred_when_saving_the_new_group')) + growl.error(_t('.group_forman_error_occurred_when_saving_the_new_group')) $scope.groups.splice($scope.groups.length-1, 1) @@ -55,10 +64,27 @@ Application.Controllers.controller "GroupsController", ["$scope", 'groupsPromise ## $scope.removeGroup = (index) -> Group.delete { id: $scope.groups[index].id }, (resp) -> - growl.success(_t('group_successfully_deleted')) + growl.success(_t('group_form.group_successfully_deleted')) $scope.groups.splice(index, 1) , (error) -> - growl.error(_t('unable_to_delete_group_because_some_users_and_or_groups_are_still_linked_to_it')) + growl.error(_t('group_form.unable_to_delete_group_because_some_users_and_or_groups_are_still_linked_to_it')) + + + + ## + # Enable/disable the group at the specified index + # @param index {number} group index in the $scope.groups array + ## + $scope.toggleDisableGroup = (index) -> + group = $scope.groups[index] + if (!group.disabled && group.users > 0) + growl.error(_t('group_form.unable_to_disable_group_with_users', { USERS: group.users }, 'messageformat')) + else + Group.update {id: group.id}, { group: { disabled: !group.disabled } }, (response) -> + $scope.groups[index] = response + growl.success(_t('group_form.group_successfully_enabled_disabled', { STATUS: response.disabled }, 'messageformat')) + , (error) -> + growl.error(_t('group_form.unable_to_enable_disable_group', { STATUS: !group.disabled }, 'messageformat')) ] diff --git a/app/assets/javascripts/controllers/admin/members.coffee.erb b/app/assets/javascripts/controllers/admin/members.coffee.erb index 86df205b0..e6ac6f423 100644 --- a/app/assets/javascripts/controllers/admin/members.coffee.erb +++ b/app/assets/javascripts/controllers/admin/members.coffee.erb @@ -25,13 +25,14 @@ class MembersController ## Retrieve the profiles groups (eg. students ...) Group.query (groups) -> - $scope.groups = groups.filter (g) -> g.slug != 'admins' + $scope.groups = groups.filter (g) -> g.slug != 'admins' && !g.disabled - ## Retrieve the list the available trainings + ## Retrieve the list of available trainings Training.query().$promise.then (data)-> $scope.trainings = data.map (d) -> id: d.id name: d.name + disabled: d.disabled ## Default parameters for AngularUI-Bootstrap datepicker $scope.datePicker = @@ -477,6 +478,14 @@ Application.Controllers.controller "EditMemberController", ["$scope", "$state", + ## + # To use as callback in Array.prototype.filter to get only enabled plans + ## + $scope.filterDisabledPlans = (plan) -> + !plan.disabled + + + ### PRIVATE SCOPE ### diff --git a/app/assets/javascripts/controllers/admin/plans.coffee.erb b/app/assets/javascripts/controllers/admin/plans.coffee.erb index 4c4486728..303c30575 100644 --- a/app/assets/javascripts/controllers/admin/plans.coffee.erb +++ b/app/assets/javascripts/controllers/admin/plans.coffee.erb @@ -13,7 +13,7 @@ class PlanController ## groups list - $scope.groups = groups.filter (g) -> g.slug != 'admins' + $scope.groups = groups.filter (g) -> g.slug != 'admins' && !g.disabled ## users with role 'partner', notifiables for a partner plan $scope.partners = partners.users @@ -175,6 +175,7 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p ## edited plan data $scope.plan = planPromise $scope.plan.type = "Plan" if $scope.plan.type == null + $scope.plan.disabled = 'true' if $scope.plan.disabled ## API URL where the form will be posted $scope.actionUrl = "/api/plans/" + $stateParams.id @@ -231,26 +232,26 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p ## - # Retrieve the name of a machine from its ID + # Retrieve the machine from its ID # @param machine_id {number} machine identifier - # @returns {string} Machine's name + # @returns {Object} Machine ## - $scope.getMachineName = (machine_id) -> + $scope.getMachine = (machine_id) -> for machine in $scope.machines if machine.id == machine_id - return machine.name + return machine ## - # Retrieve the name of a space from its ID + # Retrieve the space from its ID # @param space_id {number} space identifier - # @returns {string} Space's name + # @returns {Object} Space ## - $scope.getSpaceName = (space_id) -> + $scope.getSpace = (space_id) -> for space in $scope.spaces if space.id == space_id - return space.name + return space diff --git a/app/assets/javascripts/controllers/admin/pricing.coffee.erb b/app/assets/javascripts/controllers/admin/pricing.coffee.erb index 53bd9a78d..73c7a158e 100644 --- a/app/assets/javascripts/controllers/admin/pricing.coffee.erb +++ b/app/assets/javascripts/controllers/admin/pricing.coffee.erb @@ -15,9 +15,11 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", ## List of available subscriptions plans (eg. student/month, PME/year ...) $scope.plans = plans + $scope.enabledPlans = plans.filter (p) -> !p.disabled ## List of groups (eg. normal, student ...) $scope.groups = groups.filter (g) -> g.slug != 'admins' + $scope.enabledGroups = groups.filter (g) -> g.slug != 'admins' && !g.disabled ## Associate free machine hours with subscriptions $scope.machineCredits = machineCreditsPromise @@ -29,16 +31,18 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", $scope.trainingCreditsGroups = {} ## List of trainings - $scope.trainings = trainingsPromise + $scope.trainings = trainingsPromise.filter (t) -> !t.disabled ## List of machines $scope.machines = machinesPromise + $scope.enabledMachines = machinesPromise.filter (m) -> !m.disabled ## List of coupons $scope.coupons = couponsPromise ## List of spaces $scope.spaces = spacesPromise + $scope.enabledSpaces = spacesPromise.filter (s) -> !s.disabled ## Associate free space hours with subscriptions $scope.spaceCredits = spacesCreditsPromise @@ -53,6 +57,16 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", $scope.status = isopen: false + ## Default: we show only enabled plans + $scope.planFiltering = 'enabled' + + ## Available options for filtering plans by status + $scope.filterDisabled = [ + 'enabled', + 'disabled', + 'all', + ] + $scope.findTrainingsPricing = (trainingsPricings, trainingId, groupId)-> @@ -181,21 +195,37 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", ## - # In the Credits tab, while editing a machine credit row, select the current machine from the - # drop-down list of machines as the current item. + # In the Credits tab, return the name of the machine/space associated with the given credit # @param credit {Object} credit object, inherited from $resource + # @returns {String} ## $scope.showCreditableName = (credit) -> selected = _t('pricing.not_set') + if credit and credit.creditable_id + object = $scope.getCreditable(credit) + selected = object.name + if credit.creditable_type == 'Machine' + selected += ' ( id. ' + object.id + ' )' + return selected + + + + ## + # In the Credits tab, return the machine/space associated with the given credit + # @param credit {Object} credit object, inherited from $resource + # @returns {Object} + ## + $scope.getCreditable = (credit) -> + selected = undefined if credit and credit.creditable_id if credit.creditable_type == 'Machine' angular.forEach $scope.machines, (m)-> if m.id == credit.creditable_id - selected = m.name + ' ( id. ' + m.id + ' )' + selected = m else if credit.creditable_type == 'Space' angular.forEach $scope.spaces, (s)-> if s.id == credit.creditable_id - selected = s.name + selected = s return selected @@ -224,6 +254,9 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", , (resp) -> $scope.machineCredits[$scope.machineCredits.length-1].id = resp.id growl.success(_t('pricing.credit_was_successfully_saved')) + , (err) -> + $scope.machineCredits.pop() + growl.error(_t('pricing.error_creating_credit')) ## @@ -287,10 +320,14 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", , (resp) -> $scope.spaceCredits[$scope.spaceCredits.length - 1].id = resp.id growl.success(_t('pricing.credit_was_successfully_saved')) + , (err) -> + $scope.spaceCredits.pop() + growl.error(_t('pricing.error_creating_credit')) - ## + + ## # Removes the newly inserted but not saved space credit / Cancel the current space credit modification # @param rowform {Object} see http://vitalets.github.io/angular-xeditable/ # @param index {number} credit index in the $scope.spaceCredits array diff --git a/app/assets/javascripts/controllers/admin/trainings.coffee.erb b/app/assets/javascripts/controllers/admin/trainings.coffee.erb index 6ae3e12ab..8cf29d565 100644 --- a/app/assets/javascripts/controllers/admin/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/admin/trainings.coffee.erb @@ -9,9 +9,11 @@ # Provides : # - $scope.submited(content) # - $scope.fileinputClass(v) +# - $scope.onDisableToggled # # Requires : # - $state (Ui-Router) [ 'app.admin.trainings' ] +# - $scope.training ## class TrainingsController constructor: ($scope, $state) -> @@ -43,6 +45,14 @@ class TrainingsController + ## + # Force the 'public_page' attribute to false when the current training is disabled + ## + $scope.onDisableToggled = -> + $scope.training.public_page = !$scope.training.disabled + + + ## # For use with 'ng-class', returns the CSS class name for the uploads previews. # The preview may show a placeholder or the content of the file depending on the upload state. @@ -167,6 +177,16 @@ Application.Controllers.controller "TrainingsAdminController", ["$scope", "$stat ## Binding for the parseInt function $scope.parseInt = parseInt + ## Default: we show only enabled trainings + $scope.trainingFiltering = 'enabled' + + ## Available options for filtering trainings by status + $scope.filterDisabled = [ + 'enabled', + 'disabled', + 'all', + ] + ## # In the trainings listing tab, return the stringified list of machines associated with the provided training # @param training {Object} Training object, inherited from $resource diff --git a/app/assets/javascripts/controllers/calendar.coffee b/app/assets/javascripts/controllers/calendar.coffee index 6b2e9e8b5..16652b455 100644 --- a/app/assets/javascripts/controllers/calendar.coffee +++ b/app/assets/javascripts/controllers/calendar.coffee @@ -21,13 +21,13 @@ Application.Controllers.controller "CalendarController", ["$scope", "$state", "$ ### PUBLIC SCOPE ### ## List of trainings - $scope.trainings = trainingsPromise + $scope.trainings = trainingsPromise.filter (t) -> !t.disabled ## List of machines - $scope.machines = machinesPromise + $scope.machines = machinesPromise.filter (t) -> !t.disabled ## List of spaces - $scope.spaces = spacesPromise + $scope.spaces = spacesPromise.filter (t) -> !t.disabled ## add availabilities source to event sources $scope.eventSources = [] diff --git a/app/assets/javascripts/controllers/machines.coffee.erb b/app/assets/javascripts/controllers/machines.coffee.erb index ed4cfdade..ad85cf6fe 100644 --- a/app/assets/javascripts/controllers/machines.coffee.erb +++ b/app/assets/javascripts/controllers/machines.coffee.erb @@ -108,32 +108,40 @@ _reserveMachine = (machine, e) -> $uibModalInstance.dismiss('cancel') ] # ... but does not have booked the training, tell him to register for a training session first + # unless all associated trainings are disabled else - _this.$uibModal.open - templateUrl: '<%= asset_path "machines/request_training_modal.html" %>' - controller: ['$scope', '$uibModalInstance', '$state', ($scope, $uibModalInstance, $state) -> - $scope.machine = machine - $scope.member = _this.$scope.currentUser + # if all trainings are disabled, just redirect the user to the reservation calendar + if machine.trainings.map((t) -> t.disabled).reduce(((acc, val) -> acc && val), true) + _this.$state.go('app.logged.machines_reserve', {id: machine.slug}) + # otherwise open the information modal + else + _this.$uibModal.open + templateUrl: '<%= asset_path "machines/request_training_modal.html" %>' + controller: ['$scope', '$uibModalInstance', '$state', ($scope, $uibModalInstance, $state) -> + $scope.machine = machine + $scope.member = _this.$scope.currentUser - # transform the name of the trainings associated with the machine to integrate them in a sentence - $scope.humanizeTrainings = -> - text = '' - angular.forEach $scope.machine.trainings, (training) -> - if text.length > 0 - text += _this._t('_or_the_') - text += training.name.substr(0,1).toLowerCase() + training.name.substr(1) - text + # transform the name of the trainings associated with the machine to integrate them in a sentence + $scope.humanizeTrainings = -> + text = '' + angular.forEach $scope.machine.trainings, (training) -> + if text.length > 0 + text += _this._t('machines_list._or_the_') + text += training.name.substr(0,1).toLowerCase() + training.name.substr(1) + text + + # modal is closed with validation + $scope.ok = -> + $state.go('app.logged.trainings_reserve', {id: $scope.machine.trainings[0].id}) + $uibModalInstance.close(machine) + + # modal is closed with escaping + $scope.cancel = (e)-> + e.preventDefault() + $uibModalInstance.dismiss('cancel') + ] - # modal is close with validation - $scope.ok = -> - $state.go('app.logged.trainings_reserve', {id: $scope.machine.trainings[0].id}) - $uibModalInstance.close(machine) - # modal is closed with escaping - $scope.cancel = (e)-> - e.preventDefault() - $uibModalInstance.dismiss('cancel') - ] # if the user is not logged, open the login modal window else _this.$scope.login() @@ -164,6 +172,16 @@ Application.Controllers.controller "MachinesController", ["$scope", "$state", '_ _t: _t $uibModal: $uibModal Machine: Machine + + ## Default: we show only enabled machines + $scope.machineFiltering = 'enabled' + + ## Available options for filtering machines by status + $scope.filterDisabled = [ + 'enabled', + 'disabled', + 'all', + ] ] @@ -527,6 +545,14 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", '$stat + ## + # To use as callback in Array.prototype.filter to get only enabled plans + ## + $scope.filterDisabledPlans = (plan) -> + !plan.disabled + + + ### PRIVATE SCOPE ### ## diff --git a/app/assets/javascripts/controllers/members.coffee b/app/assets/javascripts/controllers/members.coffee index 3c2c96e56..717147755 100644 --- a/app/assets/javascripts/controllers/members.coffee +++ b/app/assets/javascripts/controllers/members.coffee @@ -73,7 +73,7 @@ Application.Controllers.controller "EditProfileController", ["$scope", "$rootSco $scope.actionUrl = "/api/members/" + $scope.currentUser.id ## list of groups - $scope.groups = groups + $scope.groups = groups.filter (g) -> !g.disabled ## Form action on the above URL $scope.method = 'patch' diff --git a/app/assets/javascripts/controllers/plans.coffee.erb b/app/assets/javascripts/controllers/plans.coffee.erb index f4f428e33..27b516d5b 100644 --- a/app/assets/javascripts/controllers/plans.coffee.erb +++ b/app/assets/javascripts/controllers/plans.coffee.erb @@ -8,7 +8,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop ### PUBLIC SCOPE ### ## list of groups - $scope.groups = groupsPromise.filter (g) -> g.slug != 'admins' + $scope.groups = groupsPromise.filter (g) -> g.slug != 'admins' & !g.disabled ## default : do not show the group changing form ## group ID of the current/selected user @@ -148,6 +148,14 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop + ## + # To use as callback in Array.prototype.filter to get only enabled plans + ## + $scope.filterDisabledPlans = (plan) -> + !plan.disabled + + + ### PRIVATE SCOPE ### ## diff --git a/app/assets/javascripts/controllers/spaces.coffee.erb b/app/assets/javascripts/controllers/spaces.coffee.erb index bafa77027..e20318201 100644 --- a/app/assets/javascripts/controllers/spaces.coffee.erb +++ b/app/assets/javascripts/controllers/spaces.coffee.erb @@ -92,6 +92,17 @@ Application.Controllers.controller 'SpacesController', ['$scope', '$state', 'spa ## $scope.reserveSpace = (space) -> $state.go('app.logged.space_reserve', { id: space.slug }) + + + ## Default: we show only enabled spaces + $scope.spaceFiltering = 'enabled' + + ## Available options for filtering spaces by status + $scope.filterDisabled = [ + 'enabled', + 'disabled', + 'all', + ] ] @@ -438,6 +449,14 @@ Application.Controllers.controller "ReserveSpaceController", ["$scope", '$stateP + ## + # To use as callback in Array.prototype.filter to get only enabled plans + ## + $scope.filterDisabledPlans = (plan) -> + !plan.disabled + + + ### PRIVATE SCOPE ### ## diff --git a/app/assets/javascripts/controllers/trainings.coffee.erb b/app/assets/javascripts/controllers/trainings.coffee.erb index 12b6b6a04..ef0c7f5ee 100644 --- a/app/assets/javascripts/controllers/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/trainings.coffee.erb @@ -338,6 +338,14 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", '$sta + ## + # To use as callback in Array.prototype.filter to get only enabled plans + ## + $scope.filterDisabledPlans = (plan) -> + !plan.disabled + + + ### PRIVATE SCOPE ### ## diff --git a/app/assets/javascripts/filters/filters.coffee b/app/assets/javascripts/filters/filters.coffee index a6420f896..4b0c1498a 100644 --- a/app/assets/javascripts/filters/filters.coffee +++ b/app/assets/javascripts/filters/filters.coffee @@ -258,3 +258,14 @@ Application.Filters.filter 'maxCount', [ '_t', (_t) -> max ] +Application.Filters.filter 'filterDisabled', [ -> + (list, filter) -> + if angular.isArray(list) + list.filter (e) -> + switch filter + when 'disabled' then e.disabled + when 'enabled' then !e.disabled + else true + else + list +] diff --git a/app/assets/stylesheets/app.components.scss b/app/assets/stylesheets/app.components.scss index 6a5026ba7..312a94524 100644 --- a/app/assets/stylesheets/app.components.scss +++ b/app/assets/stylesheets/app.components.scss @@ -597,4 +597,14 @@ padding: 10px; border-bottom: 1px dashed #00b3ee; cursor: help; } +} + +.reservable-card { + @media only screen and (min-width: 768px) { + height: 24em; + } +} + +.disabled-reservable { + opacity: 0.5 !important; } \ No newline at end of file diff --git a/app/assets/stylesheets/app.layout.scss b/app/assets/stylesheets/app.layout.scss index 0c8946e00..538fd9833 100644 --- a/app/assets/stylesheets/app.layout.scss +++ b/app/assets/stylesheets/app.layout.scss @@ -624,4 +624,16 @@ body.container{ .event-description { overflow: hidden; } +} + +.disabled-line { + color: $gray; + background-color: $gray-lighter; + + & td:first-child:before { + font-family: 'fontawesome' !important; + content: '\f070'; + position: absolute; + left: -4px; + } } \ No newline at end of file diff --git a/app/assets/templates/admin/groups/index.html.erb b/app/assets/templates/admin/groups/index.html.erb index 27207c90d..3aaf62f54 100644 --- a/app/assets/templates/admin/groups/index.html.erb +++ b/app/assets/templates/admin/groups/index.html.erb @@ -1,13 +1,27 @@ - +
+ +
+
+ + +
+
+
+ - - + + - + - - + + - - + + - + @@ -58,9 +58,9 @@ - + @@ -70,7 +70,7 @@ @@ -110,9 +110,9 @@ - + @@ -122,7 +122,7 @@ diff --git a/app/assets/templates/admin/pricing/machine_hours.html.erb b/app/assets/templates/admin/pricing/machine_hours.html.erb index 84ecb5e1c..8042df4e6 100644 --- a/app/assets/templates/admin/pricing/machine_hours.html.erb +++ b/app/assets/templates/admin/pricing/machine_hours.html.erb @@ -5,17 +5,17 @@ - - + - - - + -
{{ 'group_name' }}{{ 'group_form.group_name' }}
{{group.name}} @@ -23,10 +37,14 @@ -
+
+ diff --git a/app/assets/templates/admin/members/_form.html.erb b/app/assets/templates/admin/members/_form.html.erb index 243051576..dab157d1e 100644 --- a/app/assets/templates/admin/members/_form.html.erb +++ b/app/assets/templates/admin/members/_form.html.erb @@ -40,7 +40,7 @@ - + diff --git a/app/assets/templates/admin/members/edit.html.erb b/app/assets/templates/admin/members/edit.html.erb index 099fc7745..0e5117e46 100644 --- a/app/assets/templates/admin/members/edit.html.erb +++ b/app/assets/templates/admin/members/edit.html.erb @@ -85,7 +85,7 @@

{{ 'user_has_no_current_subscription' }}

- +
diff --git a/app/assets/templates/admin/plans/edit.html.erb b/app/assets/templates/admin/plans/edit.html.erb index e42326845..509b4c626 100644 --- a/app/assets/templates/admin/plans/edit.html.erb +++ b/app/assets/templates/admin/plans/edit.html.erb @@ -30,6 +30,22 @@ +
+ + + + {{ 'plan_form.disable_plan_will_not_unsubscribe_users' }} +
+

{{ 'edit_plan.prices' }}

@@ -46,8 +62,8 @@
{{ getMachineName(price.priceable_id) }} (id {{ price.priceable_id }}) *
{{ getMachine(price.priceable_id).name }} (id {{ price.priceable_id }}) *
{{currencySymbol}} @@ -67,8 +83,8 @@
{{ getSpaceName(price.priceable_id) }} *
{{ getSpace(price.priceable_id).name }} *
{{currencySymbol}} diff --git a/app/assets/templates/admin/pricing/credits.html.erb b/app/assets/templates/admin/pricing/credits.html.erb index 730759928..07c23d359 100644 --- a/app/assets/templates/admin/pricing/credits.html.erb +++ b/app/assets/templates/admin/pricing/credits.html.erb @@ -10,7 +10,7 @@
{{ plan | humanReadablePlanName: groups }}
- + {{ showCreditableName(mc) }} - + {{ getPlanFromId(mc.plan_id) | humanReadablePlanName: groups: 'short' }}
- + {{ showCreditableName(sc) }} - + {{ getPlanFromId(sc.plan_id) | humanReadablePlanName: groups: 'short' }}
{{ 'pricing.machines' }} + {{group.name}}
{{ machine.name }} + {{ findPriceBy(machinesPrices, machine.id, group.id).amount | currency}} diff --git a/app/assets/templates/admin/pricing/spaces.html.erb b/app/assets/templates/admin/pricing/spaces.html.erb index a189ac4c4..e74598bdd 100644 --- a/app/assets/templates/admin/pricing/spaces.html.erb +++ b/app/assets/templates/admin/pricing/spaces.html.erb @@ -5,17 +5,17 @@
{{ 'pricing.spaces' }} + {{group.name}}
{{ space.name }} + {{ findPriceBy(spacesPrices, space.id, group.id).amount | currency}} diff --git a/app/assets/templates/admin/pricing/subscriptions.html.erb b/app/assets/templates/admin/pricing/subscriptions.html.erb index 2dc721e8d..602176e08 100644 --- a/app/assets/templates/admin/pricing/subscriptions.html.erb +++ b/app/assets/templates/admin/pricing/subscriptions.html.erb @@ -6,7 +6,21 @@
{{ 'pricing.for_safety_reasons_please_dont_create_subscriptions_if_you_dont_want_intend_to_use_them_later' | translate }} - +
+ +
+
+ + +
+
+
+ @@ -20,11 +34,14 @@ - + - + diff --git a/app/assets/templates/admin/pricing/trainings.html.erb b/app/assets/templates/admin/pricing/trainings.html.erb index 6c6c230fd..372dc3579 100644 --- a/app/assets/templates/admin/pricing/trainings.html.erb +++ b/app/assets/templates/admin/pricing/trainings.html.erb @@ -2,7 +2,7 @@ - @@ -12,7 +12,7 @@ -
{{getPlanType(plan.type)}} {{plan.base_name}} {{ plan.interval | planIntervalFilter:plan.interval_count }}{{getGroupFromId(groups, plan.group_id).name}}{{group.name}} {{plan.amount | currency}}
{{ 'pricing.trainings' }} + {{group.name}}
{{ training.name }} + {{ findTrainingsPricing(trainingsPricings, training.id, group.id).amount | currency}} diff --git a/app/assets/templates/admin/trainings/_form.html.erb b/app/assets/templates/admin/trainings/_form.html.erb index 91e09131b..c88702a69 100644 --- a/app/assets/templates/admin/trainings/_form.html.erb +++ b/app/assets/templates/admin/trainings/_form.html.erb @@ -15,21 +15,21 @@ {{alert.msg}}
- +
- {{ 'name_is_required' }} + {{ 'trainings_form.name_is_required' }}
- +
@@ -40,7 +40,7 @@
- {{ 'add_an_illustration' | translate }} + {{ 'trainings_form.add_an_illustration' | translate }} {{ 'change' }} - +
- {{ 'description_is_required' }} + {{ 'trainings_form.description_is_required' }}
- +
- + @@ -81,7 +81,7 @@
- +
+
+ +
+ + +
+
+
diff --git a/app/assets/templates/admin/trainings/index.html.erb b/app/assets/templates/admin/trainings/index.html.erb index 93f2cb190..647098869 100644 --- a/app/assets/templates/admin/trainings/index.html.erb +++ b/app/assets/templates/admin/trainings/index.html.erb @@ -21,7 +21,20 @@
- +
+ +
+
+ + +
+
+
@@ -33,7 +46,7 @@ - + diff --git a/app/assets/templates/admin/trainings/new.html.erb b/app/assets/templates/admin/trainings/new.html.erb index 7635f836d..05a9a9177 100644 --- a/app/assets/templates/admin/trainings/new.html.erb +++ b/app/assets/templates/admin/trainings/new.html.erb @@ -7,7 +7,7 @@
-

{{ 'add_a_new_training' }}

+

{{ 'trainings_new.add_a_new_training' }}

@@ -22,8 +22,8 @@
diff --git a/app/assets/templates/machines/_form.html.erb b/app/assets/templates/machines/_form.html.erb index 4cdbf785d..b00031a1e 100644 --- a/app/assets/templates/machines/_form.html.erb +++ b/app/assets/templates/machines/_form.html.erb @@ -15,21 +15,21 @@ {{alert.msg}}
- +
- {{ 'name_is_required' }} + {{ 'machine_form.name_is_required' }}
- +
@@ -40,7 +40,7 @@
- {{ 'add_an_illustration' | translate }} + {{ 'machine_form.add_an_illustration' | translate }} {{ 'change' }} - +
- {{ 'description_is_required' }} + {{ 'machine_form.description_is_required' }}
- +
- {{ 'technical_specifications_are_required' }} + {{ 'machine_form.technical_specifications_are_required' }}
- +
@@ -101,13 +101,30 @@
{{file.attachment}}
- {{ 'attach_a_file' }} + {{ 'machine_form.attach_a_file' }} {{ 'change' }}
- {{ 'add_an_attachment' | translate }} + {{ 'machine_form.add_an_attachment' | translate }} +
+
+ +
+ +
+ +
@@ -115,7 +132,7 @@ diff --git a/app/assets/templates/machines/index.html.erb b/app/assets/templates/machines/index.html.erb index ffa7cbfac..112f4dbdb 100644 --- a/app/assets/templates/machines/index.html.erb +++ b/app/assets/templates/machines/index.html.erb @@ -7,13 +7,13 @@
-

{{ 'the_fablab_s_machines' }}

+

{{ 'machines_list.the_fablab_s_machines' }}

@@ -22,42 +22,46 @@
-
- -
- - -
-
- -
-
-
-
-

{{machine.name}}

-
- -
- - +
+
+ +
+
+
+
+ +
+
+
+
+

{{machine.name}}

+
+ +
+
+
diff --git a/app/assets/templates/plans/_plan.html.erb b/app/assets/templates/plans/_plan.html.erb index c01089e5e..c7eb3296c 100644 --- a/app/assets/templates/plans/_plan.html.erb +++ b/app/assets/templates/plans/_plan.html.erb @@ -8,8 +8,8 @@
+ 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'">

{{ plan.base_name }}

diff --git a/app/assets/templates/plans/index.html.erb b/app/assets/templates/plans/index.html.erb index dc090e9fe..6362ac2d5 100644 --- a/app/assets/templates/plans/index.html.erb +++ b/app/assets/templates/plans/index.html.erb @@ -27,8 +27,8 @@
+ ng-class="{'col-md-12 col-lg-12 b-r':(plansGroup.plans.filter(filterDisabledPlans).length % 2 == 1 && key == plansGroup.plans.filter(filterDisabledPlans).length-1)}" + ng-repeat="(key, plan) in plansGroup.plans.filter(filterDisabledPlans) | orderBy: '-ui_weight'">

{{ plan.base_name }}

diff --git a/app/assets/templates/spaces/_form.html b/app/assets/templates/spaces/_form.html index c82a8d040..ee19adf49 100644 --- a/app/assets/templates/spaces/_form.html +++ b/app/assets/templates/spaces/_form.html @@ -107,3 +107,22 @@ {{ 'space.add_an_attachment' | translate }}
+ + +
+ +
+ + +
+
diff --git a/app/assets/templates/spaces/index.html.erb b/app/assets/templates/spaces/index.html.erb index b0208155f..08c49a2ef 100644 --- a/app/assets/templates/spaces/index.html.erb +++ b/app/assets/templates/spaces/index.html.erb @@ -7,13 +7,13 @@
-

{{ 'the_spaces' }}

+

{{ 'spaces_list.the_spaces' }}

@@ -22,41 +22,47 @@
-
- -
+
+
+ + +
+
-
-
- -
-
-
-
-

{{space.name}}

-
-
{{ training.name }} {{ showMachines(training) }} {{ training.nb_total_places }}