Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Nov 5, 2024
1 parent f865a48 commit fdfe7f2
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 101 deletions.
50 changes: 21 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ its specific version.
Key features
============

- Easy to implement re-usable frontend custom components.
- **Easy to implement re-usable frontend custom components**, which in the
simples case consist of a template and declarative sort of form class.

- Support of `Bootstrap 5 <https://getbootstrap.com>`_, django CMS 3.8+
and django CMS 4.
and django CMS 4 out of the box.

- **Separation of plugins from css framework**, i.e. no need to
rebuild you site's plugin tree if css framework is changed in the
Expand All @@ -38,10 +40,6 @@ Key features
(e.g. in a custom app) giving your whole project a more consistent
user experience.

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


Description
===========
Expand All @@ -58,10 +56,6 @@ Instead all design parameters are stored in a common JSON field and
future releases of improved frontend features will not require to
rebuild your full plugin tree.

The link plugin has been rewritten to not only allow internal links to other
CMS pages, but also to other django models such as, e.g., posts of
`djangocms-blog <https://github.com/nephila/djangocms-blog>`_.

The plugins are designed to be re-usable as UI components in your
project, e.g. in a custom app, giving your whole project a more
consistent user experience.
Expand Down Expand Up @@ -101,8 +95,7 @@ file for additional dependencies:
- django-cms, version 3.7 or later
- django-filer, version 1.7 or later
- djangocms-attributes-field, version 1.0 or later
- djangocms-text-ckeditor, version 3.1 or later
- django-select2
- djangocms-text
- django-entangled

