Skip to content

Commit

Permalink
fix meeting page when no food sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
briancohan committed Jul 5, 2024
1 parent fb51bce commit 6582e01
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
24 changes: 12 additions & 12 deletions data/events.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
[
{
"url": "https://www.meetup.com/pyrvausergroup/events/300125988/",
"title": "Data Analytics with Pandas",
"location": "Ippon Technologies, Richmond, VA",
"rsvps": 13,
"description": "<div class=\"utils_cardDescription__1Qr0x max-h-[60px] text-sm\" inert=\"true\">\n <p class=\"mb-4\">\n Our own Paul Joireman will be presenting on performing Data Analyses using the Pandas library!\n </p>\n <p class=\"mb-4\">\n ***\n </p>\n <p class=\"mb-4\">\n <strong>\n Schedule\n </strong>\n <br/>\n 5:45 pm - Doors Open / Social\n <br/>\n 6:30 pm - Meeting Start\n <br/>\n 7:30 pm - Wrap-up\n <br/>\n 8:00 pm - Prologue (Social in Scotts Addition)\n </p>\n <p class=\"mb-4\">\n <strong>\n All events are open to all skill levels\n </strong>\n . If you're just starting out, come to learn and feel free to ask questions. That's where the real learning happens. If you're a more seasoned developer, we'd love to learn from you. Despite what the Zen of Python says, there are usually more than one way to do something, so share your knowledge!\n </p>\n <p class=\"mb-4\">\n Join our Discord server!\n <strong>\n https://pyrva.org/discord\n </strong>\n <br/>\n Want to sponsor PyRVA?\n <strong>\n https://pyrva.org/donate\n </strong>\n <br/>\n Want to present?\n <strong>\n https://forms.gle/q8w3xziArWjud5f67\n </strong>\n </p>\n</div>\n",
"image": "https://secure.meetupstatic.com/photos/event/1/b/5/0/event_521826992.webp",
"large_image": "https://secure.meetupstatic.com/photos/event/1/b/5/0/600_521826992.webp?w=750",
"datetime": "Tue, Jul 2, 2024, 5:45 PM"
},
{
"url": "https://www.meetup.com/pyrvausergroup/events/301247440/",
"title": "PyRVA Social Night - Richmond Flying Squirrels",
"location": "The Diamond, Richmond, VA",
"rsvps": 11,
"rsvps": 14,
"description": "<div class=\"utils_cardDescription__1Qr0x max-h-[60px] text-sm\" inert=\"true\">\n <p class=\"mb-4\">\n Join PyRVA for a night at the ballpark and cheer on the Richmond Flying Squirrels!\n </p>\n <p class=\"mb-4\">\n We'll sit in the General Admission area so it will be easy to get seats together. $10/person ahead of time, $12/person day-of. Feel free to bring your family along for the fun!\n </p>\n <p class=\"mb-4\">\n Grab your tickets here: https://www.milb.com/richmond/schedule/2024-07\n </p>\n</div>\n",
"image": "https://secure.meetupstatic.com/photos/event/3/4/a/0/event_521293472.webp",
"large_image": "https://secure.meetupstatic.com/photos/event/3/4/a/0/600_521293472.webp?w=750",
Expand All @@ -23,7 +13,7 @@
"url": "https://www.meetup.com/pyrvausergroup/events/300125994/",
"title": "Django Front Ends - HTMX vs React",
"location": "Ippon Technologies, Richmond, VA",
"rsvps": 3,
"rsvps": 5,
"description": "<div class=\"utils_cardDescription__1Qr0x max-h-[60px] text-sm\" inert=\"true\">\n <p class=\"mb-4\">\n Chris May will be doing a dress rehearsal of his DjangoCon talk comparing front end options for Python websites.\n </p>\n <p class=\"mb-4\">\n <strong>\n Schedule\n </strong>\n <br/>\n 5:45 pm - Doors Open / Social\n <br/>\n 6:30 pm - Meeting Start\n <br/>\n 7:30 pm - Wrap-up\n <br/>\n 8:00 pm - Prologue (Social in Scotts Addition)\n </p>\n <p class=\"mb-4\">\n <strong>\n All events are open to all skill levels\n </strong>\n . If you're just starting out, come to learn and feel free to ask questions. That's where the real learning happens. If you're a more seasoned developer, we'd love to learn from you. Despite what the Zen of Python says, there are usually more than one way to do something, so share your knowledge!\n </p>\n <p class=\"mb-4\">\n Join our Discord server!\n <strong>\n https://pyrva.org/discord\n </strong>\n <br/>\n Want to sponsor PyRVA?\n <strong>\n https://pyrva.org/donate\n </strong>\n <br/>\n Want to present?\n <strong>\n https://forms.gle/q8w3xziArWjud5f67\n </strong>\n </p>\n</div>\n",
"image": "https://secure.meetupstatic.com/photos/event/1/d/c/8/event_521827624.webp",
"large_image": "https://secure.meetupstatic.com/photos/event/1/d/c/8/600_521827624.webp?w=750",
Expand Down Expand Up @@ -98,5 +88,15 @@
"image": "https://secure.meetupstatic.com/photos/event/2/6/6/b/event_521349835.webp",
"large_image": "https://secure.meetupstatic.com/photos/event/2/6/6/b/600_521349835.webp?w=750",
"datetime": "Tue, Mar 18, 2025, 5:45 PM"
},
{
"url": "https://www.meetup.com/pyrvausergroup/events/hpmfmtyhcgbtb/",
"title": "PyRVA Monthly Meeting",
"location": "Ippon Technologies, Richmond, VA",
"rsvps": 2,
"description": "<div class=\"utils_cardDescription__1Qr0x max-h-[60px] text-sm\" inert=\"true\">\n <p class=\"mb-4\">\n This is a placeholder event so you know when to plan to be there.\n </p>\n <p class=\"mb-4\">\n <strong>\n Schedule\n </strong>\n <br/>\n 5:45 pm - Doors Open / Social\n <br/>\n 6:30 pm - Meeting Start\n <br/>\n 7:30 pm - Wrap-up\n <br/>\n 8:00 pm - Prologue (Social in Scotts Addition)\n </p>\n <p class=\"mb-4\">\n <strong>\n All events are open to all skill levels\n </strong>\n . If you're just starting out, come to learn and feel free to ask questions. That's where the real learning happens. If you're a more seasoned developer, we'd love to learn from you. Despite what the Zen of Python says, there are usually more than one way to do something, so share your knowledge!\n </p>\n <p class=\"mb-4\">\n Join our Discord server!\n <strong>\n https://pyrva.org/discord\n </strong>\n <br/>\n Want to sponsor PyRVA?\n <strong>\n https://pyrva.org/donate\n </strong>\n <br/>\n Want to present?\n <strong>\n https://forms.gle/q8w3xziArWjud5f67\n </strong>\n </p>\n</div>\n",
"image": "https://secure.meetupstatic.com/photos/event/2/6/6/b/event_521349835.webp",
"large_image": "https://secure.meetupstatic.com/photos/event/2/6/6/b/600_521349835.webp?w=750",
"datetime": "Tue, Apr 15, 2025, 5:45 PM"
}
]
Binary file modified src/pyrva/__pycache__/app.cpython-311.pyc
Binary file not shown.
15 changes: 9 additions & 6 deletions src/pyrva/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
T = TypeVar("T")


