Pārlūkot izejas kodu

Merged in FD3-66 (pull request #8)

Implementacion de OwnerVoterBundle en TemplateBundle

Approved-by: Guillermo Espinoza <guillermo@interlink.com.ar>
Gabriel Gosparo 8 gadi atpakaļ
vecāks
revīzija
4a3b68dae3

+ 17 - 0
app/Resources/SonataAdminBundle/views/CRUD/list__action_delete.html.twig

@@ -0,0 +1,17 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% if admin.hasAccess('delete', object) and owner_voter.vote(token_security.token, object, ['delete']) >= 0 and admin.hasRoute('delete') %}
+    <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn btn-sm btn-default delete_link" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
+        <i class="fa fa-times" aria-hidden="true"></i>
+        {{ 'action_delete'|trans({}, 'SonataAdminBundle') }}
+    </a>
+{% endif %}

+ 18 - 0
app/Resources/SonataAdminBundle/views/CRUD/list__action_edit.html.twig

@@ -0,0 +1,18 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% if admin.hasAccess('edit', object) and owner_voter.vote(token_security.token, object, ['edit']) >= 0 and admin.hasRoute('edit') %}
+    <a href="{{ admin.generateObjectUrl('edit', object) }}" class="btn btn-sm btn-default edit_link"
+       title="{{ 'action_edit'|trans({}, 'SonataAdminBundle') }}">
+        <i class="fa fa-pencil" aria-hidden="true"></i>
+        {{ 'action_edit'|trans({}, 'SonataAdminBundle') }}
+    </a>
+{% endif %}

+ 2 - 0
app/config/config.yml

@@ -59,6 +59,8 @@ twig:
     globals:
         base_url: %url_base%
         fd_alerts: '@base_admin.alert_service'
+        token_security: '@security.token_storage'
+        owner_voter: '@owner_voter.voter'
 
 # Doctrine Configuration
 doctrine:

+ 2 - 2
composer.json

@@ -62,8 +62,8 @@
         },
         {
             "type": "vcs",
-            "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/OwnerVoter.git",
-    	    "options": {
+            "url":  "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/OwnerVoter.git",
+            "options": {
                     "local_pk": "./keys/bitbucket.id_rsa"
             }
         }