diff --git a/CHANGELOG.md b/CHANGELOG.md index b6f44ac9b..faefa6896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ - Public gallery of trainings with ability to view details or to book a training on its own calendar - Ability to switch back to all trainings booking view - Fix a bug: project drafts are shown on public profiles +- Admin: Events can be associated with a theme and an age range +- Admin: Event categories, themes and age ranges can be customized +- Filter events by category, theme and age range in public view +- Statistics will include informations abouts events category, theme and age range +- [TODO DEPLOY] `rake fablab:es_add_event_filters` - [TODO DEPLOY] `rake db:migrate` ## v2.3.0 2016 June 28 @@ -27,7 +32,7 @@ ## v2.2.2 2016 June 23 - Fix some bugs: users with uncompleted account (sso imported) won't appear in statistics, in listings and in searches. Moreover, they won't block statistics generation - Fix a bug: unable to display next results in statistics tables -- Admin: Category is mandatory when creating a course/workshop (event) +- Admin: Category is mandatory when creating an event ## v2.2.1 2016 June 22 - Fix a bug: field User.merged_at should not be allowed to be mapped in SSO diff --git a/app/assets/javascripts/controllers/admin/events.coffee b/app/assets/javascripts/controllers/admin/events.coffee index 571a1eab0..adebce44b 100644 --- a/app/assets/javascripts/controllers/admin/events.coffee +++ b/app/assets/javascripts/controllers/admin/events.coffee @@ -7,7 +7,6 @@ # in the various events' admin controllers. # # Provides : -# - $scope.categories = [{Category}] # - $scope.datePicker = {} # - $scope.submited(content) # - $scope.cancel() @@ -23,13 +22,7 @@ # - $state (Ui-Router) [ 'app.public.events_list' ] ## class EventsController - constructor: ($scope, $state, Event, Category) -> - - ## Retrieve the list of categories from the server (stage, atelier, ...) - Category.query().$promise.then (data)-> - $scope.categories = data.map (d) -> - id: d.id - name: d.name + constructor: ($scope, $state) -> ## default parameters for AngularUI-Bootstrap datepicker $scope.datePicker = @@ -136,7 +129,8 @@ class EventsController ## # Controller used in the events listing page (admin view) ## -Application.Controllers.controller "AdminEventsController", ["$scope", "$state", 'Event', 'eventsPromise', ($scope, $state, Event, eventsPromise) -> +Application.Controllers.controller "AdminEventsController", ["$scope", "$state", 'dialogs', 'growl', 'Event', 'Category', 'EventTheme', 'AgeRange', 'eventsPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', '_t' +, ($scope, $state, dialogs, growl, Event, Category, EventTheme, AgeRange, eventsPromise, categoriesPromise, themesPromise, ageRangesPromise, _t) -> @@ -151,6 +145,21 @@ Application.Controllers.controller "AdminEventsController", ["$scope", "$state", ## Current virtual page $scope.page = 2 + ## Temporary datastore for creating new elements + $scope.inserted = + category: null + theme: null + age_range: null + + ## List of categories for the events + $scope.categories = categoriesPromise + + ## List of events themes + $scope.themes = themesPromise + + ## List of age ranges + $scope.ageRanges = ageRangesPromise + ## # Adds a bucket of events to the bottom of the page, grouped by month ## @@ -161,6 +170,71 @@ Application.Controllers.controller "AdminEventsController", ["$scope", "$state", $scope.page += 1 + ## + # Saves a new element / Update an existing one to the server (form validation callback) + # @param model {string} model name + # @param data {Object} element name + # @param [id] {number} element id, in case of update + ## + $scope.saveElement = (model, data, id) -> + if id? + getModel(model)[0].update {id: id}, data + else + getModel(model)[0].save data, (resp)-> + getModel(model)[1][getModel(model)[1].length-1].id = resp.id + + + + ## + # Deletes the element at the specified index + # @param model {string} model name + # @param index {number} element index in the $scope[model] array + ## + $scope.removeElement = (model, index) -> + if model == 'category' and getModel(model)[1].length == 1 + growl.error(_t('at_least_one_category_is_required')+' '+_t('unable_to_delete_the_last_one')) + return false + if getModel(model)[1][index].related_to > 0 + growl.error(_t('unable_to_delete_ELEMENT_already_in_use_NUMBER_times', {ELEMENT:model, NUMBER:getModel(model)[1][index].related_to}, "messageformat")) + return false + dialogs.confirm + resolve: + object: -> + title: _t('confirmation_required') + msg: _t('do_you_really_want_to_delete_this_ELEMENT', {ELEMENT:model}, "messageformat") + , -> # delete confirmed + getModel(model)[0].delete getModel(model)[1][index], null, -> + getModel(model)[1].splice(index, 1) + , -> + growl.error(_t('unable_to_delete_an_error_occured')) + + + + ## + # Creates a new empty entry in the $scope[model] array + # @param model {string} model name + ## + $scope.addElement = (model) -> + $scope.inserted[model] = + name: '' + related_to: 0 + getModel(model)[1].push($scope.inserted[model]) + + + + ## + # Removes the newly inserted but not saved element / Cancel the current element modification + # @param model {string} model name + # @param rowform {Object} see http://vitalets.github.io/angular-xeditable/ + # @param index {number} element index in the $scope[model] array + ## + $scope.cancelElement = (model, rowform, index) -> + if getModel(model)[1][index].id? + rowform.$cancel() + else + getModel(model)[1].splice(index, 1) + + ### PRIVATE SCOPE ### @@ -183,6 +257,17 @@ Application.Controllers.controller "AdminEventsController", ["$scope", "$state", else $scope.paginateActive = false + ## + # Return the model and the datastore matching the given name + # @param name {string} 'category', 'theme' or 'age_range' + # @return {[Object, Array]} model and datastore + ## + getModel = (name) -> + switch name + when 'category' then [Category, $scope.categories] + when 'theme' then [EventTheme, $scope.themes] + when 'age_range' then [AgeRange, $scope.ageRanges] + else [null, []] # init the controller (call at the end !) @@ -209,8 +294,8 @@ Application.Controllers.controller "ShowEventReservationsController", ["$scope", ## # Controller used in the event creation page ## -Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'Event', 'Category', 'CSRF', '_t' -, ($scope, $state, $locale, Event, Category, CSRF, _t) -> +Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', '_t' +, ($scope, $state, $locale, CSRF, categoriesPromise, themesPromise, ageRangesPromise, _t) -> CSRF.setMetaTags() ## API URL where the form will be posted @@ -219,6 +304,15 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ ## Form action on the above URL $scope.method = 'post' + ## List of categories for the events + $scope.categories = categoriesPromise + + ## List of events themes + $scope.themes = themesPromise + + ## List of age ranges + $scope.ageRanges = ageRangesPromise + ## Default event parameters $scope.event = event_files_attributes: [] @@ -243,7 +337,7 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; ## Using the EventsController - new EventsController($scope, $state, Event, Category) + new EventsController($scope, $state) ] @@ -251,8 +345,8 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ ## # Controller used in the events edition page ## -Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", "$locale", 'Event', 'Category', 'CSRF', 'eventPromise' -, ($scope, $state, $stateParams, $locale, Event, Category, CSRF, eventPromise) -> +Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", "$locale", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise' +, ($scope, $state, $stateParams, $locale, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise) -> ### PUBLIC SCOPE ### @@ -270,6 +364,15 @@ Application.Controllers.controller "EditEventController", ["$scope", "$state", " ## 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 + + ## List of events themes + $scope.themes = themesPromise + + ## List of age ranges + $scope.ageRanges = ageRangesPromise + ### PRIVATE SCOPE ### @@ -287,7 +390,7 @@ Application.Controllers.controller "EditEventController", ["$scope", "$state", " $scope.event.end_date = moment($scope.event.end_date).toDate() ## Using the EventsController - new EventsController($scope, $state, Event, Category) + new EventsController($scope, $state) diff --git a/app/assets/javascripts/controllers/admin/graphs.coffee b/app/assets/javascripts/controllers/admin/graphs.coffee index 529cbf7b4..4e24d1318 100644 --- a/app/assets/javascripts/controllers/admin/graphs.coffee +++ b/app/assets/javascripts/controllers/admin/graphs.coffee @@ -334,7 +334,7 @@ Application.Controllers.controller "GraphsController", ["$scope", "$state", "$ro callback(results) recursiveCb() else # palmares (ranking) - queryElasticRanking index.es_type_key, $scope.ranking.groupCriterion, $scope.ranking.sortCriterion, index.graph.limit, (results, error) -> + queryElasticRanking index.es_type_key, $scope.ranking.groupCriterion, $scope.ranking.sortCriterion, (results, error) -> if (error) callback([], error) else @@ -373,17 +373,18 @@ Application.Controllers.controller "GraphsController", ["$scope", "$state", "$ro ## # For ranking displays, run the elasticSearch query to retreive the /stats/type aggregations - # @param esType {String} elasticSearch document type (subscription|machine|training|...) - # @param statType {String} statistics type (year|month|hour|booking|...) + # @param esType {string} elasticSearch document type (subscription|machine|training|...) + # @param groupKey {string} statistics subtype or custom field + # @param sortKey {string} statistics type or 'ca' # @param callback {function} function be to run after results were retrieved, # it will receive two parameters : results {Array}, error {String} (if any) ## - queryElasticRanking = (esType, groupKey, sortKey, limit, callback) -> + queryElasticRanking = (esType, groupKey, sortKey, callback) -> # handle invalid callback if typeof(callback) != "function" console.error('[graphsController::queryElasticRanking] Error: invalid callback provided') return - if !esType or !groupKey or !sortKey or typeof limit != 'number' + if !esType or !groupKey or !sortKey callback([], '[graphsController::queryElasticRanking] Error: invalid parameters provided') # run query diff --git a/app/assets/javascripts/controllers/events.coffee.erb b/app/assets/javascripts/controllers/events.coffee.erb index b74cd734d..b3d84f317 100644 --- a/app/assets/javascripts/controllers/events.coffee.erb +++ b/app/assets/javascripts/controllers/events.coffee.erb @@ -1,13 +1,7 @@ 'use strict' -Application.Controllers.controller "EventsController", ["$scope", "$state", 'Event', ($scope, $state, Event) -> - - - - ### PRIVATE STATIC CONSTANTS ### - - # Number of events added to the page when the user clicks on 'load next events' - EVENTS_PER_PAGE = 12 +Application.Controllers.controller "EventsController", ["$scope", "$state", 'Event', 'categoriesPromise', 'themesPromise', 'ageRangesPromise' +, ($scope, $state, Event, categoriesPromise, themesPromise, ageRangesPromise) -> @@ -16,33 +10,40 @@ Application.Controllers.controller "EventsController", ["$scope", "$state", 'Eve ## The events displayed on the page $scope.events = [] - ## By default, the pagination mode is activated to limit the page size - $scope.paginateActive = true - ## The currently displayed page number $scope.page = 1 + ## List of categories for the events + $scope.categories = categoriesPromise + + ## List of events themes + $scope.themes = themesPromise + + ## List of age ranges + $scope.ageRanges = ageRangesPromise + + ## Hide or show the 'load more' button + $scope.noMoreResults = false + + ## Active filters for the events list + $scope.filters = + category_id: null + theme_id: null + age_range_id: null + + + ## - # Adds EVENTS_PER_PAGE events to the bottom of the page, grouped by month + # Adds a resultset of events to the bottom of the page, grouped by month ## $scope.loadMoreEvents = -> - Event.query {page: $scope.page}, (data) -> + Event.query Object.assign({page: $scope.page}, $scope.filters), (data) -> $scope.events = $scope.events.concat data - if data.length > 0 - $scope.paginateActive = false if ($scope.page-2)*EVENTS_PER_PAGE+data.length >= data[0].nb_total_events + groupEvents($scope.events) + $scope.page += 1 - $scope.eventsGroupByMonth = _.groupBy($scope.events, (obj) -> - _.map ['month', 'year'], (key, value) -> obj[key] - ) - $scope.monthOrder = _.sortBy _.keys($scope.eventsGroupByMonth), (k)-> - monthYearArray = k.split(',') - date = new Date() - date.setMonth(monthYearArray[0]) - date.setYear(monthYearArray[1]) - return -date.getTime() - else - $scope.paginateActive = false - $scope.page += 1 + if (!data[0] || data[0].nb_total_events <= $scope.events.length) + $scope.noMoreResults = true @@ -55,13 +56,69 @@ Application.Controllers.controller "EventsController", ["$scope", "$state", 'Eve + ## + # Callback to refresh the events list according to the filters set + ## + $scope.filterEvents = -> + # reinitialize results datasets + $scope.page = 1 + $scope.eventsGroupByMonth = {} + $scope.events = [] + $scope.monthOrder = [] + $scope.noMoreResults = false + + # run a search query + Event.query Object.assign({page: $scope.page}, $scope.filters), (data) -> + $scope.events = data + groupEvents(data) + $scope.page += 1 + + if (!data[0] || data[0].nb_total_events <= $scope.events.length) + $scope.noMoreResults = true + + + + ## + # Test if the provided event occurs on a single day or on many days + # @param event {{start_date:Date, end_date:Date}} Event object as retreived from the API + # @return {boolean} false if the event occurs on many days + ## + $scope.onSingleDay = (event) -> + moment(event.start_date).isSame(event.end_date, 'day') + + + ### PRIVATE SCOPE ### ## # Kind of constructor: these actions will be realized first when the controller is loaded ## initialize = -> - $scope.loadMoreEvents() + $scope.filterEvents() + + + + ## + # Group the provided events by month/year and concat them with existing results + # Then compute the ordered list of months for the complete resultset. + # Affect the resulting events groups in $scope.eventsGroupByMonth and the ordered month keys in $scope.monthOrder. + # @param {Array} Events retrived from the API + ## + groupEvents = (events) -> + if events.length > 0 + eventsGroupedByMonth = _.groupBy(events, (obj) -> + _.map ['month', 'year'], (key, value) -> obj[key] + ) + $scope.eventsGroupByMonth = Object.assign($scope.eventsGroupByMonth, eventsGroupedByMonth) + + monthsOrder = _.sortBy _.keys($scope.eventsGroupByMonth), (k)-> + monthYearArray = k.split(',') + date = new Date() + date.setMonth(monthYearArray[0]) + date.setYear(monthYearArray[1]) + return -date.getTime() + + $scope.monthOrder = monthsOrder @@ -353,7 +410,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " # Create an hash map implementing the Reservation specs # @param member {Object} User as retreived from the API: current user / selected user if current is admin # @param reserve {Object} Reservation parameters (places...) - # @param event {Object} Current event (Atelier/Stage) + # @param event {Object} Current event # @return {{user_id:Number, reservable_id:Number, reservable_type:String, slots_attributes:Array, nb_reserve_places:Number, nb_reserve_reduced_places:Number}} ## mkReservation = (member, reserve, event) -> diff --git a/app/assets/javascripts/controllers/main_nav.coffee.erb b/app/assets/javascripts/controllers/main_nav.coffee.erb index ed3465ff9..bfc731048 100644 --- a/app/assets/javascripts/controllers/main_nav.coffee.erb +++ b/app/assets/javascripts/controllers/main_nav.coffee.erb @@ -25,7 +25,7 @@ Application.Controllers.controller "MainNavController", ["$scope", "$location", } { state: 'app.public.events_list' - linkText: 'courses_and_workshops_registrations' + linkText: 'events_registrations' linkIcon: 'tags' } { @@ -73,7 +73,7 @@ Application.Controllers.controller "MainNavController", ["$scope", "$location", } { state: 'app.admin.events' - linkText: 'courses_and_workshops_monitoring' + linkText: 'manage_the_events' linkIcon: 'tags' } { diff --git a/app/assets/javascripts/router.coffee.erb b/app/assets/javascripts/router.coffee.erb index ec9e375c4..728910568 100644 --- a/app/assets/javascripts/router.coffee.erb +++ b/app/assets/javascripts/router.coffee.erb @@ -468,6 +468,15 @@ angular.module('application.router', ['ui.router']). templateUrl: '<%= asset_path "events/index.html" %>' controller: 'EventsController' resolve: + categoriesPromise: ['Category', (Category) -> + Category.query().$promise + ] + themesPromise: ['EventTheme', (EventTheme) -> + EventTheme.query().$promise + ] + ageRangesPromise: ['AgeRange', (AgeRange) -> + AgeRange.query().$promise + ] translations: [ 'Translations', (Translations) -> Translations.query('app.public.events_list').$promise ] @@ -591,6 +600,15 @@ angular.module('application.router', ['ui.router']). eventsPromise: ['Event', (Event)-> Event.query(page: 1).$promise ] + categoriesPromise: ['Category', (Category) -> + Category.query().$promise + ] + themesPromise: ['EventTheme', (EventTheme) -> + EventTheme.query().$promise + ] + ageRangesPromise: ['AgeRange', (AgeRange) -> + AgeRange.query().$promise + ] translations: [ 'Translations', (Translations) -> Translations.query('app.admin.events').$promise ] @@ -601,6 +619,15 @@ angular.module('application.router', ['ui.router']). templateUrl: '<%= asset_path "events/new.html" %>' controller: 'NewEventController' resolve: + categoriesPromise: ['Category', (Category) -> + Category.query().$promise + ] + themesPromise: ['EventTheme', (EventTheme) -> + EventTheme.query().$promise + ] + ageRangesPromise: ['AgeRange', (AgeRange) -> + AgeRange.query().$promise + ] translations: [ 'Translations', (Translations) -> Translations.query(['app.admin.events_new', 'app.shared.event']).$promise ] @@ -614,6 +641,15 @@ angular.module('application.router', ['ui.router']). eventPromise: ['Event', '$stateParams', (Event, $stateParams)-> Event.get(id: $stateParams.id).$promise ] + categoriesPromise: ['Category', (Category) -> + Category.query().$promise + ] + themesPromise: ['EventTheme', (EventTheme) -> + EventTheme.query().$promise + ] + ageRangesPromise: ['AgeRange', (AgeRange) -> + AgeRange.query().$promise + ] translations: [ 'Translations', (Translations) -> Translations.query(['app.admin.events_edit', 'app.shared.event']).$promise ] diff --git a/app/assets/javascripts/services/age_range.coffee b/app/assets/javascripts/services/age_range.coffee new file mode 100644 index 000000000..e60d5b9d8 --- /dev/null +++ b/app/assets/javascripts/services/age_range.coffee @@ -0,0 +1,8 @@ +'use strict' + +Application.Services.factory 'AgeRange', ["$resource", ($resource)-> + $resource "/api/age_ranges/:id", + {id: "@id"}, + update: + method: 'PUT' +] diff --git a/app/assets/javascripts/services/event_theme.coffee b/app/assets/javascripts/services/event_theme.coffee new file mode 100644 index 000000000..934a54f25 --- /dev/null +++ b/app/assets/javascripts/services/event_theme.coffee @@ -0,0 +1,8 @@ +'use strict' + +Application.Services.factory 'EventTheme', ["$resource", ($resource)-> + $resource "/api/event_themes/:id", + {id: "@id"}, + update: + method: 'PUT' +] diff --git a/app/assets/stylesheets/app.components.scss b/app/assets/stylesheets/app.components.scss index 830632eb4..562d1efec 100644 --- a/app/assets/stylesheets/app.components.scss +++ b/app/assets/stylesheets/app.components.scss @@ -154,8 +154,11 @@ } .article-thumbnail { - // max-height: 400px; overflow: hidden; + + img { + height: 400px; + } } } @@ -417,6 +420,7 @@ .event { transition: all 0.07s linear; + overflow: hidden; } .event:hover { @@ -431,8 +435,8 @@ border-color: #eee; } .box-h-m { - height: 150px; - max-height: 150px; + height: 175px; + max-height: 175px; } .half-w { @@ -446,25 +450,31 @@ border-color: #d0d0d0; padding: 10px; } -.crop-130 { - height: 130px; - width: 130px; - max-width: 130px; - max-height: 130px; +.crop-155 { + height: 155px; + width: 155px; + max-width: 155px; + max-height: 155px; overflow: hidden; vertical-align: bottom; } -.crop-130 img { - height: 130px; +.crop-155 img { + height: 155px; width: auto; } -@media only screen and (max-width: 1280px) and (min-width: 770px) { - .crop-130 { +@media only screen and (max-width: 1375px) and (min-width: 770px) { + .crop-155 { height: 90px; width: 90px; - margin-top: 25px; + margin-top: 35px; + } +} + +@media only screen and (max-width: 1375px) and (min-width: 1125px) { + .half-w { + width: 60%; } } diff --git a/app/assets/templates/admin/events/filters.html.erb b/app/assets/templates/admin/events/filters.html.erb new file mode 100644 index 000000000..7a2e5d130 --- /dev/null +++ b/app/assets/templates/admin/events/filters.html.erb @@ -0,0 +1,120 @@ +
+