Make sure `django Filer
Expand All @@ -124,23 +117,22 @@ For a manual install:
'easy_thumbnails',
'djangocms_frontend',
'djangocms_frontend.contrib.accordion',
'djangocms_frontend.contrib.alert',
'djangocms_frontend.contrib.badge',
'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',
'djangocms_frontend.contrib.image',
'djangocms_frontend.contrib.jumbotron',
'djangocms_frontend.contrib.link',
'djangocms_frontend.contrib.listgroup',
'djangocms_frontend.contrib.media',
'djangocms_frontend.contrib.tabs',
'djangocms_frontend.contrib.utilities',
'djangocms_frontend.contrib.accordion', # optional
'djangocms_frontend.contrib.alert', # optional
'djangocms_frontend.contrib.badge', # optional
'djangocms_frontend.contrib.card', # optional
'djangocms_frontend.contrib.carousel', # optional
'djangocms_frontend.contrib.collapse', # optional
'djangocms_frontend.contrib.content', # optional
'djangocms_frontend.contrib.grid', # optional
'djangocms_frontend.contrib.icon', # optional
'djangocms_frontend.contrib.image', # optional
'djangocms_frontend.contrib.jumbotron', # optional
'djangocms_frontend.contrib.link', # optional
'djangocms_frontend.contrib.listgroup', # optional
'djangocms_frontend.contrib.media', # optional
'djangocms_frontend.contrib.tabs', # optional
'djangocms_frontend.contrib.utilities', # optional
- run ``python manage.py migrate``

Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/static/djangocms_frontend/css/base.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@
{% endblock %}
{% block content_subtitle %}{% endblock %}
{% block field_sets %}
<div class="djangocms-frontend
{% block custom_class %}{% endblock %}" data-static="{% get_static_prefix %}">
<ul class="djangocms-frontend nav nav-pills" role="tablist">
{% for fieldset in adminform %}
{% if forloop.counter == 1 or "collapse" in fieldset.classes %}
<li class="nav-item" role="presentation">
<a class="nav-link" href="#tab-{{ forloop.counter }}"
{% if forloop.counter == 1 and original %}title="{{ original.pk|safe }}"{% endif %}
data-bs-toggle="tab" id="lnk-{{ forloop.counter }}" type="button" role="tab"
data-bs-target="#tab-{{ forloop.counter }}">{{ fieldset.name|default:adminform.model_admin }}
{% if "attributes" in fieldset.classes and original.attributes %}
<span class="indicator attributes"></span>
{% endif %}
<span class="indicator error"></span>
</a>
</li>
{% endif %}
{% endfor %}
{% if original %}
<div class="tab-pk">{{ original.pk|safe }}</div>
{% endif %}
</ul>
<div class="djangocms-frontend tab-content">
{% for fieldset in adminform %}
{% if forloop.counter == 1 or "collapse" in fieldset.classes %}
{% if forloop.counter != 1 %}</div>{% endif %}
<div class="tab-pane fade" id="tab-{{ forloop.counter }}" role="tabpanel">
{% endif %}
{% include "djangocms_frontend/admin/includes/fieldset.html" %}
{% endfor %}{# djlint:off #}</div>
</div>
<div class="djangocms-frontend
{% block custom_class %}{% endblock %}" data-static="{% get_static_prefix %}">
<ul class="djangocms-frontend nav nav-pills" role="tablist">
{% for fieldset in adminform %}
{% if forloop.counter == 1 or "collapse" in fieldset.classes %}
<li class="nav-item" role="presentation">
<a class="nav-link" href="#tab-{{ forloop.counter }}"
{% if forloop.counter == 1 and original %}title="{{ original.pk|safe }}"{% endif %}
data-bs-toggle="tab" id="lnk-{{ forloop.counter }}" type="button" role="tab"
data-bs-target="#tab-{{ forloop.counter }}">{{ fieldset.name|default:adminform.model_admin }}
{% if "attributes" in fieldset.classes and original.attributes %}
<span class="indicator attributes"></span>
{% endif %}
<span class="indicator error"></span>
</a>
</li>
{% endif %}
{% endfor %}
{% if original %}
<div class="tab-pk">{{ original.pk|safe }}</div>
{% endif %}
</ul>
<div class="djangocms-frontend tab-content">
{% for fieldset in adminform %}
{% if forloop.counter == 1 or "collapse" in fieldset.classes %}
{% if forloop.counter != 1 %}</div>{% endif %}
<div class="tab-pane fade" id="tab-{{ forloop.counter }}" role="tabpanel">
{% endif %}
{% include "djangocms_frontend/admin/includes/fieldset.html" %}
{% endfor %}{# djlint:off #}</div>
</div>
</div>{# djlint:on #}
{% endblock %}
9 changes: 5 additions & 4 deletions docs/source/custom_components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ Custom Components

.. versionadded:: 2.0

Some frontend developers prefer custom components specifically tailored to
give the project a unique and distinct look.
Custom components are a powerful tool for content editors, allowing them to build pages without needing
in-depth knowledge of design, HTML, or nested structures. Editors can simply add content to pre-defined
components, creating visually cohesive pages with ease.

When working with `Tailwind CSS <https://tailwindcss.com>`_, for example, you
either create your custom components or customize components from providers,
e.g. `Tailwind UI <https://tailwindui.com>`_,
`Flowbite <https://flowbite.com>`_, or the commiunity
`Tailwind Components <https://tailwindcomponents.com>`_.

With django CMS you make your components available to the content editors for
drag and drop **and** frontend developers for use in templates from a single
With django CMS you make your components available to the content editors to
simply add them to a page by a click **and** frontend developers for use in templates from a single
source.

Custom components are part of the djangocms-frontend root package and do not
Expand Down
8 changes: 7 additions & 1 deletion docs/source/grid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
Grid plugins
##############

For details on how grids work, see, e.g. the `Bootstrap 5 documentation
The grid is the basis for responsive page design. It splits the page into
containers, rows and columns. Depending on the device, columns are shown
next to each other (larger screens) or one below the other (smaller
screens).

The details of the grid system are based on the Bootstrap framework. Therefore,
for details on how grids work, see, e.g. the `Bootstrap 5 documentation
<https://getbootstrap.com/docs/5.1/layout/grid/>`_.

