Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
4245adc
Fix: Update locales and add floating options for images
fsbraun Nov 7, 2023
e66e618
Merge branch 'master' of github.com:fsbraun/djangocms-frontend
fsbraun Nov 7, 2023
cbaccdd
Merge branch 'master' of github.com:fsbraun/djangocms-frontend
fsbraun Nov 28, 2023
66e053e
fix: icons not showing in ckeditor
fsbraun Nov 28, 2023
fec0ece
Merge branch 'django-cms:master' into master
fsbraun Nov 28, 2023
49e4acc
Merge branch 'django-cms:master' into master
fsbraun Nov 28, 2023
a9ead97
Add image drag and drop
fsbraun Nov 28, 2023
9ac7126
Merge branch 'master' of github.com:fsbraun/djangocms-frontend
fsbraun Nov 28, 2023
f5f27b6
Update docs
fsbraun Nov 28, 2023
6d5fac4
Add tests
fsbraun Nov 28, 2023
18d60ab
Fix tests for v4
fsbraun Nov 28, 2023
44d5035
Bump version
fsbraun Nov 28, 2023
210cccd
Update changelog
fsbraun Nov 28, 2023
510494e
Merge branch 'django-cms:master' into master
fsbraun Nov 28, 2023
297d436
Merge branch 'django-cms:master' into master
fsbraun Dec 13, 2023
fc20a5a
Merge branch 'django-cms:master' into master
fsbraun Dec 15, 2023
606cc91
fix/remove-unused-css
fsbraun Dec 15, 2023
1af2ef9
Merge branch 'django-cms:master' into master
fsbraun Jan 4, 2024
60f810f
Merge branch 'django-cms:master' into master
fsbraun Jan 8, 2024
05a0939
Merge branch 'django-cms:master' into master
fsbraun Jan 8, 2024
a8e5f2d
Doc typos
fsbraun Jan 8, 2024
c7c8bcf
Merge branch 'django-cms:master' into master
fsbraun Jan 9, 2024
ad90c57
Fix: Missing space in auto column short description
fsbraun Jan 11, 2024
d2a2e78
Merge branch 'master' of github.com:fsbraun/djangocms-frontend
fsbraun Jan 11, 2024
41e58bc
Merge branch 'master' into master
fsbraun Jan 11, 2024
ef87c91
Unlist removed iconsets from the docs
fsbraun Jan 12, 2024
8d63c99
Merge branch 'django-cms:master' into master
fsbraun Jan 12, 2024
a165dcd
Merge branch 'master' into master
fsbraun Jan 13, 2024
c7e34a2
Merge branch 'django-cms:master' into master
fsbraun Feb 14, 2024
aa0aff9
Merge branch 'django-cms:master' into master
fsbraun Feb 16, 2024
1017581
Merge branch 'django-cms:master' into master
fsbraun Feb 28, 2024
4a6c6bf
Merge branch 'django-cms:master' into master
fsbraun Mar 21, 2024
25cbc79
Bump version
fsbraun Mar 21, 2024
a006821
Add translations
fsbraun Mar 21, 2024
47cb3d0
Update test environment
fsbraun Mar 21, 2024
17f3b71
Fix: Tree structure for pages
fsbraun Mar 21, 2024
1dd0e83
Restore Django 3.2 compatibility
fsbraun Mar 21, 2024
d405c51
Update changelog
fsbraun Mar 21, 2024
123ee85
Fix: Min width of select2 box
fsbraun Mar 21, 2024
e443877
Merge remote-tracking branch 'upstream/master'
fsbraun Mar 21, 2024
b8ba771
Fix icon picker
fsbraun Mar 21, 2024
68e9889
Prepopulate badge
fsbraun Mar 21, 2024
b6e5f34
Merge branch 'django-cms:master' into master
fsbraun Mar 21, 2024
8754e88
Merge branch 'django-cms:master' into master
fsbraun Apr 9, 2024
4151e55
Merge branch 'django-cms:master' into master
fsbraun Apr 10, 2024
fa6e98f
Merge branch 'django-cms:master' into master
fsbraun Apr 24, 2024
1d735ba
Add empty selection to internal link choices (fixes #206)
fsbraun Apr 24, 2024
1abe124
Merge branch 'django-cms:master' into master
fsbraun Apr 24, 2024
c2f8da8
Merge branch 'django-cms:master' into master
fsbraun Apr 24, 2024
0eb5feb
Fix pypi actions
fsbraun Apr 24, 2024
e993b33
Merge branch 'master' of github.com:fsbraun/djangocms-frontend
fsbraun Apr 24, 2024
6554f84
Add write permissions to pypi actions
fsbraun Apr 24, 2024
83e99f0
Add env.
fsbraun Apr 24, 2024
f3d5a93
fix: Unescape JSONView for django admin's autocomplete widget
fsbraun Apr 29, 2024
db4748a
Merge branch 'master' into fix/escape
fsbraun Apr 29, 2024
0dc9b41
Merge pull request #2 from fsbraun/fix/escape
fsbraun Apr 29, 2024
c615895
Add tests
fsbraun Apr 29, 2024
40cb02e
Merge branch 'fix/escape' of github.com:fsbraun/djangocms-frontend in…
fsbraun Apr 29, 2024
659ed56
Fix tests
fsbraun Apr 29, 2024
1b3c0cf
Merge branch 'django-cms:master' into fix/escape
fsbraun Apr 29, 2024
5918709
Merge pull request #4 from fsbraun/fix/escape
fsbraun Apr 29, 2024
3a44667
Merge branch 'django-cms:master' into master
fsbraun May 28, 2024
1156c6c
Add `{% plugin %}` template tag.
fsbraun May 28, 2024
9b57107
Fix tests
fsbraun May 28, 2024
353cdb3
Improve testing
fsbraun May 28, 2024
b8674ea
Cleanup
fsbraun May 28, 2024
817e666
Update readme.
fsbraun May 28, 2024
fc4628e
Fix readme formatting
fsbraun May 28, 2024
f7a740b
coverage
fsbraun May 28, 2024
89843f4
Fix: Side-effect on attributes
fsbraun May 28, 2024
7518b42
Update docs, add empty children messages
fsbraun May 29, 2024
b4975e9
Remove empty line
fsbraun May 29, 2024
52ec8c6
Refactor common module, add custom components
fsbraun May 29, 2024
e77d34a
first tailwind steps
fsbraun May 29, 2024
d4bfe19
Add slots to components
fsbraun Jun 6, 2024
afce5cb
Merge branch 'master' into feat/components
fsbraun Jun 6, 2024
66721a2
Update custom_components.rst
fsbraun Jun 11, 2024
369fac7
Update custom_components.rst
fsbraun Jun 11, 2024
d7a0172
Add Link-enabled component
fsbraun Jun 13, 2024
6753c90
add link fieldset position as component Meta
fsbraun Jun 13, 2024
6aba1db
Make ImageFields available through their field name in templtes
fsbraun Jun 18, 2024
7afd7fd
Merge branch 'master' into feat/components
fsbraun Jun 18, 2024
73d0940
Simplify related object access
fsbraun Jun 18, 2024
069f783
Fix: Typing for py3.9
fsbraun Jun 18, 2024
d5454fe
Update tests
fsbraun Jun 18, 2024
74cd0f9
Update testing
fsbraun Jun 18, 2024
b5053e9
Remove dj40 and dj41 from tests
fsbraun Jun 18, 2024
bc9a47f
Update test dependencies
fsbraun Jun 18, 2024
cfeeea2
Update tests
fsbraun Jun 18, 2024
3fba47c
Add html5lib dependency for tests
fsbraun Jun 18, 2024
ad135bd
Fix: versatile entangled form support
fsbraun Jun 18, 2024
bed084c
Performance: cached related properties
fsbraun Jun 19, 2024
3407419
Skip Link component test for django CMS 4.1 since djangocms-url-manag…
fsbraun Jun 20, 2024
19779c3
Fix: Workaround for newer versioning versions potentially used with d…
fsbraun Jun 20, 2024
cd465d7
Some pragma no-cover
fsbraun Jun 20, 2024
5289f5c
Add tailwind menu
fsbraun Jun 20, 2024
8d94c2a
Merge branch 'master' into feat/components
fsbraun Jul 1, 2024
a1c86df
Fix: get current page for link
fsbraun Jul 10, 2024
47af84f
Merge branch 'feat/components' of github.com:fsbraun/djangocms-fronte…
fsbraun Jul 10, 2024
7bdca5d
Fix: Migrations for components and rename `djangocms_frontend.pool` t…
fsbraun Jul 10, 2024
d06b71e
Merge branch 'master' into feat/components
fsbraun Jul 11, 2024
8f03797
Update docs
fsbraun Jul 22, 2024
219ceb6
Merge branch 'feat/components' of github.com:fsbraun/djangocms-fronte…
fsbraun Jul 22, 2024
4185bed
Merge branch 'master' into feat/components
fsbraun Aug 29, 2024
b1c48b2
Fix tests
fsbraun Aug 29, 2024
0f265bd
Add filer to test requirements
fsbraun Aug 29, 2024
e3cfcee
Update test requirements to include package requirements themselves
fsbraun Aug 29, 2024
bc5457c
Fix 3.11 test
fsbraun Aug 29, 2024
4012562
Update 5.1 test
fsbraun Aug 29, 2024
70cbbbf
Fix tests
fsbraun Aug 29, 2024
462de10
feat: Make component slots not editable
fsbraun Sep 13, 2024
943a0ba
Fix `child_plugins` improvement
fsbraun Sep 27, 2024
5bad1e9
fix tests
fsbraun Sep 27, 2024
a441b89
fix linting issues
fsbraun Sep 27, 2024
a7f00c9
Update docs build requirements
fsbraun Sep 27, 2024
5012df4
Update sphinx config
fsbraun Sep 27, 2024
fcffc51
Allow `get_render_template` for components
fsbraun Sep 29, 2024
bc1ecc7
Add tests for frontend editable endpoint
fsbraun Sep 29, 2024
bbb6159
Move non-bootstrap render function to plugin (image)
fsbraun Sep 30, 2024
7027832
Merge branch 'master' into feat/components
fsbraun Sep 30, 2024
10f9d66
Remove tailwind file
fsbraun Sep 30, 2024
603e526
Fix: update django-entangled requirement
fsbraun Sep 30, 2024
682e54f
fix coverage
fsbraun Sep 30, 2024
9f96a50
Add Django 5.1 tests
fsbraun Sep 30, 2024
053af23
Fix Django 5.1 test requirements
fsbraun Oct 1, 2024
cadf3a3
Merge branch 'master' into feat/components
fsbraun Oct 7, 2024
290e2a8
Improved inline editing for django CMS v3
fsbraun Oct 7, 2024
4b4c237
fix: Disallow edit for DummyPlugins
fsbraun Oct 7, 2024
e39fc8f
Update tests
fsbraun Oct 7, 2024
ec1bc8d
fix tests to independently install djangocms-url-manager
fsbraun Oct 7, 2024
42bc9c7
tests: Add test for related field descriptor
fsbraun Oct 7, 2024
af6ea3a
Fix: Register component models only once
fsbraun Oct 7, 2024
8f91c9e
Update docs
fsbraun Oct 7, 2024
0767d49
Merge branch 'master' into feat/components
fsbraun Oct 7, 2024
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
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ For a manual install:

- run ``pip install djangocms-frontend``

- add the following entries to your ``INSTALLED_APPS``:
- add the following entries to your ``INSTALLED_APPS`` (or only those you need):

.. code::

Expand All @@ -127,6 +127,7 @@ For a manual install:
'djangocms_frontend.contrib.card',
'djangocms_frontend.contrib.carousel',
'djangocms_frontend.contrib.collapse',
'djangocms_frontend.contrib.component',
'djangocms_frontend.contrib.content',
'djangocms_frontend.contrib.grid',
'djangocms_frontend.contrib.icon',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<{{ instance.tag_type }}{{ instance.get_attributes }}
id="{{ instance.container_identifier }}"
role="tabpanel"
data-bs-parent="#parent-{{ parent.pk|safe }}"
data-bs-parent="#{{ parent.uuid }}"
aria-labelledby="trigger-{{ instance.container_identifier }}">
{% for plugin in instance.child_plugin_instances %}
{% with forloop as parentloop %}{% render_plugin plugin %}{% endwith %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load cms_tags frontend %}
<{{ instance.tag_type }}{{ instance.get_attributes }}
id="parent-{{ instance.pk|safe }}"
id="{{ instance.uuid }}"
data-bs-children="{{ instance.collapse_siblings }}"
role="tablist"
>
Expand Down
4 changes: 4 additions & 0 deletions djangocms_frontend/contrib/content/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class BlockquotePlugin(
),
]

