Skip to content

Commit

Permalink
Fix some rst docs (sonata-project#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and soullivaneuh committed May 13, 2016
1 parent e2af4ea commit 2d51e49
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 64 deletions.
6 changes: 2 additions & 4 deletions Resources/doc/getting_started/creating_an_admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ After this, you'll need to tweak the entities a bit:
// ...
}
.. code-block:: php
Set the default value to ``false``.

.. code-block:: php
Expand Down Expand Up @@ -179,9 +177,9 @@ service and tag it with the ``sonata.admin`` tag:
.. code-block:: yaml
# app/config/services.yml
# ...
services:
# ...
admin.category:
class: AppBundle\Admin\CategoryAdmin
arguments: [~, AppBundle\Entity\Category, ~]
Expand Down
13 changes: 7 additions & 6 deletions Resources/doc/getting_started/the_form_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ The same applies to the service definition:
# app/config/services.yml
# ...
services:
# ...
admin.blog_post:
class: AppBundle\Admin\BlogPostAdmin
arguments: [~, AppBundle\Entity\BlogPost, ~]
Expand Down Expand Up @@ -110,7 +108,7 @@ as choice.
}
.. note::

'`property`_' field is not supported by Symfony >= 2.7. You should use `choice_label`_ instead.
The `property`_ option is not supported by Symfony >= 2.7. You should use `choice_label`_ instead.

As each blog post will only have one category, it renders as a select list:

Expand Down Expand Up @@ -236,9 +234,12 @@ successfully created.*
While it's very friendly of the SonataAdminBundle to notify the admin of a
successful creation, the classname and some sort of hash aren't really nice to
read. This is the default string representation of an object in the
SonataAdminBundle. You can change it by defining a ``toString()`` (note: no
underscore prefix) method in the Admin class. This receives the object to
transform to a string as the first parameter:
SonataAdminBundle. You can change it by defining a ``toString()`` method in the
Admin class. This receives the object to transform to a string as the first parameter:

.. note::

No underscore prefix! ``toString()`` is correct!

.. code-block:: php
Expand Down
34 changes: 17 additions & 17 deletions Resources/doc/reference/action_create_edit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ of the fields and forms available in these views and any other relevant settings
Basic configuration
-------------------

To do:
.. note::

- global (yml) options that affect the create and edit actions
- a note about Routes and how disabling them disables the related action
- using configureFormFields() to set which fields to display
- options available when adding fields, inc custom templates
- link to the field_types document for more details about specific field types
**TODO**:
* global (yml) options that affect the create and edit actions
* a note about Routes and how disabling them disables the related action
* using configureFormFields() to set which fields to display
* options available when adding fields, inc custom templates
* link to the field_types document for more details about specific field types

FormGroup options
~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -55,10 +56,8 @@ To specify options, do as follows:
'description' => 'Lorem ipsum',
// ...
))
->add('title')
// ...
->add('title')
// ...
->end()
->end()
;
Expand All @@ -74,18 +73,19 @@ Here is an example of what you can do with customizing the box_class on a group
Embedding other Admins
----------------------

To do:

- how to embed one Admin in another (1:1, 1:M, M:M)
- how to access the right object(s) from the embedded Admin's code
.. note::

**TODO**:
* how to embed one Admin in another (1:1, 1:M, M:M)
* how to access the right object(s) from the embedded Admin's code

Customizing just one of the actions
-----------------------------------

To do:
.. note::

- how to create settings/fields that appear on just one of the create/edit views
and any controller changes needed to manage them
**TODO**:
* how to create settings/fields that appear on just one of the create/edit views
* and any controller changes needed to manage them

.. _`issues on GitHub`: https://github.com/sonata-project/SonataAdminBundle/issues/1519
12 changes: 6 additions & 6 deletions Resources/doc/reference/action_delete.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Deleting objects

This document will cover the Delete action and any related configuration options.


Basic configuration
-------------------

To do:
.. note::

- global (yml) options that affect the delete action
- a note about Routes and how disabling them disables the related action
- any Admin configuration options that affect delete
- a note about lifecycle events triggered by delete?
**TODO**:
* global (yml) options that affect the delete action
* a note about Routes and how disabling them disables the related action
* any Admin configuration options that affect delete
* a note about lifecycle events triggered by delete?

