Skip to content

Commit

Permalink
Merge branch 'master' into release/2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Nov 25, 2024
2 parents e02f50d + a448e16 commit 8359574
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
==================
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
5 changes: 5 additions & 0 deletions djangocms_moderation/static/djangocms_moderation/js/burger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8359574

Please sign in to comment.