Skip to content

Commit

Permalink
Add Event image to form and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
joeriddles committed Sep 2, 2024
1 parent 9d55774 commit 28a32b4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ local_settings.py
db.sqlite3
db.sqlite3-journal
*.dump
staticfiles
src/staticfiles
src/media

# Flask stuff:
instance/
Expand Down
1 change: 1 addition & 0 deletions src/web/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Meta:
"location",
"url",
"external_id",
"image",
"group",
"tags",
]
Expand Down
10 changes: 9 additions & 1 deletion src/web/templates/web/partials/detail_event.htm
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{% load web_extras markdownify %}
<div class="max-w-content">
<h1 class="mb-3 text-primary">
<h1 class="mb-3">
{{ object }}
</h1>

<div class="mb-3 d-inline-block">
{% include 'spokanetech/partials/human_readable_datetime.htm' with object=object only %}
</div>

{% if object.image %}
<div class="max-w-100">
<img class="w-100 rounded" src="{{ object.image.url }}" />
</div>
{% endif %}

{% if object.group %}
<div class="mb-3 card fit-content">
<div class="card-body">
<div class="card-title my-0">
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
</div>
</div>
</div>
{% endif %}

<p>
<h2>Description</h2>
Expand Down
9 changes: 9 additions & 0 deletions src/web/templates/web/partials/event_list.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<div class="grid">
{% for object in queryset %}
<div class="card mb-0">
{% if object.image %}
<a href="{{ object.get_absolute_url }}">
<img style="max-height: 200px; object-fit: cover;" src="{{ object.image.url }}" class="card-img-top">
</a>
{% endif %}
<div class="card-body card-header">
<h5 class="card-title">
<a href="{{ object.get_absolute_url }}" class="link">
Expand Down Expand Up @@ -33,14 +38,18 @@ <h5 class="card-title">
{{ object.description|markdownify|truncatewords_html:50 }}
</div>
<div class="card-body d-flex flex-wrap align-items-end justify-content-between" style="gap: 8px;">
{% if object.group %}
<a href="{{ object.group.get_absolute_url }}" class="card-link">
{{ object.group }}
</a>
{% endif %}
{% if object.url %}
<div class="flex-grow-1 text-end">
<a href="{{ object.url }}" target="_blank" class="card-link">
RSVP <i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
</div>
{% endif %}
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit 28a32b4

Please sign in to comment.