diff --git a/assets/css/src/calendar-strip.css b/assets/css/src/calendar-strip.css index 222ee79..7edfc7c 100644 --- a/assets/css/src/calendar-strip.css +++ b/assets/css/src/calendar-strip.css @@ -66,27 +66,27 @@ max-height: 20rem; } -.calendar-strip__session:first-child > a { +.session:first-child > a { border-top: var(--border) !important; } -.calendar-strip__session:not(:last-child) { +.session:not(:last-child) { border-bottom: var(--border); } -.calendar-strip__session > a { +.session__event-link { display: grid; grid-template-columns: repeat(5, 1fr); padding: var(--padding-vertical) var(--space-m); } -.calendar-strip__session:hover { +.session:hover { background-color: var(--color); } -.calendar-strip__session:not(:last-child) { - margin-bottom: 4rem; -} - -.calendar-strip__session > div { +.session__info { width: 100%; } + +.session__info > p:not(:last-child) { + margin-bottom: 1rem; +} diff --git a/assets/css/src/collapsable-section.css b/assets/css/src/collapsable-section.css index 6e2f86a..c4337e4 100644 --- a/assets/css/src/collapsable-section.css +++ b/assets/css/src/collapsable-section.css @@ -4,8 +4,8 @@ padding: 0 !important; } -.collapsable:not(:first-child) > *, -.collapsable:first-child > button, +.collapsable:not(.sessions) > *, +.collapsable.sessions > button, .collapsable .session { padding: var(--row-padding); box-sizing: border-box; diff --git a/site/controllers/program.php b/site/controllers/program.php index 290e0c2..708d37d 100644 --- a/site/controllers/program.php +++ b/site/controllers/program.php @@ -40,7 +40,13 @@ return function($page) { $isStillShowing = false; foreach ($sessions->toStructure() as $session) { - $currentSeasonSessions[] = $session->toArray(); + $arraySession = $session->toArray(); + $arraySession['title'] = $event->title()->value(); + $arraySession['authors'] = $event->authors(); + $arraySession['place'] = $event->place(); + $arraySession['duration'] = $event->isMapadoEvent() == 'true' ? $event->remoteDuration() : $event->duration(); + $arraySession['ticketingUrl'] = ''; + $currentSeasonSessions[] = $arraySession; $sessionDate = str_replace('-', '', $session->date()->toDate('YMMdd')); diff --git a/site/plugins/helpers/index.php b/site/plugins/helpers/index.php index efe04f9..d26ef0c 100644 --- a/site/plugins/helpers/index.php +++ b/site/plugins/helpers/index.php @@ -102,7 +102,7 @@ function createMapadoEventRequest($page) { "subfields" => [ ["name" => "startDate"], ["name" => "endDate"], - ["name" => "bookableStock"] + ["name" => "notInStockContingentBookableStock"] ] ], ] @@ -150,7 +150,7 @@ function saveMapadoEvent($mapadoEvent, $page) { "date" => substr($session->startDate, 0, 10), "time" => str_replace(':', 'h', $startTime), "ticketingUrl" => $ticketingUrl, - "bookableStock" => $session->bookableStock + "bookableStock" => $session->notInStockContingentBookableStock ]; } @@ -164,4 +164,14 @@ function saveMapadoEvent($mapadoEvent, $page) { $page->update($dataToSave); return $dataToSave; -} \ No newline at end of file +} + +function getEndTime($session) { + $formattedTime = strlen($session['time']) < 4 ? $session['time'] . '00' : $session['time']; + $time1 = DateTime::createFromFormat('G\hi', $formattedTime); + $formattedDuration = strlen($session['duration']) < 4 ? $session['duration'] . '00' : $session['duration']; + $time2 = DateTime::createFromFormat('G\hi', $formattedDuration); + $time1->add(new DateInterval('PT' . $time2->format('H') . 'H' . $time2->format('i') . 'M')); + $endTime = $time1->format('G\hi'); + return $endTime; +} diff --git a/site/snippets/calendar-strip.php b/site/snippets/calendar-strip.php index 26ec518..8893600 100644 --- a/site/snippets/calendar-strip.php +++ b/site/snippets/calendar-strip.php @@ -62,24 +62,27 @@
-