Added a better slugify function, monthly archives work, notes are optional now.
[~kgodey/maayanwich.git] / templates / onesandwich.html
index b9bf28b..bc3c013 100644 (file)
@@ -5,13 +5,17 @@
 {% block content %}
        <h3 class="sandwichtitle">{{ s.adjective }}</h3>
        <p class="metadata">Made on {{ s.date_made }} and added by {{ s.user.username }}.</p>
-       <img class="sandwichimg" src="{{ s.picture.url }}">
+       {% if s.picture %}
+               <img class="sandwichimg" src="{{ s.picture.url }}">
+       {% endif %}
        <h4 class="sandwichsub">Ingredients</h4>
        <ul class="ingredients">
                {% for i in s.ingredients.all %}
                        <li>{{ i.name }}
                {% endfor %}
        </ul>
-       <h4 class="sandwichsub">Notes</h5>
-       <p class="sandnotes"> {{ s.notes }}</p>
+       {% if s.notes %}
+               <h4 class="sandwichsub">Notes</h5>
+               <p class="sandnotes"> {{ s.notes }}</p>
+       {% endif %}
 {% endblock %}
\ No newline at end of file