From patchwork Mon Oct 3 16:48:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 4504 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 DF8C323EF6 for ; Mon, 3 Oct 2011 16:48:19 +0000 (UTC) Received: from mail-wy0-f180.google.com (mail-wy0-f180.google.com [74.125.82.180]) by fiordland.canonical.com (Postfix) with ESMTP id D719DA18A02 for ; Mon, 3 Oct 2011 16:48:19 +0000 (UTC) Received: by wyh11 with SMTP id 11so4751677wyh.11 for ; Mon, 03 Oct 2011 09:48:19 -0700 (PDT) Received: by 10.223.26.26 with SMTP id b26mr145902fac.122.1317660498666; Mon, 03 Oct 2011 09:48:18 -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.152.23.170 with SMTP id n10cs20549laf; Mon, 3 Oct 2011 09:48:18 -0700 (PDT) Received: by 10.216.221.30 with SMTP id q30mr3758226wep.1.1317660497754; Mon, 03 Oct 2011 09:48:17 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id er18si1015798wbb.67.2011.10.03.09.48.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Oct 2011 09:48:17 -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 1RAlgf-0006HV-64 for ; Mon, 03 Oct 2011 16:48:17 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 2636BE208B for ; Mon, 3 Oct 2011 16:48:17 +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: 248 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 248: Use breadcrubms on project root page Message-Id: <20111003164817.1881.39536.launchpad@ackee.canonical.com> Date: Mon, 03 Oct 2011 16:48:17 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14071"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: bf2d90ef4dc14ec7c12d2ca9ceb4c04b650b5376 ------------------------------------------------------------ revno: 248 committer: Zygmunt Krynicki branch nick: trunk timestamp: Mon 2011-10-03 14:35:31 +0200 message: Use breadcrubms on project root page modified: lava_projects/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_projects/views.py' --- lava_projects/views.py 2011-09-24 19:18:28 +0000 +++ lava_projects/views.py 2011-10-03 12:35:31 +0000 @@ -18,11 +18,15 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden -from django.shortcuts import get_object_or_404 +from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext, loader from django.utils.translation import ugettext as _ from django.views.generic.list_detail import object_list, object_detail +from lava_server.bread_crumbs import ( + BreadCrumb, + BreadCrumbTrail, +) from lava_projects.models import ( Project, ProjectFormerIdentifier, @@ -34,11 +38,13 @@ ) +@BreadCrumb("Projects") def project_root(request): template_name = "lava_projects/project_root.html" t = loader.get_template(template_name) c = RequestContext(request, { - 'recent_project_list': Project.objects.accessible_by_principal(request.user).recently_registered() + 'recent_project_list': Project.objects.accessible_by_principal(request.user).recently_registered(), + 'bread_crumb_trail': BreadCrumbTrail.leading_to(project_root) }) return HttpResponse(t.render(c))