Parcourir la source

Fix some rst docs (#3797)

Oskar Stark il y a 9 ans
Parent
commit
2d51e49bb3

+ 2 - 4
Resources/doc/getting_started/creating_an_admin.rst

@@ -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
@@ -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, ~]

+ 7 - 6
Resources/doc/getting_started/the_form_view.rst

@@ -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, ~]
@@ -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:
 
@@ -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
 

+ 17 - 17
Resources/doc/reference/action_create_edit.rst

@@ -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
 ~~~~~~~~~~~~~~~~~
@@ -55,10 +56,8 @@ To specify options, do as follows:
                         'description' => 'Lorem ipsum',
                         // ...
                     ))
-                    ->add('title')
-
-                    // ...
-
+                        ->add('title')
+                        // ...
                     ->end()
                 ->end()
             ;
@@ -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

+ 6 - 6
Resources/doc/reference/action_delete.rst

@@ -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

+ 7 - 9
Resources/doc/reference/action_export.rst

@@ -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

+ 12 - 10
Resources/doc/reference/action_list.rst

@@ -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
 -------------------------------------------------
@@ -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
 -------
@@ -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
 --------------------

+ 9 - 10
Resources/doc/reference/action_show.rst

@@ -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
 ~~~~~~~~~~~~~
@@ -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()
             ;

+ 2 - 2
Resources/doc/reference/architecture.rst

@@ -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
@@ -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