From b7524542331529314633a68491be3cb3abe25bdf Mon Sep 17 00:00:00 2001 From: reverend Date: Fri, 2 Apr 2021 17:21:00 +0200 Subject: [PATCH] #39 Partial for Images --- .../lostplaces/templates/home_unauth.html | 2 +- .../lostplaces/templates/partials/image.html | 14 ++++++++++++++ .../templates/partials/place_teaser.html | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 django_lostplaces/lostplaces/templates/partials/image.html diff --git a/django_lostplaces/lostplaces/templates/home_unauth.html b/django_lostplaces/lostplaces/templates/home_unauth.html index bbd5cf9..6e6ed28 100644 --- a/django_lostplaces/lostplaces/templates/home_unauth.html +++ b/django_lostplaces/lostplaces/templates/home_unauth.html @@ -24,7 +24,7 @@
- + {% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
diff --git a/django_lostplaces/lostplaces/templates/partials/image.html b/django_lostplaces/lostplaces/templates/partials/image.html new file mode 100644 index 0000000..2ad0240 --- /dev/null +++ b/django_lostplaces/lostplaces/templates/partials/image.html @@ -0,0 +1,14 @@ +{% if link_url %} + +{% endif %} +
+ {{alt_text}} +
+{% if link_url %}
{% endif %} \ No newline at end of file diff --git a/django_lostplaces/lostplaces/templates/partials/place_teaser.html b/django_lostplaces/lostplaces/templates/partials/place_teaser.html index 15929a5..0083943 100644 --- a/django_lostplaces/lostplaces/templates/partials/place_teaser.html +++ b/django_lostplaces/lostplaces/templates/partials/place_teaser.html @@ -3,7 +3,7 @@
{% if place.placeimages.all|length > 0 %} - + {% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %} {% else %} {% endif %}