<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -88,12 +88,13 @@ def comment_delete(request, entry, comment):
     data = f.delete_comment(entry, comment)
     if 'errorCode' in data:
         return error(request, data)
-    next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=deleted&amp;entry=%s&amp;comment=%s' % (entry, comment)
-    else:
-        next = next + '?message=deleted&amp;entry=%s&amp;comment=%s' % (entry, comment)
-    next = next + '#%s' % entry
+    next = reverse('entry', args=[entry])
+    args = {
+        'message': 'deleted',
+        'entry': entry,
+        'comment': comment,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def comment_undelete(request, entry, comment):
@@ -111,12 +112,13 @@ def comment_undelete(request, entry, comment):
     data = f.undelete_comment(entry, comment)
     if 'errorCode' in data:
         return error(request, data)
-    next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=commented&amp;entry=%s&amp;comment=%s' % (entry, comment)
-    else:
-        next = next + '?message=commented&amp;entry=%s&amp;comment=%s' % (entry, comment)
-    next = next + '#%s' % comment
+    next = reverse('entry', args=[entry])
+    args = {
+        'message': 'commented',
+        'entry': entry,
+        'comment': comment,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), comment)
     return HttpResponseRedirect(next)
 
 def entry(request, entry):
@@ -164,19 +166,19 @@ def entry_comment(request, entry):
                 return error(request, data)
             next = form.data['next']
             comment = data['id']
