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