moved media to media folder in app
[~kgodey/maayanwich.git] / templates / allsandwiches.html
1 {% extends "base.html" %}
2
3 {% block title %}All Sandwiches{% endblock %}
4
5 {% block content %}
6                 {% for s in allsandwiches %}
7                         <h3 class="sandwichtitle">{{ s.adjective }}</h3>
8                         <p class="metadata">Made on {{ s.date_made|date:"F j Y" }} and added by  
9                                 {% ifequal s.user request.user %} you. 
10                                         <a href="{% url edit_sandwich slug=s.slug %}"> (Edit) 
11                                 {% else %} 
12                                         {% if s.user.first_name %} {{ s.user.first_name }} 
13                                                 {% if s.user.last_name %} {{ s.user.last_name }} 
14                                                 {% endif %} 
15                                         {% else %} 
16                                                 {{ s.user.username }}. 
17                                         {% endif %}
18                                 {% endifequal %}</p>
19                         {% if s.picture %}
20                                 <img class="sandwichimg" src="{{ s.picture.url }}">
21                         {% endif %}
22                         <h4 class="sandwichsub">Ingredients</h4>
23                         <ul class="ingredients">
24                                 {% for i in s.ingredients.all %}
25                                         <li>{{ i.name }}
26                                 {% endfor %}
27                         </ul>
28                         {% if s.notes %}
29                                 <h4 class="sandwichsub">Notes</h4>
30                                 <p class="sandnotes"> {{ s.notes }}</p>
31                         {% endif %}
32                         {% load comments %}
33                         {% get_comment_count for s as c %}
34                         {% ifequal c 1 %}
35                                 <p class="sandnotes"><a href="{{ s.get_absolute_url }}">1 comment</a></p>
36                         {% else %}
37                                 <p class="sandnotes"><a href="{{ s.get_absolute_url }}">{{ c }} comments</a></p>
38                         {% endifequal %}
39                 {% endfor %}
40 {% endblock %}