Commits

powersurge360 committed 374837b

Added in photo gallery.

  • Participants
  • Parent commits 2bf7402

Comments (0)

Files changed (1)

share_search/reviews/templates/reviews/store_detail.html

             {% if user.is_authenticated %}<a href="#add-photo" data-toggle="modal">Add a photo</a>{% else %}<a href="{% url "site:register" %}">Register to add a photo.</a>{% endif %}
         </h3>
     </div>
-    <div class="row">
-        <div class="span12">
-            {% if object.photos.count %}
-                <div class="gallery">
-                    {% for photo in object.photos.all %}
-                        {{ photo }}
+    {% if object.photos.count %}
+        <div class="gallery">
+            {% gridify object.photos.all 4 as photos %}
+            {% for row in photos %}
+                <div class="row">
+                    {% for photo in row %}
+                        <div class="span3">
+                            <img src="{{ photo.image.url }}">
+                        </div>
                     {% endfor %}
                 </div>
-            {% else %}
-                <h3>No photos. {% if user.is_authenticated %}Care to <a href="#add-photo" data-toggle="modal">add one?</a>{% else %}<a href="{% url "site:register" %}">Register to add one.</a>{% endif %}</h3>
-            {% endif %}
+            {% endfor %}
         </div>
-    </div>
+    {% else %}
+        <div class="row">
+            <div class="span12">
+                    <h3>No photos. {% if user.is_authenticated %}Care to <a href="#add-photo" data-toggle="modal">add one?</a>{% else %}<a href="{% url "site:register" %}">Register to add one.</a>{% endif %}</h3>
+            </div>
+        </div>
+    {% endif %}
     <div class="modal hide" id="add-photo">
         <div class="modal-header">
             <h2>Add a Photo</h2>