changeset 431:6800ab9dd159

fixed acl search issue Fixes #14
author Michael Mayorov <marchael@kb.csu.ru>
date Sat, 13 Aug 2011 15:58:40 +0000
parents 78a2962bf192
children 66981eb25822
files MoinMoin/templates/search_results.html
diffstat 1 files changed, 24 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/search_results.html	Wed Aug 10 20:12:05 2011 +0000
+++ b/MoinMoin/templates/search_results.html	Sat Aug 13 15:58:40 2011 +0000
@@ -24,25 +24,33 @@
         <div class="searchresults">
         <table>
             {% for result in results %}
-            <tr>
-                <td class="moin-wordbreak">{{ result.pos + 1 }}
                 {% if result['wikiname'] == cfg.interwikiname %}
-                    <a href="{{ url_for_item(item_name=result['name'], wiki_name='Self', rev=result['rev_no']) }}"><b>{{ result['name'] }}</b></a>
+                    <tr>
+                        <td class="moin-wordbreak">{{ result.pos + 1 }}
+                        <a href="{{ url_for_item(item_name=result['name'], wiki_name='Self', rev=result['rev_no']) }}"><b>{{ result['name'] }}</b></a>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <p class="info searchhitinfobar">{{ _("Revision: %(rev_no)d Last Change: %(mtime)s", rev_no=result['rev_no'], mtime=result['mtime']|datetimeformat) }}</p>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            {% if user.may.read(result['name']) %}
+                                <p class="info foundtext">{{ result.highlights('content')|safe }}</p>
+                            {% else %}
+                                <p class="info foundtext">{{ _("You don't have read permission for this item.") }}</p>
+                            {% endif %}
+                        </td>
+                    </tr>
                 {% else %}
-                    <a class="moin-interwiki" href="{{ url_for_item(item_name=result['name'], wiki_name=result['wikiname'], rev=result['rev_no']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
+                    <tr>
+                        <td class="moin-wordbreak">{{ result.pos + 1 }}
+                        <a class="moin-interwiki" href="{{ url_for_item(item_name=result['name'], wiki_name=result['wikiname'], rev=result['rev_no']) }}"><b>{{ "%s:%s" % (result['wikiname'], result['name']) }}</b></a>
+                        </td>
+                    </tr>
                 {% endif %}
-                </td>
-            </tr>
-            <tr>
-                <td>
-                <p class="info searchhitinfobar">{{ _("Revision: %(rev_no)d Last Change: %(mtime)s", rev_no=result['rev_no'], mtime=result['mtime']|datetimeformat) }}</p>
-                </td>
-            </tr>
-            <tr>
-                <td>
-                <p class="info foundtext">{{ result.highlights('content')|safe }}</p>
-                </td>
-            </tr>
             {% endfor %}
         </table>
         </div>