diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 075d1fc9..2c26da02 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,11 @@ Release history and notes ===================================== +0.3.1 +------------------------------------- +2014-11-19 + +- DjangoCMS integration app. + 0.3 ------------------------------------- 2014-11-09 @@ -11,7 +17,7 @@ need to do is update the app paths in the ``settings`` module of your project. - Minor core improvements related to the themeing of the form handler plugins. - Several presentational form element plugins have been renamed. The ``fobi.contrib.plugins.form_elements.content.image`` plugin has been - renamed to `fobi.contrib.plugins.form_elements.content.content_image`. + renamed to ``fobi.contrib.plugins.form_elements.content.content_image``. The ``fobi.contrib.plugins.form_elements.content.text`` plugin has been renamed to ``fobi.contrib.plugins.form_elements.content.content_text``. The ``fobi.contrib.plugins.form_elements.content.video`` plugin has been @@ -19,7 +25,7 @@ need to do is update the app paths in the ``settings`` module of your project. If you have used any of the above mentioned plugins, make sure to update the app paths in the ``settings`` module of your project. - The ``fobi.contrib.plugins.form_elements.content.dummy`` plugin has been moved - to ``fobi.contrib.plugins.form_elements.text.dummy`` location. If you have + to ``fobi.contrib.plugins.form_elements.test.dummy`` location. If you have used it, make sure to update the its' path in the ``settings`` module of your project. - Added readme to the following content form element plugins: ``dummy``, diff --git a/MANIFEST.in b/MANIFEST.in index b2b9d163..8f33c1e5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -25,7 +25,7 @@ recursive-include src/fobi/contrib/themes/foundation5/templates * recursive-include src/fobi/contrib/themes/foundation5/widgets/form_handlers/db_store_foundation5_widget/templates * recursive-include src/fobi/contrib/themes/simple/templates * -#recursive-include src/fobi/contrib/apps/djangocms_integration/templates * +recursive-include src/fobi/contrib/apps/djangocms_integration/templates * #recursive-include src/fobi/contrib/apps/feincms_integration/templates * recursive-include src/fobi/contrib/plugins/form_elements/content/content_image/templates * diff --git a/README.rst b/README.rst index 32d9d2b9..e2e05094 100644 --- a/README.rst +++ b/README.rst @@ -56,6 +56,7 @@ Main features and highlights - Theming. There are 3 ready to use themes bundled: Bootstrap 3, Foundation 5 and Simple (in style of Django admin). - Implemented integration with FeinCMS (in a form of a FeinCMS Page widget). +- Implemented integration with DjangoCMS (in a form of a DjangoCMS Page plugin). - Reordering of form elements using drag-n-drop. - Data export (``db_store`` form handler plugin) into XLS/CSV format. diff --git a/TODOS.rst b/TODOS.rst index 420092cf..332e8868 100644 --- a/TODOS.rst +++ b/TODOS.rst @@ -217,13 +217,22 @@ Should haves + Make it possible to use a custom user model. + Improve the "Simple" theme (Django admin integration part). + Place a basic README.rst in each plugin. -- Make it possible to use something else than Django's ORM (django-mongoengine, - SQLAlchemy). ++ As another prove of concept, write an integration app for Django-CMS. + Add birthday field. + Add data export features to ``db_store`` plugin. ++ Make 3 base templates for the DjangoCMS integration app. Save things in + settings and make the template to be chosen depending on the fobi_theme ( + likely, move the declation of the FOBI_THEME above the declaration of the + Django-CMS templates). +- Rename the ``birthday`` field to ``date_drop_down`` field. +- Make a real ``birthday`` field (with no year selection). +- Improve the Django-CMS integration app (make sure it works with + Django-CMS < 3.0). +- Make it possible to use something else than Django's ORM (django-mongoengine, + SQLAlchemy). - Fix the view saved form entries template (nicer look) for Foundation 5 theme. -- Fix the input_format option in the date and datetime fields. +- Fix the ``input_format`` option in the date and datetime fields. - Finish form importers concept and the MailChimp form importer plugin. - Make sure it's possible to assign CSS and JS files to the form handler plugins. @@ -267,7 +276,6 @@ Could haves - Add datetime range and date range fields. - Add a property "allow_multiple" to the form handlers, for form handlers. - Make a django theme for jquery UI. -- As another prove of concept, write an integration app for Django-CMS. - Base fieldset. Allow users to add more than one field to a fieldset. - Make it possible (just checkbox) to set a fieldset as clonable. - Confugure defaults values of each plugin in projects' settings module. @@ -279,7 +287,7 @@ Could haves - Finish select multiple model objects plugin (issue with processing form data on form submit). - Add option to redirect to another page. -- Conditional inputs +- Conditional inputs. - Perhaps, completely re-write the base template for the foundation 5 theme? Would haves diff --git a/docs/fobi.contrib.apps.djangocms_integration.rst b/docs/fobi.contrib.apps.djangocms_integration.rst index 2aa41b65..b53915a7 100644 --- a/docs/fobi.contrib.apps.djangocms_integration.rst +++ b/docs/fobi.contrib.apps.djangocms_integration.rst @@ -36,6 +36,14 @@ fobi.contrib.apps.djangocms_integration.defaults module :undoc-members: :show-inheritance: +fobi.contrib.apps.djangocms_integration.helpers module +------------------------------------------------------ + +.. automodule:: fobi.contrib.apps.djangocms_integration.helpers + :members: + :undoc-members: + :show-inheritance: + fobi.contrib.apps.djangocms_integration.models module ----------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index f7eaa84a..afccac9b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -56,6 +56,7 @@ Main features and highlights - Theming. There are 3 ready to use themes bundled: Bootstrap 3, Foundation 5 and Simple (in style of Django admin). - Implemented integration with FeinCMS (in a form of a FeinCMS Page widget). +- Implemented integration with DjangoCMS (in a form of a DjangoCMS Page plugin). - Reordering of form elements using drag-n-drop. - Data export (``db_store`` form handler plugin) into XLS/CSV format. diff --git a/examples/requirements.txt b/examples/requirements.txt index a9d4b2f8..129ce696 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -1,5 +1,4 @@ Django>=1.5,<1.8 -FeinCMS>=1.9,<1.10 Jinja2 MarkupSafe MySQL-python diff --git a/examples/requirements_djangocms.txt b/examples/requirements_djangocms.txt new file mode 100644 index 00000000..2d74e74a --- /dev/null +++ b/examples/requirements_djangocms.txt @@ -0,0 +1,5 @@ +django-cms==3.0.6 +#django-cms==2.4.1 +djangocms-picture +djangocms-snippet +djangocms-text-ckeditor diff --git a/examples/requirements_feincms.txt b/examples/requirements_feincms.txt new file mode 100644 index 00000000..fd18835f --- /dev/null +++ b/examples/requirements_feincms.txt @@ -0,0 +1 @@ +FeinCMS>=1.9,<1.10 \ No newline at end of file diff --git a/examples/simple/admin_tools_dashboard/__init__.py b/examples/simple/admin_tools_dashboard/__init__.py index ef1be50e..823271c1 100644 --- a/examples/simple/admin_tools_dashboard/__init__.py +++ b/examples/simple/admin_tools_dashboard/__init__.py @@ -10,6 +10,7 @@ And to activate the app index dashboard:: ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'admin_tools_dashboard.CustomAppIndexDashboard' """ +from django.conf import settings from django.utils.translation import ugettext, ugettext_lazy as _ from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard @@ -42,13 +43,23 @@ class CustomIndexDashboard(Dashboard): ] )) - # FeinCMS pages - self.children.append(modules.AppList( - _('Pages'), - models = conf.feincms_pages, - collapsible = False, - deletable = False - )) + if 'feincms' in settings.INSTALLED_APPS: + # FeinCMS pages + self.children.append(modules.AppList( + _('FeinCMS Pages'), + models = conf.feincms_pages, + collapsible = False, + deletable = False + )) + + if 'cms' in settings.INSTALLED_APPS: + # DjangoCMS pages + self.children.append(modules.AppList( + _('DjangoCMS Pages'), + models = conf.djangocms_pages, + collapsible = False, + deletable = False + )) # Append an app list module for "Administration" self.children.append(modules.AppList( diff --git a/examples/simple/admin_tools_dashboard/conf.py b/examples/simple/admin_tools_dashboard/conf.py index e1c08ebe..e44b0d68 100644 --- a/examples/simple/admin_tools_dashboard/conf.py +++ b/examples/simple/admin_tools_dashboard/conf.py @@ -24,6 +24,11 @@ fobi_data = [ feincms_pages = [ 'page.*', ] + +djangocms_pages = [ + 'cms.models.*', +] + # ******************************* # ************ Django *********** # ******************************* diff --git a/examples/simple/admin_tools_dashboard/menu.py b/examples/simple/admin_tools_dashboard/menu.py index 150cc0c0..096a698e 100644 --- a/examples/simple/admin_tools_dashboard/menu.py +++ b/examples/simple/admin_tools_dashboard/menu.py @@ -6,6 +6,7 @@ To activate your custom menu add the following to your settings.py:: ADMIN_TOOLS_MENU = 'admin_tools_dashboard.menu.CustomMenu' """ +from django.conf import settings from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ @@ -38,11 +39,19 @@ class CustomMenu(Menu): ] )) - # FeinCMS pages integration - self.children.append(items.AppList( - _('Pages'), - models = conf.feincms_pages - )) + if 'feincms' in settings.INSTALLED_APPS: + # FeinCMS pages integration + self.children.append(items.AppList( + _('FeinCMS Pages'), + models = conf.feincms_pages + )) + + if 'cms' in settings.INSTALLED_APPS: + # DjangoCMS pages integration + self.children.append(items.AppList( + _('DjangoCMS Pages'), + models = conf.djangocms_pages + )) # append an app list module for "Administration" self.children.append(items.AppList( diff --git a/examples/simple/runserver-bootstrap3-theme-djangocms-integration.sh b/examples/simple/runserver-bootstrap3-theme-djangocms-integration.sh new file mode 100755 index 00000000..32d9d50d --- /dev/null +++ b/examples/simple/runserver-bootstrap3-theme-djangocms-integration.sh @@ -0,0 +1,2 @@ +#workon fobi +./manage.py runserver 0.0.0.0:8000 --settings=settings_bootstrap3_theme_djangocms --traceback -v 3 diff --git a/examples/simple/settings.py b/examples/simple/settings.py index 8b819707..819d6709 100644 --- a/examples/simple/settings.py +++ b/examples/simple/settings.py @@ -295,6 +295,20 @@ FOBI_CUSTOM_THEME_DATA = { ), ], }, + 'djangocms_integration': { + 'form_template_choices': [ + ( + 'fobi/bootstrap3_extras/view_embed_form_entry_ajax.html', + gettext("Custom bootstrap3 embed form view template") + ), + ], + 'success_page_template_choices': [ + ( + 'fobi/bootstrap3_extras/embed_form_entry_submitted_ajax.html', + gettext("Custom bootstrap3 embed form entry submitted template") + ), + ], + }, }, 'foundation5': { 'page_header_html_class': '', @@ -317,6 +331,20 @@ FOBI_CUSTOM_THEME_DATA = { ), ], }, + 'djangocms_integration': { + 'form_template_choices': [ + ( + 'fobi/foundation5_extras/view_embed_form_entry_ajax.html', + gettext("Custom foundation5 embed form view template") + ), + ], + 'success_page_template_choices': [ + ( + 'fobi/foundation5_extras/embed_form_entry_submitted_ajax.html', + gettext("Custom foundation5 embed form entry submitted template") + ), + ], + }, }, 'simple': { 'page_header_html_class': '', @@ -327,6 +355,8 @@ FOBI_CUSTOM_THEME_DATA = { 'form_primary_button_html_class': 'btn-primary', 'feincms_integration': { }, + 'djangocms_integration': { + }, } } @@ -435,20 +465,31 @@ except: pass if DEBUG and DEBUG_TOOLBAR: - # debug_toolbar - MIDDLEWARE_CLASSES += ( - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ) + try: + # Make sure the django-debug-toolbar is installed + import debug_toolbar - INSTALLED_APPS += ( - 'debug_toolbar', - ) + # debug_toolbar + MIDDLEWARE_CLASSES += ( + 'debug_toolbar.middleware.DebugToolbarMiddleware', + ) - DEBUG_TOOLBAR_CONFIG = { - 'INTERCEPT_REDIRECTS': False, - } + INSTALLED_APPS += ( + 'debug_toolbar', + ) + + DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + } + except ImportError: + pass if DEBUG and TEMPLATE_DEBUG: - INSTALLED_APPS += ( - 'template_debug', - ) + try: + # Make sure the django-template-debug is installed + import template_debug + INSTALLED_APPS += ( + 'template_debug', + ) + except ImportError: + pass diff --git a/examples/simple/settings_bootstrap3_theme_djangocms.py b/examples/simple/settings_bootstrap3_theme_djangocms.py new file mode 100644 index 00000000..8d2afb80 --- /dev/null +++ b/examples/simple/settings_bootstrap3_theme_djangocms.py @@ -0,0 +1,67 @@ +from settings import * + +INSTALLED_APPS = list(INSTALLED_APPS) +INSTALLED_APPS += [ + 'cms', # DjangoCMS + 'mptt', + 'menus', + 'sekizai', + #'djangocms_admin_style', + + # Some plugins + 'djangocms_picture', + 'djangocms_snippet', + + 'fobi.contrib.apps.djangocms_integration', # Fobi DjangoCMS app + + #'djangocms_page', # Example +] + +try: + #INSTALLED_APPS.remove('admin_tools') \ + # if 'admin_tools' in INSTALLED_APPS else None + #INSTALLED_APPS.remove('admin_tools.menu') \ + # if 'admin_tools.menu' in INSTALLED_APPS else None + INSTALLED_APPS.remove('admin_tools.dashboard') \ + if 'admin_tools.dashboard' in INSTALLED_APPS else None +except Exception as e: + pass + +MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) +MIDDLEWARE_CLASSES += [ + #'django.middleware.cache.UpdateCacheMiddleware', + 'cms.middleware.page.CurrentPageMiddleware', + 'cms.middleware.user.CurrentUserMiddleware', + 'cms.middleware.toolbar.ToolbarMiddleware', + 'cms.middleware.language.LanguageCookieMiddleware', + #'django.middleware.cache.FetchFromCacheMiddleware', +] + +TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS) +TEMPLATE_CONTEXT_PROCESSORS += [ + 'cms.context_processors.media', + 'sekizai.context_processors.sekizai', + 'cms.context_processors.cms_settings', +] + +FOBI_DEFAULT_THEME = 'bootstrap3' +#FOBI_DEFAULT_THEME = 'foundation5' +#FOBI_DEFAULT_THEME = 'simple' + +CMS_TEMPLATES = ( + ('cms_page/{0}/page_with_sidebar.html'.format(FOBI_DEFAULT_THEME), + 'General template with sidebar for {0}'.format(FOBI_DEFAULT_THEME)), + ('cms_page/{0}/page_without_sidebar.html'.format(FOBI_DEFAULT_THEME), + 'General template without sidebar for {0}'.format(FOBI_DEFAULT_THEME)), +) + +MIGRATION_MODULES = { + 'cms': 'cms.migrations_django', + 'menus': 'menus.migrations_django', +} + +LANGUAGE_CODE = 'en' + +#FEINCMS_RICHTEXT_INIT_CONTEXT = { +# 'TINYMCE_JS_URL': STATIC_URL + 'tiny_mce/tiny_mce.js', +#} diff --git a/examples/simple/settings_bootstrap3_theme_feincms.py b/examples/simple/settings_bootstrap3_theme_feincms.py index dfdbe59c..09f187e6 100644 --- a/examples/simple/settings_bootstrap3_theme_feincms.py +++ b/examples/simple/settings_bootstrap3_theme_feincms.py @@ -9,6 +9,13 @@ INSTALLED_APPS += [ 'page', # Example ] +try: + #INSTALLED_APPS.remove('admin_tools') if 'admin_tools' in INSTALLED_APPS else None + #INSTALLED_APPS.remove('admin_tools.menu') if 'admin_tools.menu' in INSTALLED_APPS else None + INSTALLED_APPS.remove('admin_tools.dashboard') if 'admin_tools.dashboard' in INSTALLED_APPS else None +except Exception as e: + pass + FEINCMS_RICHTEXT_INIT_CONTEXT = { 'TINYMCE_JS_URL': STATIC_URL + 'tiny_mce/tiny_mce.js', } diff --git a/examples/simple/templates/admin/README.rst b/examples/simple/templates/admin/README.rst new file mode 100644 index 00000000..58c95c56 --- /dev/null +++ b/examples/simple/templates/admin/README.rst @@ -0,0 +1,3 @@ +===================================== +django.contrib.admin custom templates +===================================== \ No newline at end of file diff --git a/examples/simple/templates/cms_page/README.rst b/examples/simple/templates/cms_page/README.rst new file mode 100644 index 00000000..32882ee3 --- /dev/null +++ b/examples/simple/templates/cms_page/README.rst @@ -0,0 +1,3 @@ +============================ +DjangoCMS page templates +============================ \ No newline at end of file diff --git a/examples/simple/templates/cms_page/base.html b/examples/simple/templates/cms_page/base.html new file mode 100644 index 00000000..1f955cdb --- /dev/null +++ b/examples/simple/templates/cms_page/base.html @@ -0,0 +1,162 @@ +{% load static i18n cms_tags sekizai_tags menu_tags placeholder_tags %} + + +
+ + + + + + + {% block favicon %} + + {% endblock favicon %} + ++ +
+ {% endblock responsive-nav %} + + {% block content-wrapper %} +