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