incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1307992 - in /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard: layouts/bootstrap.py layouts/templates/bs_btnbar.html web_ui.py
Date Sun, 01 Apr 2012 01:43:43 GMT
Author: gjm
Date: Sun Apr  1 01:43:43 2012
New Revision: 1307992

URL: http://svn.apache.org/viewvc?rev=1307992&view=rev
Log:
Dashboard code import: BH_Dashboard: Display default panel in button toolbar

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py?rev=1307992&r1=1307991&r2=1307992&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py Sun Apr
 1 01:43:43 2012
@@ -89,13 +89,14 @@ class BootstrapLayout(Component):
         if not ready:
             layout_data['toolbar'] = tb = [[]]
             last_group = tb[0]
-            for caption, idx in orig_tb:
+            active = layout_data.get('active')
+            for i, (caption, idx) in enumerate(orig_tb):
                 if caption == '|' :
                     last_group = []
                     tb.append(last_group)
                 else:
                     last_group.append(
                             { 'caption' : caption, 'widget' :idx, 
-                              'id' : uuid4().hex })
+                              'id' : uuid4().hex, 'active' : i == active })
         layout_data['ready'] = True
 

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html?rev=1307992&r1=1307991&r2=1307992&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html
(original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html
Sun Apr  1 01:43:43 2012
@@ -11,7 +11,7 @@
         py:for="g in layout.toolbar" >
       <button data-target="#tb-item-${tb_item.id}" data-toggle="tab" 
           disabled="${tb_item.widget is None and 'true' or None}" 
-          class="btn ${tb_item.widget is None and 'disabled' or None}" 
+          class="btn ${tb_item.widget is None and 'disabled' or None} ${tb_item.active and
'active' or None}" 
           py:for="tb_item in g">
         ${tb_item.caption}
       </button>
@@ -20,7 +20,8 @@
   <div class="tab-content">
     <py:for each="g in layout.toolbar">
       <div py:for="tb_item in g" py:if="tb_item.widget is not None"
-          class="tab-pane" id="tb-item-${tb_item.id}">
+          class="tab-pane ${tb_item.active and 'active' or None}" 
+          id="tb-item-${tb_item.id}">
         ${widget_container(widgets[tb_item.widget])}
       </div>
     </py:for>

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py?rev=1307992&r1=1307991&r2=1307992&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py Sun Apr  1 01:43:43
2012
@@ -159,6 +159,7 @@ class DashboardModule(Component):
                                                   ["Projects", null],
                                                   ["Components", 0]
                                                 ],
+                                              "active" : 1,
                                               "widgets" : [
                                                 {
                                                   "args" : [



Mime
View raw message