Commits

David Wolever committed 7a642d7

A bunch of template tinkering

Comments (0)

Files changed (4)

queue/templates/queue/queue_enqueue.html

+{% if urlsaved %}
+<p>URL succssfully queued!</p>
+{% endif %}
+
 <form method="POST">
   URL: <input type="text" name="url" /><br />
   Title: <input type="text" name="title" /> <br />
   <input type="submit" value="Queue!" />
 </form>
 
+<a href="{% url queue-show queue_name %}">
+  Back to <tt>{{ queue_name }}</tt>&hellip;
+</a>

queue/templates/queue/queue_show.html

 <ul>
   {% for url_ in urls %}
   <li><a href="{{ url_.url }}">{{ url_.title }}</a>
-      (enqueued: {{ url_.enqueued|timesince }})</li>
+      (enqueued {{ url_.enqueued|timesince }} ago)</li>
   {% endfor %}
 </ul>
+
+<a href="{% url queue-enqueue queue_name %}">Enqueue more&hellip;</a>
 }
 
 urlpatterns = patterns('urlqueue.queue.views',
-    url(r'^(%(queue_name)s)/$' % matchers, 'queue_show', name='queue-show'),
-    url(r'^(%(queue_name)s)/dequeue$' % matchers, 'queue_dequeue'),
-    url(r'^(%(queue_name)s)/enqueue$' % matchers, 'queue_enqueue'),
+    url(r'^(%(queue_name)s)/$' % matchers,
+        'queue_show', name='queue-show'),
+    url(r'^(%(queue_name)s)/enqueue$' % matchers,
+        'queue_enqueue', name='queue-enqueue'),
+    url(r'^(%(queue_name)s)/dequeue$' % matchers,
+        'queue_dequeue'),
 )
 
     data = {
         'urlsaved': request.GET.get('urlsaved'),
+        'queue_name': queue_name,
     }
 
-    return render_to_response('queue/queue_enqueue.html')
+    return render_to_response('queue/queue_enqueue.html', data)