Return-Path: X-Original-To: apmail-incubator-bloodhound-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B9069A53 for ; Sun, 1 Apr 2012 01:36:52 +0000 (UTC) Received: (qmail 6297 invoked by uid 500); 1 Apr 2012 01:36:52 -0000 Delivered-To: apmail-incubator-bloodhound-commits-archive@incubator.apache.org Received: (qmail 6276 invoked by uid 500); 1 Apr 2012 01:36:52 -0000 Mailing-List: contact bloodhound-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bloodhound-dev@incubator.apache.org Delivered-To: mailing list bloodhound-commits@incubator.apache.org Received: (qmail 6268 invoked by uid 99); 1 Apr 2012 01:36:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2012 01:36:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2012 01:36:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3E1C9238896F; Sun, 1 Apr 2012 01:36:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1307987 - in /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard: ./ layouts/ layouts/templates/ Date: Sun, 01 Apr 2012 01:36:26 -0000 To: bloodhound-commits@incubator.apache.org From: gjm@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120401013627.3E1C9238896F@eris.apache.org> Author: gjm Date: Sun Apr 1 01:36:26 2012 New Revision: 1307987 URL: http://svn.apache.org/viewvc?rev=1307987&view=rev Log: Dashboard code import: BH_Dashboard: Initial version of Bootstrap button toolbar layout. Toolbar only Added: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html (with props) incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html (with props) incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html (with props) Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/bootstrap.py incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_grid.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=1307987&r1=1307986&r2=1307987&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:36:26 2012 @@ -39,20 +39,57 @@ class BootstrapLayout(Component): """Supported layouts. """ yield 'bootstrap_grid' + yield 'bootstrap_btnbar' def get_layout_description(self, name): """Return plain text description of the layout with specified name. """ - return "Bootstrap grid system " \ - "http://twitter.github.com/bootstrap/scaffolding.html#layouts" + return { + 'bootstrap_grid' : "Bootstrap grid system " \ + "http://twitter.github.com/bootstrap/scaffolding.html#layouts", + 'bootstrap_btnbar' : "Button toolbar acting as tabs nav" + }[name] def expand_layout(self, name, context, options): """Specify bootstrap layout template """ req = context.req add_stylesheet(req, 'dashboard/bootstrap.css') - return { - 'template' : options.get('embed') and \ - 'bs_grid.html' or 'bs_grid_full.html', + + if name == 'bootstrap_btnbar': + self._process_btnbar(options) + + results = { + ('bootstrap_grid', False) : { + 'template' : 'bs_grid_full.html', + }, + ('bootstrap_grid', True) : { + 'template' : 'bs_grid.html', + }, + ('bootstrap_btnbar', False) : { + 'template' : 'bs_btnbar_full.html', + }, + ('bootstrap_btnbar', True) : { + 'template' : 'bs_btnbar.html', + }, } + return results[( name , bool(options.get('embed')) )] + + # Internal methods + def _process_btnbar(self, options): + """Determine toolbar groups + """ + layout_data = options['schema'] + orig_tb = layout_data.get('toolbar', []) + ready = layout_data.get('ready') + if not ready: + layout_data['toolbar'] = tb = [[]] + last_group = tb[0] + for caption, idx in orig_tb: + if caption == '|' : + last_group = [] + tb.append(last_group) + else: + last_group.append({ 'caption' : caption, 'widget' :idx }) + layout_data['ready'] = True Added: 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=1307987&view=auto ============================================================================== --- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html (added) +++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html Sun Apr 1 01:36:26 2012 @@ -0,0 +1,18 @@ + + + + + + + Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar.html ------------------------------------------------------------------------------ svn:mime-type = text/html Added: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html?rev=1307987&view=auto ============================================================================== --- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html (added) +++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html Sun Apr 1 01:36:26 2012 @@ -0,0 +1,22 @@ + + + + + $title + + + + +
+
+ Note: See + BloodhoundDashboard + for help on using the dashboard. +
+
+ + Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_btnbar_full.html ------------------------------------------------------------------------------ svn:mime-type = text/html Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_grid.html URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_grid.html?rev=1307987&r1=1307986&r2=1307987&view=diff ============================================================================== --- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_grid.html (original) +++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/bs_grid.html Sun Apr 1 01:36:26 2012 @@ -4,29 +4,7 @@ xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="" > -
-

${w.title}

- - -   $itm - - -    -
- - Download - - -
-
- ${w.content} -
+
Added: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html?rev=1307987&view=auto ============================================================================== --- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html (added) +++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html Sun Apr 1 01:36:26 2012 @@ -0,0 +1,30 @@ + + +
+

${w.title}

+ + +   $itm + + +    +
+ + Download + + +
+
+ ${w.content} +
+ Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/layouts/templates/widget_macros.html ------------------------------------------------------------------------------ svn:mime-type = text/html 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=1307987&r1=1307986&r2=1307987&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:36:26 2012 @@ -154,20 +154,17 @@ class DashboardModule(Component): }, { 'args' : ['Container', None, - {'args' : {'layout' : 'bootstrap_grid', + {'args' : {'layout' : 'bootstrap_btnbar', 'schema' : """ { - "div" : [{ - "_class" : "row", - "div" : [{ - "_class" : "span3", - "widgets" : [0] - }, - { - "_class" : "span5", - "widgets" : [1] - }] - }], + "toolbar" : [ + ["Products", null], + ["My Tickets", 1], + ["All tickets", 2], + ["|", null], + ["Projects", null], + ["Components", 0] + ], "widgets" : [ { "args" : [