Anonymous avatar Anonymous committed d98cc22

Update winehq.py to eliminate fatal errors.

A few changes to MoinMoin's theme system broke
backwards-compatibility. The theme still has
display issues, mainly due to MoinMoin now
outputting strict HTML4.

Comments (0)

Files changed (1)

 """
 
 from MoinMoin import wikiutil
+from MoinMoin.action import get_available_actions
 from MoinMoin.Page import Page
 from MoinMoin.theme import ThemeBase
 
         @return: title html
         """
         _ = self.request.getText
-        if d['title_link']:
-            content = ('<a title="%(title)s" href="%(href)s">%(text)s</a>') % {
-                'title': _('Click to do a full-text search for this title'),
-                'href': d['title_link'],
-                'text': wikiutil.escape(d['title_text']),
-                }
+        content = []
+        if d['title_text'] == d['page'].split_title(): # just showing a page, no action
+            link_text = d['page_name']
+            link_title = _('Click to do a full-text search for this title')
+            link_query = {
+                'action': 'fullsearch',
+                'value': 'linkto:"%s"' % d['page_name'],
+                'context': '180',
+            }
+            # we dont use d['title_link'] any more, but make it ourselves:
+            link = d['page'].link_to(self.request, link_text, querystr=link_query, title=link_title)
+            content.append('%s' % link)
         else:
-            content = wikiutil.escape(d['title_text'])
+            content.append('%s' % wikiutil.escape(d['title_text']))
 
         args = {}
-        args['title'] = content
+        args['title'] = content.pop()
         args['blank'] = self.img_url('blank.gif')
         args['dot_left'] = self.img_url('winehq_border_dot_left.gif')
         args['top_left'] = self.img_url('winehq_border_top_left.gif')
         @return: msg display html
         """
         _ = self.request.getText
-        msg = d['msg']
-        if not msg:
+        msgs = d['msg']
+        html = u''
+
+        for msg, msg_class in msgs:
+            try:
+                # msg is a widget
+                html += msg.render()
+            except AttributeError:
+                # Render simple strings with a close link
+                close = d['page'].link_to(self.request,
+                                  text=_('Clear message'),
+                                  querystr={'action': 'show'})
+                html += u'<p>%s (<span class="buttons">%s</span>)</p>\n' % (msg, close)
+
+        if not html:
             return u''
-
-        if isinstance(msg, (str, unicode)):
-            # Render simple strings with a close link
-            close = d['page'].link_to(self.request,
-                                      text=_('Clear message'),
-                                      querystr={'action': 'show'})
-            html = u'<p>%s (<span class="buttons">%s</span>)</p>\n' % (msg, close)
         else:
-            # msg is a widget
-            html = msg.render()
-
-        return u'<div id="message">\n%s\n</div>\n' % html
+            return u'<div id="message">\n%s\n</div>\n' % html
 
     def searchform(self, d):
         """
         if parent:
            add(parent.link_to(request, _("Show Parent", formatted=False)))
 
-        available = request.getAvailableActions(page)
+        available = get_available_actions(request.cfg, page, request.user)
 
         # Page actions
         if page.isWritable() and request.user.may.write(page.page_name):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.