Skip to content
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

WIP: NeosCon Website allow adding schedules for different event lengths #469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,26 @@
icon: 'calendar-alt'
position: 20
properties:
title:
type: string
placeholder: 'title'
ui:
label: 'Title'
inspector:
group: 'event'
event:
type: reference
ui:
label: 'Event'
reloadIfChanged: true
inspector:
group: 'event'
scheduleDate:
type: DateTime
placeholder: 'Select a date to display the schedule for'
ui:
label: 'Schedule date'
inspector:
group: 'event'
editorOptions:
format: 'd.m.Y'
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
prototype(Neos.NeosConIo:Schedule) < prototype(Neos.Neos:ContentComponent) {
@if.eventNodeIsSet = ${q(event).is('[instanceof Neos.NeosConIo:Event]')}
@if.dateIsSet = ${q(q(event).property('eventDate')).is('[instanceof DateTime]')}
scheduleDate = ${q(node).property('scheduleDate')}
title = ${q(node).property('title')}

@context {
event = ${q(node).property('event')}
days = Neos.Fusion:DataStructure {
day1 = ${q(node).property('event') && q(q(node).property('event')).property('eventDate')}
day2 = ${q(node).property('event') && q(q(node).property('event')).property('eventDate') && Date.add(q(q(node).property('event')).property('eventDate'), 'P1D')}
}
}
// Neos.NeosConIo:Schedule.Talks needs the event set.
@context.event = ${q(node).property('event')}

@cache {
mode = 'cached'
Expand All @@ -25,19 +20,15 @@ prototype(Neos.NeosConIo:Schedule) < prototype(Neos.Neos:ContentComponent) {
}
}

days = ${days}

renderer = afx`
<div class="schedule" data-component="Schedule">
<Neos.Fusion:Loop items={props.days} itemName="day" @children="itemRenderer">
<h3 class="conferenceDayTitle">Conference Day {iterator.cycle}</h3>
<div class="conferenceDaySubtitle">
{Date.format(day, 'd M Y')}
</div>
<div class="talks">
<Neos.NeosConIo:Schedule.Talks day={day} />
</div>
</Neos.Fusion:Loop>
<h3 class="conferenceDayTitle">{props.title}</h3>
<div class="conferenceDaySubtitle">
{Date.format(props.scheduleDate, 'd M Y')}
</div>
<div class="talks">
<Neos.NeosConIo:Schedule.Talks day={props.scheduleDate} />
</div>
</div>
`
}