Deleting sandwiches works.
[~kgodey/maayanwich.git] / templates / onesandwich.html
index 60ea42b..d88cfbd 100644 (file)
@@ -4,7 +4,17 @@
 
 {% block content %}
        <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 %}
@@ -36,6 +46,7 @@
                <p class="sandnotes">{{ comment.comment }}</p>
                <p class="metadata">{{ comment.submit_date }}</p>
        {% endfor %}
+       <a name="comments"></a> 
        <h4 class="addcomment">Add a Comment</h4>
        {% render_comment_form for s %}
 {% endblock %}
\ No newline at end of file