From 481f61844aace73f677d556785f0f76fab0dcbd7 Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Mon, 15 May 2017 22:41:03 +0200 Subject: [PATCH] more on docs --- .../apps/mezzanine_integration/README.rst | 23 ++--- .../content/content_image/README.rst | 42 ++++---- .../content/content_text/README.rst | 96 +++++++++---------- .../content/content_video/README.rst | 40 ++++---- .../form_elements/fields/boolean/README.rst | 30 +++--- .../checkbox_select_multiple/README.rst | 69 ++++++------- 6 files changed, 149 insertions(+), 151 deletions(-) diff --git a/src/fobi/contrib/apps/mezzanine_integration/README.rst b/src/fobi/contrib/apps/mezzanine_integration/README.rst index 9585b841..fe17fa5b 100644 --- a/src/fobi/contrib/apps/mezzanine_integration/README.rst +++ b/src/fobi/contrib/apps/mezzanine_integration/README.rst @@ -1,16 +1,16 @@ fobi.contrib.apps.mezzanine_integration -======================================= +--------------------------------------- A ``django-fobi`` integration with Mezzanine. Installation ------------- +~~~~~~~~~~~~ Versions -~~~~~~~~ +######## See the `requirements file `_. your_project/settings.py -~~~~~~~~~~~~~~~~~~~~~~~~ +######################## See the `example settings file `_. @@ -24,9 +24,9 @@ See the `example settings file ] Information for developers --------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~ Template rendering -~~~~~~~~~~~~~~~~~~ +################## The form embed into Mezzanine page is rendered with use of two theme templates: - ``view_embed_form_entry_ajax_template``: Used for rendering the form. @@ -34,7 +34,7 @@ The form embed into Mezzanine page is rendered with use of two theme templates: sent event. Using custom templates for rendering the form -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +############################################# In the widget, you can specify a template which you want to be used for rendering the form or the form-sent event. @@ -95,9 +95,9 @@ example below. } Usage ------ +~~~~~ The ``fobi`` page model -~~~~~~~~~~~~~~~~~~~~~~~ +####################### The ``fobi.contrib.apps.mezzanine_integration.models.FobiFormPage`` consists of the following fields: @@ -113,16 +113,13 @@ of the following fields: - Success page text: Overrides the form-sent text. Steps described -~~~~~~~~~~~~~~~ +############### 1. If you use the mezzanine `example `_ project, to start go to the http://localhost:8003/fobi/ URL and create a form. - 2. Then go to http://localhost:8003/admin/pages/page/ and add a new `Fobi form` page. - 3. Choose the form and optionally - override the form settings and then save the page. - 4. See the page in the front-end. diff --git a/src/fobi/contrib/plugins/form_elements/content/content_image/README.rst b/src/fobi/contrib/plugins/form_elements/content/content_image/README.rst index 02f745a8..01e37d9b 100644 --- a/src/fobi/contrib/plugins/form_elements/content/content_image/README.rst +++ b/src/fobi/contrib/plugins/form_elements/content/content_image/README.rst @@ -1,32 +1,32 @@ fobi.contrib.plugins.form_elements.content.content_image -======================================================== +-------------------------------------------------------- A ``Fobi`` Image form element plugin. Installation ------------- -1. Add ``fobi.contrib.plugins.form_elements.content.content_image`` to the - ``INSTALLED_APPS`` in your ``settings.py``. +~~~~~~~~~~~~ +(1) Add ``fobi.contrib.plugins.form_elements.content.content_image`` to the + ``INSTALLED_APPS`` in your ``settings.py``. -.. code-block:: python + .. code-block:: python - INSTALLED_APPS = ( - # ... - 'easy_thumbnails', - 'fobi.contrib.plugins.form_elements.content.content_image', - # ... - ) + INSTALLED_APPS = ( + # ... + 'easy_thumbnails', + 'fobi.contrib.plugins.form_elements.content.content_image', + # ... + ) -2. In the terminal type: +(2) In the terminal type: -.. code-block:: sh + .. code-block:: sh - ./manage.py fobi_sync_plugins + ./manage.py fobi_sync_plugins -3. Assign appropriate permissions to the target users/groups to be using - the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. +(3) Assign appropriate permissions to the target users/groups to be using + the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. -4. Additionally, for the fine tuning, see the - ``fobi.contrib.plugins.form_elements.content.content_image.defaults`` - module. If necessary, override the settings by prepending - ``FOBI_PLUGIN_CONTENT_IMAGE_`` to the desired variable name from the - above mentioned ``defaults`` module. +(4) Additionally, for the fine tuning, see the + ``fobi.contrib.plugins.form_elements.content.content_image.defaults`` + module. If necessary, override the settings by prepending + ``FOBI_PLUGIN_CONTENT_IMAGE_`` to the desired variable name from the + above mentioned ``defaults`` module. diff --git a/src/fobi/contrib/plugins/form_elements/content/content_text/README.rst b/src/fobi/contrib/plugins/form_elements/content/content_text/README.rst index e7ba2d3e..97a3e66c 100644 --- a/src/fobi/contrib/plugins/form_elements/content/content_text/README.rst +++ b/src/fobi/contrib/plugins/form_elements/content/content_text/README.rst @@ -1,66 +1,66 @@ fobi.contrib.plugins.form_elements.content.content_text -======================================================= +------------------------------------------------------- A ``Fobi`` Text form element plugin. Installation ------------- -1. Add ``fobi.contrib.plugins.form_elements.content.content_text`` to the - ``INSTALLED_APPS`` in your ``settings.py``. +~~~~~~~~~~~~ +(1) Add ``fobi.contrib.plugins.form_elements.content.content_text`` to the + ``INSTALLED_APPS`` in your ``settings.py``. -.. code-block:: python + .. code-block:: python - INSTALLED_APPS = ( - # ... - 'fobi.contrib.plugins.form_elements.content.content_text', - # ... - ) + INSTALLED_APPS = ( + # ... + 'fobi.contrib.plugins.form_elements.content.content_text', + # ... + ) -2. In the terminal type: +(2) In the terminal type: -.. code-block:: sh + .. code-block:: sh - ./manage.py fobi_sync_plugins + ./manage.py fobi_sync_plugins -3. Assign appropriate permissions to the target users/groups to be using - the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. +(3) Assign appropriate permissions to the target users/groups to be using + the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. -4. Additionally, for the fine tuning, see the - ``fobi.contrib.plugins.form_elements.content.content_text.defaults`` - module. If necessary, override the settings by prepending - ``FOBI_PLUGIN_CONTENT_TEXT_`` to the desired variable name from the - above mentioned ``defaults`` module. +(4) Additionally, for the fine tuning, see the + ``fobi.contrib.plugins.form_elements.content.content_text.defaults`` + module. If necessary, override the settings by prepending + ``FOBI_PLUGIN_CONTENT_TEXT_`` to the desired variable name from the + above mentioned ``defaults`` module. - By default the content of the text field is stripped using either the - awesome `bleach `_ library or if bleach - is not installed just Django's own `strip_tags` function. To configure - the strip (bleach only) behaviour, two settings are introduced: + By default the content of the text field is stripped using either the + awesome `bleach `_ library or if bleach + is not installed just Django's own `strip_tags` function. To configure + the strip (bleach only) behaviour, two settings are introduced: -.. code-block:: text + .. code-block:: text - - ALLOWED_TAGS: - - ALLOWED_ATTRIBUTES: + - ALLOWED_TAGS: + - ALLOWED_ATTRIBUTES: -The default values are: + The default values are: -.. code-block:: python + .. code-block:: python - ALLOWED_TAGS = [ - 'a', - 'abbr', - 'acronym', - 'b', - 'blockquote', - 'code', - 'em', - 'i', - 'li', - 'ol', - 'strong', - 'ul', - ] + ALLOWED_TAGS = [ + 'a', + 'abbr', + 'acronym', + 'b', + 'blockquote', + 'code', + 'em', + 'i', + 'li', + 'ol', + 'strong', + 'ul', + ] - ALLOWED_ATTRIBUTES = { - 'a': ['href', 'title'], - 'abbr': ['title'], - 'acronym': ['title'], - } + ALLOWED_ATTRIBUTES = { + 'a': ['href', 'title'], + 'abbr': ['title'], + 'acronym': ['title'], + } diff --git a/src/fobi/contrib/plugins/form_elements/content/content_video/README.rst b/src/fobi/contrib/plugins/form_elements/content/content_video/README.rst index c011e9ca..e9a60b2c 100644 --- a/src/fobi/contrib/plugins/form_elements/content/content_video/README.rst +++ b/src/fobi/contrib/plugins/form_elements/content/content_video/README.rst @@ -1,31 +1,31 @@ fobi.contrib.plugins.form_elements.content.content_video -======================================================== +-------------------------------------------------------- A ``Fobi`` Video form element plugin. Installation ------------- -1. Add ``fobi.contrib.plugins.form_elements.content.content_video`` to the - ``INSTALLED_APPS`` in your ``settings.py``. +~~~~~~~~~~~~ +(1) Add ``fobi.contrib.plugins.form_elements.content.content_video`` to the + ``INSTALLED_APPS`` in your ``settings.py``. -.. code-block:: python + .. code-block:: python - INSTALLED_APPS = ( - # ... - 'fobi.contrib.plugins.form_elements.content.content_video', - # ... - ) + INSTALLED_APPS = ( + # ... + 'fobi.contrib.plugins.form_elements.content.content_video', + # ... + ) -2. In the terminal type: +(2) In the terminal type: -.. code-block:: sh + .. code-block:: sh - ./manage.py fobi_sync_plugins + ./manage.py fobi_sync_plugins -3. Assign appropriate permissions to the target users/groups to be using - the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. +(3) Assign appropriate permissions to the target users/groups to be using + the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. -4. Additionally, for the fine tuning, see the - ``fobi.contrib.plugins.form_elements.content.content_video.defaults`` - module. If necessary, override the settings by prepending - ``FOBI_PLUGIN_CONTENT_VIDEO_`` to the desired variable name from the - above mentioned ``defaults`` module. +(4) Additionally, for the fine tuning, see the + ``fobi.contrib.plugins.form_elements.content.content_video.defaults`` + module. If necessary, override the settings by prepending + ``FOBI_PLUGIN_CONTENT_VIDEO_`` to the desired variable name from the + above mentioned ``defaults`` module. diff --git a/src/fobi/contrib/plugins/form_elements/fields/boolean/README.rst b/src/fobi/contrib/plugins/form_elements/fields/boolean/README.rst index 7cf7ab43..86231f4f 100644 --- a/src/fobi/contrib/plugins/form_elements/fields/boolean/README.rst +++ b/src/fobi/contrib/plugins/form_elements/fields/boolean/README.rst @@ -1,26 +1,26 @@ fobi.contrib.plugins.form_elements.fields.boolean -================================================= +------------------------------------------------- A ``Fobi`` Boolean form field plugin. Makes use of the ``django.forms.fields.BooleanField``. Installation ------------- -1. Add ``fobi.contrib.plugins.form_elements.fields.boolean`` to the - ``INSTALLED_APPS`` in your ``settings.py``. +~~~~~~~~~~~~ +(1) Add ``fobi.contrib.plugins.form_elements.fields.boolean`` to the + ``INSTALLED_APPS`` in your ``settings.py``. -.. code-block:: python + .. code-block:: python - INSTALLED_APPS = ( - # ... - 'fobi.contrib.plugins.form_elements.fields.boolean', - # ... - ) + INSTALLED_APPS = ( + # ... + 'fobi.contrib.plugins.form_elements.fields.boolean', + # ... + ) -2. In the terminal type: +(2) In the terminal type: -.. code-block:: sh + .. code-block:: sh - ./manage.py fobi_sync_plugins + ./manage.py fobi_sync_plugins -3. Assign appropriate permissions to the target users/groups to be using - the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. +(3) Assign appropriate permissions to the target users/groups to be using + the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. diff --git a/src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple/README.rst b/src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple/README.rst index 3d9fb282..6242c4d5 100644 --- a/src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple/README.rst +++ b/src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple/README.rst @@ -1,57 +1,58 @@ fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple -================================================================== +------------------------------------------------------------------ A ``Fobi`` Select Multiple form field plugin. Makes use of the ``django.forms.fields.MultipleChoiceField`` and ``django.forms.widgets.CheckboxSelectMultiple``. Installation ------------- -1. Add ``fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple`` - to the ``INSTALLED_APPS`` in your ``settings.py``. +~~~~~~~~~~~~ +(1) Add ``fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple`` + to the ``INSTALLED_APPS`` in your ``settings.py``. -.. code-block:: python + .. code-block:: python - INSTALLED_APPS = ( - # ... - 'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple', - # ... - ) + INSTALLED_APPS = ( + # ... + 'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple', + # ... + ) -2. In the terminal type: +(2) In the terminal type: -.. code-block:: sh + .. code-block:: sh - ./manage.py fobi_sync_plugins + ./manage.py fobi_sync_plugins -3. Assign appropriate permissions to the target users/groups to be using - the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. +(3) Assign appropriate permissions to the target users/groups to be using + the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True. -4. By default, the submitted form value of `select_multiple` - elements is label (human readable representation of the value chosen). - However, that part of the behaviour has been made configurable. You can - choose between the following options: +(4) By default, the submitted form value of `select_multiple` + elements is label (human readable representation of the value chosen). + However, that part of the behaviour has been made configurable. You can + choose between the following options: - Consider the following list of (value, label) choices (the first element in - the tuple is value, the second element is label): + Consider the following list of (value, label) choices (the first element in + the tuple is value, the second element is label): - .. code-block:: python + .. code-block:: python - [ - ('alpha', 'Alpha'), - ('beta', 'Beta'), - ('gamma', 'Gamma'), - ] + [ + ('alpha', 'Alpha'), + ('beta', 'Beta'), + ('gamma', 'Gamma'), + ] - - "val": `value` (example: "alpha"). - - "repr" (default): `label` (example: "Alpha"). - - "mix": `value (label)` (example: "Alpha (alpha)"). + - "val": `value` (example: "alpha"). + - "repr" (default): `label` (example: "Alpha"). + - "mix": `value (label)` (example: "Alpha (alpha)"). - Simply set the - ``FOBI_FORM_ELEMENT_CHECKBOX_SELECT_MULTIPLE_SUBMIT_VALUE_AS`` assign one of - the following values: "val", "repr" or "mix" to get the desired behaviour. + Simply set the + ``FOBI_FORM_ELEMENT_CHECKBOX_SELECT_MULTIPLE_SUBMIT_VALUE_AS`` assign one + of the following values: "val", "repr" or "mix" to get the desired + behaviour. Usage ------ +~~~~~ You should be entering a single choice per line. Choice might consist of just a single value or value/label pair.