diff gpp/templates/forums/topic.html @ 232:a46788862737

Implement a forum favorites feature for #82
author Brian Neal <bgneal@gmail.com>
date Sun, 01 Aug 2010 21:26:12 +0000
parents 6a5549c2efb5
children 6dde069debd4
line wrap: on
line diff
--- a/gpp/templates/forums/topic.html	Wed Jul 14 02:35:39 2010 +0000
+++ b/gpp/templates/forums/topic.html	Sun Aug 01 21:26:12 2010 +0000
@@ -59,6 +59,27 @@
 {% endif %}
 
 {% if user.is_authenticated %}
+<form action={% if is_bookmarked %}"{% url forums-unfavorite_topic topic.id %}"{% else %}"{% url forums-favorite_topic topic.id %}"{% endif %} method="post">{% csrf_token %}
+<fieldset>
+   <legend>Favorite Options</legend>
+   <p>
+   {% if is_favorite %}
+      <img src="{{ MEDIA_URL }}icons/delete.png" alt="Favorite" />
+      You currently have saved this topic in your list of favorites.
+      <input type="submit" value="Remove from favorites" />
+   {% else %}
+      <img src="{{ MEDIA_URL }}icons/add.png" alt="Favorite" />
+      Would you like to save this topic to your favorites list?
+      <input type="submit" value="Save to favorites" />
+   {% endif %}
+   </p>
+   <p>
+   To manage all your forum topic favorites, please visit your 
+   <a href="{% url forums-manage_favorites %}">favorites page</a>.
+   </p>
+</fieldset>
+</form>
+
 <form action={% if is_subscribed %}"{% url forums-unsubscribe_topic topic.id %}"{% else %}"{% url forums-subscribe_topic topic.id %}"{% endif %} method="post">{% csrf_token %}
 <fieldset>
    <legend>Subscription Options</legend>