Преглед изворни кода

Revert "remove the Bundle keyword due to the last Symfony changes"

This reverts commit 790e1922c1bcff3b74190c9f3e03085c5dbe69cb.
Thomas пре 14 година
родитељ
комит
9876d11c8d
41 измењених фајлова са 79 додато и 78 уклоњено
  1. 3 3
      Admin/Admin.php
  2. 1 0
      Admin/Pool.php
  3. 3 3
      Builder/ORM/DatagridBuilder.php
  4. 5 5
      Builder/ORM/FormBuilder.php
  5. 7 7
      Builder/ORM/ListBuilder.php
  6. 1 1
      Controller/CoreController.php
  7. 4 4
      Resources/config/routing/sonata_admin.xml
  8. 2 2
      Resources/config/templates.xml
  9. 1 1
      Resources/doc/reference/filter_field_definition.rst
  10. 1 1
      Resources/doc/reference/installation.rst
  11. 2 2
      Resources/doc/reference/list_field_definition.rst
  12. 1 1
      Resources/views/CRUD/edit.html.twig
  13. 1 1
      Resources/views/CRUD/edit_bigint.html.twig
  14. 1 1
      Resources/views/CRUD/edit_orm_many_to_many.html.twig
  15. 2 2
      Resources/views/CRUD/edit_orm_many_to_one.html.twig
  16. 2 2
      Resources/views/CRUD/edit_orm_one_to_many.html.twig
  17. 2 2
      Resources/views/CRUD/edit_orm_one_to_one.html.twig
  18. 1 1
      Resources/views/CRUD/edit_smallint.html.twig
  19. 1 1
      Resources/views/CRUD/filter_boolean.html.twig
  20. 1 1
      Resources/views/CRUD/filter_callback.html.twig
  21. 1 1
      Resources/views/CRUD/filter_identifier.html.twig
  22. 1 1
      Resources/views/CRUD/filter_integer.html.twig
  23. 1 1
      Resources/views/CRUD/filter_many_to_many.html.twig
  24. 1 1
      Resources/views/CRUD/filter_many_to_one.html.twig
  25. 1 1
      Resources/views/CRUD/filter_string.html.twig
  26. 1 1
      Resources/views/CRUD/filter_text.html.twig
  27. 1 1
      Resources/views/CRUD/list.html.twig
  28. 1 1
      Resources/views/CRUD/list_array.html.twig
  29. 1 1
      Resources/views/CRUD/list_bigint.html.twig
  30. 1 1
      Resources/views/CRUD/list_boolean.html.twig
  31. 1 1
      Resources/views/CRUD/list_datetime.html.twig
  32. 1 1
      Resources/views/CRUD/list_decimal.html.twig
  33. 1 1
      Resources/views/CRUD/list_identifier.html.twig
  34. 1 1
      Resources/views/CRUD/list_integer.html.twig
  35. 1 1
      Resources/views/CRUD/list_orm_many_to_one.html.twig
  36. 1 1
      Resources/views/CRUD/list_orm_one_to_one.html.twig
  37. 1 1
      Resources/views/CRUD/list_smallint.html.twig
  38. 1 1
      Resources/views/CRUD/list_string.html.twig
  39. 1 1
      Resources/views/CRUD/list_text.html.twig
  40. 16 16
      Tests/Admin/AdminTest.php
  41. 2 2
      Twig/Extension/SonataAdminExtension.php

+ 3 - 3
Admin/Admin.php

@@ -448,7 +448,7 @@ abstract class Admin implements AdminInterface
                 'code'  => '_batch',
                 'type'  => 'batch',
             ));
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:list__batch.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list__batch.html.twig');
             $this->listFieldDescriptions = array( '_batch' => $fieldDescription ) + $this->listFieldDescriptions;
         }
 
