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/04/01 02:56:50 UTC

svn commit: r1307969 - in /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard: templates/bhdb_one_col.html web_ui.py widgets/templates/widget_grid.html

Author: gjm
Date: Sun Apr  1 00:56:50 2012
New Revision: 1307969

URL: http://svn.apache.org/viewvc?rev=1307969&view=rev
Log:
Dashboard code import: BH_Dashboard: Introducing widget max height option

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bhdb_one_col.html
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bhdb_one_col.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bhdb_one_col.html?rev=1307969&r1=1307968&r2=1307969&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bhdb_one_col.html (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/templates/bhdb_one_col.html Sun Apr  1 00:56:50 2012
@@ -7,6 +7,12 @@
   <xi:include href="layout.html" />
   <head>
     <title>$title</title>
+    <style py:if="default.height is not None">
+      .ui-box-panel {
+        max-height:${default.height}px !important;
+        overflow: auto;
+      }
+    </style>
   </head>
   <body class="yui-skin-sam">
     <div id="doc3" class="yui-t7">

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=1307969&r1=1307968&r2=1307969&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py Sun Apr  1 00:56:50 2012
@@ -29,7 +29,7 @@ import re
 
 from genshi.builder import tag
 from trac.core import Component, implements
-from trac.config import Option
+from trac.config import Option, IntOption
 from trac.mimeview.api import Context
 from trac.util.translation import _
 from trac.web.api import IRequestHandler
@@ -41,6 +41,8 @@ class DashboardModule(Component):
 
     mainnav_label = Option('dashboard', 'mainnav', 'Dashboard', \
                             """Dashboard label in mainnav""")
+    default_widget_height = IntOption('widgets', 'default_height', 320, \
+                            """Default widget height in pixels""")
 
     # IRequestHandler methods
     def match_request(self, req):
@@ -55,8 +57,12 @@ class DashboardModule(Component):
         add_stylesheet(req, 'dashboard/skin.css')
         return 'bhdb_one_col.html', \
                 {
+                    'context' : Context.from_request(req),
                     'widgets' : self.expand_widget_data(req), 
-                    'title' : _('Dashboard')
+                    'title' : _(self.mainnav_label),
+                    'default' : {
+                            'height' : self.default_widget_height or None
+                        }
                 }, \
                 None
 
@@ -101,7 +107,7 @@ class DashboardModule(Component):
         from bhdashboard.widgets.report import TicketReportWidget
         w = TicketReportWidget(self.env)
         ctx = Context.from_request(req)
-        args = ('TicketReport', ctx, {'args' : {'id' : 7, 'limit' : 10}})
+        args = ('TicketReport', ctx, {'args' : {'id' : 3}})
         chrome = Chrome(self.env)
         template, data, _ = w.render_widget(*args)
         render = chrome.render_template

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html?rev=1307969&r1=1307968&r2=1307969&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_grid.html Sun Apr  1 00:56:50 2012
@@ -3,17 +3,19 @@
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:py="http://genshi.edgewall.org/"
       xmlns:xi="http://www.w3.org/2001/XInclude">
-  <div py:if="numrows" class="numrows">($numrows total rows)</div>
   <!-- TODO: Add description icon plus tooltip -->
   <!-- div py:if="description" id="description" xml:space="preserve">
     ${wiki_to_html(context, description)}
   </div -->
-  <div py:if="paginator.has_more_pages">
-    <h2 class="report-result">
-      Results <span class="numresults">(${paginator.displayed_items()})</span>
-    </h2>
-    <xi:include href="page_index.html" />
-  </div>
+  <py:choose test="">
+    <div py:when="paginator.has_more_pages">
+      <h2 class="report-result">
+        Results <span class="numresults">(${paginator.displayed_items()})</span>
+      </h2>
+      <!-- xi:include href="page_index.html" / -->
+    </div>
+    <div py:when="numrows" class="numrows">($numrows total rows)</div>
+  </py:choose>
 
   <py:for each="value_for_group, row_group in row_groups">
     <h2 class="report-result" py:if="value_for_group">$value_for_group