diff --git a/app/frontend/src/javascript/controllers/events.js.erb b/app/frontend/src/javascript/controllers/events.js.erb index 3786901f7..7a6098be2 100644 --- a/app/frontend/src/javascript/controllers/events.js.erb +++ b/app/frontend/src/javascript/controllers/events.js.erb @@ -95,6 +95,16 @@ Application.Controllers.controller('EventsController', ['$scope', '$state', 'Eve */ $scope.onSingleDay = function (event) { moment(event.start_date).isSame(event.end_date, 'day'); }; + /** + * Move down the viewport to the featured event + */ + $scope.scrollToFeaturedEvent = function () { + const card = document.getElementsByClassName('featured-event')[0]; + if (card) { + card.childNodes[0].scrollIntoView({ behavior: 'smooth', block: 'center' }); + } + } + /* PRIVATE SCOPE */ /** diff --git a/app/frontend/templates/events/index.html b/app/frontend/templates/events/index.html index 8152eab70..77e9e9d97 100644 --- a/app/frontend/templates/events/index.html +++ b/app/frontend/templates/events/index.html @@ -47,6 +47,9 @@ ui-sref="app.public.events_show({id: featuredEevent.id})"> +
+ +

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

@@ -55,7 +58,8 @@
diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index d997c59aa..820d97c21 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -289,6 +289,7 @@ en: full_price_: "Full price:" to_date: "to" #eg. from 01/01 to 01/05 all_themes: "All themes" + show_featured: "Show the featured event" #details and booking of an event events_show: event_description: "Event description"