Skip to content

Commit

Permalink
Alphabetize locations, show location thumbnails
Browse files Browse the repository at this point in the history
- Toward wagtail-nest#24. Pending image stretch fix, need to enhance
  • Loading branch information
shacker committed Feb 15, 2017
1 parent 355ef11 commit 0a5358d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bakerydemo/locations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 6 additions & 1 deletion bakerydemo/templates/locations/locations_index_page.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}


{% block content-header %}
{{ page.title }}
{% endblock content-header %}

{% 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 %}

0 comments on commit 0a5358d

Please sign in to comment.