From 0a5358d13f86041229148db2976866f29e4169c2 Mon Sep 17 00:00:00 2001 From: Scot Hacker Date: Wed, 15 Feb 2017 00:33:46 -0800 Subject: [PATCH] Alphabetize locations, show location thumbnails - Toward #24. Pending image stretch fix, need to enhance --- bakerydemo/locations/models.py | 2 +- bakerydemo/templates/locations/locations_index_page.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bakerydemo/locations/models.py b/bakerydemo/locations/models.py index dfcd571..834d341 100644 --- a/bakerydemo/locations/models.py +++ b/bakerydemo/locations/models.py @@ -73,7 +73,7 @@ def get_context(self, request): context = super(LocationsIndexPage, self).get_context(request) context['locations'] = LocationPage.objects.descendant_of( self).live().order_by( - '-first_published_at') + 'title') return context diff --git a/bakerydemo/templates/locations/locations_index_page.html b/bakerydemo/templates/locations/locations_index_page.html index 63455ae..1165304 100644 --- a/bakerydemo/templates/locations/locations_index_page.html +++ b/bakerydemo/templates/locations/locations_index_page.html @@ -1,5 +1,7 @@ {% extends "base.html" %} {% load wagtailcore_tags %} +{% load wagtailimages_tags %} + {% block content-header %} {{ page.title }} @@ -7,6 +9,9 @@ {% block content-body %} {% for location in locations %} -
{{ location.title }}
+
+ {{ location.title }} + {% image location.image width-150 %} +
{% endfor %} {% endblock content-body %}