소스 검색

fixed bug when admin doesn't has edit route.

Abdellatif AitBoudad 11 년 전
부모
커밋
f0f96f0a89
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Resources/views/Block/block_search_result.html.twig

+ 5 - 1
Resources/views/Block/block_search_result.html.twig

@@ -30,7 +30,11 @@ file that was distributed with this source code.
         <ul>
             {% if pager %}
                 {% for result in pager.getResults() %}
-                    <li><a href="{{ admin.generateObjectUrl('edit', result) }}">{{ admin.toString(result) }}</a></li>
+                    {% if admin.hasRoute('edit') %}
+                        <li><a href="{{ admin.generateObjectUrl('edit', result) }}">{{ admin.toString(result) }}</a></li>
+                    {% else %}
+                        <li><i>{{ admin.toString(result) }}</i></li>
+                    {% endif %}
                 {% else %}
                     {% if admin.hasRoute('create') %}
                         <li><i>{{ 'no_results_found'|trans({}, 'SonataAdminBundle') }} ~ <a href="{{ admin.generateUrl('create') }}">{{ 'add_new_entry'|trans({}, 'SonataAdminBundle') }}</a></i></li>