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