Commits

marchael committed 6800ab9

fixed acl search issue Fixes #14

Comments (0)

Files changed (1)

MoinMoin/templates/search_results.html

         <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>