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