From patchwork Wed Jun 29 16:44:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 2370 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 4D3D223F3D for ; Wed, 29 Jun 2011 16:44:26 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id E70ABA1864C for ; Wed, 29 Jun 2011 16:44:25 +0000 (UTC) Received: by qyk30 with SMTP id 30so992681qyk.11 for ; Wed, 29 Jun 2011 09:44:25 -0700 (PDT) Received: by 10.229.62.194 with SMTP id y2mr785141qch.4.1309365865208; Wed, 29 Jun 2011 09:44:25 -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.229.48.135 with SMTP id r7cs46073qcf; Wed, 29 Jun 2011 09:44:24 -0700 (PDT) Received: by 10.216.60.203 with SMTP id u53mr1733288wec.96.1309365863438; Wed, 29 Jun 2011 09:44:23 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id f6si2925644wed.13.2011.06.29.09.44.22; Wed, 29 Jun 2011 09:44:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QbxsE-0003gr-N0 for ; Wed, 29 Jun 2011 16:44:22 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id AB8902E8960 for ; Wed, 29 Jun 2011 16:44:22 +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: 183 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 183: Add support for arbitrary navigation content in extensions Message-Id: <20110629164422.21015.15582.launchpad@loganberry.canonical.com> Date: Wed, 29 Jun 2011 16:44:22 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: b23972fca39fcded75b86cdc54662d9e256d6d65 Merge authors: Zygmunt Krynicki (zkrynicki) Related merge proposals: https://code.launchpad.net/~zkrynicki/lava-server/extension-navigation/+merge/66282 proposed by: Zygmunt Krynicki (zkrynicki) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 183 [merge] committer: Paul Larson branch nick: lava-server timestamp: Wed 2011-06-29 17:41:26 +0100 message: Add support for arbitrary navigation content in extensions Instead of overly-technical python-based published menu tree I just added a new block in the server base template that allows extensions to drop arbitrary section between the main navigation tabs and the breadcrumbs. I also used this in the demo app and updated some demo app setup.py stuff in one go modified: demo/demo_app/templates/demo_app/hello.html demo/setup.py lava_server/htdocs/css/default.css lava_server/templates/base.html lava_server/templates/layouts/content_with_sidebar.html --- 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 'demo/demo_app/templates/demo_app/hello.html' --- demo/demo_app/templates/demo_app/hello.html 2011-05-24 13:31:05 +0000 +++ demo/demo_app/templates/demo_app/hello.html 2011-06-29 11:38:08 +0000 @@ -1,5 +1,10 @@ {% extends "base.html" %} +{% block extension_navigation %} +
+

Additional per-extension navigation can be located here

+
+{% endblock %} {% block breadcrumbs %} {{ block.super }} === modified file 'demo/setup.py' --- demo/setup.py 2011-05-25 03:37:10 +0000 +++ demo/setup.py 2011-06-29 11:38:50 +0000 @@ -23,21 +23,21 @@ setup( name='lava-server-demo', - version="1.0", + version=":versiontools:demo_app:", author="Zygmunt Krynicki", author_email="zygmunt.krynicki@linaro.org", packages=find_packages(), license="AGPL", - description="LAVA Demo Application", + description="Demo application for LAVA Server", entry_points = """ - [lava_server.extensions] - demo = demo_app.extension:DemoExtension - """, + [lava_server.extensions] + demo = demo_app.extension:DemoExtension + """, long_description=""" - XXX + Demonstration on how to extend LAVA Server with + additional applications. """, - install_requires=[ - "lava-server", - ], + install_requires=["lava-server >= 0.2"], + setup_requires=["versiontools >= 1.4"], zip_safe=False, include_package_data=True) === modified file 'lava_server/htdocs/css/default.css' --- lava_server/htdocs/css/default.css 2011-05-24 16:17:30 +0000 +++ lava_server/htdocs/css/default.css 2011-06-29 14:02:57 +0000 @@ -114,6 +114,39 @@ color: #F5F4E1; } +#extension_navigation { + background-color: #541D09; + color: #F5F4E1; +} + +#extension_navigation ul { + margin: 0; + padding: 10pt 5pt; +} + +#extension_navigation ul li { + display: inline; + margin: 0; + padding: 0.2em 0; +} + +#extension_navigation ul li a { + color: #F5F4E1; + text-decoration: none; + background-color: #943310; + text-shadow: #541d09 1px 1px; + font-weight: bold; + padding: 5pt; + border-radius: 5pt; + -moz-border-radius: 5pt; + -webkit-border-radius: 5pt; +} + +#extension_navigation ul li a:active { + color: #943310; + background-color: #F5F4E1; + text-shadow: none; +} ul.menu { display: inline; @@ -188,8 +221,7 @@ #content { color: #202020; - padding-top: 0.5em; - padding: 5pt; + padding: 0 1px 0 0; width: 78%; background-color: #F5F4E1; @@ -291,7 +323,6 @@ } #content table.data { - width: 100%; border: 1px solid gray; border-collapse: collapse; margin: 5pt; === modified file 'lava_server/templates/base.html' --- lava_server/templates/base.html 2011-05-24 16:20:15 +0000 +++ lava_server/templates/base.html 2011-06-29 11:38:23 +0000 @@ -31,11 +31,14 @@ {% block navigation %} +
{% endblock %} === modified file 'lava_server/templates/layouts/content_with_sidebar.html' --- lava_server/templates/layouts/content_with_sidebar.html 2011-05-24 16:17:30 +0000 +++ lava_server/templates/layouts/content_with_sidebar.html 2011-06-29 11:37:42 +0000 @@ -15,6 +15,11 @@ {% block navigation %}{% endblock %} + + + {% block extension_navigation %}{% endblock %} + +