Skip to content

Commit

Permalink
Toggle all event details with showEventDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
JHWelch committed Oct 5, 2023
1 parent 3f73269 commit 80684b4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<%- include('partials/weeks', {
fetchUrl: '/api/weeks/',
showRSVP: true,
showEventDetails: true,
sectionTitles: {
0: 'Now Playing',
1: 'Coming Attractions',
Expand Down
19 changes: 13 additions & 6 deletions views/partials/movie.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@
:class="titleSize(movie) + ' overflow-hidden font-medium text-center overflow-ellipsis'"
></span>

<span
x-show="movie.time"
x-text="movie.time.replace(/ /g, '\u00a0')"
class="text-md overflow-hidden font-medium text-center bg-violet-700 text-white px-2 py-0.5 rounded-2xl"
></span>

<% if (showEventDetails) { %>
<span
x-show="movie.time"
x-text="movie.time.replace(/ /g, '\u00a0')"
class="text-md overflow-hidden font-medium text-center bg-violet-700 text-white px-2 py-0.5 rounded-2xl"
></span>
<% } else { %>
<span><!-- Empty span to Retain formatting --></span>
<% } %>
</h4>

<div class="flex flex-col justify-between flex-1">
<div class="relative mt-2">
<%- include('movie/field_trip_banner'); %>
<% if (showEventDetails) { %>
<%- include('movie/field_trip_banner'); %>
<% } %>

<a
:href="movie.url"
Expand Down
2 changes: 1 addition & 1 deletion views/partials/movies.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex flex-wrap justify-center mt-2 space-y-4 max-w-9xl">
<template x-for="movie in week.movies">
<%- include('movie.ejs'); %>
<%- include('movie.ejs', { showEventDetails }); %>
</template>
</div>
4 changes: 2 additions & 2 deletions views/partials/week.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
></span>
</h3>

<% if (showRSVP) { %>
<% if (showEventDetails) { %>
<button
x-data
x-cloak
Expand All @@ -35,6 +35,6 @@
</template>

<template x-if="!week.isSkipped">
<%- include('movies') %>
<%- include('movies', { showEventDetails }) %>
</template>
</div>
2 changes: 1 addition & 1 deletion views/partials/weeks.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<div>
<%- include('section_title') %>

<%- include('week', { showRSVP }); %>
<%- include('week', { showEventDetails }); %>
</div>
</template>
</div>
2 changes: 1 addition & 1 deletion views/previous/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="mt-10">
<%- include('../partials/weeks', {
fetchUrl: '/api/weeks?past=true',
showRSVP: false,
showEventDetails: false,
sectionTitles: { 0: 'Past Releases' },
}); %>
</div>
Expand Down

0 comments on commit 80684b4

Please sign in to comment.