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