Explorar o código

Merge remote branch 'origin/2.0'

Conflicts:
	Resources/doc/reference/templates.rst
	Resources/public/css/layout.css
	Resources/views/CRUD/base_edit.html.twig
	Resources/views/CRUD/base_edit_form.html.twig
	Resources/views/standard_layout.html.twig
Thomas Rabaix %!s(int64=13) %!d(string=hai) anos
pai
achega
ff1c009da8

+ 8 - 0
Form/Type/BooleanType.php

@@ -46,4 +46,12 @@ class BooleanType extends FormChoiceType
             )
         ));
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'sonata_type_boolean';
+    }
 }

+ 8 - 0
Form/Type/EqualType.php

@@ -46,4 +46,12 @@ class EqualType extends FormChoiceType
             )
         ));
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'sonata_type_equal';
+    }
 }

+ 8 - 0
Form/Type/TranslatableChoiceType.php

@@ -81,4 +81,12 @@ class TranslatableChoiceType extends ChoiceType
 
         parent::buildForm($builder, $options);
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'sonata_type_translatable_choice';
+    }
 }

+ 1 - 1
Resources/public/css/layout.css

@@ -301,4 +301,4 @@ legend + .sonata-ba-collapsed-fields {
 
 .sonata-bc .pagination {
     margin: 0px;
-}
+}

+ 13 - 0
Resources/translations/SonataAdminBundle.nl.xliff

@@ -334,6 +334,19 @@
                 <source>btn_preview_decline</source>
                 <target>Afkeuren</target>
             </trans-unit>
+
+            <trans-unit id="btn_preview">
+                <source>btn_preview</source>
+                <target>Voorvertoning</target>
+            </trans-unit>
+            <trans-unit id="btn_preview_approve">
+                <source>btn_preview_approve</source>
+                <target>Goedkeuren</target>
+            </trans-unit>
+            <trans-unit id="btn_preview_decline">
+                <source>btn_preview_decline</source>
+                <target>Afkeuren</target>
+            </trans-unit>
         </body>
     </file>
 </xliff>

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

@@ -44,8 +44,8 @@ file that was distributed with this source code.
 
                 {% for field_name in view_group.fields %}
                     <tr class="sonata-ba-view-container">
-                        {% if admin.show[field_name] is defined %}
-                            {{ admin.show[field_name]|render_view_element(object) }}
+                        {% if elements[field_name] is defined %}
+                            {{ elements[field_name]|render_view_element(object) }}
                         {% endif %}
                     </tr>
                 {% endfor %}

+ 26 - 5
Resources/views/standard_layout.html.twig

@@ -28,12 +28,12 @@ file that was distributed with this source code.
             <!-- jQuery code -->
             <link rel="stylesheet" href="{{ asset('bundles/sonatajquery/themes/flick/jquery-ui-1.8.16.custom.css') }}" type="text/css" media="all" />
 
-            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/css/bootstrap.min.css') }}" type="text/css" media="all" >
-            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/css/bootstrap-responsive.min.css') }}" type="text/css" media="all" >
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/css/bootstrap.min.css') }}" type="text/css" media="all"  />
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/bootstrap/css/bootstrap-responsive.min.css') }}" type="text/css" media="all" />
 
             <!-- base application asset -->
-            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/layout.css') }}" type="text/css" media="all">
-            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/colors.css') }}" type="text/css" media="all">
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/layout.css') }}" type="text/css" media="all" />
+            <link rel="stylesheet" href="{{ asset('bundles/sonataadmin/css/colors.css') }}" type="text/css" media="all" />
         {% endblock %}
 
         {% block javascripts %}
@@ -87,9 +87,10 @@ file that was distributed with this source code.
                                 {{ admin_pool.title }}
                             </a>
                         {% endblock %}
-                    
+
                         <div class="nav-collapse">
                             <ul class="nav">
+<<<<<<< HEAD
                                 {% block top_bar_before_nav %} {% endblock %}
                                 {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
                                     {% for group in admin_pool.dashboardgroups %}
@@ -106,6 +107,26 @@ file that was distributed with this source code.
                                     {% endfor %}
                                 {% endif %}
                                 {% block top_bar_after_nav %} {% endblock %}
+=======
+
+                                {% block sonata_top_bar_nav %}
+                                    {# There is no hasRole in a TokenInterface ... #}
+                                    {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+                                        {% for group in admin_pool.dashboardgroups %}
+                                            <li class="dropdown">
+                                                <a href="#" class="dropdown-toggle">{{ group.label|trans({}, group.label_catalogue) }}</a>
+                                                <ul class="dropdown-menu">
+                                                    {% for admin in group.items %}
+                                                        {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                            <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                        {% endif %}
+                                                    {% endfor %}
+                                                </ul>
+                                            </li>
+                                        {% endfor %}
+                                    {% endif %}
+                                {% endblock %}
+>>>>>>> origin/2.0
                             </ul>
                         </div>
                     {% endif %}

+ 1 - 1
Validator/InlineValidator.php

@@ -56,6 +56,6 @@ class InlineValidator extends ConstraintValidator
 
         call_user_func($function, $errorElement, $value);
 
-        return count($this->context->getViolations()) == 0;
+        return true;
     }
 }