Added an index instead of "all sandwiches", made custom titles for every page.
[~kgodey/maayanwich.git] / templates / allsandwiches.html
index 17c40df..eaaba21 100644 (file)
@@ -1,9 +1,21 @@
 {% extends "base.html" %}
 
+{% block title %}All Sandwiches{% endblock %}
+
 {% block content %}
                {% 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 {% 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>
+                       <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 %}