]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blob - sommitrealweird/photo/templates/photo/photo_list.html
Changes for django 2.2
[sommitrealweird.git] / sommitrealweird / photo / templates / photo / photo_list.html
1 {% extends "base.html" %}
2 {% load thumbnail %}
3
4 {% block title %}Photos - {{ object_list.0.album.caption }}{% endblock %}
5
6 {% block content %}
7     {% if object_list %}
8         <h1>{{ object_list.0.album.name }}</h1>
9         {% if object_list.0.album.caption %}
10         <div class="album_caption">{{ object_list.0.album.caption }}</div>
11         {% endif %}
12         {% for photo in object_list %}
13             <div class="photo">
14                 <a href="{{ photo.id }}/"><img src='{{ photo.image.url|thumbnail:"width=250" }}' alt="{{ photo.caption }}" /></a>
15                 {% if photo.caption %}
16                 <p>{{ photo.caption }}</p>
17                 {% endif %}
18             </div>
19         {% endfor %}
20         <div style="clear: both;">&nbsp;</div>
21         {% if is_paginated %}
22             <p class="paginator">Pages: 
23             {% if page_obj.has_previous %}
24                 <a href="?page={{ page_obj.previous_page_number }}">Previous</a> |
25             {% endif %}
26             {% for paginator_page in paginator.page_range %}
27                 {% if forloop.first %}
28                 {% else %}
29                     |
30                 {% endif %}
31                 {% ifequal paginator_page page_obj.number %}
32                     {{ paginator_page }}
33                 {% else %}
34                     <a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
35                 {% endifequal %}
36             {% endfor %}
37             {% if page_obj.has_next %}
38                 | <a href="?page={{ page_obj.next_page_number }}">Next</a>
39             {% endif %}
40             </p>
41         {% endif %}
42     {% else %}
43         <p>There are no photos available.</p>
44     {% endif %}
45 {% endblock %}