{{ 'categories' }}

+

{{ 'at_least_one_category_is_required' }}

+ + + + + + + + + + + + + + +
{{ 'name' }}
+ + {{ category.name }} + + + +
+ + +
+
+ + +
+
+ +

{{ 'themes' }}

+ + + + + + + + + + + + + + +
{{ 'name' }}
+ + {{ theme.name }} + + + +
+ + +
+
+ + +
+
+ +

{{ 'age_ranges' }}

+ + + + + + + + + + + + + + +
{{ 'name' }}
+ + {{ range.name }} + + + +
+ + +
+
+ + +
+
+ +
\ No newline at end of file diff --git a/app/assets/templates/admin/events/index.html.erb b/app/assets/templates/admin/events/index.html.erb index 1a38d12d3..3d4ad5b5e 100644 --- a/app/assets/templates/admin/events/index.html.erb +++ b/app/assets/templates/admin/events/index.html.erb @@ -7,7 +7,7 @@
-

{{ 'fablab_courses_and_workshops' }}

+

{{ 'fablab_events' }}

@@ -21,57 +21,66 @@
+ + -
- -
+
+ +
- - - - - - - - - - - - - - - -
{{ 'title' }}{{ 'dates' }}
- {{ event.title }} - - {{ 'from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} {{ 'to_date' }} {{event.end_date | amDateFormat:'LL'}} -
- {{ 'all_day' }} - - {{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} - {{ 'to_time' }} - {{event.end_date | amDateFormat:'LT'}} - -
-
- - + + + + + + + + + + + + + + + +
{{ 'title' }}{{ 'dates' }}
+ {{ event.title }} + + {{ 'from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} {{ 'to_date' }} {{event.end_date | amDateFormat:'LL'}} +
+ {{ 'all_day' }} + + {{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} + {{ 'to_time' }} + {{event.end_date | amDateFormat:'LT'}} + +
+
+ + +
+
+ +
-
-
+ + -
diff --git a/app/assets/templates/admin/members/edit.html.erb b/app/assets/templates/admin/members/edit.html.erb index 92107c960..e8b9eaf94 100644 --- a/app/assets/templates/admin/members/edit.html.erb +++ b/app/assets/templates/admin/members/edit.html.erb @@ -138,11 +138,11 @@ - +
-

{{ 'next_courses_and_workshops' | translate }}

+

{{ 'next_events' | translate }}

    @@ -158,14 +158,14 @@
-
{{ 'no_upcomning_courses_or_workshops'}}
+
{{ 'no_upcoming_events' }}
-

{{ 'passed_courses_and_workshops' | translate }}

+

{{ 'passed_events' | translate }}

    @@ -173,7 +173,7 @@ {{r.reservable.title}} - {{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}
-
{{ 'no_passed_courses_or_workshop' }}
+
{{ 'no_passed_events' }}
diff --git a/app/assets/templates/dashboard/events.html.erb b/app/assets/templates/dashboard/events.html.erb index 0903ba9dd..dc578ecf9 100644 --- a/app/assets/templates/dashboard/events.html.erb +++ b/app/assets/templates/dashboard/events.html.erb @@ -13,7 +13,7 @@
-

{{ 'your_next_courses_and_workshops' | translate }}

+

{{ 'your_next_events' | translate }}

    @@ -23,14 +23,14 @@
    {{ 'NUMBER_reduced_fare_places_reserved' }}
-
{{ 'no_courses_or_workshops_to_come' }}
+
{{ 'no_events_to_come' }}
-

{{ 'your_previous_courses_and_workshops' | translate }}

+

{{ 'your_previous_events' | translate }}

    @@ -38,7 +38,7 @@ {{r.reservable.title}} - {{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }}
-
{{ 'no_passed_courses_or_workshops' }}
+
{{ 'no_passed_events' }}
diff --git a/app/assets/templates/dashboard/nav.html.erb b/app/assets/templates/dashboard/nav.html.erb index ee0c398c0..954fcd515 100644 --- a/app/assets/templates/dashboard/nav.html.erb +++ b/app/assets/templates/dashboard/nav.html.erb @@ -14,7 +14,7 @@
  • {{ 'my_settings' }}
  • {{ 'my_projects' }}
  • {{ 'my_trainings' }}
  • -
  • {{ 'my_courses_and_workshops' }}
  • +
  • {{ 'my_events' }}
  • {{ 'my_invoices' }}
  • diff --git a/app/assets/templates/events/_form.html.erb b/app/assets/templates/events/_form.html.erb index 685ea8172..846067559 100644 --- a/app/assets/templates/events/_form.html.erb +++ b/app/assets/templates/events/_form.html.erb @@ -80,7 +80,7 @@
    -

    {{ 'event_type' }}

    +

    {{ 'event_type' }} *

    @@ -96,6 +96,40 @@
    +
    +
    +

    {{ 'event_theme' }}

    +
    +
    + + + + + + + + + + +
    +
    + +
    +
    +

    {{ 'age_range' }}

    +
    +
    + + + + + + + + + +
    +

    {{ 'dates_and_opening_hours' }}

    diff --git a/app/assets/templates/events/index.html.erb b/app/assets/templates/events/index.html.erb index 9182191a4..ec1c492cc 100644 --- a/app/assets/templates/events/index.html.erb +++ b/app/assets/templates/events/index.html.erb @@ -7,7 +7,7 @@
    -

    {{ 'the_fablab_s_courses_and_workshops' }}

    +

    {{ 'the_fablab_s_events' }}

    @@ -20,38 +20,64 @@
    -
    -

    {{month.split(',')[0]}}, {{month.split(',')[1]}}

    +
    +
    + +
    - diff --git a/app/assets/templates/events/show.html.erb b/app/assets/templates/events/show.html.erb index fff0f497c..e951556ab 100644 --- a/app/assets/templates/events/show.html.erb +++ b/app/assets/templates/events/show.html.erb @@ -69,7 +69,11 @@
    {{event.categories[0].name}}
    -
    {{ 'dates' | translate }}
    +
    {{event.event_themes[0].name}}
    +
    {{event.age_range.name}}
    +
    +
    +
    {{ 'dates' | translate }}
    {{ 'beginning' | translate }} {{event.start_date | amDateFormat:'L'}}
    {{ 'ending' | translate }} {{event.end_date | amDateFormat:'L'}}
    {{ 'opening_hours' | translate }}
    {{ 'all_day' }}
    diff --git a/app/assets/templates/home.html.erb b/app/assets/templates/home.html.erb index 134e65afe..e69fb0943 100644 --- a/app/assets/templates/home.html.erb +++ b/app/assets/templates/home.html.erb @@ -80,7 +80,7 @@
    -

    {{ 'fablab_s_next_courses_and_workshops' | translate }} {{ 'every_events' | translate }}

    +

    {{ 'fablab_s_next_events' | translate }} {{ 'every_events' | translate }}

    diff --git a/app/assets/templates/shared/header.html.erb b/app/assets/templates/shared/header.html.erb index 180fd7493..263be0ab2 100644 --- a/app/assets/templates/shared/header.html.erb +++ b/app/assets/templates/shared/header.html.erb @@ -38,7 +38,7 @@
  • {{ 'my_settings' }}
  • {{ 'my_projects' }}
  • {{ 'my_trainings' }}
  • -
  • {{ 'my_courses_and_workshops' }}
  • +
  • {{ 'my_events' }}
  • {{ 'my_invoices' }}
  • diff --git a/app/assets/templates/shared/leftnav.html.erb b/app/assets/templates/shared/leftnav.html.erb index b50dd1d58..8c6141a4b 100644 --- a/app/assets/templates/shared/leftnav.html.erb +++ b/app/assets/templates/shared/leftnav.html.erb @@ -53,7 +53,7 @@