1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

(feat) admins can scroll to the featured event

This commit is contained in:
Sylvain 2022-06-15 12:26:44 +02:00
parent 96c825769c
commit 503ae22c0b
3 changed files with 16 additions and 1 deletions

View File

@ -95,6 +95,16 @@ Application.Controllers.controller('EventsController', ['$scope', '$state', 'Eve
*/ */
$scope.onSingleDay = function (event) { moment(event.start_date).isSame(event.end_date, 'day'); }; $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 */ /* PRIVATE SCOPE */
/** /**

View File

@ -47,6 +47,9 @@
ui-sref="app.public.events_show({id: featuredEevent.id})"> ui-sref="app.public.events_show({id: featuredEevent.id})">
</event-card> </event-card>
</div> </div>
<div ng-if="isAuthorized(['admin', 'manager'])">
<button class="btn btn-default" ng-click="scrollToFeaturedEvent()" translate>{{ 'app.public.events_list.show_featured' }}</button>
</div>
<div ng-repeat="month in monthOrder"> <div ng-repeat="month in monthOrder">
<h1>{{monthNames[month.split(',')[0] - 1]}}, {{month.split(',')[1]}}</h1> <h1>{{monthNames[month.split(',')[0] - 1]}}, {{month.split(',')[1]}}</h1>
@ -55,7 +58,8 @@
<event-card style="display: contents" <event-card style="display: contents"
event="event" event="event"
card-type="'sm'" card-type="'sm'"
ng-class="{'focus': event.id === featuredEevent.id}" ng-if="isAuthorized(['admin', 'manager']) || event.id !== featuredEevent.id"
ng-class="{'featured-event': event.id === featuredEevent.id}"
ui-sref="app.public.events_show({id: event.id})"> ui-sref="app.public.events_show({id: event.id})">
</event-card> </event-card>
</div> </div>

View File

@ -289,6 +289,7 @@ en:
full_price_: "Full price:" full_price_: "Full price:"
to_date: "to" #eg. from 01/01 to 01/05 to_date: "to" #eg. from 01/01 to 01/05
all_themes: "All themes" all_themes: "All themes"
show_featured: "Show the featured event"
#details and booking of an event #details and booking of an event
events_show: events_show:
event_description: "Event description" event_description: "Event description"