.. _`issues on Github`: https://github.com/sonata-project/SonataAdminBundle/issues/1519
16 changes: 7 additions & 9 deletions Resources/doc/reference/action_export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ The Export action

This document will cover the Export action and related configuration options.


Basic configuration
-------------------

To do:

- any global (yml) options that affect the export actions
- how to disable (some of) the default formats
- how to add new export formats
- customising the templates used to render the output
- customising the query used to fetch the results

.. note::

**TODO**:
* any global (yml) options that affect the export actions
* how to disable (some of) the default formats
* how to add new export formats
* customising the templates used to render the output
* customising the query used to fetch the results

.. _`issues on Github`: https://github.com/sonata-project/SonataAdminBundle/issues/1519
22 changes: 12 additions & 10 deletions Resources/doc/reference/action_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ SonataAdmin Options that may affect the list view:
pager_results: SonataAdminBundle:Pager:results.html.twig
To do:
.. note::

- a note about Routes and how disabling them disables the related action
- adding custom columns
**TODO**:
* a note about Routes and how disabling them disables the related action
* adding custom columns

Customizing the fields displayed on the list page
-------------------------------------------------
Expand Down Expand Up @@ -230,11 +231,11 @@ the ``datagridValues`` array property. All three keys ``_page``, ``_sort_order``
.. note::

The '_sort_by' key can be of the form ``mySubModel.mySubSubModel.myField``.
The ``_sort_by`` key can be of the form ``mySubModel.mySubSubModel.myField``.

To do:
.. note::

- how to sort by multiple fields (this might be a separate recipe?)
**TODO**: how to sort by multiple fields (this might be a separate recipe?)

Filters
-------
Expand Down Expand Up @@ -504,11 +505,12 @@ You can also get the filter type which can be helpful to change the operator typ
}
}
To do:
.. note::

- basic filter configuration and options
- targeting submodel fields using dot-separated notation
- advanced filter options (global_search)
**TODO**:
* basic filter configuration and options
* targeting submodel fields using dot-separated notation
* advanced filter options (global_search)

Visual configuration
--------------------
Expand Down
19 changes: 9 additions & 10 deletions Resources/doc/reference/action_show.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ This document will cover the Show action and related configuration options.
Basic configuration
-------------------

To do:
.. note::

- a note about Routes and how disabling them disables the related action
- a note about lifecycle events triggered by delete?
- options available when adding general fields, inc custom templates
- targeting submodel fields using dot-separated notation
- (Note, if this is very similar to the form documentation it can be combined)
**TODO**:
* a note about Routes and how disabling them disables the related action
* a note about lifecycle events triggered by delete?
* options available when adding general fields, inc custom templates
* targeting submodel fields using dot-separated notation
* (Note, if this is very similar to the form documentation it can be combined)

Group options
~~~~~~~~~~~~~
Expand Down Expand Up @@ -50,10 +51,8 @@ To specify options, do as follow:
'box_class' => 'box box-solid box-danger',
'description' => 'Lorem ipsum',
))
->add('title')
// ...
->add('title')
// ...
->end()
->end()
;
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/reference/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ or how to build the list view. Inside the ``CRUDController``, you can access the

.. note::

`CRUD is an acronym`_ for "Create, Read, Update and Delete"
`CRUD`_ is an acronym for "Create, Read, Update and Delete"

The ``CRUDController`` is no different from any other Symfony controller, meaning
that you have all the usual options available to you, like getting services from
Expand Down Expand Up @@ -357,4 +357,4 @@ Then, you have to set the CommentAdmin ``parentAssociationMapping`` attribute to
It also possible to set a dot-separated value, like ``post.author``, if your parent and child admins are not directly related.

.. _`Django Project Website`: http://www.djangoproject.com/
.. _`CRUD is an acronym`: http://en.wikipedia.org/wiki/CRUD
.. _`CRUD`: http://en.wikipedia.org/wiki/CRUD

0 comments on commit 2d51e49

Please sign in to comment.