From patchwork Wed Nov 9 19:26:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 4987 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 546ED23E0F for ; Wed, 9 Nov 2011 19:26:17 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 38AABA1810C for ; Wed, 9 Nov 2011 19:26:17 +0000 (UTC) Received: by faan26 with SMTP id n26so2870852faa.11 for ; Wed, 09 Nov 2011 11:26:17 -0800 (PST) Received: by 10.152.102.148 with SMTP id fo20mr2439748lab.51.1320866776837; Wed, 09 Nov 2011 11:26:16 -0800 (PST) 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.152.10.72 with SMTP id g8cs183728lab; Wed, 9 Nov 2011 11:26:16 -0800 (PST) Received: by 10.227.207.205 with SMTP id fz13mr2826653wbb.0.1320866775113; Wed, 09 Nov 2011 11:26:15 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id ep6si3302873wbb.100.2011.11.09.11.26.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 11:26:15 -0800 (PST) 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 1RODmo-0000cZ-J1 for ; Wed, 09 Nov 2011 19:26:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 874BFE01E4 for ; Wed, 9 Nov 2011 19:26:14 +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: 273 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 273: Add personal user page, breadcrumbify lava-server views Message-Id: <20111109192614.3833.80687.launchpad@ackee.canonical.com> Date: Wed, 09 Nov 2011 19:26:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14263"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f6b9e313e43c8c2864d9a5a70772dcbe1ad75988 ------------------------------------------------------------ revno: 273 committer: Zygmunt Krynicki branch nick: lava-server timestamp: Fri 2011-10-28 01:25:01 +0200 message: Add personal user page, breadcrumbify lava-server views added: lava_server/templates/me.html modified: lava_server/urls.py 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 === added file 'lava_server/templates/me.html' --- lava_server/templates/me.html 1970-01-01 00:00:00 +0000 +++ lava_server/templates/me.html 2011-10-27 23:25:01 +0000 @@ -0,0 +1,17 @@ +{% extends "layouts/content_with_sidebar.html" %} +{% load i18n %} + +{% block sidebar %} +

{% trans "Actions" %}

+ +{% endblock %} + +{% block content %} +

Welcome

+

This is a placeholder for more interesting content

+{% endblock %} === modified file 'lava_server/urls.py' --- lava_server/urls.py 2011-10-11 09:58:00 +0000 +++ lava_server/urls.py 2011-10-27 23:25:01 +0000 @@ -24,7 +24,7 @@ from linaro_django_xmlrpc import urls as api_urls from lava_server.extension import loader -from lava_server.views import index, version +from lava_server.views import index, me, version # Enable admin stuff @@ -37,6 +37,9 @@ url(r'^' + settings.APP_URL_PREFIX + r'$', index, name='lava.home'), + url(r'^' + settings.APP_URL_PREFIX + r'me/$', + me, + name='lava.me'), url(r'^' + settings.APP_URL_PREFIX + r'version/$', version, name='lava.version_details'), === modified file 'lava_server/views.py' --- lava_server/views.py 2011-10-11 09:20:14 +0000 +++ lava_server/views.py 2011-10-27 23:25:01 +0000 @@ -16,16 +16,26 @@ # You should have received a copy of the GNU Affero General Public License # along with LAVA Server. If not, see . +from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.template import loader, RequestContext +from django.utils.translation import ugettext as _ from django.views.generic.simple import direct_to_template +from lava_server.bread_crumbs import ( + BreadCrumb, + BreadCrumbTrail, +) from lava_server.extension import loader as extension_loader +@BreadCrumb(_("LAVA")) def index(request): # Start with a list of extensions - data = {'extension_list': extension_loader.extensions} + data = { + 'extension_list': extension_loader.extensions, + 'bread_crumb_trail': BreadCrumbTrail.leading_to(index), + } # Append each extension context data for extension in extension_loader.extensions: data.update(extension.get_front_page_context()) @@ -35,5 +45,24 @@ return HttpResponse(template.render(context)) +@BreadCrumb(_("About you ({you})"), + parent=index) +@login_required +def me(request): + data = { + 'bread_crumb_trail': BreadCrumbTrail.leading_to(me, you=request.user.get_full_name()) + } + context = RequestContext(request, data) + template = loader.get_template('me.html') + return HttpResponse(template.render(context)) + + +@BreadCrumb(_("Version details"), + parent=index) def version(request): - return direct_to_template(request, 'version_details.html') + data = { + 'bread_crumb_trail': BreadCrumbTrail.leading_to(version) + } + context = RequestContext(request, data) + template = loader.get_template('version_details.html') + return HttpResponse(template.render(context))