Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added breadcrumbs to one-off points interface and redirect to changel…

…ist after awarding
  • Loading branch information...
commit c505f052baa51a71ff6de4dbd66a5664d64cb50a 1 parent 0571d38
Brian Rosner authored November 01, 2010
4  agon/admin.py
... ...
@@ -1,4 +1,4 @@
1  
-from django.shortcuts import render_to_response
  1
+from django.shortcuts import render_to_response, redirect
2 2
 from django.template import RequestContext
3 3
 from django.utils.functional import update_wrapper
4 4
 
@@ -53,6 +53,7 @@ def one_off_points(self, request):
53 53
             form = OneOffPointAwardForm(request.POST)
54 54
             if form.is_valid():
55 55
                 form.award()
  56
+                return redirect("admin:agon_awardedpointvalue_changelist")
56 57
         else:
57 58
             form = OneOffPointAwardForm()
58 59
         form = helpers.AdminForm(
@@ -62,6 +63,7 @@ def one_off_points(self, request):
62 63
             model_admin=self
63 64
         )
64 65
         ctx = {
  66
+            "opts": self.model._meta,
65 67
             "form": form,
66 68
         }
67 69
         ctx = RequestContext(request, ctx)
14  agon/templates/agon/one_off_points.html
... ...
@@ -1,9 +1,21 @@
1 1
 {% extends "admin/base_site.html" %}
2 2
 
3  
-{% load admin_modify adminmedia %}
  3
+{% load i18n admin_modify adminmedia %}
4 4
 
5 5
 {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
6 6
 
  7
+{% block breadcrumbs %}
  8
+    <div class="breadcrumbs">
  9
+        <a href="../../">{% trans "Home" %}</a>
  10
+        &rsaquo;
  11
+        <a href="../">{{ opts.app_label|capfirst }}</a>
  12
+        &rsaquo;
  13
+        <a href="../">{{ opts.verbose_name_plural|capfirst }}</a>
  14
+        &rsaquo;
  15
+        Award one-off points
  16
+    </div>
  17
+{% endblock %}
  18
+
7 19
 {% block content %}
8 20
 <div id="content-main">
9 21
     <h1>Issue one-off point rewards</h1>

0 notes on commit c505f05

Please sign in to comment.
Something went wrong with that request. Please try again.