You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by pe...@apache.org on 2012/12/10 11:33:39 UTC

svn commit: r1419326 - /incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Author: peter
Date: Mon Dec 10 10:33:38 2012
New Revision: 1419326

URL: http://svn.apache.org/viewvc?rev=1419326&view=rev
Log:
#270 - Whitelabeling/detracify: Fix UI wiki documentation links
 - Renamed wiki links label 

Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py?rev=1419326&r1=1419325&r2=1419326&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Mon Dec 10 10:33:38 2012
@@ -17,6 +17,7 @@
 #  under the License.
 
 from genshi.builder import tag
+from genshi.core import TEXT           
 from genshi.filters.transform import Transformer
 
 from trac.core import *
@@ -126,7 +127,8 @@ class BloodhoundTheme(ThemeBase):
 
     def filter_stream(self, req, method, filename, stream, data):
         """Insert default Bootstrap CSS classes if rendering 
-        legacy templates (i.e. determined by template name prefix).
+        legacy templates (i.e. determined by template name prefix) 
+        and renames wiki guide links.
         """
         tx = Transformer('body')
 
@@ -147,6 +149,12 @@ class BloodhoundTheme(ThemeBase):
         for xpath, classes in self.BOOTSTRAP_CSS_DEFAULTS :
             tx = tx.end().select(xpath) \
                     .attr('class', add_classes(classes))
+         
+        # Rename wiki guide links
+        tx = tx.end() \
+            .select("body//a[contains(@href,'/wiki/%s')]" % wiki.GUIDE_NAME) \
+            .map(lambda text: wiki.new_name(text), TEXT)            
+                    
         return stream | tx
 
     # IRequestFilter methods