You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2012/05/23 12:12:38 UTC

svn commit: r1341816 - in /incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates: bh_admin.html bloodhound_admin_theme.html bloodhound_theme.html

Author: gjm
Date: Wed May 23 10:12:37 2012
New Revision: 1341816

URL: http://svn.apache.org/viewvc?rev=1341816&view=rev
Log:
theme: move to a single file solution for including or replacing common admin panel code - towards #79 (from olemis)

Removed:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_admin_theme.html
Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html?rev=1341816&r1=1341815&r2=1341816&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html Wed May 23 10:12:37 2012
@@ -6,43 +6,66 @@
       xmlns:py="http://genshi.edgewall.org/"
       py:strip="">
 
-  <py:match path="head" once="true"><head>
-    <title>Administration: ${select('title/text()')}</title>
-    ${select("*[local-name() != 'title']")}
-  </head></py:match>
-
-  <py:match path="body" once="true" buffer="false"><body>
-    <div id="content" class="row">
-      <h1>Administration</h1>
-      <div id="tabs" class="span3">
-        <div class="well">
-          <ul class="nav nav-list">
-            <py:for each="category, panels in groupby(panels, lambda p: p.category)"
-                py:with="cat_is_active = category.id == active_cat">
-              <li class="nav-header">
-                <py:choose test="">
-                  <span py:when="cat_is_active" class="label label-important">
-                    ${category.label}
-                  </span>
-                  <py:otherwise>${category.label}</py:otherwise>
-                </py:choose>
-              </li>
-              <li py:for="panel in panels" py:with="panel = panel.panel;
-                      pan_is_active = cat_is_active and panel.id == active_panel"
-                  class="${'active' if pan_is_active else None}">
-                <a href="${href.admin(category.id, panel.id)}">${panel.label}</a>
-              </li>
-            </py:for>
-          </ul>
-        </div>
-      </div>
-      <div id="tabcontent" class="span9">
-        ${select("*|text()")}
-        <br style="clear: right" />
-      </div>
+  <py:def function="admin_nav_list()">
+    <div class="well">
+      <ul class="nav nav-list">
+        <py:for each="category, panels in groupby(panels, lambda p: p.category)"
+            py:with="cat_is_active = category.id == active_cat">
+          <li class="nav-header">
+            <py:choose test="">
+              <span py:when="cat_is_active" class="label label-important">
+                ${category.label}
+              </span>
+              <py:otherwise>${category.label}</py:otherwise>
+            </py:choose>
+          </li>
+          <li py:for="panel in panels" py:with="panel = panel.panel;
+                  pan_is_active = cat_is_active and panel.id == active_panel"
+              class="${'active' if pan_is_active else None}">
+            <a href="${href.admin(category.id, panel.id)}">${panel.label}</a>
+          </li>
+        </py:for>
+      </ul>
     </div>
+  </py:def>
 
-  </body></py:match>
-
-  <xi:include href="layout.html" />
+  <py:choose>
+    <py:when test="bh_fix_legacy">
+      <py:match path="div[@id='content' and @class='admin']" once="true"
+          buffer="false">
+        <div id="content" class="row">
+          <h1>Administration</h1>
+          <div id="tabs" class="span3">
+            ${admin_nav_list()}
+          </div>
+          <div id="tabcontent" class="span9">
+            ${select("div[@id='tabcontent']/*|text()")}
+            <br style="clear: right" />
+          </div>
+        </div>
+      </py:match>
+    </py:when>
+    <py:otherwise>
+      <py:match path="head" once="true"><head>
+        <title>Administration: ${select('title/text()')}</title>
+        ${select("*[local-name() != 'title']")}
+      </head></py:match>
+    
+      <py:match path="body" once="true" buffer="false"><body>
+        <div id="content" class="admin row">
+          <h1>Administration</h1>
+          <div id="tabs" class="span3">
+            ${admin_nav_list()}
+          </div>
+          <div id="tabcontent" class="span9">
+            ${select("*|text()")}
+            <br style="clear: right" />
+          </div>
+        </div>
+    
+      </body></py:match>
+    
+      <xi:include href="layout.html" />
+    </py:otherwise>
+  </py:choose>
 </html>

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1341816&r1=1341815&r2=1341816&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html Wed May 23 10:12:37 2012
@@ -251,5 +251,5 @@
     <br/>
   </body></py:match>
   
-  <xi:include href="bloodhound_admin_theme.html"/>
+  <xi:include href="bh_admin.html" py:with="bh_fix_legacy = True"/>
 </html>