Skip to content

Instantly share code, notes, and snippets.

@kshepp
Last active January 18, 2016 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kshepp/e62f1734528964217ba1 to your computer and use it in GitHub Desktop.
Save kshepp/e62f1734528964217ba1 to your computer and use it in GitHub Desktop.
cafes_all.html
<!--Use the 'if' statement to call the class in the model you'd like to display-->
{% if cafes %}
<!--Use the 'for' statement to iterate through the model-->
{% for cafe in cafes %}
<div class = "col-xs-12">
<!--This line of code creates multiple rows.-->
<div class="{% cycle 'row1' 'row2' %}">
<div class="item">
<div align="center">
<img class="cafe_thumbnail" src="/media/{{cafe.file_up}}"/>
</div>
<ul>
<li class = "big_title"><b>Name:</b> {{cafe.cafe}}</li>
<br />
<li class = "big_title"><b>City: </b>{{cafe.cityName}}</li>
<br />
<li class = "big_title"><b>More Information: <a href = "{% url 'cafe' cafe.url %}">{{cafe.cafe}}</a></li>
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<p></p>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment