Переглянути джерело

Merge branch 'master' of github.com:sonata-project/SonataAdminBundle into date_filters

Pat Haggerty 13 роки тому
батько
коміт
9f577ab43d

+ 8 - 0
Admin/Admin.php

@@ -1127,6 +1127,14 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         return $this->list;
         return $this->list;
     }
     }
 
 
+    /**
+     * @return \Sonata\AdminBundle\Datagrid\ProxyQueryInterface
+     */
+    public function createQuery($context = 'list')
+    {
+        return $this->modelManager->createQuery($this->class);
+    }
+
     /**
     /**
      * Returns a list depend on the given $object
      * Returns a list depend on the given $object
      *
      *

+ 6 - 1
Admin/AdminInterface.php

@@ -113,6 +113,12 @@ interface AdminInterface
      */
      */
     function getModelManager();
     function getModelManager();
 
 
+    /**
+     * @abstract
+     * @return \Sonata\AdminBundle\Datagrid\ProxyQueryInterface
+     */
+    function createQuery($context = 'list');
+
     /**
     /**
      *
      *
      * @return \Symfony\Component\Form\FormBuilder the form builder
      * @return \Symfony\Component\Form\FormBuilder the form builder
@@ -197,7 +203,6 @@ interface AdminInterface
      */
      */
     function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);
     function addFilterFieldDescription($name, FieldDescriptionInterface $fieldDescription);
 
 
-
     /**
     /**
      * Returns a list depend on the given $object
      * Returns a list depend on the given $object
      *
      *

+ 6 - 0
Resources/public/css/colors.css

@@ -3,6 +3,12 @@ table.sonata-ba-list th {
     background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f8f8f8), to(#e2e2e2));
     background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f8f8f8), to(#e2e2e2));
 }
 }
 
 
+table.sonata-ba-list tfoot td {
+    background-image: -moz-linear-gradient(-90deg, #f8f8f8 , #e2e2e2);
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f8f8f8), to(#e2e2e2));
+    border-top: 1px solid #DDD;
+}
+
 /* Form */
 /* Form */
 textarea.title {
 textarea.title {
     font-size: 1em;
     font-size: 1em;

+ 15 - 0
Resources/views/CRUD/list_trans.html.twig

@@ -0,0 +1,15 @@
+{#
+
+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.
+
+#}
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
+
+{% block field%}
+    {{value|trans({}, field_description.options.catalogue)}}
+{% endblock %}

+ 15 - 0
Resources/views/CRUD/show_trans.html.twig

@@ -0,0 +1,15 @@
+{#
+
+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.
+
+#}
+{% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
+
+{% block field%}
+    {{value|trans({}, field_description.options.catalogue)}}
+{% endblock %}