=== modified file 'lava_server/settings/common.py'
@@ -154,3 +154,8 @@
# This is fixed in south 0.7.1, if we upgrade past that it's safe to
# remove this line.
SKIP_SOUTH_TESTS = True
+
+ME_PAGE_ACTIONS = [
+ ("django.contrib.auth.views.password_change", "Change your password"),
+ ("django.contrib.auth.views.logout", "Sign out"),
+ ]
=== modified file 'lava_server/templates/me.html'
@@ -5,10 +5,9 @@
{% block sidebar %}
<h3>{% trans "Actions" %}</h3>
<ul>
- <li><a href="{% url django.contrib.auth.views.logout %}"
- >{% trans "Sign out" %}</a></li>
- <li><a href="{% url django.contrib.auth.views.password_change %}"
- >{% trans "Change your password" %}</a></li>
+ {% for action in actions %}
+ <li><a href="{{ action.0 }}">{{ action.1 }}</a></li>
+ {% endfor %}
</ul>
{% endblock %}
=== modified file 'lava_server/views.py'
@@ -18,6 +18,7 @@
from django.conf import settings
from django.contrib.auth.decorators import login_required
+from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseServerError
from django.template import Context, loader, RequestContext
from django.utils.translation import ugettext as _
@@ -50,9 +51,13 @@
parent=index)
@login_required
def me(request):
+ actions = []
+ for view, text in settings.ME_PAGE_ACTIONS:
+ actions.append((reverse(view), text))
data = {
'bread_crumb_trail': BreadCrumbTrail.leading_to(
- me, you=request.user.get_full_name() or request.user.username)
+ me, you=request.user.get_full_name() or request.user.username),
+ 'actions': actions,
}
context = RequestContext(request, data)
template = loader.get_template('me.html')