[static-web] full text search links are evil



commit dde738b18129d469b9f04cf8d145db19e02291e2
Author: Olav Vitters <olav vitters nl>
Date:   Sat Aug 2 01:55:38 2014 +0200

    full text search links are evil

 wiki.gnome.org/gnome/gnome.py |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/wiki.gnome.org/gnome/gnome.py b/wiki.gnome.org/gnome/gnome.py
index ed84b8e..34d88d3 100644
--- a/wiki.gnome.org/gnome/gnome.py
+++ b/wiki.gnome.org/gnome/gnome.py
@@ -116,6 +116,35 @@ class Theme(ThemeBase):
         return html
 
 
+   def title_with_separators2(self, d):
+        """ Assemble the title using slashes, not <ul>
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: title html
+        """
+        _ = self.request.getText
+        if d['title_text'] == d['page'].split_title():
+            # just showing a page, no action
+            segments = d['page_name'].split('/')
+            link_text = segments[-1]
+            link = d['page'].link_to(self.request, link_text)
+
+            if len(segments) <= 1:
+                html = link
+            else:
+                content = []
+                curpage = ''
+                for s in segments[:-1]:
+                    curpage += s
+                    content.append(Page(self.request,
+                                        curpage).link_to(self.request, s))
+                    curpage += '/'
+                path_html = u'<span class="sep">/</span>'.join(content)
+                html = u'<span class="pagepath">%s</span><span class="sep">/</span>%s' % (path_html, link)
+        else:
+            html = wikiutil.escape(d['title_text'])
+        return u'<span id="pagelocation">%s</span>' % html
 
     def header(self, d):
         """
@@ -127,7 +156,7 @@ class Theme(ThemeBase):
         """
         _ = self.request.getText
 
-        html_title = self.title_with_separators(d)
+        html_title = self.title_with_separators2(d)
         html_tabs = self.tabs(d)
 
         html = [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]