From: Brett Parker <iDunno@sommitrealweird.co.uk>
Date: Sun, 29 Mar 2009 14:06:43 +0000 (+0100)
Subject: Stop albums from displaying None when they don't need to
X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/commitdiff_plain/547584af4df530421c153aad6ae69683e002f213?ds=sidebyside;hp=-c

Stop albums from displaying None when they don't need to
---

547584af4df530421c153aad6ae69683e002f213
diff --git a/sommitrealweird/photo/templates/photo/album_index.html b/sommitrealweird/photo/templates/photo/album_index.html
index 402deed..33cbbc6 100644
--- a/sommitrealweird/photo/templates/photo/album_index.html
+++ b/sommitrealweird/photo/templates/photo/album_index.html
@@ -10,7 +10,9 @@
                 <a href="{{ album.slug }}/"><img src="{{ album.get_main_image.url|thumbnail:"width=250" }}" alt="{{ album.get_main_image.caption }}" /></a>
                 {% endif %}
                 <h2><a href="{{ album.slug }}/">{{ album.name }}</a></h2>
+                {% if album.caption %}
                 <p>{{ album.caption }}</h2>
+                {% endif %}
             </div>
         {% endfor %}
         {% if is_paginated %}
diff --git a/sommitrealweird/photo/templates/photo/photo_index.html b/sommitrealweird/photo/templates/photo/photo_index.html
index 573d6fe..1afcccf 100644
--- a/sommitrealweird/photo/templates/photo/photo_index.html
+++ b/sommitrealweird/photo/templates/photo/photo_index.html
@@ -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>