Skip to content

Commit 1c0173e

Browse files
authored
Merge branch 'django-cms:master' into master
2 parents 3a44667 + a50d679 commit 1c0173e

File tree

131 files changed

+2319
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+2319
-537
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ insert_final_newline = false
3838

3939
[*plugins/image.html]
4040
insert_final_newline = false
41+
42+
[*.html]
43+
indent_size = 2

.github/workflows/codecov.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: [ 3.8, 3.9, "3.10", "3.11"] # latest release minus two
15+
python-version: ["3.10", "3.11", "3.12"] # latest release minus two
1616
requirements-file: [
17-
dj32_cms38.txt,
18-
dj32_cms39.txt,
19-
dj32_cms41.txt,
20-
dj40_cms311.txt,
21-
dj41_cms311.txt,
2217
dj42_cms311.txt,
23-
dj40_cms41.txt,
24-
dj41_cms41.txt,
2518
dj42_cms41.txt,
19+
dj50_cms41.txt,
20+
dj51_cms41.txt,
2621
]
2722
os: [
2823
ubuntu-20.04,
@@ -40,6 +35,6 @@ jobs:
4035
- name: Generate Report
4136
run: |
4237
pip install -r tests/requirements/${{ matrix.requirements-file }}
43-
coverage run setup.py test
38+
coverage run run_tests.py
4439
- name: Upload Coverage to Codecov
4540
uses: codecov/codecov-action@v4

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
python-version: '3.11'
2020
cache: 'pip'
2121
- name: Cache dependencies
22-
uses: actions/cache@v4.0.2
22+
uses: actions/cache@v4.1.0
2323
with:
2424
path: ~/.cache/pip
2525
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.in') }}
2626
restore-keys: |
2727
${{ runner.os }}-pip-
28-
- run: python -m pip install -r docs/requirements.in
28+
- run: python -m pip install -r docs/requirements.txt
2929
- name: Build docs
3030
run: |
3131
cd docs
@@ -44,13 +44,13 @@ jobs:
4444
python-version: '3.11'
4545
cache: 'pip'
4646
- name: Cache dependencies
47-
uses: actions/cache@v4.0.2
47+
uses: actions/cache@v4.1.0
4848
with:
4949
path: ~/.cache/pip
5050
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.in') }}
5151
restore-keys: |
5252
${{ runner.os }}-pip-
53-
- run: python -m pip install -r docs/requirements.in
53+
- run: python -m pip install -r docs/requirements.txt
5454
- name: Check spelling
5555
run: |
5656
cd docs

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
python -m pip install --upgrade pip
2323
pip install ruff
2424
- name: Run Ruff
25-
run: ruff djangocms_frontend
25+
run: ruff check djangocms_frontend

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/asottile/pyupgrade
12-
rev: v3.15.2
12+
rev: v3.17.0
1313
hooks:
1414
- id: pyupgrade
1515
args: ["--py37-plus"]
1616
- repo: https://github.com/adamchainz/django-upgrade
17-
rev: "1.16.0"
17+
rev: "1.21.0"
1818
hooks:
1919
- id: django-upgrade
2020
args: [--target-version, "2.2"]
@@ -24,7 +24,7 @@ repos:
2424
- id: isort
2525
name: isort (python)
2626
- repo: https://github.com/PyCQA/flake8
27-
rev: 7.0.0
27+
rev: 7.1.1
2828
hooks:
2929
- id: flake8
3030
additional_dependencies:

CHANGELOG.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22
Changelog
33
=========
44

5+
1.3.4 (2024-09-30)
6+
==================
7+
8+
* feat: Rename link plugin to text link plugin by @fsbraun in https://github.com/django-cms/djangocms-frontend/pull/219
9+
* Updates for file djangocms_frontend/locale/en/LC_MESSAGES/django.po in de by @transifex-integration in https://github.com/django-cms/djangocms-frontend/pull/228
10+
* fix: setting `DJANGOCMS_FRONTEND_MINIMUM_INPUT_LENGTH` caused a regression when updating opt groups by @fsbraun in https://github.com/django-cms/djangocms-frontend/pull/230
11+
* fix: Pin django-entangled dependency to <0.6.
12+
13+
1.3.3 (2024-07-11)
14+
==================
15+
16+
* fix: pypi environments by @fsbraun in https://github.com/django-cms/djangocms-frontend/pull/214
17+
* fix: escaped characters in autocomplete view of link plugin by @fsbraun in https://github.com/django-cms/djangocms-frontend/pull/217
18+
* fix: Misaligned icons in mobile view of navigation by @hgkornmann in https://github.com/django-cms/djangocms-frontend/pull/221
19+
* chore: update pypi actions to use trusted publishers by @fsbraun in https://github.com/django-cms/djangocms-frontend/pull/213
20+
21+
**New Contributors**
22+
23+
* @hgkornmann made their first contribution in https://github.com/django-cms/djangocms-frontend/pull/221
24+
25+
526
1.3.2 (2024-04-25)
627
==================
728

README.rst

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,31 @@ currently used frontend framework such as Bootstrap, or its specific version.
1414
Key features
1515
============
1616

17-
- Support of `Bootstrap 5 <https://getbootstrap.com>`_, django CMS 3.8+
18-
and the new upcoming major django CMS 4.
17+
- Support of `Bootstrap 5 <https://getbootstrap.com>`_, django CMS 3.8+
18+
and django CMS 4.
1919

20-
- **Separation of plugins from css framework**, i.e. no need to
21-
rebuild you site's plugin tree if css framework is changed in the
22-
future, e.g. from Bootstrap 5 to a future version.
20+
- **Separation of plugins from css framework**, i.e. no need to
21+
rebuild you site's plugin tree if css framework is changed in the
22+
future, e.g. from Bootstrap 5 to a future version.
2323

24-
- **New link plugin** allowing to link to internal pages provided by
25-
other applications, such as `djangocms-blog
26-
<https://github.com/nephila/djangocms-blog>`_.
24+
- **New link plugin** allowing to link to internal pages provided by
25+
other applications, such as `djangocms-blog
26+
<https://github.com/nephila/djangocms-blog>`_.
2727

28-
- **Nice and well-arranged admin frontend** of `djangocms-bootstrap4
29-
<https://github.com/django-cms/djangocms-bootstrap4>`_
28+
- **Nice and well-arranged admin frontend** of `djangocms-bootstrap4
29+
<https://github.com/django-cms/djangocms-bootstrap4>`_
30+
31+
- **Extensible** within the project and with separate project (e.g. a
32+
theme app). Create your own components with a few lines of code only.
33+
34+
- **Plugins are re-usable as UI components** anywhere in your project
35+
(e.g. in a custom app) giving your whole project a more consistent
36+
user experience.
3037

3138
- A management command to **migrate from djangocms-bootstrap4**. This
3239
command automatically migrates all ``djangocms-bootstrap4`` plugins to
3340
``djangocms-frontend``.
3441

35-
- **Extensible** within the project and with separate project (e.g. a
36-
theme app)
37-
3842

3943
Description
4044
===========
@@ -55,6 +59,10 @@ The link plugin has been rewritten to not only allow internal links to other
5559
CMS pages, but also to other django models such as, e.g., posts of
5660
`djangocms-blog <https://github.com/nephila/djangocms-blog>`_.
5761

62+
The plugins are designed to be re-usable as UI components in your
63+
project, e.g. in a custom app, giving your whole project a more
64+
consistent user experience.
65+
5866
Contributing
5967
============
6068

@@ -150,7 +158,7 @@ See readthedocs for the `documentation
150158
License
151159
=======
152160

153-
See `LICENSE <https://github.com/django-cms/djangocms-frontend/blob/master/LICENSE>`_.
161+
See `LICENSE <https://github.com/django-cms/djangocms-frontend/blob/master/LICENSE>`_.
154162

155163
.. |pypi| image:: https://badge.fury.io/py/djangocms-frontend.svg
156164
:target: http://badge.fury.io/py/djangocms-frontend

djangocms_frontend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
13. Github actions will publish the new package to pypi
2020
"""
2121

22-
__version__ = "1.3.2"
22+
__version__ = "2.0.0a"

djangocms_frontend/apps.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django import apps
2+
3+
4+
class DjangocmsFrontendConfig(apps.AppConfig):
5+
name = "djangocms_frontend"
6+
verbose_name = "DjangoCMS Frontend"
7+
8+
def ready(self):
9+
from .component_pool import setup
10+
11+
setup()

djangocms_frontend/cms_plugins.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
1+
from cms.constants import SLUG_REGEXP
12
from cms.plugin_base import CMSPluginBase
23
from django.utils.encoding import force_str
34

5+
from djangocms_frontend.helpers import get_related
46

5-
class CMSUIPlugin(CMSPluginBase):
7+
if hasattr(CMSPluginBase, "edit_field"):
8+
# FrontendEditable functionality already implemented in core?
9+
FrontendEditableAdminMixin = object
10+
else:
11+
# If not use our own version of the plugin-enabled mixin
12+
from .helpers import FrontendEditableAdminMixin
13+
14+
15+
class CMSUIPlugin(FrontendEditableAdminMixin, CMSPluginBase):
616
render_template = "djangocms_frontend/html_container.html"
717
change_form_template = "djangocms_frontend/admin/base.html"
818

919
def __str__(self):
1020
return force_str(super().__str__())
21+
22+
def render(self, context, instance, placeholder):
23+
for key, value in instance.config.items():
24+
if isinstance(value, dict) and set(value.keys()) == {"pk", "model"}:
25+
if key not in instance.__dir__(): # hasattr would return the value in the config dict
26+
setattr(instance.__class__, key, get_related(key))
27+
return super().render(context, instance, placeholder)
28+
29+
def get_plugin_urls(self):
30+
from django.urls import re_path
31+
32+
info = f"{self.model._meta.app_label}_{self.model._meta.model_name}"
33+
34+
def pat(regex, fn):
35+
return re_path(regex, fn, name=f"{info}_{fn.__name__}")
36+
37+
return [
38+
pat(r'edit-field/(%s)/([a-z\-]+)/$' % SLUG_REGEXP, self.edit_field),
39+
]
40+
41+
def _get_object_for_single_field(self, object_id, language):
42+
from .models import FrontendUIItem
43+
44+
return FrontendUIItem.objects.get(pk=object_id)

0 commit comments

Comments
 (0)