From 6dbd628ebdaa4ecf7629e967c47ebcf4ff77eaec Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 13:48:57 -0400 Subject: [PATCH 1/8] Add centering css --- frontend/src/app/events/events.component.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/app/events/events.component.css b/frontend/src/app/events/events.component.css index bbff534..b797e5d 100644 --- a/frontend/src/app/events/events.component.css +++ b/frontend/src/app/events/events.component.css @@ -37,4 +37,12 @@ .mat-mdc-card:hover { box-shadow: 0px 0px 5px #8c8c8c; +} + +.centered-lists { + z-index: 0; + position:relative; + display: flex; + flex-direction: column; + align-items: center; } \ No newline at end of file From e81954973b9cce144a0cbbeb8beffdf8778d67ee Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 14:05:33 -0400 Subject: [PATCH 2/8] Add 'Upcoming' and 'Previous' text --- frontend/src/app/events/events.component.html | 158 ++++++++++++------ frontend/src/app/events/events.component.ts | 1 + 2 files changed, 105 insertions(+), 54 deletions(-) diff --git a/frontend/src/app/events/events.component.html b/frontend/src/app/events/events.component.html index 8baa57c..110b90f 100644 --- a/frontend/src/app/events/events.component.html +++ b/frontend/src/app/events/events.component.html @@ -1,59 +1,109 @@ -
-
- - - - - -    - - -
+
+
+
+
+ + + + + +    + + +
+
+
+ Upcoming - -
- - -
- {{ user_event.event.name }} - {{ user_event.event.club_name }} -
-
- -
- {{ user_event.event.show_short_description ? getShortDescription(user_event.event) : user_event.event.description }} -
-
-
- - - - - - - - - -
+ Previous + + + +
+ + +
+ {{ user_event.event.name }} + {{ user_event.event.club_name }} +
+
+ +
+ {{ user_event.event.show_short_description ? getShortDescription(user_event.event) : user_event.event.description }} +
+
+
+ + + + + + + + + +
+
+
+
+ When: {{ user_event.event.start_time | date: 'MMM d, y, h:mm a' }} - {{ user_event.event.end_time | date: 'MMM d, y, h:mm a' }} + Where: {{ user_event.event.location }} +
+
+
-
-
- When: {{ user_event.event.start_time | date: 'MMM d, y, h:mm a' }} - {{ user_event.event.end_time | date: 'MMM d, y, h:mm a' }} - Where: {{ user_event.event.location }} + + + +
+ + +
+ {{ user_event.event.name }} + {{ user_event.event.club_name }} +
+
+ +
+ {{ user_event.event.show_short_description ? getShortDescription(user_event.event) : user_event.event.description }} +
+
+
+ + + + + + + + + +
+
+
+
+ When: {{ user_event.event.start_time | date: 'MMM d, y, h:mm a' }} - {{ user_event.event.end_time | date: 'MMM d, y, h:mm a' }} + Where: {{ user_event.event.location }} +
+
+
- - +
+
- +
+ diff --git a/frontend/src/app/events/events.component.ts b/frontend/src/app/events/events.component.ts index 55d5d8d..350a711 100644 --- a/frontend/src/app/events/events.component.ts +++ b/frontend/src/app/events/events.component.ts @@ -28,6 +28,7 @@ export class EventsComponent { public events$: Observable public user_events$: Observable public searchText = '' + public currentDate = new Date() constructor(route: ActivatedRoute, private eventService: EventService, private profileService: ProfileService, private http: HttpClient, protected snackBar: MatSnackBar) { const data = route.snapshot.data as { profile: Profile } From 54362c9e939387a7f89600400decb4e1566df8eb Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 14:56:10 -0400 Subject: [PATCH 3/8] previous and upcoming working or all events list --- frontend/src/app/events/events.component.html | 13 ++++++------- frontend/src/app/events/events.component.ts | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/events/events.component.html b/frontend/src/app/events/events.component.html index 110b90f..04ec327 100644 --- a/frontend/src/app/events/events.component.html +++ b/frontend/src/app/events/events.component.html @@ -23,11 +23,8 @@
Upcoming - - Previous - - +
@@ -64,8 +61,10 @@
- - + + Previous + +
@@ -101,7 +100,7 @@
-
+
diff --git a/frontend/src/app/events/events.component.ts b/frontend/src/app/events/events.component.ts index 350a711..2214a69 100644 --- a/frontend/src/app/events/events.component.ts +++ b/frontend/src/app/events/events.component.ts @@ -2,11 +2,12 @@ import { HttpClient } from '@angular/common/http'; import { Component } from '@angular/core'; import { Observable, map } from 'rxjs'; import { Event, User_Event, EventService } from '../event.service' -import { ActivatedRoute, Route } from '@angular/router'; +import { ActivatedRoute, ChildActivationStart, Route } from '@angular/router'; import { isAuthenticated } from '../gate/gate.guard'; import { profileResolver } from '../profile/profile.resolver'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Profile, ProfileService } from '../profile/profile.service'; +import * as moment from 'moment' ; @Component({ selector: 'app-events', @@ -154,4 +155,20 @@ export class EventsComponent { }) })) } + + compareDateGreaterThanNow(date: Date): boolean { + if (moment(date).isAfter(this.currentDate)) { + return true + } + else return false + } + + compareDateLessThanNow(date: Date): boolean { + console.log("This is the moment of event date" + moment(date)) + console.log("This is true/false of current date grateer than event date:" + moment(date).isAfter(this.currentDate)) + if (moment(date).isAfter(this.currentDate)) { + return false + } + else return true + } } From 80bc1936ffce6b416948f00c02d434d6ec3779cf Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 15:18:21 -0400 Subject: [PATCH 4/8] Get upcoming/previous to work for manage events Its kind of ugly with there are no upccoming, so trying to add text for that --- frontend/src/app/events/events.component.ts | 6 +- .../manage-events.component.html | 109 ++++++++++++------ .../manage-events/manage-events.component.ts | 16 +++ 3 files changed, 93 insertions(+), 38 deletions(-) diff --git a/frontend/src/app/events/events.component.ts b/frontend/src/app/events/events.component.ts index 2214a69..9756cc0 100644 --- a/frontend/src/app/events/events.component.ts +++ b/frontend/src/app/events/events.component.ts @@ -157,7 +157,7 @@ export class EventsComponent { } compareDateGreaterThanNow(date: Date): boolean { - if (moment(date).isAfter(this.currentDate)) { + if (moment(date).isAfter(Date())) { return true } else return false @@ -165,8 +165,8 @@ export class EventsComponent { compareDateLessThanNow(date: Date): boolean { console.log("This is the moment of event date" + moment(date)) - console.log("This is true/false of current date grateer than event date:" + moment(date).isAfter(this.currentDate)) - if (moment(date).isAfter(this.currentDate)) { + console.log("This is true/false of current date grateer than event date:" + moment(date).isAfter(Date())) + if (moment(date).isAfter(Date())) { return false } else return true diff --git a/frontend/src/app/manage-events/manage-events.component.html b/frontend/src/app/manage-events/manage-events.component.html index d02170b..ea0f33c 100644 --- a/frontend/src/app/manage-events/manage-events.component.html +++ b/frontend/src/app/manage-events/manage-events.component.html @@ -9,43 +9,82 @@
+ Upcoming -
- - -
- {{ event.name }} -
-
-
- -
- {{ event.show_short_description ? getShortDescription(event) : event.description }} -
-
- - - - - - -
-
-
- When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' }} - Where: {{ event.location }} + +
+ + +
+ {{ event.name }} +
+
+ +
+ {{ event.show_short_description ? getShortDescription(event) : event.description }} +
+
+ + + + + + +

- {{ event.attendees }} -
- - -
+
+ When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' }} + Where: {{ event.location }} +
+ {{ event.attendees }} +
+
+
+
+ + Previous + + +
+ + +
+ {{ event.name }} +
+
+ +
+ {{ event.show_short_description ? getShortDescription(event) : event.description }} +
+
+ + + + + + +
+
+
+ When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' }} + Where: {{ event.location }} +
+ {{ event.attendees }} +
+
+
+
+
+
-
- +
\ No newline at end of file diff --git a/frontend/src/app/manage-events/manage-events.component.ts b/frontend/src/app/manage-events/manage-events.component.ts index e468a9d..4b5d4ba 100644 --- a/frontend/src/app/manage-events/manage-events.component.ts +++ b/frontend/src/app/manage-events/manage-events.component.ts @@ -5,6 +5,7 @@ import { profileResolver } from '../profile/profile.resolver'; import { Event, EventService } from '../event.service'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Observable } from 'rxjs'; +import * as moment from 'moment' ; @Component({ selector: 'app-manage-events', @@ -59,4 +60,19 @@ export class ManageEventsComponent { } } + compareDateGreaterThanNow(date: Date): boolean { + if (moment(date).isAfter(Date())) { + return true + } + else return false + } + + compareDateLessThanNow(date: Date): boolean { + console.log("This is the moment of event date" + moment(date)) + console.log("This is true/false of current date grateer than event date:" + moment(date).isAfter(Date())) + if (moment(date).isAfter(Date())) { + return false + } + else return true + } } From 0690ea994411cff690f9b8bd70ee7f2e3b02c2fc Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 15:22:35 -0400 Subject: [PATCH 5/8] Add line breaks --- frontend/src/app/events/events.component.html | 2 ++ frontend/src/app/manage-events/manage-events.component.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/frontend/src/app/events/events.component.html b/frontend/src/app/events/events.component.html index 04ec327..e217213 100644 --- a/frontend/src/app/events/events.component.html +++ b/frontend/src/app/events/events.component.html @@ -23,6 +23,7 @@
Upcoming +
@@ -63,6 +64,7 @@ Previous +
diff --git a/frontend/src/app/manage-events/manage-events.component.html b/frontend/src/app/manage-events/manage-events.component.html index ea0f33c..fa613c8 100644 --- a/frontend/src/app/manage-events/manage-events.component.html +++ b/frontend/src/app/manage-events/manage-events.component.html @@ -10,6 +10,7 @@
Upcoming +
@@ -48,6 +49,7 @@ Previous +
From 2b740d0e6e4bdc2ba6ecc611e57354949bb9b696 Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 15:24:53 -0400 Subject: [PATCH 6/8] Change color of line break --- frontend/src/app/events/events.component.html | 4 ++-- frontend/src/app/manage-events/manage-events.component.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/events/events.component.html b/frontend/src/app/events/events.component.html index e217213..79d96ce 100644 --- a/frontend/src/app/events/events.component.html +++ b/frontend/src/app/events/events.component.html @@ -23,7 +23,7 @@
Upcoming -
+
@@ -64,7 +64,7 @@ Previous -
+
diff --git a/frontend/src/app/manage-events/manage-events.component.html b/frontend/src/app/manage-events/manage-events.component.html index fa613c8..12c1da4 100644 --- a/frontend/src/app/manage-events/manage-events.component.html +++ b/frontend/src/app/manage-events/manage-events.component.html @@ -10,7 +10,7 @@
Upcoming -
+
@@ -49,7 +49,7 @@ Previous -
+
From 6c19b1120c73712e1b1ca8a334240601cb312508 Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 15:35:04 -0400 Subject: [PATCH 7/8] Add messages when no events are showing up and take away line breaks --- frontend/src/app/events/events.component.html | 2 -- .../app/manage-events/manage-events.component.html | 12 ++++++++++-- .../src/app/manage-events/manage-events.component.ts | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/events/events.component.html b/frontend/src/app/events/events.component.html index 79d96ce..04ec327 100644 --- a/frontend/src/app/events/events.component.html +++ b/frontend/src/app/events/events.component.html @@ -23,7 +23,6 @@
Upcoming -
@@ -64,7 +63,6 @@ Previous -
diff --git a/frontend/src/app/manage-events/manage-events.component.html b/frontend/src/app/manage-events/manage-events.component.html index 12c1da4..2d56a56 100644 --- a/frontend/src/app/manage-events/manage-events.component.html +++ b/frontend/src/app/manage-events/manage-events.component.html @@ -10,7 +10,6 @@
Upcoming -
@@ -48,8 +47,12 @@
+ +
+ Your clubs have no upcoming events. Register an Event for your club now. +
+
Previous -
@@ -87,6 +90,11 @@
+ +
+ Your clubs have no previous events. +
+
\ No newline at end of file diff --git a/frontend/src/app/manage-events/manage-events.component.ts b/frontend/src/app/manage-events/manage-events.component.ts index 4b5d4ba..945a739 100644 --- a/frontend/src/app/manage-events/manage-events.component.ts +++ b/frontend/src/app/manage-events/manage-events.component.ts @@ -22,6 +22,8 @@ export class ManageEventsComponent { }; public club_events$: Observable + public previous_events: Date[] = [] + public upcoming_events: Date[] = [] constructor(private eventService: EventService, protected snackBar: MatSnackBar) { // TODO: get events by club not just all events @@ -62,15 +64,15 @@ export class ManageEventsComponent { compareDateGreaterThanNow(date: Date): boolean { if (moment(date).isAfter(Date())) { + this.upcoming_events.push(date) return true } else return false } compareDateLessThanNow(date: Date): boolean { - console.log("This is the moment of event date" + moment(date)) - console.log("This is true/false of current date grateer than event date:" + moment(date).isAfter(Date())) if (moment(date).isAfter(Date())) { + this.previous_events.push(date) return false } else return true From b86bdacf7f202638108a186ed25f69b1ca37335b Mon Sep 17 00:00:00 2001 From: Catherine Roberts Date: Fri, 28 Apr 2023 15:45:45 -0400 Subject: [PATCH 8/8] Finalize upcoming/previous events and messages for all events, my events, manage events --- .../manage-events.component.html | 2 +- .../manage-events/manage-events.component.ts | 4 +- .../app/my-events/my-events.component.html | 103 +++++++++++++----- .../src/app/my-events/my-events.component.ts | 19 ++++ 4 files changed, 97 insertions(+), 31 deletions(-) diff --git a/frontend/src/app/manage-events/manage-events.component.html b/frontend/src/app/manage-events/manage-events.component.html index 2d56a56..01330b5 100644 --- a/frontend/src/app/manage-events/manage-events.component.html +++ b/frontend/src/app/manage-events/manage-events.component.html @@ -48,7 +48,7 @@
-
+
Your clubs have no upcoming events. Register an Event for your club now.
diff --git a/frontend/src/app/manage-events/manage-events.component.ts b/frontend/src/app/manage-events/manage-events.component.ts index 945a739..df4a9b9 100644 --- a/frontend/src/app/manage-events/manage-events.component.ts +++ b/frontend/src/app/manage-events/manage-events.component.ts @@ -72,9 +72,9 @@ export class ManageEventsComponent { compareDateLessThanNow(date: Date): boolean { if (moment(date).isAfter(Date())) { - this.previous_events.push(date) return false } - else return true + this.previous_events.push(date) + return true } } diff --git a/frontend/src/app/my-events/my-events.component.html b/frontend/src/app/my-events/my-events.component.html index b0ab6d1..f5dbf08 100644 --- a/frontend/src/app/my-events/my-events.component.html +++ b/frontend/src/app/my-events/my-events.component.html @@ -9,37 +9,84 @@
+ Upcoming -
- - -
- {{ event.name }} -
-
- -
- {{ event.show_short_description ? getShortDescription(event) : event.description }} -
-
- - - - - - -
-
-
- When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' : '-0400' }} - Where: {{ event.location }} -
-
-
+ +
+ + +
+ {{ event.name }} +
+
+ +
+ {{ event.show_short_description ? getShortDescription(event) : event.description }} +
+
+ + + + + + +
+
+
+ When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' : '-0400' }} + Where: {{ event.location }} +
+
+
+
+
+ + +
+ You have no upcoming events. Register for an Event now!
+
+ Previous + + +
+ + +
+ {{ event.name }} +
+
+ +
+ {{ event.show_short_description ? getShortDescription(event) : event.description }} +
+
+ + + + + + +
+
+
+ When: {{ event.start_time | date: 'MMM d, y, h:mm a' }} - {{ event.end_time | date: 'MMM d, y, h:mm a' : '-0400' }} + Where: {{ event.location }} +
+
+
+
+
+ +
+ You have no previous events. +
+
diff --git a/frontend/src/app/my-events/my-events.component.ts b/frontend/src/app/my-events/my-events.component.ts index a1aa273..8b536db 100644 --- a/frontend/src/app/my-events/my-events.component.ts +++ b/frontend/src/app/my-events/my-events.component.ts @@ -7,6 +7,7 @@ import { Profile } from '../profile/profile.service'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Observable, map } from 'rxjs'; import { MatSnackBar } from '@angular/material/snack-bar'; +import * as moment from 'moment' ; @Component({ selector: 'app-my-events', @@ -26,6 +27,8 @@ export class MyEventsComponent { public my_events$: Observable public my_events_shown$: Observable public searchText = '' + public previous_events: Date[] = [] + public upcoming_events: Date[] = [] constructor(private eventService: EventService, route: ActivatedRoute, private http: HttpClient, protected snackBar: MatSnackBar) { this.my_events$ = eventService.getMyEvents() @@ -76,4 +79,20 @@ export class MyEventsComponent { this.searchText = '' this.my_events_shown$ = this.my_events$.pipe(map((events: Event[]) => {return events.map(event => {return {...event, show_short_description: true}})})) } + + compareDateGreaterThanNow(date: Date): boolean { + if (moment(date).isAfter(Date())) { + this.upcoming_events.push(date) + return true + } + else return false + } + + compareDateLessThanNow(date: Date): boolean { + if (moment(date).isAfter(Date())) { + return false + } + this.previous_events.push(date) + return true + } }