-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List of Events #118
Merged
Merged
List of Events #118
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3bb5e12
feat: added link to events page
L-Steinmacher 9feaa2e
feat: added events-list.mjs and rendering it on pages/events.mjs
L-Steinmacher d30bf6d
feat: displaying data and starting html
L-Steinmacher 1318beb
feat:events-sponsors rendered
L-Steinmacher 0e25493
update data being fetched for route
L-Steinmacher 0ab09c2
talks rendering now
L-Steinmacher 1c31dae
small change
L-Steinmacher 1c7472e
feat rendering event talks list and talks on page
L-Steinmacher fa77933
added anchor tag
L-Steinmacher f4543a2
cleaned up files
L-Steinmacher 728d4a5
align past events with header
L-Steinmacher 3c08ea3
removed the current/future event from the pastEvents.
L-Steinmacher 40f2a5b
fixed dates on events.json and pastEvents sort
L-Steinmacher baf3871
fixed past events
L-Steinmacher b739284
fixed pastEvents, added closing ul and removed target
L-Steinmacher 6a492c0
fixed data fetching for talks, displaying name from speaker
L-Steinmacher 167e775
normalize data and expand data in api events
L-Steinmacher df608a8
use list-sponsors and list-talks in events/
L-Steinmacher 6144e9d
add turnary on topic for older talks
L-Steinmacher 215d714
removed unused element, reorganized helper functions to respective files
L-Steinmacher 8ca401b
refactored events/ to properly use 404
L-Steinmacher a45771f
added additional comment for event inflation
L-Steinmacher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import { events } from '../events.mjs' | ||
import events from '../../data/events.json' assert { type: 'json' } | ||
import sponsors from '../../data/sponsors.json' assert { type: 'json' } | ||
import talks from '../../data/talks.json' assert { type: 'json' } | ||
import speakers from '../../data/speakers.json' assert { type: 'json' } | ||
|
||
export async function get(req) { | ||
let { id } = req.params | ||
|
||
let event = events.find(s => s.id === id) | ||
let eventSponsors = sponsors.filter(s => event.sponsors.includes(s.id)) | ||
|
||
let eventTalks = event.talks ?talks.filter(t => { | ||
return event.talks.includes(t.id) | ||
}) : [] | ||
|
||
let eventSpeakers = eventTalks ? speakers.filter(s => { | ||
return eventTalks.map(t => t.speaker_id).includes(s.id) | ||
}) : [] | ||
|
||
return { | ||
json: { event } | ||
json: { event, eventSponsors, eventTalks, eventSpeakers } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export default function eventSponsors({ html, state = {} }) { | ||
const { store = {} } = state | ||
const { eventSponsors } = store | ||
|
||
return html` | ||
<style> | ||
:host div { | ||
padding: 16px; | ||
} | ||
|
||
:host img { | ||
height: 80px; | ||
} | ||
@media only screen and (min-width: 768px) { | ||
:host { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
} | ||
</style> | ||
|
||
${eventSponsors | ||
.map( | ||
s => html` <div> | ||
<a target="_sponsor" href="${s.url}" | ||
><img src="/_public/images/sponsors/${s.image}" | ||
/></a> | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</div>` | ||
) | ||
.join('')} | ||
` | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
export default function EventTalk({ html, state = {} }) { | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { store = {}, attrs } = state | ||
let { eventTalks, eventSpeakers } = store | ||
let { talkid, speakerid } = attrs | ||
|
||
let talk = eventTalks.filter(t => t.id === talkid)[0] | ||
let speaker = eventSpeakers.filter(s => s.id === speakerid)[0] | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
let { title, type } = talk | ||
let { name, company, photo, location } = speaker | ||
|
||
return html` | ||
<style> | ||
.speaker { | ||
margin-right: 16px; | ||
} | ||
|
||
.photo { | ||
position: relative; | ||
height: 250px; | ||
width: 250px; | ||
} | ||
|
||
.photo .overlay { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
opacity: 0; | ||
transition: 0.5s ease; | ||
background-color: #ee3e4a; | ||
} | ||
|
||
.photo:hover .overlay { | ||
opacity: 1; | ||
} | ||
|
||
.photo .overlay .text { | ||
color: white; | ||
font-family: headline-gothic-atf-round, sans-serif; | ||
font-weight: 500; | ||
font-style: italic; | ||
font-size: 24px; | ||
line-height: 1.125em; | ||
margin: 16px; | ||
text-align: left; | ||
} | ||
|
||
.photo img { | ||
object-fit: cover; | ||
height: 250px; | ||
width: 250px; | ||
} | ||
|
||
.info { | ||
margin: 8px 0 16px 0; | ||
} | ||
|
||
.name { | ||
font-family: headline-gothic-atf-round, sans-serif; | ||
font-weight: 700; | ||
font-size: 24px; | ||
} | ||
</style> | ||
|
||
<div class="speaker"> | ||
<div class="photo"> | ||
<img src="/_public/images/speakers/${photo}" alt="photo of ${name}" /> | ||
<div class="overlay"> | ||
<div class="text">${type === 'lightning' ? '⚡️' : ''}${title}</div> | ||
</div> | ||
</div> | ||
<div class="info"> | ||
<div class="name">${name}</div> | ||
<div class="misc"> | ||
${ company && company }<br/>${ location && location } | ||
</div> | ||
</div> | ||
</div> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default function EventTalk({ html, state = {} }) { | ||
const { store } = state | ||
let { eventTalks, eventSpeakers } = store | ||
|
||
return html` | ||
<ul> | ||
${eventTalks.length > 0 ?eventTalks | ||
.map( | ||
t => | ||
/*html*/ `<event-talk talkId=${t.id} speakerId=${ | ||
eventSpeakers.find(s => s.id === t.speaker_id).id | ||
}></event-talk>` | ||
) | ||
.join(''): 'No talks this month.'} | ||
</ul> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export default function EventsList({ html, state }) { | ||
const { store } = state | ||
const allEvents = store.data | ||
|
||
// The last item in the array is the current event | ||
let pastEvents = allEvents.sort((a,b) => new Date(b.date) - new Date(a.date)).slice(1) | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (pastEvents.length > 0) { | ||
return html` | ||
<style> | ||
@media only screen and (min-width: 768px) { | ||
:host { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: flex-start; | ||
} | ||
} | ||
ul { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
li { | ||
list-style-type: none; | ||
} | ||
</style> | ||
<ul> | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
${pastEvents.map( | ||
e => ` | ||
<li > | ||
<a target="_self" href="/events/${e.id}"> | ||
${e.title} | ||
</a> | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</li>` | ||
) | ||
.join('')} | ||
` | ||
}else { | ||
return ` | ||
<p>Wait for it...</p> | ||
` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
import { marked } from "marked" | ||
|
||
export default function ({ html, state = {} }) { | ||
let { store = {} } = state | ||
let { event } = store | ||
|
||
return html` | ||
<page-layout title=${event.title}> | ||
<pre>${JSON.stringify(event, null, 2)}</pre> | ||
<h3>${event.title}</h3> | ||
${event.description && `<p>${marked(event.description)}</p>` } | ||
|
||
<h4>Thanks to our Sponsors ❤️</h4> | ||
${event.sponsors.length > 0 ? html`<event-sponsors></event-sponsors>` : null} | ||
<event-talks-list></event-talks-list> | ||
andrewiggins marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div class=""> | ||
<a target="_self" href="/events"> | ||
See all past events <i class="fa-solid fa-arrow-right"></i> | ||
</a> | ||
</div> | ||
</page-layout> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list of events looks a little funky on a desktop browser. It's not aligned with the title. Probably not a blocking issue, but is there an easy fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, Carter already mentioned this here: #118 (comment)