Ver código fonte

Merge pull request #502 from EmmanuelVella/delete

Fix edit button display in delete template
Thomas 13 anos atrás
pai
commit
3db4661d22
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      Resources/views/CRUD/delete.html.twig

+ 4 - 2
Resources/views/CRUD/delete.html.twig

@@ -40,9 +40,11 @@ file that was distributed with this source code.
 
                 <input type="submit" class="btn danger" value="{% trans from 'SonataAdminBundle' %}btn_delete{% endtrans %}" />
 
-                {% trans from 'SonataAdminBundle' %}delete_or{% endtrans %}
+                {% if admin.hasRoute('edit') and admin.isGranted('EDIT') %}
+                    {% trans from 'SonataAdminBundle' %}delete_or{% endtrans %}
 
-                <a class="btn success" href="{{ admin.generateObjectUrl('edit', object) }}">{% trans from 'SonataAdminBundle' %}link_action_edit{% endtrans %}</a>
+                    <a class="btn success" href="{{ admin.generateObjectUrl('edit', object) }}">{% trans from 'SonataAdminBundle' %}link_action_edit{% endtrans %}</a>
+                {% endif %}
             </form>
         </div>
     </div>