frontend_editable_fields = ("quote_content", "quote_origin")


@plugin_pool.register_plugin
class FigurePlugin(
Expand Down Expand Up @@ -110,3 +112,5 @@ class FigurePlugin(
},
),
]

frontend_editable_fields = ("figure_caption",)
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
{# djlint:on #}
{% for plugin in instance.child_plugin_instances %}
{% with parentloop=forloop parent=instance %}{% render_plugin plugin %}{% endwith %}
{% empty %}{{ instance.quote_content|html_safe }}{% endfor %}
{% empty %}{% inline_field instance "quote_content" "" "html_safe" %}{% endfor %}
{# djlint:off #}
</blockquote>
{# djlint:on #}
{% if instance.quote_origin %}
<figcaption class="blockquote-footer">
{{ instance.quote_origin|safe_caption }}
{% inline_field instance "quote_origin" "" "safe_caption" %}
</figcaption>
</figure>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{% for plugin in instance.child_plugin_instances %}
{% with forloop=parentloop parent=instance %}{% render_plugin plugin %}{% endwith %}
{% endfor %}
<figcaption class="figure-caption{% if figure_alignment %} text-{{ figure_alignment }}{% endif %}">{{ instance.figure_caption|safe_caption }}</figcaption>
<figcaption class="figure-caption{% if figure_alignment %} text-{{ figure_alignment }}{% endif %}">{% inline_field instance "figure_caption" "" "safe_caption" %}</figcaption>
</figure>
2 changes: 2 additions & 0 deletions docs/source/custom_components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Custom Components
#################

.. versionadded:: 2.0

Some frontend developers prefer custom components specifically tailored to
give the project a unique and distinct look.

Expand Down
62 changes: 47 additions & 15 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Add the following entries to your ``INSTALLED_APPS``:
"djangocms_frontend.contrib.card",
"djangocms_frontend.contrib.carousel",
"djangocms_frontend.contrib.collapse",
"djangocms_frontend.contrib.component",
"djangocms_frontend.contrib.content",
"djangocms_frontend.contrib.grid",
"djangocms_frontend.contrib.icon",
Expand All @@ -62,12 +63,6 @@ Add the following entries to your ``INSTALLED_APPS``:
"djangocms_frontend.contrib.tabs",
"djangocms_frontend.contrib.utilities",

.. note :: Using Django 2.2 to 3.1

You will need to add ``django-jsonfield-backport`` to your
``requirements.txt`` and add ``"django_jsonfield_backport"`` to your
``INSTALLED_APPS``.


Create necessary database table
===============================
Expand Down Expand Up @@ -440,15 +435,19 @@ the upper right corner:
Using frontend plugins as components in templates
=================================================

.. versionadded:: 2.0

The plugins of **djangocms-frontend** can be used as components in your
templates - even in apps that do not use or integrate with djanog CMS
otherwise. This is useful if you want use exactly the same markup for, say,
buttons, links, the grid both in pages managed with django CMS and in
other parts of your project.
other parts of your project without duplicating HTML code.

This allows you to keep one set of templates for your django CMS frontend
plugins and any changes to those templates will be reflected in all parts
of your project.
This feature introduces a simple and flexible way to re-use djangocms-frontend
plugins directly in templates without needing to create database entries for
them. This allows developers to maintain clean, reusable, and dynamic
components, such as buttons, cards, links, and more, while minimizing code
repetition.

To use a frontend plugin in a template you need to load the ``frontend`` tags
and then use the ``plugin`` template tag to render a frontend plugin.
Expand All @@ -464,15 +463,48 @@ The plugins will be rendered based on their standard attribute settings.
You can override these settings by passing them as keyword arguments to the
``plugin`` template tag.

See the documentation of the djanog CMS plugins for examples of how to use
the ``{% plugin %}`` template tag with each plugin.
You can also create more complex reusable components, like a card with inner
elements such as headers, bodies, and lists, by nesting plugins. Here’s an
example of a card component::

{% load frontend %}
{% plugin "card" card_alignment="center" card_outline="info" card_text_color="primary" card_full_height=True %}
{% plugin "cardinner" inner_type="card-header" text_alignment="start" %}
<h4>Card title</h4>
{% endplugin %}
{% plugin "cardinner" inner_type="card-body" text_alignment="center" %}
Some quick example text to build on the card title and make up the bulk of the card's content.
{% endplugin %}
{% plugin "listgroupitem" %}An item{% endplugin %}
{% plugin "listgroupitem" %}A second item{% endplugin %}
{% plugin "listgroupitem" %}A third item{% endplugin %}
{% endplugin %}

Breakdown of the Code:

* ``plugin "card"``: Creates the outer card component.
* ``card_alignment="center"``: Aligns the card content to the center.
* ``card_outline="info"``: Gives the card an "info" outline style.
* ``card_text_color="primary"``: Changes the text color to "primary."
* ``card_full_height=True``: Ensures the card takes up the full height of its container.
* Nested ``plugin "cardinner"``: Creates inner components within the card.
* ``inner_type="card-header"``: Specifies a header section for the card.
* ``text_alignment="start"``: Aligns the header text to the start (left).
* Additional nested ``plugin "cardinner"`` and ``listgroupitem``:
* These create the body of the card and a list group inside the card.

The above template generates a dynamic card component with a header, a body,
and a list group that can be reused across multiple pages without requiring
database entries.

For more examples, see the documentation of the djanog CMS plugins on of how to
use the ``{% plugin %}`` template tag with each plugin.


.. note::

While this is designed for **djangocms-frontend** plugins primarily, it
will work with most django CMS plugins.
will work with many other django CMS plugins.

Since no plugins are created in the database, plugins relying on their
instances being available in the database will potentially not work.
This especially is true for plugins that have a foreign key to
other models.
21 changes: 21 additions & 0 deletions docs/source/grid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ Full container
New feature:
Containers can have a background color ("context"), opacity and shadow.

Component example
=================

To create a container in a Django template, you need to load the `frontend` tags
and then use the `plugin` template tag to render the container plugin.
Below is an example of how you might do this::

{% load frontend %}

<!-- Example of using the plugin template tag for a container -->
{% plugin "container" container_type="container-fluid" %}
{% plugin "row" %}
{% plugin "column" xs_col=6 %}
<p>This is the first column inside the container.</p>
{% endplugin %}
{% plugin "column" xs_col=6 %}
<p>This is the second column inside the container.</p>
{% endplugin %}
{% endplugin %}
{% endplugin %}


.. index::
single: Row
Expand Down