mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
(feat) feature the next event in the event page
This commit is contained in:
parent
a8ca94ce32
commit
31fe9dea05
@ -2,6 +2,7 @@
|
||||
|
||||
## next deploy
|
||||
|
||||
- Feature the next event in the event page
|
||||
- Documentation for installing behind a proxy
|
||||
- Ability to install behind a proxy
|
||||
- Improved docker image building time
|
||||
|
@ -112,14 +112,14 @@ Application.Controllers.controller('EventsController', ['$scope', '$state', 'Eve
|
||||
*/
|
||||
const groupEvents = function (events) {
|
||||
if (events.length > 0) {
|
||||
const eventsGroupedByMonth = _.groupBy(events.slice(1), function (obj) {
|
||||
const eventsGroupedByMonth = _.groupBy(events, function (obj) {
|
||||
return _.map(['month_id', 'year'], function (key) {
|
||||
return obj[key];
|
||||
});
|
||||
});
|
||||
$scope.eventsGroupByMonth = Object.assign($scope.eventsGroupByMonth, eventsGroupedByMonth);
|
||||
$scope.monthOrder = Object.keys($scope.eventsGroupByMonth);
|
||||
$scope.featuredEevent = events[0];
|
||||
$scope.featuredEevent = _.minBy(events.filter(e => moment(e.start_date).isAfter()), e => e.start_date);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -56,6 +56,7 @@
|
||||
event="event"
|
||||
card-type="'sm'"
|
||||
ng-repeat="event in eventsGroupByMonth[month].slice(3*$index, 3*$index + 3)"
|
||||
ng-if="event.id !== featuredEevent.id"
|
||||
ui-sref="app.public.events_show({id: event.id})">
|
||||
</event-card>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user