[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
State Accepted
Headers show

Commit Message

Paul Larson June 29, 2011, 4:44 p.m.
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 <paul.larson@canonical.com>
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

Patch

=== 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 %}
+<div id="extension_navigation">
+  <p>Additional per-extension navigation can be located here</p>
+</div>
+{% 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 %}
 <ul class="menu">
+  <!--
   <li><a href="{% url lava.home %}">{% trans "Home" %}</a></li>
+  -->
   {% for extension in lava.extensions %}
   <li><a href="{{ extension.get_main_url }}">{{ extension.name }}</a></li>
   {% endfor %}
 </ul>
+<div style="clear:both"></div>
 {% 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 %}
     </td>
   </tr>
+  <tr id="extension_navigation">
+    <td colspan="2">
+      {% block extension_navigation %}{% endblock %}
+    </td>
+  </tr>
   <tr id="navigation">
     <td colspan="2">
       <div id="breadcrumbs">