Return-Path: X-Original-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2728EC8FC for ; Fri, 25 May 2012 00:52:49 +0000 (UTC) Received: (qmail 76639 invoked by uid 500); 25 May 2012 00:52:49 -0000 Delivered-To: apmail-incubator-bloodhound-dev-archive@incubator.apache.org Received: (qmail 76619 invoked by uid 500); 25 May 2012 00:52:49 -0000 Mailing-List: contact bloodhound-dev-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-dev@incubator.apache.org Received: (qmail 76606 invoked by uid 99); 25 May 2012 00:52:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 00:52:48 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gary.martin@wandisco.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2012 00:52:41 +0000 Received: by wibhm14 with SMTP id hm14so300245wib.0 for ; Thu, 24 May 2012 17:52:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=5npgxAvWGo+xx1HPY89c4gBM9jXKOBsmXduVMfFcpCM=; b=WnzTWpdJVxlk/H6lmRALTSu0TENfHsTwsuWeq1QB9Ju/vFBjpqnESOkEy9p16c+5YB kdkAktxozb/hbsS6gSZ4s2QcW3jwPL7GwhYzW04oMaTObfYWmSdL2y3vyqmfFGrNpLHP zf1DQtlQOubcz23nZ9uO+DxdDmxim+2eFz2TIvXlEDHIgVOs52ROjU5qsTYhxMkVJPhq f6b9ssc+IWkCc0kCCic0GoxRLO4vyGv8rAw64SGNy5KpgnFXyFfF8baCt3RernSu9nzO QWPOLpMESeI/JRI1nRP/QW0TY5xwEQrtXBag/fLMOfXKnEBvcyfvVmm8AgBwhH26ov0c k0cw== Received: by 10.216.150.213 with SMTP id z63mr736742wej.102.1337907140498; Thu, 24 May 2012 17:52:20 -0700 (PDT) Received: from [192.168.1.202] ([87.112.197.147]) by mx.google.com with ESMTPS id n11sm14094704wiv.9.2012.05.24.17.52.19 (version=SSLv3 cipher=OTHER); Thu, 24 May 2012 17:52:19 -0700 (PDT) Message-ID: <4FBED7C2.7070905@wandisco.com> Date: Fri, 25 May 2012 01:52:18 +0100 From: Gary User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: bloodhound-dev@incubator.apache.org Subject: Re: [Apache Bloodhound] #88: Generic conversions of tables to bootstrap References: <052.677c2c93c80c82971fb640d3b29469df@incubator.apache.org> <067.85dc5d147b6ab2d8a5c41ccfca0cc5bb@incubator.apache.org> In-Reply-To: <067.85dc5d147b6ab2d8a5c41ccfca0cc5bb@incubator.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQm74vi7vQ6mVqHYalva3sF4hg1WlLL3g9cc313l9V2QObj0uFBVeqL+NaXwiwZfxGX642Sb X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have some more suggestions for how we might provide limited support for plugin templates to allow them to blend in a little easier with our theme. https://issues.apache.org/bloodhound/ticket/88 contains the initial suggestion, including a helper function to help add classes to elements and applying it to tables. https://issues.apache.org/bloodhound/ticket/36 begins to look at buttons with the same approach. If this idea is seen as having merit and appears to work then further tickets should be raised for other predictable conversions. Cheers, Gary On 25/05/12 01:29, Apache Bloodhound wrote: > #88: Generic conversions of tables to bootstrap > --------------------------+----------------- > Reporter: gjm | Owner: gjm > Type: enhancement | Status: new > Priority: major | Milestone: > Component: dashboard | Version: > Resolution: | Keywords: > --------------------------+----------------- > > Comment (by gjm): > > Part of the barrier to doing this is a simple way of adding the bootstrap > classes to objects - it is useful to make this fairly simple so that it is > reusable for other conversions. The following might suffice as a starting > point. > > {{{ > #!diff > Index: trunk/bloodhound_theme/bhtheme/theme.py > =================================================================== > --- trunk/bloodhound_theme/bhtheme/theme.py (revision 1341781) > +++ trunk/bloodhound_theme/bhtheme/theme.py (working copy) > @@ -105,6 +106,21 @@ > def post_process_request(self, req, template, data, content_type): > """Post process request filter. > Removes all trac provided css if required""" > + def add_classes(attributes,*args): > + """Helper function to add classes to the existing attributes > found > + by a select('@*') or similar. Example use: > + > + """ > + attrib_list = list(attributes) > + if attrib_list: > + attrs = dict(list(attrib_list[0])) > + else: > + attrs = {} > + if len(args): > + attrs['class'] = ' '.join((attrs.get('class',''),) + > args) > + return attrs > + data['add_classes'] = add_classes > + > def is_active_theme(): > is_active = False > active_theme = ThemeEngineSystem(self.env).theme > }}} > > Using this, it is then possible to transform unconverted tables with > something like this: > > {{{ > #!diff > Index: trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html > =================================================================== > --- trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html > (revision 1341816) > +++ trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html > (working copy) > @@ -252,4 +252,30 @@ > > > > + > + buffer="true"> > + > + ${select('*|text()|comment()')} > +
> +
> + > > }}} > > Similar conversions could be applied for buttons and other common > interface pieces but these should be considered in separate tickets. > > Comments appreciated. >