From patchwork Sun Aug 5 22:04:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 10486 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5B59824000 for ; Sun, 5 Aug 2012 22:04:14 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0A910A1814E for ; Sun, 5 Aug 2012 22:04:13 +0000 (UTC) Received: by yhpp61 with SMTP id p61so107834yhp.11 for ; Sun, 05 Aug 2012 15:04:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=JXUbua1xjBvWqUw6Fz1qmWW6n9J9gSHQSKMGldDkF1Y=; b=SpIvwy+JMFqMIR9YBkJDQMIrABAYwjwu/3dicGlECPSJsGut7JwtNbT/nSAJJF/FK9 ZIhO7CJ5ELpJtm4XT6JkUQWbYaghVZwJsVmS3CXBFIuWiHZQYkecbcPww0pY4A3Q4g8O ZZmXPxVFFrRwIcixIpad1R/tS8uUQV4fCnB9QML+LEtiFZQnqW6g01M6Y05HmWMBvkAR 6C+zqnBOpr1oO2ZMde3uU2UYkPs/2tEcAjBUkZMlosDS7wJOz1QK/5mOb/G/MULvIcmO dp6gVOtbtOij1myN9L23CQXbLNlvXaGtEhXJuX9RGza47Dqd7qJtdtq4mqMaCVZboId2 2toQ== Received: by 10.42.123.130 with SMTP id s2mr2324866icr.50.1344204253205; Sun, 05 Aug 2012 15:04:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp410791igz; Sun, 5 Aug 2012 15:04:12 -0700 (PDT) Received: by 10.180.84.169 with SMTP id a9mr13108331wiz.8.1344204251682; Sun, 05 Aug 2012 15:04:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id hd6si11555084wib.20.2012.08.05.15.04.10 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 15:04:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Sy8vi-0004v5-P7 for ; Sun, 05 Aug 2012 22:04:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id ABDF1E0463 for ; Sun, 5 Aug 2012 22:04:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 385 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 385: define "me" page actions in settings, so that extensions can add stuff Message-Id: <20120805220410.12982.66103.launchpad@ackee.canonical.com> Date: Sun, 05 Aug 2012 22:04:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15742"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 21d573b531417b522b8ac6177360a69e50ab8491 X-Gm-Message-State: ALoCoQk5OOSIRJ2aaUABgT36ktZG1fslnVmAxW5acskzo4k7RtT5gbT2Hn+gscW+Bo1tDzEl63uP Merge authors: Michael Hudson-Doyle (mwhudson) Spring Zhang (qzhang) Related merge proposals: https://code.launchpad.net/~qzhang/lava-server/user-notification/+merge/113166 proposed by: Spring Zhang (qzhang) review: Approve - Michael Hudson-Doyle (mwhudson) review: Resubmit - Spring Zhang (qzhang) ------------------------------------------------------------ revno: 385 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Mon 2012-08-06 10:03:21 +1200 message: define "me" page actions in settings, so that extensions can add stuff modified: lava_server/settings/common.py lava_server/templates/me.html lava_server/views.py --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === modified file 'lava_server/settings/common.py' --- lava_server/settings/common.py 2012-05-11 20:11:09 +0000 +++ lava_server/settings/common.py 2012-07-09 09:37:58 +0000 @@ -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' --- lava_server/templates/me.html 2011-11-22 16:58:50 +0000 +++ lava_server/templates/me.html 2012-07-09 09:37:58 +0000 @@ -5,10 +5,9 @@ {% block sidebar %}

{% trans "Actions" %}

{% endblock %} === modified file 'lava_server/views.py' --- lava_server/views.py 2012-02-15 21:53:07 +0000 +++ lava_server/views.py 2012-08-05 21:58:27 +0000 @@ -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')