Ingredients auto complete, adding ingredients works. Some template tweaks.
[~kgodey/maayanwich.git] / templates / allsandwiches.html
index 4877263..d55cdb9 100644 (file)
@@ -1,18 +1,21 @@
 {% extends "base.html" %}
 
 {% block content %}
-       <h1 class="pagetitle">All Ma'ayanwiches</h1>
                {% for s in allsandwiches %}
                        <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 }}">
+                       <p class="metadata">Made on {{ s.date_made|date:"F j Y" }} and added by {% if s.user.first_name %} {{ s.user.first_name }} {% if s.user.last_name %} {{ s.user.last_name }} {% endif %} {% else %} {{ s.user.username }}. {% endif %}</p>
+                       {% 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 %}
                {% endfor %}
 {% endblock %}
\ No newline at end of file