From 2b23473b38641db3b3269ffe6bbe52fd785ce082 Mon Sep 17 00:00:00 2001 From: "sourcery-ai[bot]" Date: Mon, 25 Nov 2024 08:53:48 +0000 Subject: [PATCH 1/6] 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 --- README.rst | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/README.rst b/README.rst index e2d425b2..3bd5ff5d 100644 --- a/README.rst +++ b/README.rst @@ -30,9 +30,70 @@ Run:: python manage.py migrate djangocms_moderation +REPLACE 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. + * - ``CMS_MODERATION_COMPLIANCE_NUMBER_BACKENDS`` + - List of available compliance number backend classes. + * - ``CMS_MODERATION_ENABLE_WORKFLOW_OVERRIDE`` + - Enable/disable workflow override functionality. + * - ``CMS_MODERATION_DEFAULT_CONFIRMATION_PAGE_TEMPLATE`` + - Default template for confirmation pages. + * - ``CMS_MODERATION_CONFIRMATION_PAGE_TEMPLATES`` + - List of available confirmation page templates. + * - ``CMS_MODERATION_COLLECTION_COMMENTS_ENABLED`` + - Enable/disable comments on collections. + * - ``CMS_MODERATION_REQUEST_COMMENTS_ENABLED`` + - Enable/disable comments on requests. + * - ``CMS_MODERATION_COLLECTION_NAME_LENGTH_LIMIT`` + - Maximum length for collection names. + * - ``EMAIL_NOTIFICATIONS_FAIL_SILENTLY`` + - Control email notification error handling. + +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 +============ +======= ============= We maintain documentation under ``docs`` folder using rst format. HTML documentation can be generated using the following commands From e12d8a1361b586b947d102b7130cfee23d96acf4 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 25 Nov 2024 10:27:03 +0100 Subject: [PATCH 2/6] Update README.rst --- README.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 3bd5ff5d..19a6e81a 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ REPLACE 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: @@ -64,7 +64,7 @@ The following settings can be added to your project's settings file to configure - Control email notification error handling. Example Configuration -------------------- +--------------------- Add these settings to your project's settings file: @@ -90,10 +90,7 @@ Add these settings to your project's settings file: EMAIL_NOTIFICATIONS_FAIL_SILENTLY = False ============= -======= Documentation -============ -======= ============= We maintain documentation under ``docs`` folder using rst format. HTML documentation can be generated using the following commands From c5249ba063378fa7a7799c5f3a584e8fcd68330f Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 25 Nov 2024 10:29:18 +0100 Subject: [PATCH 3/6] Update README.rst --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 19a6e81a..a91d58db 100644 --- a/README.rst +++ b/README.rst @@ -72,20 +72,20 @@ Add these settings to your project's settings file: # 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 From bdeb987e8b223670903550731c92b11e54b7f6f8 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 25 Nov 2024 10:39:07 +0100 Subject: [PATCH 4/6] Add defaults --- CHANGELOG.rst | 1 + README.rst | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c5df6e12..1d7eabb0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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) ================== diff --git a/README.rst b/README.rst index a91d58db..cd54cd84 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,6 @@ Run:: python manage.py migrate djangocms_moderation -REPLACE to perform the application's database migrations. Configuration @@ -46,22 +45,28 @@ The following settings can be added to your project's settings file to configure - 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. + - Enable/disable workflow override functionality. Defaults to ``False``. * - ``CMS_MODERATION_DEFAULT_CONFIRMATION_PAGE_TEMPLATE`` - - Default template for confirmation pages. + - Default template for confirmation pages. Defaults to + ``djangocms_moderation/moderation_confirmation.html`` * - ``CMS_MODERATION_CONFIRMATION_PAGE_TEMPLATES`` - - List of available 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. + - Enable/disable comments on collections. Defaults to ``True``. * - ``CMS_MODERATION_REQUEST_COMMENTS_ENABLED`` - - Enable/disable comments on requests. + - Enable/disable comments on requests. Defaults to ``True``. * - ``CMS_MODERATION_COLLECTION_NAME_LENGTH_LIMIT`` - - Maximum length for collection names. + - Maximum length for collection names. Defaults to ``24``. * - ``EMAIL_NOTIFICATIONS_FAIL_SILENTLY`` - - Control email notification error handling. + - Control email notification error handling. Defaults to ``False``. Example Configuration --------------------- From 13c0d369eb2ce7a3f9f0e7ed10643ebb2b47bb0b Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 25 Nov 2024 10:40:41 +0100 Subject: [PATCH 5/6] Fix formatting --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index cd54cd84..21421ca7 100644 --- a/README.rst +++ b/README.rst @@ -23,8 +23,8 @@ Run:: Add the following to your project's ``INSTALLED_APPS``: - - ``'djangocms_moderation'`` - - ``'adminsortable2'`` +- ``'djangocms_moderation'`` +- ``'adminsortable2'`` Run:: From 3637bc05ae38bd28ada5c68867b5083d9a0e32f1 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 25 Nov 2024 10:43:36 +0100 Subject: [PATCH 6/6] Fix typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 21421ca7..93572458 100644 --- a/README.rst +++ b/README.rst @@ -58,7 +58,7 @@ The following settings can be added to your project's settings file to configure ``djangocms_moderation/moderation_confirmation.html`` * - ``CMS_MODERATION_CONFIRMATION_PAGE_TEMPLATES`` - List of available confirmation page templates. Only includes the - default template by defaut. + default template by default. * - ``CMS_MODERATION_COLLECTION_COMMENTS_ENABLED`` - Enable/disable comments on collections. Defaults to ``True``. * - ``CMS_MODERATION_REQUEST_COMMENTS_ENABLED``