Sfoglia il codice sorgente

Update documentation

Thomas Rabaix 13 anni fa
parent
commit
6a541ae401
3 ha cambiato i file con 108 aggiunte e 58 eliminazioni
  1. 36 25
      CHANGES
  2. 46 22
      Resources/doc/reference/dashboard.rst
  3. 26 11
      Resources/doc/reference/getting_started.rst

+ 36 - 25
CHANGES

@@ -1,64 +1,75 @@
-07/03/2012
-----------
+CHANGELOG
+=========
 
-* Extension : refactor the AdminExtensionInterface to use the proper AdminInterface, add a new configureQuery method
+### 2012-03-07
+
+* [BC BREAK] Extension : refactor the AdminExtensionInterface to use the proper AdminInterface, add a new configureQuery method
+* Add export to xls format (html file)
+
+### 2012-03-01
+
+* [BC BREAK] Introduce Block Into the Admin Bundle
+  The AdminBundle has now a dependency to BlockBundle : http://github.com/sonata-project/SonataBlockBundle
+  The dashboard list is now a block, so it can be removed from the sonata_admin configuration.
+  More blocks can be created please follow the instruction here : http://sonata-project.org/bundles/block/master/doc/reference/your_first_block.html
+
+* [BC BREAK] New configuration format for the dasboard section.
+
+### 2012-02-28
+
+* Add export feature to csv, xml, json
+  The AdminBundle has now a new dependency to exporter : https://github.com/sonata-project/exporter
+
+### 2011-09-04
 
-04/09/2011
-----------
 * Add a delete option on widget with edit = list
 * Refactoring the Menu/Breadcrumb management due to a change in the KnpLab Menu lib
 
-03/08/2011
-----------
+### 2011-08-03
+
 * remove property definitions
 * add TypeGuesser for list/show/filter
 * refactor [Form|List|Filter|Show]|Mapper to match the Symfony2 Form API
 * add theme form definition from within the Admin class - default : SonataAdminBundle:Form:admin_fields.html.twig
-* add new twig bloc type names to allows custom widget layouts per admin
+* add new twig block type names to allows custom widget layouts per admin
 * add show
 
-01/04/2011
-----------
+### 2011-04-01
+
 * migrate to the new form framework
 
-03/03/2011
-----------
+### 2011-03-03
+
 * add sortable option
 
- 08/02/2011
-----------
+### 2011-02-08
+
 * add prototype for nested admin
 
-07/02/2011
-----------
+### 2011-02-07
 
 * refactor code to use builder (FormBuilder, DatagradBuilder, FilterBuilder)
 
-02/02/2011
-----------
+### 2011-02-02
 
 * starting to use the form.field_factory service
 * update code to integrate the last symfony changes
 
- 24/01/2011
-----------
+### 2011-01-24
 
 * add list mode
 * add 'add_empty' option to association widget (ie: select)
 * add country field type
 * refactor the form creation
 
-18/01/2011
-----------
+### 18/01/2011
 
 * respect symfony conventions
 * add new base edit template (standard and inline)
 * admin instances are not singletons anymore
 * add inline edition
 
-
-15/01/2011
-----------
+### 15/01/2011
 
 * respect symfony conventions
 * add a FieldDescription

+ 46 - 22
Resources/doc/reference/dashboard.rst

@@ -1,8 +1,10 @@
 Dashboard
 =========
 
-The dashboard is the main landing page. By default the dashboard lists the
-different admin areas available.
+The dashboard is the main landing page. By default the dashboard lists the different admin areas available.
+The admin list is a block defined by the ``sonata.admin.block.admin_list`` service. More block can be added, just
+follow the instruction in the `BlockBundle documentation <http://sonata-project.org/bundles/block/master/doc/index.html>`_.
+
 If you want to customize the dashboard, add the following code to your
 application's config file:
 
@@ -10,8 +12,13 @@ application's config file:
 
     # app/config/config.yml
     sonata_admin:
-        dashboard_groups:
-            ... your config ...
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        dashboard
+            groups:
+                ... your config ...
 
 
 Examples
@@ -24,10 +31,15 @@ Set the label group & add all the default items
 
     # app/config/config.yml
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                label: Page
-                items: ~
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    label: Page
+                    items: ~
 
 Set items group
 ^^^^^^^^^^^^^^^
@@ -36,10 +48,15 @@ Set items group
 
     # app/config/config.yml
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                items:
-                    - sonata.page.admin.page
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    items:
+                        - sonata.page.admin.page
 
 Add a group with all the default items
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -48,8 +65,13 @@ Add a group with all the default items
 
     # app/config/config.yml
     sonata_admin:
-        dashboard_groups:
-            sonata_page: ~
+        dashboard
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page: ~
 
 Add some items to a group
 ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -58,14 +80,16 @@ Add some items to a group
 
     # app/config/config.yml
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                item_adds:
-                    - sonata.page.admin.myitem1
-                    - sonata.page.admin.myitem2
-
-
-
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    item_adds:
+                        - sonata.page.admin.myitem1
+                        - sonata.page.admin.myitem2
 
 
 .. image:: ../images/dashboard.png

+ 26 - 11
Resources/doc/reference/getting_started.rst

@@ -69,15 +69,15 @@ the Sonata\AdminBundle\Admin\Admin class. Here is a simple example from the
 SonataNewsBundle:
 
 .. code-block:: php
-   
+
    namespace Sonata\NewsBundle\Admin;
-   
+
    use Sonata\AdminBundle\Admin\Admin;
    use Sonata\AdminBundle\Datagrid\ListMapper;
    use Sonata\AdminBundle\Datagrid\DatagridMapper;
    use Sonata\AdminBundle\Validator\ErrorElement;
    use Sonata\AdminBundle\Form\FormMapper;
-   
+
    class TagAdmin extends Admin
    {
        protected function configureFormFields(FormMapper $formMapper)
@@ -163,22 +163,37 @@ and change them according to your requirements:
             list:    SonataAdminBundle:CRUD:list.html.twig
             show:    SonataAdminBundle:CRUD:show.html.twig
             edit:    SonataAdminBundle:CRUD:edit.html.twig
-        dashboard_groups:
-            default: ~
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                default: ~
 
 
 Linking the admin class to the dashboard is done automatically because of the
 default option you defined above:
 
-    dashboard_groups:
-        default: ~
+    dashboard
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        groups:
+            default: ~
 
 However you can define only admin groups you want to show in the dashboard by:
 
-    dashboard_groups:
-        sonata_page:
-            label: Page
-            items: ~
+    dashboard
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        groups:
+            sonata_page:
+                label: Page
+                items: ~
 
 More information can be found in the configuration chapter of this documentation.