-            if not form.data['comment']:
-                if '?' in next:
-                    next = next + '&amp;message=commented&amp;entry=%s&amp;comment=%s' % (entry, comment)
-                else:
-                    next = next + '?message=commented&amp;entry=%s&amp;comment=%s' % (entry, comment)
-            next = next + '#%s' % comment
+            args = {
+                'entry': form.data['entry'],
+                'comment': comment,
+                'message': 'edited' if form.data['comment'] else 'commented',
+            }
+            next += '?%s#%s' % (urllib.urlencode(args), comment)
             return HttpResponseRedirect(next)
     else:
         initial = {
             'body': request.GET.get('body', None),
             'comment': request.GET.get('comment', None),
             'entry': entry,
-            'next': request.GET.get('next', '/'),
+            'next': reverse('entry', args=[entry]),
         }
         form = CommentForm(initial=initial)
     extra_context = {
@@ -199,11 +201,13 @@ def entry_delete(request, entry):
     if 'errorCode' in data:
         return error(request, data)
     next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=deleted&amp;entry=%s' % entry
-    else:
-        next = next + '?message=deleted&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    if next == reverse('entry', args=[entry]):
+        next = '/'
+    args = {
+        'message': 'deleted',
+        'entry': entry,
+    }
+    next += '?%s' % (urllib.urlencode(args))
     return HttpResponseRedirect(next)
 
 def entry_undelete(request, entry):
@@ -220,12 +224,12 @@ def entry_undelete(request, entry):
     data = f.undelete_entry(entry)
     if 'errorCode' in data:
         return error(request, data)
-    next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=shared&amp;entry=%s' % entry
-    else:
-        next = next + '?message=shared&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    next = reverse('entry', args=[entry])
+    args = {
+        'message': 'shared',
+        'entry': entry,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def entry_hide(request, entry):
@@ -243,11 +247,11 @@ def entry_hide(request, entry):
     if 'errorCode' in data:
         return error(request, data)
     next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=hidden&amp;entry=%s' % entry
-    else:
-        next = next + '?message=hidden&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    args = {
+        'message': 'hidden',
+        'entry': entry,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def entry_like(request, entry):
@@ -264,12 +268,12 @@ def entry_like(request, entry):
     data = f.add_like(entry)
     if 'errorCode' in data:
         return error(request, data)
-    next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=liked&amp;entry=%s' % entry
-    else:
-        next = next + '?message=liked&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    next = reverse('entry', args=[entry])
+    args = {
+        'message': 'liked',
+        'entry': entry,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def entry_unhide(request, entry):
@@ -287,11 +291,11 @@ def entry_unhide(request, entry):
     if 'errorCode' in data:
         return error(request, data)
     next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=un-hidden&amp;entry=%s' % entry
-    else:
-        next = next + '?message=un-hidden&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    args = {
+        'message': 'un-hidden',
+        'entry': entry,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def entry_unlike(request, entry):
@@ -308,12 +312,12 @@ def entry_unlike(request, entry):
     data = f.delete_like(entry)
     if 'errorCode' in data:
         return error(request, data)
-    next = request.GET.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=un-liked&amp;entry=%s' % entry
-    else:
-        next = next + '?message=un-liked&amp;entry=%s' % entry
-    next = next + '#%s' % entry
+    next = reverse('entry', args=[entry])
+    args = {
+        'message': 'un-liked',
+        'entry': entry,
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), entry)
     return HttpResponseRedirect(next)
 
 def home(request):
@@ -326,7 +330,7 @@ def home(request):
     f = friendfeed.FriendFeed(request.session['nickname'],
         request.session['key'])
     start = max(get_integer_argument(request, 'start', 0), 0)
-    num = get_integer_argument(request, 'num', request.session.get(&quot;num&quot;, NUM))
+    num = get_integer_argument(request, 'num', request.session.get('num', NUM))
     data = f.fetch_home_feed(**request_to_feed_args_dict(request))
     if 'errorCode' in data:
         return error(request, data)
@@ -644,12 +648,12 @@ def share(request):
             data = f.publish_message(request.POST['title'], via=VIA, room=request.POST.get('room', None))
             if 'errorCode' in data:
                 return error(request, data)
-    next = request.POST.get('next', '/')
-    if '?' in next:
-        next = next + '&amp;message=shared&amp;entry=%s' % data['entries'][0]['id']
-    else:
-        next = next + '?message=shared&amp;entry=%s' % data['entries'][0]['id']
-    next += '#%s' % data['entries'][0]['id']
+    next = reverse('entry', args=[data['entries'][0]['id']])
+    args = {
+        'message': 'shared',
+        'entry': data['entries'][0]['id'],
+    }
+    next += '?%s#%s' % (urllib.urlencode(args), data['entries'][0]['id'])
     return HttpResponseRedirect(next)
 
 def user(request, nickname, type=None):</diff>
      <filename>fftogo/views.py</filename>
    </modified>
    <modified>
      <diff>@@ -31,6 +31,9 @@
                     &lt;a href=&quot;{% url entry_undelete request.GET.entry %}&quot;?next={{ request.path }}&quot;&gt;Undo&lt;/a&gt;
                 {% endif %}
             {% endifequal %}
+            {% ifequal request.GET.message 'edited' %}
+                Comment edited
+            {% endifequal %}
             {% ifequal request.GET.message 'commented' %}
                 Comment created
                 -</diff>
      <filename>templates/entries.html</filename>
    </modified>
    <modified>
      <diff>@@ -3,3 +3,5 @@
 {% block title %}
     {{ title }}
 {% endblock %}
+
+{% block share %}{% endblock %}</diff>
      <filename>templates/entry.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>07b6b8e02eb26f9780037a30b61ed8d6f7256c17</id>
    </parent>
  </parents>
  <author>
    <name>Benjamin Golub</name>
    <email>bgolub@benjamingolub.com</email>
  </author>
  <url>http://github.com/bgolub/fftogo/commit/97b78d37f647cedf0317619d9a72a8687b16a74f</url>
  <id>97b78d37f647cedf0317619d9a72a8687b16a74f</id>
  <committed-date>2009-03-03T17:14:57-08:00</committed-date>
  <authored-date>2009-03-03T17:14:57-08:00</authored-date>
  <message>bugs</message>
  <tree>d5da1b1b3c5a606edb48cd09866044447a970f5c</tree>
  <committer>
    <name>Benjamin Golub</name>
    <email>bgolub@benjamingolub.com</email>
  </committer>
</commit>
