Lots of changes to fix lots of bugs and add comments to blog
[sommitrealweird.git] / sommitrealweird / photo / templates / photo / photo_index.html
1 {% extends "base.html" %}
2 {% load thumbnail %}
3
4 {% block title %}Photos - {{ object_list.0.album.caption }}{% endblock %}
5
6 {% block content %}
7     {% if object_list %}
8         <h1>{{ object_list.0.album.name }}</h1>
9         {% if object_list.0.album.caption %}
10         <div class="album_caption">{{ object_list.0.album.caption }}</div>
11         {% endif %}
12         {% for photo in object_list %}
13             <div class="photo">
14                 <a href="{{ photo.id }}/"><img src='{{ photo.image.url|thumbnail:"width=250" }}' alt="{{ photo.caption }}" /></a>
15                 {% if photo.caption %}
16                 <p>{{ photo.caption }}</p>
17                 {% endif %}
18             </div>
19         {% endfor %}
20         <div style="clear: both;">&nbsp;</div>
21         {% if is_paginated %}
22             <p class="paginator">Pages: 
23             {% if page_obj.has_previous %}
24                 <a href="?page={{ page_obj.previous_page_number }}">Previous</a> |
25             {% endif %}
26             {% for paginator_page in paginator.page_range %}
27                 {% if forloop.first %}
28                 {% else %}
29                     |
30                 {% endif %}
31                 {% ifequal paginator_page page %}
32                     {{ page }}
33                 {% else %}
34                     <a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
35                 {% endifequal %}
36             {% endfor %}
37             {% if page_obj.has_next %}
38                 | <a href="?page={{ page_obj.next_page_number }}">Next</a>
39             {% endif %}
40             </p>
41         {% endif %}
42     {% else %}
43         <p>There are no photos available.</p>
44     {% endif %}
45 {% endblock %}