changeset 2281:5bc7db3fbb87

Search results display improvements, Fix for issue #8.
author Ashutosh Singla <ashu1461@gmail.com>
date Wed, 18 Sep 2013 19:45:39 +0530
parents 5cee54021c88
children 5c424120a253
files MoinMoin/apps/frontend/views.py MoinMoin/templates/search.html
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Wed Sep 18 19:23:22 2013 +0530
+++ b/MoinMoin/apps/frontend/views.py	Wed Sep 18 19:45:39 2013 +0530
@@ -311,6 +311,7 @@
                                    query=query,
                                    medium_search_form=search_form,
                                    item_name=item_name,
+                                   history=history,
             )
             flaskg.clock.stop('search render')
     else:
--- a/MoinMoin/templates/search.html	Wed Sep 18 19:23:22 2013 +0530
+++ b/MoinMoin/templates/search.html	Wed Sep 18 19:45:39 2013 +0530
@@ -44,7 +44,11 @@
                         {% if result['wikiname'] == cfg.interwikiname %}
                             <tr>
                                 <td class="moin-wordbreak">{{ result.pos + 1 }}
-                                <a href="{{ url_for_item(item_name=result['name'][0], wiki_name='Self', rev=result['revid']) }}"><b>{{ result['name'] | join(' | ')}}</b></a>
+                                    {% if history %}
+                                        <a href="{{ url_for_item(item_name=result['revid'], wiki_name='Self', namespace=result['namespace'], field='revid') }}"><b>{{ result['name'] | join(' | ')}}</b></a>
+                                    {% else %}
+                                        <a href="{{ url_for_item(item_name=result['name'][0], wiki_name='Self', namespace=result['namespace']) }}"><b>{{ result['name'] | join(' | ')}}</b></a>
+                                    {% endif %}
                                 </td>
                             </tr>
                             {% if result['summary'] %}