Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rabaix committed Mar 7, 2012
1 parent 309d399 commit 6a541ae
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 58 deletions.
61 changes: 36 additions & 25 deletions CHANGES → CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
68 changes: 46 additions & 22 deletions Resources/doc/reference/dashboard.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
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:

.. code-block:: yaml
# 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
Expand All @@ -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
^^^^^^^^^^^^^^^
Expand All @@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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
Expand Down
37 changes: 26 additions & 11 deletions Resources/doc/reference/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 6a541ae

Please sign in to comment.