Stop albums from displaying None when they don't need to
[sommitrealweird.git] / sommitrealweird / photo / templates / photo / photo_index.html
index 573d6fe98e5e34e10f0cf7d159a2abd7aea53f03..1afcccf5868ad6e6e912ed49d40c711de06838e3 100644 (file)
@@ -4,11 +4,15 @@
 {% block content %}
     {% if object_list %}
         <h1>{{ object_list.0.album.name }}</h1>
+        {% if object_list.0.album.caption %}
         <div class="album_caption">{{ object_list.0.album.caption }}</div>
+        {% endif %}
         {% for photo in object_list %}
             <div class="photo">
                 <a href="{{ photo.id }}/"><img src='{{ photo.image.url|thumbnail:"width=250" }}' alt="{{ photo.caption }}" /></a>
-                <p>{{ photo.caption }}</h2>
+                {% if photo.caption %}
+                <p>{{ photo.caption }}</p>
+                {% endif %}
             </div>
         {% endfor %}
         <div style="clear: both;">&nbsp;</div>