.. index::
Expand Down
59 changes: 24 additions & 35 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
..
djangocms-blog documentation master file, created by
sphinx-quickstart on Sun Jun 5 23:27:04 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
################################################
Welcome to djangocms-frontend's documentation!
################################################
Expand All @@ -12,39 +6,42 @@
djangocms-frontend
********************

**djangocms-frontend** is a plugin bundle based on `djangocms_bootstrap5
<https://github.com/gl-agnx/djangocms-bootstrap5>`_. Its objective is to
provide a set of popular frontend components independent of the
currently used frontend framework such as Bootstrap, or its specific
version.
**django CMS Frontend** is a plugin bundle which originally built on and improved
the architecture of `djangocms-bootstrap4 <https://github.com/django-cms/djangocms-bootstrap4>`_.
Its objective is to provide a toolset to quickly create re-usable frontend
components and comes preloaded with a set of popular frontend components
independent of the currently used frontend framework such as Bootstrap, or
its specific version.

.. image:: ../../preview.png

**************
Key features
**************

- Support of `Bootstrap 5 <https://getbootstrap.com>`_.
- **Easy to implement re-usable frontend custom components**, which in the
simples case consist of a template and declarative sort of form class.

- **Separation of plugins from css framework**, i.e., no need to
rebuild you site's plugin tree if css framework is changed in the
future, e.g., from Bootstrap 5 to a future version.
- Support of `Bootstrap 5 <https://getbootstrap.com>`_, django CMS 3.8+
and django CMS 4 out of the box.

- **New link plugin** allowing to link to internal pages provided by
other applications, such as `djangocms-blog
<https://github.com/nephila/djangocms-blog>`_.
- **Separation of plugins from css framework**, i.e. no need to
rebuild you site's plugin tree if css framework is changed in the
future, e.g. from Bootstrap 5 to a future version.

- **Nice and well-arranged admin frontend** of `djangocms-bootstrap4
<https://github.com/django-cms/djangocms-bootstrap4>`_
- Leverage of new **djangocms-link features** allowing to link to internal pages
provided by other applications, such as `djangocms-blog
<https://github.com/nephila/djangocms-blog>`_.

- Management command to **migrate from djangocms-bootstrap4**. This
command automatically migrates all djangocms-bootstrap4 plugins to
djangocms-frontend.
- **Nice and well-arranged admin frontend** of `djangocms-bootstrap4
<https://github.com/django-cms/djangocms-bootstrap4>`_

- **Extensible** within the project and with separate project (e.g., a
theme app)
- **Extensible** within the project and with separate project (e.g. a
theme app). Create your own components with a few lines of code only.

- **Accordion** plugin.
- **Plugins are re-usable as UI components** anywhere in your project
(e.g. in a custom app) giving your whole project a more consistent
user experience.

*************
Description
Expand All @@ -62,10 +59,6 @@ Instead all design parameters are stored in a common JSON field and
future releases of improved frontend features will not require to
rebuild your full plugin tree.

The link plugin has been rewritten to not allow internal links to other
CMS pages, but also to other django models such as, e.g., posts of
`djangocms-blog <https://github.com/nephila/djangocms-blog>`_.

**djangocms-frontend** provides a set of plugins to structure your
layout. This includes three basic elements

Expand All @@ -80,10 +73,6 @@ Components
to grasp and easy to use look. Alerts or cards are examples of
components.

Forms
To nicely integrate formss into your page we recommend
**djangocms-form-builder** which works stand-alone but also nicely
integrates with **djangocms-frontend**.

Contents
========
Expand All @@ -92,9 +81,9 @@ Contents
:maxdepth: 3

getting_started
custom_components
grid
components
custom_components
how-to/index
reference

Expand Down
4 changes: 4 additions & 0 deletions private/sass/components/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
}

ul.nav {
&:has(> li ~ div) {
// Hide single tab
display: none;
}
.nav-item {
margin-inline-end: 1rem;
}
Expand Down

0 comments on commit fdfe7f2

Please sign in to comment.