Skip to content

Commit 719121c

Browse files
committed
feat: add videos under events
1 parent c4ab885 commit 719121c

File tree

6 files changed

+48
-5
lines changed

6 files changed

+48
-5
lines changed

public/data/events.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
"fullDescriptionEn": "The last meetup of 2024 was held at CreationDose with a Christmas theme: latest Python news, expert talks, gift exchange, toast and a final PyDinner. A perfect way to bid farewell to the year together with the community.",
264264
"attendees": 44,
265265
"url": "https://www.meetup.com/python-catania/events/304691223/",
266+
"videos": ["c8URuoByeRY", "AavetGgMq40", "Kkd2cmjGub0?start=829"],
266267
"gallery": ["/images/events/event-304691223.jpg"],
267268
"speakers": [
268269
{
@@ -284,13 +285,26 @@
284285
"fullDescriptionEn": "Summer Edition 2024 was held at Paradigma SpA with the goal of sharing the latest Python news, listening to community expert talks and networking. The evening ended with a PyPizza together.",
285286
"attendees": 32,
286287
"url": "https://www.meetup.com/python-catania/events/302671524/",
288+
"videos": ["1HksMsb9Xho", "m0lCULOKqTc", "ymCyuHgP6h4", "yD2zhMWeJBM?start=1547"],
287289
"gallery": ["/images/events/event-302671524.jpg"],
288290
"speakers": [
289291
{
290292
"name": "Salvatore Rapisarda",
291-
"topic": "Condivisione delle ultime novità riguardo il linguaggio Python.",
292-
"topicEn": "Sharing the latest news about the Python language.",
293+
"topic": "Introduzione a ODOO",
294+
"topicEn": "Introduction to ODOO",
293295
"image": "/images/about/SalvoRapisarda.jpeg"
296+
},
297+
{
298+
"name": "Salvatore Sanfilippo",
299+
"topic": "Micropython",
300+
"topicEn": "Micropython",
301+
"image": "/images/events-speakers/SalvatoreSanfilippo.jpeg"
302+
},
303+
{
304+
"name": "Pietro Peterlongo",
305+
"topic": "PyScript",
306+
"topicEn": "PyScript",
307+
"image": "/images/events-speakers/PietroPeterlongo.jpeg"
294308
}
295309
]
296310
},

public/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"attendees": "attendees",
3131
"backToEvents": "Back to events",
3232
"speakers": "Speakers",
33+
"videos": "Videos",
3334
"gallery": "Gallery",
3435
"viewOnMeetup": "View on Meetup"
3536
},

public/i18n/it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"attendees": "partecipanti",
3131
"backToEvents": "Torna agli eventi",
3232
"speakers": "Speaker",
33+
"videos": "Video",
3334
"gallery": "Galleria",
3435
"viewOnMeetup": "Vedi su Meetup"
3536
},
2.36 KB
Loading

src/app/pages/events/event-detail/event-detail.component.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ <h1 class="mb-2 text-3xl font-bold">{{ event()!.title }}</h1>
3535
<h2 class="mb-4 text-xl font-semibold">{{ 'events.speakers' | transloco }}</h2>
3636
<ul class="grid list-none grid-cols-1 gap-3 p-0 sm:grid-cols-2">
3737
@for (speaker of event()!.speakers; track speaker.name) {
38-
<li
39-
class="flex items-start gap-3 rounded-(--radius) border border-(--border) bg-(--surface) p-4"
40-
>
38+
<li class="flex items-start gap-3 rounded-(--radius) border border-(--border) bg-(--surface) p-4">
4139
@if (speaker.image) {
4240
<img
4341
[ngSrc]="speaker.image"
@@ -65,6 +63,26 @@ <h2 class="mb-4 text-xl font-semibold">{{ 'events.speakers' | transloco }}</h2>
6563
</div>
6664
}
6765

66+
<!-- Videos -->
67+
@if (event()!.videos && event()!.videos!.length > 0) {
68+
<div class="mb-10">
69+
<h2 class="mb-4 text-xl font-semibold">{{ 'events.videos' | transloco }}</h2>
70+
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
71+
@for (videoId of event()!.videos!; track videoId) {
72+
<div class="aspect-video w-full overflow-hidden rounded-(--radius) shadow">
73+
<iframe
74+
[src]="embedUrl(videoId)"
75+
class="h-full w-full"
76+
allowfullscreen
77+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
78+
title="Video"
79+
></iframe>
80+
</div>
81+
}
82+
</div>
83+
</div>
84+
}
85+
6886
<!-- Gallery -->
6987
@if (event()!.gallery.length > 0) {
7088
<div class="mb-10">

src/app/pages/events/event-detail/event-detail.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';
22
import { NgOptimizedImage } from '@angular/common';
3+
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
34
import { ActivatedRoute, RouterLink } from '@angular/router';
45
import { HttpClient } from '@angular/common/http';
56
import { toSignal } from '@angular/core/rxjs-interop';
@@ -25,6 +26,7 @@ interface MeetupEvent {
2526
readonly fullDescriptionEn: string;
2627
readonly attendees: number;
2728
readonly url: string;
29+
readonly videos?: string[];
2830
readonly gallery: string[];
2931
readonly speakers: Speaker[];
3032
}
@@ -38,6 +40,7 @@ interface MeetupEvent {
3840
export class EventDetailComponent {
3941
private readonly http = inject(HttpClient);
4042
private readonly route = inject(ActivatedRoute);
43+
private readonly sanitizer = inject(DomSanitizer);
4144
private readonly translocoService = inject(TranslocoService);
4245
protected readonly baseUrl = inject(BASE_URL);
4346

@@ -55,6 +58,12 @@ export class EventDetailComponent {
5558
});
5659
}
5760

61+
protected embedUrl(videoId: string): SafeResourceUrl {
62+
return this.sanitizer.bypassSecurityTrustResourceUrl(
63+
`https://www.youtube.com/embed/${videoId}`
64+
);
65+
}
66+
5867
protected openLightbox(index: number): void {
5968
this.lightboxIndex.set(index);
6069
}

0 commit comments

Comments
 (0)