Browse Source

Alphabetize locations, show location thumbnails
- Toward #24. Pending image stretch fix, need to enhance

Scot Hacker 8 years ago
parent
commit
0a5358d13f

+ 1 - 1
bakerydemo/locations/models.py

@@ -73,7 +73,7 @@ class LocationsIndexPage(Page):
         context = super(LocationsIndexPage, self).get_context(request)
         context['locations'] = LocationPage.objects.descendant_of(
             self).live().order_by(
-            '-first_published_at')
+            'title')
         return context
 
 

+ 6 - 1
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 %}
-        <div><a href="{% pageurl location %}">{{ location.title }}</a></div>
+        <div>
+            <a href="{% pageurl location %}">{{ location.title }}</a>
+            {% image location.image width-150 %}
+        </div>
     {% endfor %}
 {% endblock content-body %}