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