Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Configuration' section to README for moderation app settings #293

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
63 changes: 63 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,69 @@ Run::

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::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sourcery-ai Can you add the defaults and the selection of available compliance backends?

: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 defaut.
* - ``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
Loading