added comment form plus number of comments.
[~kgodey/maayanwich.git] / templates / allsandwiches.html
index 2a7435c..17c40df 100644 (file)
@@ -3,7 +3,7 @@
 {% block content %}
                {% 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>
+                       <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 %}
                                {% endfor %}
                        </ul>
                        {% if s.notes %}
-                               <h4 class="sandwichsub">Notes</h5>
+                               <h4 class="sandwichsub">Notes</h4>
                                <p class="sandnotes"> {{ s.notes }}</p>
                        {% endif %}
+                       {% load comments %}
+                       {% get_comment_count for s as c %}
+                       {% ifequal c 1 %}
+                               <p class="sandnotes"><a href="{{ s.get_absolute_url }}">1 comment</a></p>
+                       {% else %}
+                               <p class="sandnotes"><a href="{{ s.get_absolute_url }}">{{ c }} comments</a></p>
+                       {% endifequal %}
                {% endfor %}
 {% endblock %}
\ No newline at end of file