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 %} + + {% block page-title %}{% page_attribute page_title %}{% endblock page-title %} | {% block site-title %}{% endblock site-title %} + + {% block stylesheets %} + {##} + {% endblock stylesheets %} + + {% block theme-stylesheets %} + {##} + + {% for css_file in fobi_theme.get_media_css %} + + {% endfor %} + + {% endblock theme-stylesheets %} + + {% block extra-stylesheets %} + + + {% endblock extra-stylesheets %} + + {% block head-javascripts %} + + + {% endblock head-javascripts %} + + {% block extra-head-javascripts %}{% endblock extra-head-javascripts %} + + {% block extrahead %}{% endblock extrahead %} + + {% render_block "css" %} + + + + {% cms_toolbar %} + {% block before-main-wrapper %} + {% endblock %} + + {% block main-wrapper %} + + {% block navbar-wrapper %} + + {% endblock navbar-wrapper %} + + {% block main-content-wrapper %} +
+ {% block messages-wrapper %} + {% include fobi_theme.messages_snippet_template_name %} + {% endblock messages-wrapper %} + {% block main-content %} +
+ + + {% block responsive-nav %} +

+ +

+ {% endblock responsive-nav %} + + {% block content-wrapper %} +
+
+ {% block content %} + {% endblock content %} +
+
+ {% endblock content-wrapper %} +
+ + {% block sidebar-wrapper %} + + {% endblock sidebar-wrapper %} +
+ {% endblock main-content %} + + {% block content-footer-separator %} +
+ {% endblock content-footer-separator %} + + {% block footer-wrapper %} + + {% endblock footer-wrapper %} + + + {% endblock main-content-wrapper %} + + + {% endblock main-wrapper %} + + {% block javascripts %} + {##} + {##} + {% endblock javascripts %} + + {% block theme-javascripts %} + {##} + {% for js_file in fobi_theme.get_media_js %} + + {% endfor %} + + {% endblock theme-javascripts %} + + {% render_block "js" %} + + diff --git a/examples/simple/templates/cms_page/bootstrap3/README.rst b/examples/simple/templates/cms_page/bootstrap3/README.rst new file mode 100644 index 00000000..ad3a19de --- /dev/null +++ b/examples/simple/templates/cms_page/bootstrap3/README.rst @@ -0,0 +1,5 @@ +======================================= +Bootstrap3 page templates for DjangoCMS +======================================= +DjangoCMS templates for the Bootstrap3 theme +(``fobi.contrib.themes.bootstrap3``). diff --git a/examples/simple/templates/cms_page/bootstrap3/base.html b/examples/simple/templates/cms_page/bootstrap3/base.html new file mode 100644 index 00000000..3cfb87f9 --- /dev/null +++ b/examples/simple/templates/cms_page/bootstrap3/base.html @@ -0,0 +1,9 @@ +{% extends "cms_page/base.html" %} + +{% load i18n %} + +{% block navbar-class %}navbar navbar-fixed-top navbar-inverse{% endblock navbar-class %} + +{% block navbar-container-class %}container{% endblock navbar-container-class %} + +{% block site-title %}{% trans "DjangoCMS Bootstrap 3 example" %}{% endblock site-title %} diff --git a/examples/simple/templates/cms_page/bootstrap3/page_with_sidebar.html b/examples/simple/templates/cms_page/bootstrap3/page_with_sidebar.html new file mode 100644 index 00000000..86da1fa9 --- /dev/null +++ b/examples/simple/templates/cms_page/bootstrap3/page_with_sidebar.html @@ -0,0 +1,11 @@ +{% extends "cms_page/bootstrap3/base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} + {% placeholder page_sidebar %} +{% endblock %} diff --git a/examples/simple/templates/cms_page/bootstrap3/page_without_sidebar.html b/examples/simple/templates/cms_page/bootstrap3/page_without_sidebar.html new file mode 100644 index 00000000..dd45d842 --- /dev/null +++ b/examples/simple/templates/cms_page/bootstrap3/page_without_sidebar.html @@ -0,0 +1,10 @@ +{% extends "cms_page/bootstrap3/base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block main-content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} +{% endblock %} diff --git a/examples/simple/templates/cms_page/foundation5/README.rst b/examples/simple/templates/cms_page/foundation5/README.rst new file mode 100644 index 00000000..5f58fafc --- /dev/null +++ b/examples/simple/templates/cms_page/foundation5/README.rst @@ -0,0 +1,5 @@ +======================================== +Foundation5 page templates for DjangoCMS +======================================== +DjangoCMS templates for the Foundation5 theme +(``fobi.contrib.themes.foundation5``). diff --git a/examples/simple/templates/cms_page/foundation5/base.html b/examples/simple/templates/cms_page/foundation5/base.html new file mode 100644 index 00000000..e612ff7f --- /dev/null +++ b/examples/simple/templates/cms_page/foundation5/base.html @@ -0,0 +1,160 @@ +{% extends "cms_page/base.html" %} + +{# Foundation 5 master base template #} + +{% load i18n static %} + +{% block html-attributes %} class="no-js"{% endblock html-attributes %} + +{% block site-title %}{% trans "DjangoCMS Foundation 5 example" %}{% endblock site-title %} + +{% block navbar-wrapper %} + +{% endblock navbar-wrapper %} + +{% block navbar-content %} + + + + +{% endblock navbar-content %} + +{% block responsive-nav %}{% endblock responsive-nav %} + +{% block main-content-wrapper %} + {% block messages-wrapper %} + {% include fobi_theme.messages_snippet_template_name %} + {% endblock messages-wrapper %} + +{% block main-content %} +
+ + + + + {% block content-wrapper %} + + {% block content %} +

Get in Touch!

+
+ +

Risus ligula, aliquam nec fermentum vitae, sollicitudin eget urna. Donec + dignissim nibh fermentum odio ornare sagittis.

+ + + {% endblock content %} + + {% endblock content-wrapper %} + + {% block sidebar-wrapper %} +
+ {% block sidebar %} + {% block sidebar-content %} +

Get In Touch!

+
+ +
+ Call To Action! +
+
+ Call To Action! +
+ {% endblock sidebar-content %} + {% endblock sidebar %} +
+ {% endblock sidebar-wrapper %} +
+ + + +{% endblock main-content %} +{% endblock main-content-wrapper %} diff --git a/examples/simple/templates/cms_page/foundation5/page_with_sidebar.html b/examples/simple/templates/cms_page/foundation5/page_with_sidebar.html new file mode 100644 index 00000000..79488509 --- /dev/null +++ b/examples/simple/templates/cms_page/foundation5/page_with_sidebar.html @@ -0,0 +1,15 @@ +{% extends "cms_page/foundation5/base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} + {% placeholder page_sidebar %} +{% endblock %} + +{% block navbar-menu-content %} +{% endblock navbar-menu-content %} + diff --git a/examples/simple/templates/cms_page/foundation5/page_without_sidebar.html b/examples/simple/templates/cms_page/foundation5/page_without_sidebar.html new file mode 100644 index 00000000..005fb4c0 --- /dev/null +++ b/examples/simple/templates/cms_page/foundation5/page_without_sidebar.html @@ -0,0 +1,13 @@ +{% extends "cms_page/foundation5//base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} +{% endblock %} + +{% block navbar-menu-content %} +{% endblock navbar-menu-content %} diff --git a/examples/simple/templates/cms_page/simple/README.rst b/examples/simple/templates/cms_page/simple/README.rst new file mode 100644 index 00000000..6ba4a723 --- /dev/null +++ b/examples/simple/templates/cms_page/simple/README.rst @@ -0,0 +1,4 @@ +======================================== +Simple page templates for DjangoCMS +======================================== +DjangoCMS templates for the Simple theme (``fobi.contrib.themes.simple``). \ No newline at end of file diff --git a/examples/simple/templates/cms_page/simple/base.html b/examples/simple/templates/cms_page/simple/base.html new file mode 100644 index 00000000..b37ab89d --- /dev/null +++ b/examples/simple/templates/cms_page/simple/base.html @@ -0,0 +1,104 @@ +{% load static future_compat i18n cms_tags sekizai_tags menu_tags placeholder_tags %} + + +{% block page-title %}{% endblock page-title %} | {% block site-title %}{% trans "DjangoCMS Simple example" %}{% endblock site-title %} +{% block extrastyle %}{% endblock %} + +{% block stylesheets %} +{##} +{% endblock stylesheets %} + +{% block theme-stylesheets %} +{##} + +{% for css_file in fobi_theme.get_media_css %} + +{% endfor %} + +{% endblock theme-stylesheets %} + +{% block extra-stylesheets %}{% endblock extra-stylesheets %} + +{% block head-javascripts %} + + +{% endblock head-javascripts %} + +{% block extra-head-javascripts %}{% endblock extra-head-javascripts %} + +{% block extrahead %}{% endblock extrahead %} + +{% block blockbots %}{% endblock %} + +{% render_block "css" %} + + +{% load i18n %} + + +{% cms_toolbar %} + +{% block main-wrapper %} + +
+ + + {% block messages %} + {% if messages %} + + {% endif %} + {% endblock messages %} + + {% block main-content-wrapper %} + + + {% block main-content %} + {% block content-wrapper %} + + {% block content %} + {{ content }} + {% endblock %} + {% endblock content-wrapper %} + + {% block sidebar-wrapper %} + {% block sidebar %}{% endblock %} + {% endblock sidebar-wrapper %} + + {% endblock main-content %} + + + + {% block footer-wrapper %} + {% block footer %}{% endblock %} + {% endblock footer-wrapper %} + + {% endblock main-content-wrapper %} + + +
+ + +{% endblock main-wrapper %} + + {% block javascripts %} + {##} + {##} + {% endblock javascripts %} + + {% block theme-javascripts %} + {##} + {% for js_file in fobi_theme.get_media_js %} + + {% endfor %} + + {% endblock theme-javascripts %} + + {% render_block "js" %} + + + diff --git a/examples/simple/templates/cms_page/simple/page_with_sidebar.html b/examples/simple/templates/cms_page/simple/page_with_sidebar.html new file mode 100644 index 00000000..55f04e86 --- /dev/null +++ b/examples/simple/templates/cms_page/simple/page_with_sidebar.html @@ -0,0 +1,11 @@ +{% extends "cms_page/simple/base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block main-content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} + {% placeholder page_sidebar %} +{% endblock %} diff --git a/examples/simple/templates/cms_page/simple/page_without_sidebar.html b/examples/simple/templates/cms_page/simple/page_without_sidebar.html new file mode 100644 index 00000000..94728f6e --- /dev/null +++ b/examples/simple/templates/cms_page/simple/page_without_sidebar.html @@ -0,0 +1,10 @@ +{% extends "cms_page/simple//base.html" %} + +{% load cms_tags menu_tags placeholder_tags %} + +{% block main-content %} + {% placeholder page_content %} +{% endblock %} + +{% block sidebar-content %} +{% endblock %} diff --git a/examples/simple/templates/fobi/README.rst b/examples/simple/templates/fobi/README.rst new file mode 100644 index 00000000..a9aed58e --- /dev/null +++ b/examples/simple/templates/fobi/README.rst @@ -0,0 +1,5 @@ +=========================================================== +Custom templates for fobi.contrib.apps.feincms_integration +=========================================================== +Custom templates for rendering the form and the thanks page to be used in +FeinCMS. diff --git a/examples/simple/templates/home/README.rst b/examples/simple/templates/home/README.rst new file mode 100644 index 00000000..9a2a5b86 --- /dev/null +++ b/examples/simple/templates/home/README.rst @@ -0,0 +1,4 @@ +=========================================================== +Custom project home templates for various themes +=========================================================== + diff --git a/examples/simple/templates/page/README.rst b/examples/simple/templates/page/README.rst new file mode 100644 index 00000000..812b3ac8 --- /dev/null +++ b/examples/simple/templates/page/README.rst @@ -0,0 +1,3 @@ +============================ +FeinCMS page templates +============================ \ No newline at end of file diff --git a/examples/simple/templates/registration/README.rst b/examples/simple/templates/registration/README.rst new file mode 100644 index 00000000..0d1e4f50 --- /dev/null +++ b/examples/simple/templates/registration/README.rst @@ -0,0 +1,4 @@ +=========================================================== +django-registration templates +=========================================================== +The ``django-registration`` templates for ``fobi``. diff --git a/examples/simple/urls.py b/examples/simple/urls.py index 6ca166e1..39020757 100644 --- a/examples/simple/urls.py +++ b/examples/simple/urls.py @@ -66,6 +66,13 @@ if 'feincms' in settings.INSTALLED_APPS: url(r'^pages/', include('feincms.urls')), ) +# Conditionally including DjangoCMS URls in case if +# DjangoCMS in installed apps. +if 'cms' in settings.INSTALLED_APPS: + urlpatterns += patterns('', + url(r'^cms-pages/', include('cms.urls')), + ) + # Conditionally including Captcha URls in case if # Captcha in installed apps. if 'captcha' in settings.INSTALLED_APPS: diff --git a/install_djangocms.sh b/install_djangocms.sh new file mode 100755 index 00000000..7c0835db --- /dev/null +++ b/install_djangocms.sh @@ -0,0 +1,10 @@ +#pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +pip install -r examples/requirements.txt +pip install -r examples/requirements_djangocms.txt +python setup.py install +mkdir -p examples/logs examples/db examples/media examples/media/static examples/media/fobi_plugins/content_image +mkdir -p examples/media/fobi_plugins/file +python examples/simple/manage.py collectstatic --noinput --settings=settings_bootstrap3_theme_djangocms --traceback -v 3 +python examples/simple/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_djangocms --traceback -v 3 +python examples/simple/manage.py migrate --noinput --settings=settings_bootstrap3_theme_djangocms --traceback -v 3 +python examples/simple/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_djangocms --traceback -v 3 diff --git a/install_feincms.sh b/install_feincms.sh index 2a7dfad3..b408d27a 100755 --- a/install_feincms.sh +++ b/install_feincms.sh @@ -1,5 +1,6 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools pip install -r examples/requirements.txt +pip install -r examples/requirements_feincms.txt python setup.py install mkdir -p examples/logs examples/db examples/media examples/media/static examples/media/fobi_plugins/content_image mkdir -p examples/media/fobi_plugins/file diff --git a/reinstall_djangocms.sh b/reinstall_djangocms.sh new file mode 100755 index 00000000..38543ed9 --- /dev/null +++ b/reinstall_djangocms.sh @@ -0,0 +1,3 @@ +reset +./uninstall.sh +./install_djangocms.sh \ No newline at end of file diff --git a/setup.py b/setup.py index cae8356f..24c4a9d7 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ template_dirs = [ "src/fobi/contrib/themes/foundation5/widgets/form_handlers/db_store_foundation5_widget", # DB Store widget for Foundation 5 "src/fobi/contrib/themes/simple/templates/simple", # Simple - #"src/fobi/contrib/apps/djangocms_integration/templates/djangocms_integration", # DjangoCMS integration + "src/fobi/contrib/apps/djangocms_integration/templates/djangocms_integration", # DjangoCMS integration #"src/fobi/contrib/apps/feincms_integration/templates/feincms_integration", # FeinCMS integration "src/fobi/contrib/plugins/form_elements/content/content_image/templates/content_image", # Content image @@ -57,7 +57,7 @@ for static_dir in static_dirs: for locale_dir in locale_dirs: locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)] -version = '0.3' +version = '0.3.1' install_requires = [ 'Pillow>=2.0.0', diff --git a/src/fobi/__init__.py b/src/fobi/__init__.py index 96cd555f..c96c004b 100644 --- a/src/fobi/__init__.py +++ b/src/fobi/__init__.py @@ -1,6 +1,6 @@ __title__ = 'django-fobi' -__version__ = '0.3' -__build__ = 0x000010 +__version__ = '0.3.1' +__build__ = 0x00000b __author__ = 'Artur Barseghyan ' __copyright__ = 'Copyright (c) 2014 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' diff --git a/src/fobi/templates/fobi/generic/_base.html b/src/fobi/templates/fobi/generic/_base.html index 8ae85fb4..b0caabee 100644 --- a/src/fobi/templates/fobi/generic/_base.html +++ b/src/fobi/templates/fobi/generic/_base.html @@ -43,6 +43,8 @@ + {% block before-main-wrapper %}{% endblock %} + {% block main-wrapper %} {% block navbar-wrapper %}