diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3f5614e..e99f5e66 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,13 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.19.0 hooks: - id: pyupgrade args: ["--py310-plus"] - repo: https://github.com/adamchainz/django-upgrade - rev: '1.21.0' + rev: '1.22.1' hooks: - id: django-upgrade args: [--target-version, "4.0"] diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1dcb1832..88720e5f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,13 +2,12 @@ Changelog ========= -Unreleased -========== - 2.2.2 (2024-11-07) ================== +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 e2d425b2..93572458 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:: @@ -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:: + :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 ============= diff --git a/djangocms_moderation/static/djangocms_moderation/js/burger.js b/djangocms_moderation/static/djangocms_moderation/js/burger.js index 3fbcdf9e..93efd262 100644 --- a/djangocms_moderation/static/djangocms_moderation/js/burger.js +++ b/djangocms_moderation/static/djangocms_moderation/js/burger.js @@ -147,6 +147,7 @@ let li_anchor = document.createElement('a'); const itemId = $(item).attr('id'); const itemTarget = $(item).attr('target'); + const itemDataPopup = $(item).attr('data-popup'); li_anchor.setAttribute('class', 'cms-actions-dropdown-menu-item-anchor'); li_anchor.setAttribute('href', $(item).attr('href')); @@ -158,6 +159,10 @@ if (itemTarget !== undefined) { li_anchor.setAttribute('target', itemTarget); } + // Copy the data-popup attribute if it is set + if (itemDataPopup !== undefined) { + li_anchor.setAttribute('data-popup', itemDataPopup); + } if ($(item).hasClass('cms-form-get-method')) { // Ensure the fake-form selector is propagated to the new anchor diff --git a/docs/requirements.txt b/docs/requirements.txt index 1e5785d8..f8a8a421 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -118,7 +118,7 @@ tabulate==0.9.0 # via docstrfmt toml==0.10.2 # via docstrfmt -tornado==6.4.1 +tornado==6.4.2 # via livereload typing-extensions==4.9.0 # via