def get_next(data: dict[str, list[T]]) -> list[T]:
return next(
v
for k, v in data.items()
if datetime.strptime(k, "%Y-%m-%d") >= datetime.now() - timedelta(days=1)
)
def get_next(data: dict[str, list[T]]) -> list[T] | None:
try:
return next(
v
for k, v in data.items()
if datetime.strptime(k, "%Y-%m-%d") >= datetime.now() - timedelta(days=1)
)
except StopIteration:
return None


@app.template_filter()
Expand Down
6 changes: 4 additions & 2 deletions src/pyrva/templates/pages/meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<section id="pyrva" class="flex flex-col justify-evenly basis-1/4">
<a href="{{ url_for('index') }}" class="mx-auto"><img
src="{{ url_for('static', filename='images/logo.png') }}" alt="PyRVA Logo" width="408"
src="{{ url_for('static', filename='images/logo.webp') }}" alt="PyRVA Logo" width="408"
height="139" /></a>
<ul class="mx-auto space-y-4 font-semibold w-fit text-zinc-600">
{{ social_link('icons/meetup.svg', 'meetup') }}
Expand Down Expand Up @@ -57,7 +57,7 @@ <h2 class="pb-4 text-3xl font-semibold text-center">Upcoming Events</h2>
class="flex flex-col items-center justify-between gap-4 p-16 border rounded-lg shadow-lg basis-1/2 bg-white/50">
<img class="w-3/5 rounded-lg" src="{{ event.large_image }}" alt="{{ event.title }}" width="600"
height="338" />
<h1 class="text-5xl font-bold">{{ event.title }}</h1>
<h1 class="text-5xl font-bold text-center">{{ event.title }}</h1>
<div class="flex w-full justify-evenly">
<div class="p-4 basis-5/12">
<h2 class="text-3xl font-semibold">Schedule</h2>
Expand All @@ -80,6 +80,7 @@ <h2 class="text-3xl font-semibold">Introductions</h2>
</div>
</div>
<div id="clock" class="font-mono text-6xl font-bold"></div>
{% if food_sponsors %}
<div class="text-xl font-semibold text-center">
Tonight's Food Provided By:
<div class="flex justify-center gap-8">
Expand All @@ -88,6 +89,7 @@ <h2 class="text-3xl font-semibold">Introductions</h2>
{% endfor %}
</div>
</div>
{% endif %}
</section>

<section id="sponsors" class="flex flex-col justify-between basis-1/4">
Expand Down

0 comments on commit 6582e01

Please sign in to comment.