@@ -812,7 +812,7 @@ abstract class Admin implements AdminInterface
      */
     public function getListTemplate()
     {
-        return 'SonataAdmin:CRUD:list.html.twig';
+        return 'SonataAdminBundle:CRUD:list.html.twig';
     }
 
     /**
@@ -822,7 +822,7 @@ abstract class Admin implements AdminInterface
      */
     public function getEditTemplate()
     {
-        return 'SonataAdmin:CRUD:edit.html.twig';
+        return 'SonataAdminBundle:CRUD:edit.html.twig';
     }
 
     /**

+ 1 - 0
Admin/Pool.php

@@ -47,6 +47,7 @@ class Pool
                 if (!$options['show_in_dashboard']) {
                     unset($groups[$name][$id]);
                     continue;
+
                 }
 
                 $groups[$name][$id] = $this->container->get($id);

+ 3 - 3
Builder/ORM/DatagridBuilder.php

@@ -79,14 +79,14 @@ class DatagridBuilder implements DatagridBuilderInterface
         }
 
         if (!$fieldDescription->getTemplate()) {
-            $fieldDescription->setTemplate(sprintf('SonataAdmin:CRUD:filter_%s.html.twig', $fieldDescription->getType()));
+            $fieldDescription->setTemplate(sprintf('SonataAdminBundle:CRUD:filter_%s.html.twig', $fieldDescription->getType()));
 
             if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_ONE) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:filter_many_to_one.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:filter_many_to_one.html.twig');
             }
 
             if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_MANY) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:filter_many_to_many.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:filter_many_to_many.html.twig');
             }
         }
     }

+ 5 - 5
Builder/ORM/FormBuilder.php

@@ -399,26 +399,26 @@ class FormBuilder implements FormBuilderInterface
 
         // fix template value for doctrine association fields
         if (!$fieldDescription->getTemplate()) {
-             $fieldDescription->setTemplate(sprintf('SonataAdmin:CRUD:edit_%s.html.twig', $fieldDescription->getType()));
+             $fieldDescription->setTemplate(sprintf('SonataAdminBundle:CRUD:edit_%s.html.twig', $fieldDescription->getType()));
         }
 
         if ($fieldDescription->getType() == ClassMetadataInfo::ONE_TO_ONE) {
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:edit_orm_one_to_one.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:edit_orm_one_to_one.html.twig');
             $admin->attachAdminClass($fieldDescription);
         }
 
         if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_ONE) {
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:edit_orm_many_to_one.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:edit_orm_many_to_one.html.twig');
             $admin->attachAdminClass($fieldDescription);
         }
 
         if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_MANY) {
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:edit_orm_many_to_many.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:edit_orm_many_to_many.html.twig');
             $admin->attachAdminClass($fieldDescription);
         }
 
         if ($fieldDescription->getType() == ClassMetadataInfo::ONE_TO_MANY) {
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:edit_orm_one_to_many.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:edit_orm_one_to_many.html.twig');
 
             if ($fieldDescription->getOption('edit') == 'inline' && !$fieldDescription->getOption('widget_form_field')) {
                 $fieldDescription->setOption('widget_form_field', 'Bundle\\Sonata\\AdminBundle\\Form\\EditableFieldGroup');

+ 7 - 7
Builder/ORM/ListBuilder.php

@@ -67,22 +67,22 @@ class ListBuilder implements ListBuilderInterface
 
         if (!$fieldDescription->getTemplate()) {
 
-            $fieldDescription->setTemplate(sprintf('SonataAdmin:CRUD:list_%s.html.twig', $fieldDescription->getType()));
+            $fieldDescription->setTemplate(sprintf('SonataAdminBundle:CRUD:list_%s.html.twig', $fieldDescription->getType()));
 
             if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_ONE) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:list_orm_many_to_one.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list_orm_many_to_one.html.twig');
             }
 
             if ($fieldDescription->getType() == ClassMetadataInfo::ONE_TO_ONE) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:list_orm_one_to_one.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list_orm_one_to_one.html.twig');
             }
 
             if ($fieldDescription->getType() == ClassMetadataInfo::ONE_TO_MANY) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:list_orm_one_to_many.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list_orm_one_to_many.html.twig');
             }
 
             if ($fieldDescription->getType() == ClassMetadataInfo::MANY_TO_MANY) {
-                $fieldDescription->setTemplate('SonataAdmin:CRUD:list_orm_many_to_many.html.twig');
+                $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list_orm_many_to_many.html.twig');
             }
         }
 
@@ -110,7 +110,7 @@ class ListBuilder implements ListBuilderInterface
     public function buildActionFieldDescription(FieldDescription $fieldDescription)
     {
         if (null === $fieldDescription->getTemplate()) {
-            $fieldDescription->setTemplate('SonataAdmin:CRUD:list__action.html.twig');
+            $fieldDescription->setTemplate('SonataAdminBundle:CRUD:list__action.html.twig');
         }
         
         if (null === $fieldDescription->getType()) {
@@ -129,7 +129,7 @@ class ListBuilder implements ListBuilderInterface
             $actions = $fieldDescription->getOption('actions');
             foreach ($actions as $k => $action) {
                 if (!isset($action['template'])) {
-                    $actions[$k]['template'] = sprintf('SonataAdmin:CRUD:list__action_%s.html.twig', $k);
+                    $actions[$k]['template'] = sprintf('SonataAdminBundle:CRUD:list__action_%s.html.twig', $k);
                 }
             }
             

+ 1 - 1
Controller/CoreController.php

@@ -201,7 +201,7 @@ class CoreController extends Controller
     public function dashboardAction()
     {
 
-        return $this->render('SonataAdmin:Core:dashboard.html.twig', array(
+        return $this->render('SonataAdminBundle:Core:dashboard.html.twig', array(
             'groups' => $this->get('sonata_admin.admin.pool')->getDashboardGroups(),
             'base_template'  => $this->getBaseTemplate(),
         ));

+ 4 - 4
Resources/config/routing/sonata_admin.xml

@@ -5,18 +5,18 @@
     xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
 
     <route id="sonata_admin_dashboard" pattern="/dashboard">
-        <default key="_controller">SonataAdmin:Core:dashboard</default>
+        <default key="_controller">SonataAdminBundle:Core:dashboard</default>
     </route>
 
     <route id="sonata_admin_retrieve_form_element" pattern="/core/get-form-field-element">
-        <default key="_controller">SonataAdmin:Core:retrieveFormFieldElement</default>
+        <default key="_controller">SonataAdminBundle:Core:retrieveFormFieldElement</default>
     </route>
 
     <route id="sonata_admin_append_form_element" pattern="/core/append-form-field-element">
-        <default key="_controller">SonataAdmin:Core:appendFormFieldElement</default>
+        <default key="_controller">SonataAdminBundle:Core:appendFormFieldElement</default>
     </route>
 
     <route id="sonata_admin_short_object_information" pattern="/core/get-short-object-description">
-        <default key="_controller">SonataAdmin:Core:getShortObjectDescription</default>
+        <default key="_controller">SonataAdminBundle:Core:getShortObjectDescription</default>
     </route>
 </routes>

+ 2 - 2
Resources/config/templates.xml

@@ -5,8 +5,8 @@
            xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
 
     <parameters>
-        <parameter key="sonata_admin.templates.layout">SonataAdmin::standard_layout.html.twig</parameter>
-        <parameter key="sonata_admin.templates.ajax">SonataAdmin::ajax_layout.html.twig</parameter>
+        <parameter key="sonata_admin.templates.layout">SonataAdminBundle::standard_layout.html.twig</parameter>
+        <parameter key="sonata_admin.templates.ajax">SonataAdminBundle::ajax_layout.html.twig</parameter>
     </parameters>
 
 </container>

+ 1 - 1
Resources/doc/reference/filter_field_definition.rst

@@ -27,7 +27,7 @@ Example
         {
 
             $datagrid->add('with_open_comments', array(
-                'template' => 'SonataAdmin:CRUD:filter_callback.html.twig',
+                'template' => 'SonataAdminBundle:CRUD:filter_callback.html.twig',
                 'type' => 'callback',
                 'filter_options' => array(
                     'filter' => array($this, 'getWithOpenCommentFilter'),

+ 1 - 1
Resources/doc/reference/installation.rst

@@ -51,7 +51,7 @@ code to your application's routing file:
 
     # app/config/routing.yml
     admin:
-        resource: '@SonataAdmin/Resources/config/routing/sonata_admin.xml'
+        resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
         prefix: /admin
 
     _sonata_admin:

+ 2 - 2
Resources/doc/reference/list_field_definition.rst

@@ -25,7 +25,7 @@ Example
 
         protected function configureListFields(ListMapper $list) // optional
         {
-            $list->get('summary')->setTemplate('News:NewsAdmin:list_summary.twig');
+            $list->get('summary')->setTemplate('NewsBundle:NewsAdmin:list_summary.twig');
         }
     }
 
@@ -74,7 +74,7 @@ But you can specify yours by setup 'template' option like :
 
     '_action' => array(
       'actions' => array(
-        'delete' => array('template' => 'My:MyController:my_partial.html.twig'),
+        'delete' => array('template' => 'MyBundle:MyController:my_partial.html.twig'),
         'edit' => array()
       )
     )

+ 1 - 1
Resources/views/CRUD/edit.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_edit.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_edit.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/edit_bigint.html.twig

@@ -9,4 +9,4 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:edit_integer.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:edit_integer.html.twig' %}

+ 1 - 1
Resources/views/CRUD/edit_orm_many_to_many.html.twig

@@ -34,5 +34,5 @@ file that was distributed with this source code.
         </div>
     </div>
 
-    {% include 'SonataAdmin:CRUD:edit_orm_many_association_script.html.twig' %}
+    {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
 {% endblock %}

+ 2 - 2
Resources/views/CRUD/edit_orm_many_to_one.html.twig

@@ -24,7 +24,7 @@ file that was distributed with this source code.
             {% if field_description.options.edit == 'list' %}
                 <span id="field_widget_{{ field_element.id }}" >
                     {% if value.id %}
-                        {% render 'SonataAdmin:Core:getShortObjectDescription' with {
+                        {% render 'SonataAdminBundle:Core:getShortObjectDescription' with {
                             'code': field_description.associationadmin.code,
                             'objectId': value.id,
                             'uniqid':  field_description.associationadmin.uniqid
@@ -66,6 +66,6 @@ file that was distributed with this source code.
             </div>
         </div>
 
-        {% include 'SonataAdmin:CRUD:edit_orm_many_association_script.html.twig' %}
+        {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
     {% endif %}
 {% endblock %}

+ 2 - 2
Resources/views/CRUD/edit_orm_one_to_many.html.twig

@@ -112,7 +112,7 @@ file that was distributed with this source code.
             {% endif %}
 
             {# include association code #}
-            {% include 'SonataAdmin:CRUD:edit_orm_one_association_script.html.twig' %}
+            {% include 'SonataAdminBundle:CRUD:edit_orm_one_association_script.html.twig' %}
             
         {% else %}
             <span id="field_actions_{{ field_element.id }}" >
@@ -131,7 +131,7 @@ file that was distributed with this source code.
 
             </div>
         
-            {% include 'SonataAdmin:CRUD:edit_orm_many_association_script.html.twig' %}
+            {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
         {% endif %}
     </div>
 {% endblock %}

+ 2 - 2
Resources/views/CRUD/edit_orm_one_to_one.html.twig

@@ -24,7 +24,7 @@ file that was distributed with this source code.
             {% if field_description.options.edit == 'list' %}
                 <span id="field_widget_{{ field_element.id }}" >
                     {% if value.id %}
-                        {% render 'SonataAdmin:Core:getShortObjectDescription' with {
+                        {% render 'SonataAdminBundle:Core:getShortObjectDescription' with {
                             'code': field_description.associationadmin.code,
                             'objectId': value.id,
                             'uniqid':  field_description.associationadmin.uniqid
@@ -67,6 +67,6 @@ file that was distributed with this source code.
             </div>
         </div>
 
-        {% include 'SonataAdmin:CRUD:edit_orm_many_association_script.html.twig' %}
+        {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
     {% endif %}
 {% endblock %}

+ 1 - 1
Resources/views/CRUD/edit_smallint.html.twig

@@ -9,4 +9,4 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:edit_integer.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:edit_integer.html.twig' %}

+ 1 - 1
Resources/views/CRUD/filter_boolean.html.twig

@@ -9,4 +9,4 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}

+ 1 - 1
Resources/views/CRUD/filter_callback.html.twig

@@ -9,4 +9,4 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}

+ 1 - 1
Resources/views/CRUD/filter_identifier.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/filter_integer.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/filter_many_to_many.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/filter_many_to_one.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/filter_string.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/filter_text.html.twig

@@ -9,5 +9,5 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_filter_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_filter_field.html.twig' %}
 

+ 1 - 1
Resources/views/CRUD/list.html.twig

@@ -9,4 +9,4 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_array.html.twig

@@ -9,7 +9,7 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}
     {% for key, val in value %}

+ 1 - 1
Resources/views/CRUD/list_bigint.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:list_integer.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:list_integer.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_boolean.html.twig

@@ -9,7 +9,7 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}<img src="/bundles/sonataadmin/famfamfam/{% if value %}accept{% else %}exclamation{% endif %}.png" />{% endblock %}
 

+ 1 - 1
Resources/views/CRUD/list_datetime.html.twig

@@ -9,7 +9,7 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}{{ value|date }}{% endblock %}
 

+ 1 - 1
Resources/views/CRUD/list_decimal.html.twig

@@ -9,6 +9,6 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}{{ value }}{% endblock %}

+ 1 - 1
Resources/views/CRUD/list_identifier.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_integer.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_orm_many_to_one.html.twig

@@ -9,7 +9,7 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}
     {% if value %}

+ 1 - 1
Resources/views/CRUD/list_orm_one_to_one.html.twig

@@ -9,7 +9,7 @@ file that was distributed with this source code.
 
 #}
 
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}
 

+ 1 - 1
Resources/views/CRUD/list_smallint.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:list_integer.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:list_integer.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_string.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}

+ 1 - 1
Resources/views/CRUD/list_text.html.twig

@@ -8,4 +8,4 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataAdmin:CRUD:base_list_field.html.twig' %}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}

+ 16 - 16
Tests/Admin/AdminTest.php

@@ -53,7 +53,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
     public function testConstructor()
     {
         $class = 'Application\Sonata\NewsBundle\Entity\Post';
-        $baseControllerName = 'SonataNews:PostAdmin';
+        $baseControllerName = 'SonataNewsBundle:PostAdmin';
 
         $admin = new PostAdmin($class, $baseControllerName);
         $this->assertInstanceOf('Sonata\AdminBundle\Admin\Admin', $admin);
@@ -71,12 +71,12 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testChildren()
     {
-        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $postAdmin->setCode('post');
         $this->assertFalse($postAdmin->hasChildren());
         $this->assertFalse($postAdmin->hasChild('comment'));
 
-        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNews:CommentAdmin');
+        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNewsBundle:CommentAdmin');
         $postAdmin->addChild('comment', $commentAdmin);
         $this->assertTrue($postAdmin->hasChildren());
         $this->assertTrue($postAdmin->hasChild('comment'));
@@ -96,7 +96,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testConfigure()
     {
-        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $this->assertTrue($admin->getUniqid() == "");
 
         $admin->configure();
@@ -104,7 +104,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('post', $admin->getClassnameLabel());
 
 
-        $admin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNews:CommentAdmin');
+        $admin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNewsBundle:CommentAdmin');
         $admin->setClassnameLabel('postcomment');
 
         $admin->configure();
@@ -113,7 +113,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
 
     public function testConfigureWithValidParentAssociationMapping()
     {
-        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $admin->setParentAssociationMapping('Category');
 
         $parentAssociationMapping = 'Application\Sonata\NewsBundle\Entity\Category';
@@ -130,7 +130,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testConfigureWithInvalidParentAssociationMapping()
     {
-        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $admin->setParentAssociationMapping('Category');
         $admin->setClassMetaData(new \stdClass());
 
@@ -140,14 +140,14 @@ class AdminTest extends \PHPUnit_Framework_TestCase
 
     public function testGetBaseRoutePattern()
     {
-        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $this->assertEquals('/sonata/news/post', $admin->getBaseRoutePattern());
     }
 
     public function testGetBaseRoutePatternWithChildAdmin()
     {
-        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
-        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNews:CommentAdmin');
+        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
+        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNewsBundle:CommentAdmin');
         $commentAdmin->setParent($postAdmin);
 
         $this->assertEquals('/sonata/news/post/{id}/comment', $commentAdmin->getBaseRoutePattern());
@@ -158,21 +158,21 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testGetBaseRoutePatternWithUnreconizedClassname()
     {
-        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $admin->getBaseRoutePattern();
     }
 
 
     public function testGetBaseRouteName()
     {
-        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $this->assertEquals('admin_sonata_news_post', $admin->getBaseRouteName());
     }
 
     public function testGetBaseRouteNameWithChildAdmin()
     {
-        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
-        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNews:CommentAdmin');
+        $postAdmin = new PostAdmin('Application\Sonata\NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
+        $commentAdmin = new CommentAdmin('Application\Sonata\NewsBundle\Entity\Comment', 'SonataNewsBundle:CommentAdmin');
         $commentAdmin->setParent($postAdmin);
 
         $this->assertEquals('admin_sonata_news_post_comment', $commentAdmin->getBaseRouteName());
@@ -183,7 +183,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testGetBaseRouteNameWithUnreconizedClassname()
     {
-        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
         $admin->getBaseRouteName();
     }
 
@@ -193,7 +193,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
      */
     public function testUniqid()
     {
-        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNews:PostAdmin');
+        $admin = new PostAdmin('NewsBundle\Entity\Post', 'SonataNewsBundle:PostAdmin');
 
         $uniqid = uniqid();
         $admin->setUniqid($uniqid);

+ 2 - 2
Twig/Extension/SonataAdminExtension.php

@@ -172,12 +172,12 @@ class SonataAdminExtension extends \Twig_Extension
             $params['edit']          = $fieldDescription->getOption('edit', 'standard');
             $params['inline']        = $fieldDescription->getOption('inline', 'natural');
 
-            $base_template = sprintf('SonataAdmin:CRUD:base_%s_edit_field.html.twig', 'standard');
+            $base_template = sprintf('SonataAdminBundle:CRUD:base_%s_edit_field.html.twig', 'standard');
         } else {
             $params['edit']          = $parentFieldDescription->getOption('edit', 'standard');
             $params['inline']        = $parentFieldDescription->getOption('inline', 'natural');
 
-            $base_template = sprintf('SonataAdmin:CRUD:base_%s_edit_field.html.twig', $params['edit']);
+            $base_template = sprintf('SonataAdminBundle:CRUD:base_%s_edit_field.html.twig', $params['edit']);
         }
 
         $template = $this->environment->loadTemplate($fieldDescription->getTemplate());