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