mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-10 22:03:09 +00:00
add django cms admin style theme widget for content_richtext plugin
This commit is contained in:
parent
31ee066f09
commit
93523eb683
5 changed files with 84 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
=========================================================================================================================
|
||||
fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_djangocms_admin_style_theme_widget
|
||||
=========================================================================================================================
|
||||
A rich-text widget to the ``content_richtext`` plugin (for Simple theme).
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Add ``fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_djangocms_admin_style_theme_widget``
|
||||
to the ``INSTALLED_APPS`` in your ``settings.py``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# ...
|
||||
'fobi.contrib.themes.djangocms_admin_style_theme',
|
||||
'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_djangocms_admin_style_theme_widget',
|
||||
'fobi.contrib.plugins.form_elements.content.content_richtext',
|
||||
# ...
|
||||
)
|
||||
|
||||
2. Specify ``simple`` as a default theme in your ``settings.py``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
FOBI_DEFAULT_THEME = 'djangocms_admin_style_theme'
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.' \
|
||||
'form_elements.content_richtext_djangocms_admin_style_theme_widget'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('default_app_config',)
|
||||
|
||||
default_app_config = 'fobi.contrib.themes.djangocms_admin_style_theme.' \
|
||||
'widgets.form_elements.' \
|
||||
'content_richtext_djangocms_admin_style_theme_widget.' \
|
||||
'apps.Config'
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.' \
|
||||
'form_elements.' \
|
||||
'content_richtext_djangocms_admin_style_theme_widget.apps'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('Config',)
|
||||
|
||||
try:
|
||||
from django.apps import AppConfig
|
||||
|
||||
class Config(AppConfig):
|
||||
"""Config."""
|
||||
|
||||
name = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.' \
|
||||
'form_elements.' \
|
||||
'content_richtext_djangocms_admin_style_theme_widget'
|
||||
label = 'fobi_contrib_themes_djangocms_admin_style_theme_widgets_' \
|
||||
'form_elements_content_richtext_djangocms_admin_style_theme_' \
|
||||
'widget'
|
||||
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
from fobi.base import form_element_plugin_widget_registry
|
||||
from fobi.contrib.plugins.form_elements.content.content_richtext.widgets \
|
||||
import (
|
||||
BaseContentRichTextPluginWidget
|
||||
)
|
||||
from fobi.contrib.themes.simple import UID
|
||||
|
||||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.' \
|
||||
'form_elements.' \
|
||||
'content_richtext_djangocms_admin_style_theme_widget.' \
|
||||
'fobi_form_elements'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('ContentRichTextPluginWidget',)
|
||||
|
||||
|
||||
class ContentRichTextPluginWidget(BaseContentRichTextPluginWidget):
|
||||
"""ContentRichText plugin widget for djangocms_admin_style theme."""
|
||||
|
||||
theme_uid = UID
|
||||
|
||||
|
||||
# Registering the widget
|
||||
form_element_plugin_widget_registry.register(ContentRichTextPluginWidget)
|
||||
Loading…
Reference in a new issue