Skip to content

Commit

Permalink
Add 'Configuration' section to README for moderation app settings (#293)
Browse files Browse the repository at this point in the history
* Add 'Configuration' section to README for moderation app settings

Documentation:
- Add a new 'Configuration' section in the README to document various settings of the moderation application.

Resolves #20

* Update README.rst

* Update README.rst

* Add defaults

* Fix formatting

* Fix typo

---------

Co-authored-by: sourcery-ai[bot] <sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Fabian Braun <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 2702238 commit a448e16
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unreleased
fix: Add data-popup attr to a tag in burger menu item
fix: Replace SortableAdminMixin by SortableAdminBase for WorkflowAdmin
fix: Restore "In Collection" button in the toolbar
fix: Update README.rst and add overview of settings

2.2.1 (2024-07-02)
==================
Expand Down
67 changes: 65 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,78 @@ Run::

Add the following to your project's ``INSTALLED_APPS``:

- ``'djangocms_moderation'``
- ``'adminsortable2'``
- ``'djangocms_moderation'``
- ``'adminsortable2'``

Run::

python manage.py migrate djangocms_moderation

to perform the application's database migrations.

Configuration
=============

The following settings can be added to your project's settings file to configure django CMS Moderation's behavior:

.. list-table::
:header-rows: 1
:widths: 50 50

* - Setting
- Description
* - ``CMS_MODERATION_DEFAULT_COMPLIANCE_NUMBER_BACKEND``
- Default backend class for generating compliance numbers.
Default is ``djangocms_moderation.backends.uuid4_backend``.
* - ``CMS_MODERATION_COMPLIANCE_NUMBER_BACKENDS``
- List of available compliance number backend classes.
By default, three backends are configured: ``uuid4_backend``,
``sequential_number_backend``, and
``sequential_number_with_identifier_prefix_backend``.
* - ``CMS_MODERATION_ENABLE_WORKFLOW_OVERRIDE``
- Enable/disable workflow override functionality. Defaults to ``False``.
* - ``CMS_MODERATION_DEFAULT_CONFIRMATION_PAGE_TEMPLATE``
- Default template for confirmation pages. Defaults to
``djangocms_moderation/moderation_confirmation.html``
* - ``CMS_MODERATION_CONFIRMATION_PAGE_TEMPLATES``
- List of available confirmation page templates. Only includes the
default template by default.
* - ``CMS_MODERATION_COLLECTION_COMMENTS_ENABLED``
- Enable/disable comments on collections. Defaults to ``True``.
* - ``CMS_MODERATION_REQUEST_COMMENTS_ENABLED``
- Enable/disable comments on requests. Defaults to ``True``.
* - ``CMS_MODERATION_COLLECTION_NAME_LENGTH_LIMIT``
- Maximum length for collection names. Defaults to ``24``.
* - ``EMAIL_NOTIFICATIONS_FAIL_SILENTLY``
- Control email notification error handling. Defaults to ``False``.

Example Configuration
---------------------

Add these settings to your project's settings file:

.. code-block:: python
# Custom compliance number backend
CMS_MODERATION_DEFAULT_COMPLIANCE_NUMBER_BACKEND = 'myapp.backends.CustomComplianceNumberBackend'
# Enable workflow override
CMS_MODERATION_ENABLE_WORKFLOW_OVERRIDE = True
# Custom confirmation template
CMS_MODERATION_DEFAULT_CONFIRMATION_PAGE_TEMPLATE = 'custom_confirmation.html'
# Enable comments
CMS_MODERATION_COLLECTION_COMMENTS_ENABLED = True
CMS_MODERATION_REQUEST_COMMENTS_ENABLED = True
# Set collection name length limit
CMS_MODERATION_COLLECTION_NAME_LENGTH_LIMIT = 100
# Control email notification errors
EMAIL_NOTIFICATIONS_FAIL_SILENTLY = False
=============
Documentation
=============

Expand Down

0 comments on commit a448e16

Please sign in to comment.