diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 112d722e..d0b78ec8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,15 @@ Changelog ========= +0.9.4 +===== + +* Refactor forms app into independent project +* Deprecation warning for forms app +* Add dark mode compatibility with django CMS 3.11 +* Remove strong dependency on djangocms-icon +* Sync github and pypi releases + 0.9.1 ===== diff --git a/README.rst b/README.rst index b41212d2..08f4e254 100644 --- a/README.rst +++ b/README.rst @@ -37,9 +37,6 @@ currently used frontend framework such as Bootstrap, or its specific version. - **Accordion** plugin -- **Forms** plugin for Bootstrap-styled forms on your cms page. Use django-cms' - versatile plugin system to generate your own forms. - ************* Description @@ -125,7 +122,6 @@ For a manual install: 'djangocms_frontend.contrib.carousel', 'djangocms_frontend.contrib.collapse', 'djangocms_frontend.contrib.content', - 'djangocms_frontend.contrib.frontend_forms', 'djangocms_frontend.contrib.grid', 'djangocms_frontend.contrib.image', 'djangocms_frontend.contrib.jumbotron', @@ -141,18 +137,12 @@ If you use **Django < 3.2** please also add ``django-jsonfield-backport`` to your ``requirements.txt`` and ``django_jsonfield_backport`` to your ``INSTALLED_APPS`` list. -To use the forms app ``djangocms_frontend.contrib.frontend_forms`` you will have to have -jQuery installed in your project. ``djangocms_frontend`` does not include -jQuery. - -**djangocms-frontend** has weak dependencies you can install separately or -by adding an option: +**djangocms-frontend** has a weak dependencies on **djangocms-icon** you can +install separately or by adding an option: .. code:: - pip install djangocms-frontend[reCaptcha] # Installs django-recaptcha enabling reCaptcha for forms pip install djangocms-frontend[djangocms-icon] # Installs djangocms-icon for icon support in links - pip install djangocms-frontend[reCaptcha, djangocms-icon] # comma-separate multiple dependencies diff --git a/djangocms_frontend/__init__.py b/djangocms_frontend/__init__.py index d69d16e9..e94731c0 100644 --- a/djangocms_frontend/__init__.py +++ b/djangocms_frontend/__init__.py @@ -1 +1 @@ -__version__ = "0.9.1" +__version__ = "0.9.4" diff --git a/djangocms_frontend/contrib/frontend_forms/apps.py b/djangocms_frontend/contrib/frontend_forms/apps.py index ef18f3ec..93d62597 100644 --- a/djangocms_frontend/contrib/frontend_forms/apps.py +++ b/djangocms_frontend/contrib/frontend_forms/apps.py @@ -12,6 +12,29 @@ class FormsConfig(AppConfig): def ready(self): """Install the URLs""" + + from django.core.checks import Error, Warning, register + + @register() + def deprecation_check(app_configs, **kwargs): + if "djangocms_form_builder" in settings.INSTALLED_APPS: + return [ + Error( + "djangocms_frontend.contrib.frontend_forms and djangocms_form_builder are installed.", + obj=self, + hint="Remove djangocms_frontend.contrib.frontend_forms", + id="djangocms_frontend.E001", + ) + ] + return [ + Warning( + "djangocms_frontend.contrib.frontend_forms will be removed in version 1.0", + obj=self, + hint="Use djangocms-form-builder instead.", + id="djangocms_frontend.W001", + ) + ] + try: reverse("dcf_forms:ajax_form") except NoReverseMatch: # Not installed yet diff --git a/docs/source/forms.rst b/docs/source/forms.rst deleted file mode 100644 index 5c74f049..00000000 --- a/docs/source/forms.rst +++ /dev/null @@ -1,135 +0,0 @@ -####### - Forms -####### - -.. note:: - - Forms a available as of version 0.9.1 - -.. warning:: - - Currently, for forms to work they require **jQuery** to be installed by - the user. - - -**djangocms-frontend** supports rendering of styled forms which is part of -all major frontend frameworks, like Bootstrap 5. The objective is to tightly -integrate forms in the website design. Djangocms-frontend allows as many forms -as you wish on one page. All forms are **ajax/xhr-based**. To this end, -djangocms-frontend extends the django CMS plugin model allowing a form plugin -to receive ajax post requests. - -There are two different ways to manage forms with **djangocms-frontend**: - -1. **Building a form with django CMS' powerful structure board.** This is - fast an easy. It integrates smoothly with other design elements, especially - the grid elements allowing to design simple responsive forms. - - Form actions can be configured by form. Built in actions include saving the - results in the database for later evaluation and mailing submitted forms to - the site admins. Other form actions can be registered. - - If you prefer to have a central form repository, we suggest - **djangocms-alias** to manage your forms centrally. Djangocms-alias becomes - your form editors and forms can be placed on pages by refering to them with - their alias. - -2. **Registering an application-specific form with djangocms-frontend.** If you - already have forms you may register them with djangocms-frontend and allow - editors to use them in the form plugin. If you use - `django-crispy-forms `_ - all form layouts will be retained. If you only have simpler design - requirements, **djangocms-frontend** allows you to use fieldsets as with - admin forms. - -************** -Building forms -************** - -Form plugin -=========== - -All forms live in the Form plugin. A form plugin can be positioned everywhere -except inside another form plugin. - -If you want to use the structure board to build your form you will have to add -the form components as child plugins to a form plugin. If you have registiered -an application-specific form with djangocms-frontend you will be able to select -one of the registered forms for be shown by the form plugin. (If you do both, -the selected form takes precedence over the child plugins.) - -.. image:: screenshots/form-plugin.png - :width: 720 - -In the tab "Submit button" the name and appearance of the submit button is -configured. - - -Form fields -=========== - -The form plugin accepts all regular plugins **plus** special plugins that -represent form fields. These are: - -* Text -* Textarea -* Integer -* Decimal -* Boolean -* Date -* Time -* Date and Time -* Select/Choice -* URL -* Email - -Each field requires an input of then specific form. Some fields (e.g., Boolean -or Select/Choice) offer options on the specific input widget. - -Djangocms frontend will use framework specific widgets or fall back to standard -widgets browsers offer (e.g., date picker). - -*************************** -Using forms from other apps -*************************** - -Other apps can register forms to be used by **djangocms-frontend**. Once at -least one form is registered, the form will appear as a option in the Form -plugin. - -Registration is can simply be done by a decorator or function call: - -.. code:: python - - from django import forms - from djangocms_frontend.contrib.frontend_forms import register_with_frontend - - @register_with_frontend - class MyCoolForm(forms.Form): - ... - - class MyOtherCoolForm(forms.Form): - ... - - register_with_frontend(MyOtherCoolForm) - - - -There are three ways **djangocms-frontend** can render registered forms: - -1. **Regular form rendering**: all fields a shown below one another. This is - only advisable for very simple forms (e.g. a contact form with name, email, - and text body). - -2. **Adding a fieldsets argument to the form**: The ``fieldsets`` work as you - know them from ``ModelAdmin``. See `Django documentation - `_. - This may be the most convenient way of building not-too-complex forms. - **djangocms-frontend** uses the grid system to generate the form layout. - -3. **Using the third party package** `django-crispy-forms `_: - If installed and the form has a property ``helper`` the form is automatically - rendered using **django-crispy-forms**. Note, however, that the submit button - is rendered by the plugin. Hence do not include it into the form (which is - possible with **django-crispy-forms**). - diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index e853e48c..0bdd4a20 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -49,7 +49,6 @@ Add the following entries to your ``INSTALLED_APPS``: 'djangocms_frontend.contrib.carousel', 'djangocms_frontend.contrib.collapse', 'djangocms_frontend.contrib.content', - 'djangocms_frontend.contrib.frontend_forms', 'djangocms_frontend.contrib.grid', 'djangocms_frontend.contrib.image', 'djangocms_frontend.contrib.jumbotron', @@ -65,18 +64,6 @@ Add the following entries to your ``INSTALLED_APPS``: ``requirements.txt`` and add ``"django_jsonfield_backport"`` to your ``INSTALLED_APPS``. -.. note :: jQuery required for forms app to work - - You will have to make jQuery available to your project form the forms app - to work with ajax/xhr calls. A simple way of doing this is to include the - following line in your projects base template. - - .. code:: - - - - For all versions see `code.jQuery.com `_ - Create necessary database table =============================== diff --git a/docs/source/index.rst b/docs/source/index.rst index 70afff79..a8893cbf 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -44,8 +44,7 @@ version. - **Extensible** within the project and with separate project (e.g., a theme app) -- **Accordion** plugin and simple **forms** plugin w/ Bootstrap-styled - forms on your cms page. +- **Accordion** plugin. ************* Description @@ -81,14 +80,10 @@ Components to grasp and easy to use look. Alerts or cards are examples of components. -Forms (work in progress) - Finally, djangocms-frontend lets you display forms in a nice way. - Also, it handles form submit actions, validation etc. Forms can be - easily structured using fieldsets known from django's admin app. But - djangocms-frontend also works with third-party apps like - `django-crispy-forms - `_ for - even more complex layouts. +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 ======== @@ -99,7 +94,6 @@ Contents getting_started grid components - forms howto_guides reference