Modified templates a little for sandwich by user and sandwich by month (to have more...
[~kgodey/maayanwich.git] / templates / usersandwiches.html
diff --git a/templates/usersandwiches.html b/templates/usersandwiches.html
new file mode 100644 (file)
index 0000000..197f5a7
--- /dev/null
@@ -0,0 +1,41 @@
+{% extends "base.html" %}
+
+{% block title %}My Sandwiches{% endblock %}
+
+{% block content %}
+       <h1 class="pagetitle">My Sandwiches<h1>
+               {% for s in allsandwiches %}
+                       <h3 class="sandwichtitle">{{ s.adjective }}</h3>
+                       <p class="metadata">Made on {{ s.date_made|date:"F j Y" }} and added by  
+                               {% ifequal s.user request.user %} you. 
+                                       <a href="{% url edit_sandwich slug=s.slug %}"> (Edit) 
+                               {% else %} 
+                                       {% if s.user.first_name %} {{ s.user.first_name }} 
+                                               {% if s.user.last_name %} {{ s.user.last_name }} 
+                                               {% endif %} 
+                                       {% else %} 
+                                               {{ s.user.username }}. 
+                                       {% endif %}
+                               {% endifequal %}</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>
+                       {% if s.notes %}
+                               <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