From 685a9f428bafcc90aad864047b0428fd6cd84f7a Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 9 Jan 2024 00:15:56 +0100 Subject: [PATCH 1/2] docs: Typo corrections (#175) --- docs/source/components.rst | 71 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/docs/source/components.rst b/docs/source/components.rst index 271ca05d..9575778f 100644 --- a/docs/source/components.rst +++ b/docs/source/components.rst @@ -1,7 +1,7 @@ + .. index:: single: Plugins - ################### Component plugins ################### @@ -160,10 +160,18 @@ A `Carousel `_ is a set of images (potentially with some description) that slide in (or fade in) one after the other after a certain amount of time. -Each slide requires a Carousel Slide child plugin. The simplest case specifies an image, potentially a caption and a link which is followed once the slide is clicked. +Each slide requires a Carousel Slide child plugin. The simplest case specifies +an image, potentially a caption and a link which is followed once the slide is +clicked. + +Since the design of carousels is somewhat opinionated template sets can be +specified using the ``DJANGOCMS_FRONTEND_CAROUSEL_TEMPLATES`` setting. -Since the design of carousels is somewhat opinionated template sets can be specified using the ``DJANGOCMS_FRONTEND_CAROUSEL_TEMPLATES`` setting. -.. note:: A Carousel Slide plugin can have child plugins itself. If an image is specified the child plugins add to the caption. If no image is specified the child plugins make up the slide. +.. note:: + + A Carousel Slide plugin can have child plugins itself. If an image is + specified the child plugins add to the caption. If no image is specified + the child plugins make up the slide. ****************** Collapse component @@ -349,6 +357,7 @@ djangocms-frontend offers the `ace code editor `_ to enter code bits. .. warning:: + By default the ace code editor javascript code is retrieved over the internet from a cdn. If you do not want this to happen, e.g., for data privacy reasons or because your system is not connected to the internet, please use the @@ -391,11 +400,14 @@ Icon component .. versionadded:: 1.1 -djangocms-frontend's icon plugin supports a variety of popular icon fonts. The icon component is centered around Gilles Migliori's `universal icon picker `_. +djangocms-frontend's icon plugin supports a variety of popular icon fonts. The +icon component is centered around Gilles Migliori's +`universal icon picker `_. .. image:: screenshots/icon-picker.png -A version of it is bundled with djangocms-frontend. It currently contains support for the following icon sets: +A version of it is bundled with djangocms-frontend. It currently contains +support for the following icon sets: * `Bootstrap icons `_ * `Elegant icons `_ (bundled) @@ -414,21 +426,30 @@ A version of it is bundled with djangocms-frontend. It currently contains suppor .. note:: - The icon picker needs a config file for each icon set. This requires regular update. Please be patient if new icons do not appear immediately in djangocms-frontend's icon picker or - even better - `create a pull request! `_ + The icon picker needs a config file for each icon set. This requires regular + update. Please be patient if new icons do not appear immediately in + djangocms-frontend's icon picker or - even better - + `create a pull request! `_ .. warning:: - You may either use djangocms-icon or djangocms-frontent's icon contrib package but not both, since they both register an ``IconPlugin``. + You may either use djangocms-icon or djangocms-frontent's icon contrib + package but not both, since they both register an ``IconPlugin``. Icon fonts ========== -As marked in the overview above, some MIT licenced icon fonts are bundled for convenience. They are available to the web page through static files. +As marked in the overview above, some MIT licenced icon fonts are bundled for +convenience. They are available to the web page through static files. -For other icon sets source files are loaded from CDN through the internet by default. This is not necessarily a configuration you want to have in a production situation. To specify where to get the required css files from please use the :py:attr:`~settings.DJANGOCMS_FRONTEND_ICON_LIBRARIES` setting. +For other icon sets source files are loaded from CDN through the internet by +default. This is not necessarily a configuration you want to have in a production +situation. To specify where to get the required css files from please use the +:py:attr:`~settings.DJANGOCMS_FRONTEND_ICON_LIBRARIES` setting. -To just restrict the available choices of icon sets for the user use the :py:attr:`~settings.DJANGOCMS_FRONTEND_ICON_LIBRARIES_SHOWN` setting. +To just restrict the available choices of icon sets for the user use the +:py:attr:`~settings.DJANGOCMS_FRONTEND_ICON_LIBRARIES_SHOWN` setting. Icons can be sized. Options for icon sizes are defined by the :py:attr:`~settings.DJANGOCMS_FRONTEND_ICON_SIZE_CHOICES` setting. @@ -436,7 +457,9 @@ Icons can be sized. Options for icon sizes are defined by the :py:attr:`~setting Adding custom icon fonts ======================== -To add a custom icon font you need to generate a config file. This is a json file that tells the icon picker which icons are available. As an example check out the `config file for Bootstrap Icons `_:: +To add a custom icon font you need to generate a config file. This is a json +file that tells the icon picker which icons are available. As an example check +out the `config file for Bootstrap Icons `_:: { "prefix": "bi bi-", @@ -455,13 +478,16 @@ To add a custom icon font you need to generate a config file. This is a json fil Icons are rendered as ``>`` tags with classes. -``.prefix`` defines a string that is prepended to all icons. For Bootstrap icons that's the class ``bi`` and the prefix for the icon selecting class ``bi-``. +``.prefix`` defines a string that is prepended to all icons. For Bootstrap icons +that's the class ``bi`` and the prefix for the icon selecting class ``bi-``. The list ``.icons`` contains all available icons in the set. ``.list-icon`` contains the classes for the example icon. You can probably ignore it. -``.icon-style`` currently is unused. It may in future determine how icons are rendered. Currently all icons a re rendered by ```` except material design icon which are rendered by ``bla``. +``.icon-style`` currently is unused. It may in future determine how icons are +rendered. Currently all icons a re rendered by ```` except +material design icon which are rendered by ``bla``. Using svg sprites @@ -473,9 +499,12 @@ Currently only font-based icons are supported. Icon plugins inside text plugins ================================ -The icon plugin is text-enabled, i.e., you can add it to a text plugin through djangocms-text-ckeditor's CKEDITOR. By default, however, CKEDITOR removes empty ```` or ```` tags which most icons use. +The icon plugin is text-enabled, i.e., you can add it to a text plugin through +djangocms-text-ckeditor's CKEDITOR. By default, however, CKEDITOR removes empty +```` or ```` tags which most icons use. -To disable this behavior of CKEDITOR, you need to add a ``stylesSet`` entry in ``CKEDITOR_SETTINGS``, e.g., +To disable this behavior of CKEDITOR, you need to add a ``customConfig`` entry +in ``CKEDITOR_SETTINGS``, e.g., .. code-block:: python @@ -485,16 +514,20 @@ To disable this behavior of CKEDITOR, you need to add a ``stylesSet`` entry in ` ..., } -This will load the ``ckeditor.icons.js`` file which in turn will allow empty ``span``and ``i`` tags. +This will load the ``ckeditor.icons.js`` file which in turn will allow empty +``span``and ``i`` tags. -If you already have a ``styleSet`` file specified it will suffice to add the following two lines to it. +If you already have a ``customConfig`` file specified it will suffice to add +the following two lines to it. .. code-block:: javascript CKEDITOR.dtd.$removeEmpty.span = 0; CKEDITOR.dtd.$removeEmpty.i = 0; -Finally, you potentially need to add the necessary icon css files to the ``contentCss`` property of ``CKEDITOR_SETTINGS``, e.g., for bootstrap icons from their cdn +Finally, you potentially need to add the necessary icon css files to the +``contentCss`` property of ``CKEDITOR_SETTINGS``, e.g., for bootstrap icons +from their cdn .. code-block:: python From 346a4458429881fad555ba7cb64fe7db9fb23d97 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 9 Jan 2024 00:36:05 +0100 Subject: [PATCH 2/2] fix: Replace deprecated `length_is` by `length` filter (#173) --- djangocms_frontend/frameworks/bootstrap5.py | 20 +++++------ .../templates/bootstrap5/base.html | 33 ++----------------- 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/djangocms_frontend/frameworks/bootstrap5.py b/djangocms_frontend/frameworks/bootstrap5.py index 1ac78f0e..fa018d52 100644 --- a/djangocms_frontend/frameworks/bootstrap5.py +++ b/djangocms_frontend/frameworks/bootstrap5.py @@ -145,28 +145,28 @@ "grid_sizes": grid_sizes, "grid_icons": grid_icons, "row_links": [ - "https://getbootstrap.com/docs/5.1/layout/grid/#grid-options", - "https://getbootstrap.com/docs/5.1/layout/columns/#reordering", - "https://getbootstrap.com/docs/5.1/layout/columns/#offsetting-columns", - "https://getbootstrap.com/docs/5.1/utilities/flex/#auto-margins", - "https://getbootstrap.com/docs/5.1/utilities/flex/#auto-margins", + "https://getbootstrap.com/docs/5.3/layout/grid/#grid-options", + "https://getbootstrap.com/docs/5.3/layout/columns/#reordering", + "https://getbootstrap.com/docs/5.3/layout/columns/#offsetting-columns", + "https://getbootstrap.com/docs/5.3/utilities/flex/#auto-margins", + "https://getbootstrap.com/docs/5.3/utilities/flex/#auto-margins", ], }, "GridRow": { "grid_sizes": grid_sizes, "grid_icons": grid_icons, "row_links": [ - "https://getbootstrap.com/docs/5.1/layout/grid/#row-columns", + "https://getbootstrap.com/docs/5.3/layout/grid/#row-columns", ], - "vertical_alignment_link": "https://getbootstrap.com/docs/5.1/layout/columns/#vertical-alignment", - "horizontal_alignment_link": "https://getbootstrap.com/docs/5.1/layout/columns/#horizontal-alignment", + "vertical_alignment_link": "https://getbootstrap.com/docs/5.3/layout/columns/#vertical-alignment", + "horizontal_alignment_link": "https://getbootstrap.com/docs/5.3/layout/columns/#horizontal-alignment", }, "CardLayout": { - "card_type_link": "https://getbootstrap.com/docs/5.1/components/card/#card-layout", + "card_type_link": "https://getbootstrap.com/docs/5.3/components/card/#card-layout", "grid_sizes": grid_sizes, "grid_icons": grid_icons, "row_links": [ - "https://getbootstrap.com/docs/5.1/layout/grid/#row-columns", + "https://getbootstrap.com/docs/5.3/layout/grid/#row-columns", ], }, } diff --git a/djangocms_frontend/templates/bootstrap5/base.html b/djangocms_frontend/templates/bootstrap5/base.html index f7e5adf2..a77534c1 100644 --- a/djangocms_frontend/templates/bootstrap5/base.html +++ b/djangocms_frontend/templates/bootstrap5/base.html @@ -1,9 +1,9 @@ {% extends "djangocms_frontend.html" %}{% load cms_tags menu_tags %} {% block base_css %} - + {% endblock %} {% block base_js %} - + {% endblock %} {% block navbar %} {% endblock %} -{% block bottom_css %} {# Quick check for dark mode #} - - {{ block.super }} -{% endblock %}