From 9f5d08ffd7b2d7ae253fcf2e7f15ea6ffdbe8cb9 Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Tue, 10 Feb 2015 14:02:18 +0100 Subject: [PATCH] more on preparing the 0.4.16; adding docs --- .gitignore | 1 + .hgignore | 1 + CHANGELOG.rst | 7 + MANIFEST.in | 2 + QUICK_START.rst | 204 +++++++++++++ README.rst | 12 +- TODOS.rst | 13 + build_docs.sh | 5 - docs/documentation.rst.distrib | 1 + docs/index.rst | 63 ++-- docs/quickstart.rst | 204 +++++++++++++ examples/quickstart/__init__.py | 0 examples/quickstart/local_settings.example | 31 ++ examples/quickstart/manage.py | 10 + examples/quickstart/settings.py | 283 ++++++++++++++++++ examples/quickstart/urls.py | 44 +++ examples/quickstart/wsgi.py | 32 ++ examples/requirements_djangocms.txt | 3 +- examples/simple/local_settings.example | 1 - ...admin-style-theme-djangocms-integration.sh | 2 + examples/simple/settings.py | 3 + ...s_djangocms_admin_style_theme_djangocms.py | 68 +++++ .../{base_site.html => __base_site.html} | 0 examples/simple/urls.py | 2 +- make_pypi_long_description.sh | 2 - make_release.sh | 2 - reinstall.sh | 3 - scripts/build_docs.sh | 8 + clean_up.sh => scripts/clean_up.sh | 2 + install.sh => scripts/install.sh | 4 +- install3.sh => scripts/install3.sh | 4 +- .../install_captcha.sh | 2 + .../install_django17.sh | 2 + .../install_djangocms.sh | 2 + .../install_djangocms_2.sh | 2 + ...install_djangocms_djangocms_admin_style.sh | 12 + .../install_feincms.sh | 2 + .../install_mezzanine.sh | 2 + install_pypi.sh => scripts/install_pypi.sh | 4 +- .../install_recaptcha.sh | 4 +- .../install_verbose.sh | 4 +- make_messages.sh => scripts/make_messages.sh | 3 + scripts/make_pypi_long_description.sh | 4 + scripts/make_release.sh | 4 + rebuild_docs.sh => scripts/rebuild_docs.sh | 4 +- scripts/reinstall.sh | 3 + reinstall3.sh => scripts/reinstall3.sh | 0 .../reinstall_captcha.sh | 0 .../reinstall_django17.sh | 0 .../reinstall_djangocms.sh | 0 .../reinstall_djangocms_2.sh | 0 ...install_djangocms_djangocms_admin_style.sh | 3 + .../reinstall_feincms.sh | 0 .../reinstall_mezzanine.sh | 0 .../reinstall_recaptcha.sh | 0 .../source_install.sh | 0 scripts/test.sh | 6 + scripts/test3.sh | 6 + test_django17.sh => scripts/test_django17.sh | 2 + scripts/test_pypi.sh | 6 + scripts/test_verbose.sh | 6 + uninstall.sh => scripts/uninstall.sh | 4 +- setup.py | 4 +- src/fobi/__init__.py | 4 +- src/fobi/base.py | 2 - .../djangocms_admin_style_theme/README.rst | 43 +++ .../djangocms_admin_style_theme/__init__.py | 9 + .../djangocms_admin_style_theme/apps.py | 14 + .../fobi_themes.py | 149 +++++++++ .../static/admin/img/tool-left.gif | Bin 0 -> 197 bytes .../static/admin/img/tooltag-add.gif | Bin 0 -> 932 bytes .../static/admin/img/tooltag-add_over.gif | Bin 0 -> 336 bytes .../css/fobi.djangocms_admin_style_theme.css | 65 ++++ .../fobi.djangocms_admin_style_theme.edit.css | 115 +++++++ .../fobi.djangocms_admin_style_theme.edit.js | 57 ++++ .../djangocms_admin_style_theme/_base.html | 3 + .../add_form_element_entry.html | 12 + .../add_form_element_entry_ajax.html | 1 + .../add_form_handler_entry.html | 12 + .../add_form_handler_entry_ajax.html | 1 + .../djangocms_admin_style_theme/base.html | 1 + .../base_edit.html | 152 ++++++++++ .../base_view.html | 97 ++++++ .../create_form_entry.html | 6 + .../create_form_entry_ajax.html | 1 + .../dashboard.html | 99 ++++++ .../edit_form_element_entry.html | 12 + .../edit_form_element_entry_ajax.html | 1 + .../edit_form_entry.html | 7 + .../edit_form_entry_ajax.html | 173 +++++++++++ .../edit_form_handler_entry.html | 12 + .../edit_form_handler_entry_ajax.html | 1 + .../form_entry_submitted.html | 1 + .../form_entry_submitted_ajax.html | 1 + .../snippets/form_ajax.html | 11 + .../snippets/form_edit_ajax.html | 18 ++ .../snippets/form_edit_snippet.html | 32 ++ .../snippets/form_properties_snippet.html | 30 ++ .../snippets/form_snippet.html | 37 +++ .../snippets/form_view_ajax.html | 1 + .../snippets/messages_snippet.html | 1 + .../djangocms_admin_style_theme/theme.html | 108 +++++++ .../view_form_entry.html | 1 + .../view_form_entry_ajax.html | 1 + .../widgets/__init__.py | 0 .../widgets/form_handlers/__init__.py | 0 .../widgets/form_handlers/db_store/README.rst | 26 ++ .../form_handlers/db_store/__init__.py | 7 + .../widgets/form_handlers/db_store/apps.py | 14 + .../db_store/fobi_form_elements.py | 23 ++ .../widgets/form_handlers/db_store/models.py | 0 src/fobi/fields.py | 3 + test.sh | 4 - test3.sh | 4 - test_pypi.sh | 4 - test_verbose.sh | 4 - 116 files changed, 2411 insertions(+), 77 deletions(-) create mode 100644 QUICK_START.rst delete mode 100755 build_docs.sh create mode 100644 docs/quickstart.rst create mode 100644 examples/quickstart/__init__.py create mode 100644 examples/quickstart/local_settings.example create mode 100755 examples/quickstart/manage.py create mode 100644 examples/quickstart/settings.py create mode 100644 examples/quickstart/urls.py create mode 100644 examples/quickstart/wsgi.py create mode 100755 examples/simple/runserver-djangocms-admin-style-theme-djangocms-integration.sh create mode 100644 examples/simple/settings_djangocms_admin_style_theme_djangocms.py rename examples/simple/templates/admin/{base_site.html => __base_site.html} (100%) delete mode 100755 make_pypi_long_description.sh delete mode 100755 make_release.sh delete mode 100755 reinstall.sh create mode 100755 scripts/build_docs.sh rename clean_up.sh => scripts/clean_up.sh (78%) rename install.sh => scripts/install.sh (86%) rename install3.sh => scripts/install3.sh (83%) rename install_captcha.sh => scripts/install_captcha.sh (97%) rename install_django17.sh => scripts/install_django17.sh (97%) rename install_djangocms.sh => scripts/install_djangocms.sh (97%) rename install_djangocms_2.sh => scripts/install_djangocms_2.sh (97%) create mode 100755 scripts/install_djangocms_djangocms_admin_style.sh rename install_feincms.sh => scripts/install_feincms.sh (97%) rename install_mezzanine.sh => scripts/install_mezzanine.sh (98%) rename install_pypi.sh => scripts/install_pypi.sh (86%) rename install_recaptcha.sh => scripts/install_recaptcha.sh (86%) rename install_verbose.sh => scripts/install_verbose.sh (80%) rename make_messages.sh => scripts/make_messages.sh (93%) create mode 100755 scripts/make_pypi_long_description.sh create mode 100755 scripts/make_release.sh rename rebuild_docs.sh => scripts/rebuild_docs.sh (77%) create mode 100755 scripts/reinstall.sh rename reinstall3.sh => scripts/reinstall3.sh (100%) rename reinstall_captcha.sh => scripts/reinstall_captcha.sh (100%) rename reinstall_django17.sh => scripts/reinstall_django17.sh (100%) rename reinstall_djangocms.sh => scripts/reinstall_djangocms.sh (100%) rename reinstall_djangocms_2.sh => scripts/reinstall_djangocms_2.sh (100%) create mode 100755 scripts/reinstall_djangocms_djangocms_admin_style.sh rename reinstall_feincms.sh => scripts/reinstall_feincms.sh (100%) rename reinstall_mezzanine.sh => scripts/reinstall_mezzanine.sh (100%) rename reinstall_recaptcha.sh => scripts/reinstall_recaptcha.sh (100%) rename source_install.sh => scripts/source_install.sh (100%) create mode 100755 scripts/test.sh create mode 100755 scripts/test3.sh rename test_django17.sh => scripts/test_django17.sh (88%) create mode 100755 scripts/test_pypi.sh create mode 100644 scripts/test_verbose.sh rename uninstall.sh => scripts/uninstall.sh (78%) create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/README.rst create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/__init__.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tool-left.gif create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tooltag-add.gif create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tooltag-add_over.gif create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.css create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.edit.css create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/js/fobi.djangocms_admin_style_theme.edit.js create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/_base.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_element_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_element_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_edit.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_view.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_snippet.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_properties_snippet.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_snippet.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_view_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/messages_snippet.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/theme.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry_ajax.html create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/__init__.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/__init__.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/README.rst create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/__init__.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/apps.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/fobi_form_elements.py create mode 100644 src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/models.py delete mode 100755 test.sh delete mode 100755 test3.sh delete mode 100755 test_pypi.sh delete mode 100644 test_verbose.sh diff --git a/.gitignore b/.gitignore index c1a2aeea..949dd75c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ fobi/fobi.migrations.rst /src/django_fobi.egg-info /examples/simple/local_settings.py /examples/simple/local_settings_foundation5.py +/examples/quickstart/local_settings.py /src/fobi/contrib/plugins/form_importers/mailchimp_importer/ /src/fobi/nine.py diff --git a/.hgignore b/.hgignore index 9c26dbc4..a30b8fdc 100644 --- a/.hgignore +++ b/.hgignore @@ -26,6 +26,7 @@ syntax: regexp ^examples/simple/local_settings_foundation5\.py ^examples/mezzanine_example/static/media/fobi_plugins/ ^examples/mezzanine_example/static/ +^examples/quickstart/local_settings\.py ^news-images/ ^builddocs/ ^builddocs\.zip diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dadd4d84..2dabebac 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,13 @@ are used for versioning (schema follows below): 0.3.4 to 0.4). - All backwards incompatible changes are mentioned in this document. +0.4.16 +------------------------------------- +2015-02-10 + +- A new theme ``djangocms_admin_style_theme`` added. +- Making ``fobi.fields.NoneField`` always valid. + 0.4.15 ------------------------------------- 2015-01-27 diff --git a/MANIFEST.in b/MANIFEST.in index 84454c35..e02122bf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -15,6 +15,7 @@ recursive-include src/fobi/static * recursive-include src/fobi/contrib/themes/bootstrap3/static * recursive-include src/fobi/contrib/themes/foundation5/static * recursive-include src/fobi/contrib/themes/simple/static * +recursive-include src/fobi/contrib/themes/djangocms_admin_style_theme/static * recursive-include src/fobi/contrib/plugins/form_elements/test/dummy/static * recursive-include src/fobi/contrib/plugins/form_handlers/db_store/static * @@ -26,6 +27,7 @@ recursive-include src/fobi/contrib/themes/bootstrap3/templates * 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/themes/djangocms_admin_style_theme/templates * recursive-include src/fobi/contrib/apps/djangocms_integration/templates * #recursive-include src/fobi/contrib/apps/feincms_integration/templates * diff --git a/QUICK_START.rst b/QUICK_START.rst new file mode 100644 index 00000000..141c21b6 --- /dev/null +++ b/QUICK_START.rst @@ -0,0 +1,204 @@ + +Quick start +=============================================== + +Installation and configuration +----------------------------------------------- +Install the package in your environment. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. code-block:: none + + pip install django-fobi + +INSTALLED_APPS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add ``fobi`` core and the plugins to the ``INSTALLED_APPS`` of the your +`settings` module. + +1. The core. + +.. code-block:: python + + 'fobi', + +2. The preferred theme. Bootstrap 3 theme is the default. If you have chosen a + different theme, update the value of ``FOBI_DEFAULT_THEME`` accordingly. + +.. code-block:: python + + 'fobi.contrib.themes.bootstrap3', + +3. The form field plugins. Plugins are like blocks. You are recommended to have + them all installed. Note, that the following plugins do not have + additional dependencies, while some others (like + `fobi.contrib.plugins.form_elements.security.captcha + `_ + or `fobi.contrib.plugins.form_elements.security.recaptcha + `_ + would require additional packages to be installed. If so, make sure to have + installed and configured those dependencies prior adding the dependant + add-ons to the `settings` module. + +.. code-block:: python + + 'fobi.contrib.plugins.form_elements.fields.boolean', + 'fobi.contrib.plugins.form_elements.fields.date', + 'fobi.contrib.plugins.form_elements.fields.datetime', + 'fobi.contrib.plugins.form_elements.fields.email', + 'fobi.contrib.plugins.form_elements.fields.file', + 'fobi.contrib.plugins.form_elements.fields.hidden', + 'fobi.contrib.plugins.form_elements.fields.integer', + 'fobi.contrib.plugins.form_elements.fields.password', + 'fobi.contrib.plugins.form_elements.fields.radio', + 'fobi.contrib.plugins.form_elements.fields.select', + 'fobi.contrib.plugins.form_elements.fields.select_model_object', + 'fobi.contrib.plugins.form_elements.fields.select_multiple', + 'fobi.contrib.plugins.form_elements.fields.text', + 'fobi.contrib.plugins.form_elements.fields.textarea', + 'fobi.contrib.plugins.form_elements.fields.url', + +4. The presentational form elements (images, texts, videos). + +.. code-block:: python + + 'fobi.contrib.plugins.form_elements.content.content_image', + 'fobi.contrib.plugins.form_elements.content.content_text', + 'fobi.contrib.plugins.form_elements.content.content_video', + +5. Form handlers. Note, that some of them may require database sync/migration. + +.. code-block:: python + + 'fobi.contrib.plugins.form_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.http_repost', + 'fobi.contrib.plugins.form_handlers.mail', + +Putting all together, you would have something like this. + +.. code-block:: python + + INSTALLED_APPS = ( + # ... + # Core + 'fobi.contrib.themes.bootstrap3', + + # Theme + 'fobi.contrib.themes.bootstrap3', + + # Form field plugins + 'fobi.contrib.plugins.form_elements.fields.boolean', + 'fobi.contrib.plugins.form_elements.fields.date', + 'fobi.contrib.plugins.form_elements.fields.datetime', + 'fobi.contrib.plugins.form_elements.fields.email', + 'fobi.contrib.plugins.form_elements.fields.file', + 'fobi.contrib.plugins.form_elements.fields.hidden', + 'fobi.contrib.plugins.form_elements.fields.integer', + 'fobi.contrib.plugins.form_elements.fields.password', + 'fobi.contrib.plugins.form_elements.fields.radio', + 'fobi.contrib.plugins.form_elements.fields.select', + 'fobi.contrib.plugins.form_elements.fields.select_model_object', + 'fobi.contrib.plugins.form_elements.fields.select_multiple', + 'fobi.contrib.plugins.form_elements.fields.text', + 'fobi.contrib.plugins.form_elements.fields.textarea', + 'fobi.contrib.plugins.form_elements.fields.url', + + # Form element plugins + 'fobi.contrib.plugins.form_elements.content.content_image', + 'fobi.contrib.plugins.form_elements.content.content_text', + 'fobi.contrib.plugins.form_elements.content.content_video', + + # Form handlers + 'fobi.contrib.plugins.form_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.http_repost', + 'fobi.contrib.plugins.form_handlers.mail', + + # ... + ) + +TEMPLATE_CONTEXT_PROCESSORS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add ``fobi.context_processors.theme`` to ``TEMPLATE_CONTEXT_PROCESSORS`` of +your `settings` module. + +.. code-block:: python + + TEMPLATE_CONTEXT_PROCESSORS = ( + # ... + "fobi.context_processors.theme", + # ... + ) + +urlpatterns +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add the following line to ``urlpatterns`` of your `urls` module. + +.. code-block:: python + + urlpatterns = patterns('', + # ... + + # View URLs + url(r'^fobi/', include('fobi.urls.view')), + + # Edit URLs + url(r'^fobi/', include('fobi.urls.edit')), + + # ... + + ) + +Update the database +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1. First you should be syncing/migrating the database. Depending on your + Django version and migration app, this step may vary. Typically as follows: + +.. code-block:: none + + $ ./manage.py syncdb + $ ./manage.py migrate + +2. Sync installed ``fobi`` plugins. Go to terminal and type the following + command. + +.. code-block:: none + + $ ./manage.py fobi_sync_plugins + +Specify the active theme +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Specify the default theme in your `settings` module. + +.. code-block:: python + + FOBI_DEFAULT_THEME = 'bootstrap3' + +Permissions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``fobi`` has been built with permissions in mind. Every single form element +plugin or handler is permission based. If user hasn't been given permission +to work with a form element or a form handler plugin, he won't be. If you want +to switch the permission checks off, set the value of +``FOBI_RESTRICT_PLUGIN_ACCESS`` to False in your `settings` module. + +.. code-block:: python + + FOBI_RESTRICT_PLUGIN_ACCESS = False + +Otherwise, after having completed all the steps above, do log into the +Django administration and assign the permissions (to certain user or a group) +for every single form element or form handler plugin. Bulk assignments work +as well. + +- http://yourdomain.com/admin/fobi/formelement/ +- http://yourdomain.com/admin/fobi/formhandler/ + +Also, make sure to have the Django model permissions set for following models: + +- `fobi.models.FormEntry + `_ +- `fobi.models.FormElementEntry + `_ +- `fobi.models.FormHandlerEntry + `_ +- `fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry + `_ diff --git a/README.rst b/README.rst index aa06b667..aa9fec5a 100644 --- a/README.rst +++ b/README.rst @@ -61,8 +61,10 @@ Main features and highlights - Developer-friendly API, which allows to edit existing or build new form fields and handlers without touching the core. - Support for custom user model. -- `Theming`_. There are 3 ready to use `Bundled themes`_: Bootstrap 3, - Foundation 5 and Simple (in style of Django admin). +- `Theming`_. There are 4 ready to use `Bundled themes`_: Bootstrap 3, + Foundation 5, Simple (in style of Django admin) and Django-CMS admin style + theme (in style of `djangocms-admin-style + `_). - Implemented `integration with FeinCMS `_ (in a form of a FeinCMS page widget). @@ -230,7 +232,7 @@ And the following to the context processors. TEMPLATE_CONTEXT_PROCESSORS = ( # ... - "fobi.context_processors.theme". + "fobi.context_processors.theme", # ... ) @@ -1301,6 +1303,10 @@ of each theme for details. - `Simple `_: Basic theme. Form editing is in a style of Django admin. +- `Simple + `_: + Basic theme. Form editing is in a style of `djangocms-admin-style + `_. HTML5 fields =============================================== diff --git a/TODOS.rst b/TODOS.rst index 172ab672..73c8733f 100644 --- a/TODOS.rst +++ b/TODOS.rst @@ -200,6 +200,16 @@ Must haves plugin. Make sure it doesn't. + Make sure empty lines are not treated as options in the radio or list plugins. +- Add a quickstart documentation. +- Make a Django-CMS dedicated theme (for the admin) using `djangocms-admin-style + `_. +- See if it's possible to make the "simple" theme base template (for Django + admin) as much generic so that change between versions doesn't cause + styling issues. +- Make sure the existing "simple" theme works very well (in looks) in + Django 1.6. +- Make sure the existing "simple" theme works very well (in looks) in + Django 1.7. - Nicer styling for the radio button (Foundation 5 theme). - Nicer styling for the radio button (Simple theme). - Make it possible to provide an alternative rendering of the form field @@ -209,6 +219,8 @@ Must haves widget level, so that it's not necessary to update the theme in case of customisations made for one or more form field plugins (the rendering part). +- Split the ``FOBI_RESTRICT_PLUGIN_ACCESS`` into two: one for form elements + and one for form handlers. - Make sure, that theme specific theme javascripts, css and other assets, are defined in the theme itself. Follow the ``django-dash`` example as much as possible. @@ -248,6 +260,7 @@ Should haves + At the moment Captcha data is also being saved (db_store form handler). Think of fixing that by allowing to exclude certain fields from being processed by form handlers. +- Rename the ``simple`` theme into ``django_admin_style_theme``. - Make a real ``birthday`` field (with no year selection). - Make it possible to use something else than Django's ORM (django-mongoengine, SQLAlchemy). diff --git a/build_docs.sh b/build_docs.sh deleted file mode 100755 index f35f3f63..00000000 --- a/build_docs.sh +++ /dev/null @@ -1,5 +0,0 @@ -./uninstall.sh -./install.sh -cat README.rst SCREENSHOTS.rst docs/documentation.rst.distrib > docs/index.rst -sphinx-build -n -a -b html docs builddocs -cd builddocs && zip -r ../builddocs.zip . -x ".*" && cd .. \ No newline at end of file diff --git a/docs/documentation.rst.distrib b/docs/documentation.rst.distrib index 518ed0d2..aa33c90a 100644 --- a/docs/documentation.rst.distrib +++ b/docs/documentation.rst.distrib @@ -7,6 +7,7 @@ Contents: :maxdepth: 20 fobi + quickstart Indices and tables =============================================== diff --git a/docs/index.rst b/docs/index.rst index de980c45..07672990 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -154,7 +154,7 @@ If quick installer doesn't work for you, see the manual steps on running the Installation =============================================== -1. Install latest stable version from PyPI: +(1) Install latest stable version from PyPI: .. code-block:: none @@ -172,9 +172,9 @@ Or latest stable version from BitBucket: $ pip install -e hg+https://bitbucket.org/barseghyanartur/django-fobi@stable#egg=django-fobi -2. Add `fobi` to ``INSTALLED_APPS`` of the your projects' Django settings. - Furthermore, all themes and plugins to be used, shall be added to the - ``INSTALLED_APPS`` as well. +(2) Add `fobi` to ``INSTALLED_APPS`` of the your projects' Django settings. + Furthermore, all themes and plugins to be used, shall be added to the + ``INSTALLED_APPS`` as well. .. code-block:: python @@ -221,8 +221,8 @@ Or latest stable version from BitBucket: # ... ) -3. Make appropriate changes to the ``TEMPLATE_CONTEXT_PROCESSORS`` of the your - projects' Django settings. +(3) Make appropriate changes to the ``TEMPLATE_CONTEXT_PROCESSORS`` of the your + projects' Django settings. And the following to the context processors. @@ -230,14 +230,14 @@ And the following to the context processors. TEMPLATE_CONTEXT_PROCESSORS = ( # ... - "fobi.context_processors.theme". + "fobi.context_processors.theme", # ... ) Make sure that ``django.core.context_processors.request`` is in ``TEMPLATE_CONTEXT_PROCESSORS`` too. -4. Configure URLs +(4) Configure URLs Add the following line to urlpatterns of your urls module. @@ -1399,14 +1399,14 @@ Bootstrap3 theme ----------------------------------------------- Dashboard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Dashboard +(1) Dashboard .. image:: _static/bootstrap3/01_dashboard.png :scale: 80 % Create a form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -2. Create a form +(2) Create a form .. image:: _static/bootstrap3/02_create_form.png :scale: 80 % @@ -1415,22 +1415,22 @@ View/edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Form elements +++++++++++++++++++++++++++++++++++++++++++++++ -3. Edit form - form elements tab active, no elements yet +(3) Edit form - form elements tab active, no elements yet .. image:: _static/bootstrap3/03_edit_form_-_form_elements_tab_active_-_no_elements_yet.png :scale: 80 % -4. Edit form - form elements tab active, add a form element menu +(4) Edit form - form elements tab active, add a form element menu .. image:: _static/bootstrap3/04_edit_form_-_form_elements_tab_active_-_add_element_menu.png :scale: 80 % -5. Edit form - add a form element (URL plugin) +(5) Edit form - add a form element (URL plugin) .. image:: _static/bootstrap3/05_edit_form_-_add_form_element_url_plugin.png :scale: 80 % -6. Edit form - form elements tab active, with form elements +(6) Edit form - form elements tab active, with form elements .. image:: _static/bootstrap3/06_edit_form_-_form_elements_tab_active_-_with_elements.png :scale: 80 % @@ -1438,57 +1438,57 @@ Form elements Form handlers +++++++++++++++++++++++++++++++++++++++++++++++ -7. Edit form - form handlers tab active, no handlers yet +(7) Edit form - form handlers tab active, no handlers yet .. image:: _static/bootstrap3/07_edit_form_-_form_handlers_tab_active_-_no_handlers_yet.png :scale: 80 % -8. Edit form - form handlers tab tactive, add form handler menu +(8) Edit form - form handlers tab tactive, add form handler menu .. image:: _static/bootstrap3/08_edit_form_-_form_handlers_tab_active_-_add_handler_menu.png :scale: 80 % -9. Edit form - add a form handler (Mail plugin) +(9) Edit form - add a form handler (Mail plugin) .. image:: _static/bootstrap3/09_edit_form_-_add_form_handler_mail_plugin.png :scale: 80 % -10. Edit form - form handlers tab active, with form handlers +(10) Edit form - form handlers tab active, with form handlers .. image:: _static/bootstrap3/10_edit_form_-_form_handlers_tab_active_with_handlers.png :scale: 80 % -11. Edit form - form properties tab active +(11) Edit form - form properties tab active .. image:: _static/bootstrap3/11_edit_form_-_form_properties_tab_active.png :scale: 80 % -12. View form +(12) View form .. image:: _static/bootstrap3/12_view_form.png :scale: 80 % -13. View form - form submitted (thanks page) +(13) View form - form submitted (thanks page) .. image:: _static/bootstrap3/13_view_form_-_form_submitted.png :scale: 80 % -14. Edit form - add a form element (Video plugin) +(14) Edit form - add a form element (Video plugin) .. image:: _static/bootstrap3/14_edit_form_-_add_form_element_video_plugin.png :scale: 80 % -15. Edit form - add a form element (Boolean plugin) +(15) Edit form - add a form element (Boolean plugin) .. image:: _static/bootstrap3/15_edit_form_-_add_form_element_boolean_plugin.png :scale: 80 % -16. Edit form +(16) Edit form .. image:: _static/bootstrap3/16_edit_form.png :scale: 80 % -17. View form +(17) View form .. image:: _static/bootstrap3/17_view_form.png :scale: 80 % @@ -1497,32 +1497,32 @@ Simple theme ----------------------------------------------- View/edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Edit form - form elements tab active, with form elements +(1) Edit form - form elements tab active, with form elements .. image:: _static/simple/01_edit_form_-_form_elements_tab_active_with_elements.png :scale: 80 % -2. Edit form - form elements tab active, add a form element menu +(2) Edit form - form elements tab active, add a form element menu .. image:: _static/simple/02_edit_form_-_form_elements_tab_active_add_elements_menu.png :scale: 80 % -3. Edit form - add a form element (Hidden plugin) +(3) Edit form - add a form element (Hidden plugin) .. image:: _static/simple/03_edit_form_-_add_form_element_hidden.png :scale: 80 % -4. Edit form - form handlers tab active, with form handlers +(4) Edit form - form handlers tab active, with form handlers .. image:: _static/simple/04_edit_form_-_form_handlers_tab_active_with_handlers.png :scale: 80 % -5. Edit form - form properties tab active +(5) Edit form - form properties tab active .. image:: _static/simple/05_edit_form_-_form_properties_tab_active.png :scale: 80 % -6. View form +(6) View form .. image:: _static/simple/06_view_form.png :scale: 80 % @@ -1535,6 +1535,7 @@ Contents: :maxdepth: 20 fobi + quickstart Indices and tables =============================================== diff --git a/docs/quickstart.rst b/docs/quickstart.rst new file mode 100644 index 00000000..141c21b6 --- /dev/null +++ b/docs/quickstart.rst @@ -0,0 +1,204 @@ + +Quick start +=============================================== + +Installation and configuration +----------------------------------------------- +Install the package in your environment. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. code-block:: none + + pip install django-fobi + +INSTALLED_APPS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add ``fobi`` core and the plugins to the ``INSTALLED_APPS`` of the your +`settings` module. + +1. The core. + +.. code-block:: python + + 'fobi', + +2. The preferred theme. Bootstrap 3 theme is the default. If you have chosen a + different theme, update the value of ``FOBI_DEFAULT_THEME`` accordingly. + +.. code-block:: python + + 'fobi.contrib.themes.bootstrap3', + +3. The form field plugins. Plugins are like blocks. You are recommended to have + them all installed. Note, that the following plugins do not have + additional dependencies, while some others (like + `fobi.contrib.plugins.form_elements.security.captcha + `_ + or `fobi.contrib.plugins.form_elements.security.recaptcha + `_ + would require additional packages to be installed. If so, make sure to have + installed and configured those dependencies prior adding the dependant + add-ons to the `settings` module. + +.. code-block:: python + + 'fobi.contrib.plugins.form_elements.fields.boolean', + 'fobi.contrib.plugins.form_elements.fields.date', + 'fobi.contrib.plugins.form_elements.fields.datetime', + 'fobi.contrib.plugins.form_elements.fields.email', + 'fobi.contrib.plugins.form_elements.fields.file', + 'fobi.contrib.plugins.form_elements.fields.hidden', + 'fobi.contrib.plugins.form_elements.fields.integer', + 'fobi.contrib.plugins.form_elements.fields.password', + 'fobi.contrib.plugins.form_elements.fields.radio', + 'fobi.contrib.plugins.form_elements.fields.select', + 'fobi.contrib.plugins.form_elements.fields.select_model_object', + 'fobi.contrib.plugins.form_elements.fields.select_multiple', + 'fobi.contrib.plugins.form_elements.fields.text', + 'fobi.contrib.plugins.form_elements.fields.textarea', + 'fobi.contrib.plugins.form_elements.fields.url', + +4. The presentational form elements (images, texts, videos). + +.. code-block:: python + + 'fobi.contrib.plugins.form_elements.content.content_image', + 'fobi.contrib.plugins.form_elements.content.content_text', + 'fobi.contrib.plugins.form_elements.content.content_video', + +5. Form handlers. Note, that some of them may require database sync/migration. + +.. code-block:: python + + 'fobi.contrib.plugins.form_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.http_repost', + 'fobi.contrib.plugins.form_handlers.mail', + +Putting all together, you would have something like this. + +.. code-block:: python + + INSTALLED_APPS = ( + # ... + # Core + 'fobi.contrib.themes.bootstrap3', + + # Theme + 'fobi.contrib.themes.bootstrap3', + + # Form field plugins + 'fobi.contrib.plugins.form_elements.fields.boolean', + 'fobi.contrib.plugins.form_elements.fields.date', + 'fobi.contrib.plugins.form_elements.fields.datetime', + 'fobi.contrib.plugins.form_elements.fields.email', + 'fobi.contrib.plugins.form_elements.fields.file', + 'fobi.contrib.plugins.form_elements.fields.hidden', + 'fobi.contrib.plugins.form_elements.fields.integer', + 'fobi.contrib.plugins.form_elements.fields.password', + 'fobi.contrib.plugins.form_elements.fields.radio', + 'fobi.contrib.plugins.form_elements.fields.select', + 'fobi.contrib.plugins.form_elements.fields.select_model_object', + 'fobi.contrib.plugins.form_elements.fields.select_multiple', + 'fobi.contrib.plugins.form_elements.fields.text', + 'fobi.contrib.plugins.form_elements.fields.textarea', + 'fobi.contrib.plugins.form_elements.fields.url', + + # Form element plugins + 'fobi.contrib.plugins.form_elements.content.content_image', + 'fobi.contrib.plugins.form_elements.content.content_text', + 'fobi.contrib.plugins.form_elements.content.content_video', + + # Form handlers + 'fobi.contrib.plugins.form_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.http_repost', + 'fobi.contrib.plugins.form_handlers.mail', + + # ... + ) + +TEMPLATE_CONTEXT_PROCESSORS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add ``fobi.context_processors.theme`` to ``TEMPLATE_CONTEXT_PROCESSORS`` of +your `settings` module. + +.. code-block:: python + + TEMPLATE_CONTEXT_PROCESSORS = ( + # ... + "fobi.context_processors.theme", + # ... + ) + +urlpatterns +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Add the following line to ``urlpatterns`` of your `urls` module. + +.. code-block:: python + + urlpatterns = patterns('', + # ... + + # View URLs + url(r'^fobi/', include('fobi.urls.view')), + + # Edit URLs + url(r'^fobi/', include('fobi.urls.edit')), + + # ... + + ) + +Update the database +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1. First you should be syncing/migrating the database. Depending on your + Django version and migration app, this step may vary. Typically as follows: + +.. code-block:: none + + $ ./manage.py syncdb + $ ./manage.py migrate + +2. Sync installed ``fobi`` plugins. Go to terminal and type the following + command. + +.. code-block:: none + + $ ./manage.py fobi_sync_plugins + +Specify the active theme +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Specify the default theme in your `settings` module. + +.. code-block:: python + + FOBI_DEFAULT_THEME = 'bootstrap3' + +Permissions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``fobi`` has been built with permissions in mind. Every single form element +plugin or handler is permission based. If user hasn't been given permission +to work with a form element or a form handler plugin, he won't be. If you want +to switch the permission checks off, set the value of +``FOBI_RESTRICT_PLUGIN_ACCESS`` to False in your `settings` module. + +.. code-block:: python + + FOBI_RESTRICT_PLUGIN_ACCESS = False + +Otherwise, after having completed all the steps above, do log into the +Django administration and assign the permissions (to certain user or a group) +for every single form element or form handler plugin. Bulk assignments work +as well. + +- http://yourdomain.com/admin/fobi/formelement/ +- http://yourdomain.com/admin/fobi/formhandler/ + +Also, make sure to have the Django model permissions set for following models: + +- `fobi.models.FormEntry + `_ +- `fobi.models.FormElementEntry + `_ +- `fobi.models.FormHandlerEntry + `_ +- `fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry + `_ diff --git a/examples/quickstart/__init__.py b/examples/quickstart/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/examples/quickstart/local_settings.example b/examples/quickstart/local_settings.example new file mode 100644 index 00000000..8c91f23c --- /dev/null +++ b/examples/quickstart/local_settings.example @@ -0,0 +1,31 @@ +import os +PROJECT_DIR = lambda base : os.path.abspath(os.path.join(os.path.dirname(__file__), base).replace('\\','/')) + +DEBUG = True +DEBUG_TOOLBAR = not True +TEMPLATE_DEBUG = True + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': PROJECT_DIR('../db/quickstart.db'), # Or path to database file if using sqlite3. + + # The following settings are not used with sqlite3: + 'USER': '', + 'PASSWORD': '', + 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'PORT': '', # Set to empty string for default. + } +} + +INTERNAL_IPS = ('127.0.0.1',) + +EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' +EMAIL_FILE_PATH = PROJECT_DIR('../tmp') + +DEFAULT_FROM_EMAIL = '' + +# Fobi settings +FOBI_DEBUG = True +FOBI_RESTRICT_PLUGIN_ACCESS = False + diff --git a/examples/quickstart/manage.py b/examples/quickstart/manage.py new file mode 100755 index 00000000..f9726f9e --- /dev/null +++ b/examples/quickstart/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/examples/quickstart/settings.py b/examples/quickstart/settings.py new file mode 100644 index 00000000..e06b83c1 --- /dev/null +++ b/examples/quickstart/settings.py @@ -0,0 +1,283 @@ +# Django settings for example project. +import os +PROJECT_DIR = lambda base : os.path.abspath(os.path.join(os.path.dirname(__file__), base).replace('\\','/')) +gettext = lambda s: s + +DEBUG = False +DEBUG_TOOLBAR = False +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': PROJECT_DIR('../db/example.db'), # Or path to database file if using sqlite3. + # The following settings are not used with sqlite3: + 'USER': '', + 'PASSWORD': '', + 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'PORT': '', # Set to empty string for default. + } +} + +# Hosts/domain names that are valid for this site; required if DEBUG is False +# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts +ALLOWED_HOSTS = ['*',] + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# In a Windows environment this must be set to your system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +#LANGUAGE_CODE = 'en-us' + +LANGUAGES = ( + ('en', gettext("English")), +) + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale. +USE_L10N = True + +# If you set this to False, Django will not use timezone-aware datetimes. +USE_TZ = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/var/www/example.com/media/" +MEDIA_ROOT = PROJECT_DIR(os.path.join('..', 'media')) + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://example.com/media/", "http://media.example.com/" +MEDIA_URL = '/media/' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/var/www/example.com/static/" +STATIC_ROOT = PROJECT_DIR(os.path.join('..', 'static')) + +# URL prefix for static files. +# Example: "http://example.com/static/", "http://static.example.com/" +STATIC_URL = '/static/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + PROJECT_DIR(os.path.join('..', 'media', 'static')), +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '97818c*w97Zi8a-m^1coRRrmurMI6+q5_kyn*)s@(*_Pk6q423' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + 'django.template.loaders.eggs.Loader', +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + # Uncomment the next line for simple clickjacking protection: + # 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + +ROOT_URLCONF = 'urls' + +# Python dotted path to the WSGI application used by Django's runserver. +WSGI_APPLICATION = 'wsgi.application' + +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.contrib.auth.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", + "django.core.context_processors.static", + "django.core.context_processors.tz", + "django.contrib.messages.context_processors.messages", + "django.core.context_processors.request", + "fobi.context_processors.theme", # Important! +) + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + PROJECT_DIR('templates'), +) + +INSTALLED_APPS = ( + # Admin dashboard + # Django core and contrib apps + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.admin', + 'django.contrib.sitemaps', + + # Third party apps used in the project + 'south', # Database migration app + 'easy_thumbnails', # Thumbnailer + 'registration', # Auth views and registration app + + # The core package + 'fobi', + + # Default (Bootstrap 3) theme. If you choose a different theme + # you should update the value of ``FOBI_DEFAULT_THEME`` accordingly. + 'fobi.contrib.themes.bootstrap3', + + # Form fields. Plugins are like blocks. You are recommended to have + # them all installed. + 'fobi.contrib.plugins.form_elements.fields.boolean', + 'fobi.contrib.plugins.form_elements.fields.date', + 'fobi.contrib.plugins.form_elements.fields.datetime', + 'fobi.contrib.plugins.form_elements.fields.email', + 'fobi.contrib.plugins.form_elements.fields.file', + 'fobi.contrib.plugins.form_elements.fields.hidden', + 'fobi.contrib.plugins.form_elements.fields.integer', + 'fobi.contrib.plugins.form_elements.fields.password', + 'fobi.contrib.plugins.form_elements.fields.radio', + 'fobi.contrib.plugins.form_elements.fields.select', + 'fobi.contrib.plugins.form_elements.fields.select_model_object', + 'fobi.contrib.plugins.form_elements.fields.select_multiple', + 'fobi.contrib.plugins.form_elements.fields.text', + 'fobi.contrib.plugins.form_elements.fields.textarea', + 'fobi.contrib.plugins.form_elements.fields.url', + + # Presentational form elements (images, texts, videos) + 'fobi.contrib.plugins.form_elements.content.content_image', + 'fobi.contrib.plugins.form_elements.content.content_text', + 'fobi.contrib.plugins.form_elements.content.content_video', + + # Form handlers + 'fobi.contrib.plugins.form_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.http_repost', + 'fobi.contrib.plugins.form_handlers.mail', +) + +LOGIN_REDIRECT_URL = '/fobi/' # Important for passing the selenium tests + +#LOGIN_URL = '/accounts/login/' +#LOGIN_ERROR_URL = '/accounts/login/' +#LOGOUT_URL = '/accounts/logout/' + +# A sample logging configuration. The only tangible logging +# performed by this configuration is to send an email to +# the site admins on every HTTP 500 error when DEBUG=False. +# See http://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'filters': { + 'require_debug_false': { + '()': 'django.utils.log.RequireDebugFalse' + } + }, + 'formatters': { + 'verbose': { + 'format': '\n%(levelname)s %(asctime)s [%(pathname)s:%(lineno)s] %(message)s' + }, + 'simple': { + 'format': '\n%(levelname)s %(message)s' + }, + }, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'filters': ['require_debug_false'], + 'class': 'django.utils.log.AdminEmailHandler' + }, + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'verbose' + }, + 'django_log': { + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'filename': PROJECT_DIR("../logs/django.log"), + 'maxBytes': 1048576, + 'backupCount': 99, + 'formatter': 'verbose', + }, + 'fobi_log': { + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'filename': PROJECT_DIR("../logs/fobi.log"), + 'maxBytes': 1048576, + 'backupCount': 99, + 'formatter': 'verbose', + }, + }, + 'loggers': { + 'django': { + 'handlers': ['django_log'], + 'level': 'ERROR', + 'propagate': True, + }, + 'fobi': { + 'handlers': ['console', 'fobi_log'], + 'level': 'DEBUG', + 'propagate': True, + }, + }, +} + +# Do not put any settings below this line +try: + from local_settings import * +except: + pass + +if DEBUG and DEBUG_TOOLBAR: + # debug_toolbar + MIDDLEWARE_CLASSES += ( + 'debug_toolbar.middleware.DebugToolbarMiddleware', + ) + + INSTALLED_APPS += ( + 'debug_toolbar', + ) + + DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + } + +if DEBUG and TEMPLATE_DEBUG: + INSTALLED_APPS += ( + 'template_debug', + ) diff --git a/examples/quickstart/urls.py b/examples/quickstart/urls.py new file mode 100644 index 00000000..b07ba958 --- /dev/null +++ b/examples/quickstart/urls.py @@ -0,0 +1,44 @@ +from django.conf.urls import patterns, include, url + +from django.conf import settings +from django.contrib import admin +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.conf.urls.static import static +from django.views.generic import TemplateView + +from fobi.settings import DEFAULT_THEME + +admin.autodiscover() + +# Mapping. +fobi_theme_home_template_mapping = { + 'bootstrap3': 'home/bootstrap3.html', + 'foundation5': 'home/foundation5.html', +} + +# Get the template to be used. +fobi_home_template = fobi_theme_home_template_mapping.get( + DEFAULT_THEME, + 'home/base.html' + ) + +urlpatterns = patterns('', + # DB Store plugin URLs + url(r'^fobi/plugins/form-handlers/db-store/', + include('fobi.contrib.plugins.form_handlers.db_store.urls')), + + # django-fobi URLs: + url(r'^fobi/', include('fobi.urls')), + + url(r'^admin/', include(admin.site.urls)), + + # django-registration URLs: + (r'^accounts/', include('registration.backends.default.urls')), + + url(r'^$', TemplateView.as_view(template_name=fobi_home_template)), +) + +# Serving media and static in debug/developer mode. +if settings.DEBUG: + urlpatterns += staticfiles_urlpatterns() + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/examples/quickstart/wsgi.py b/examples/quickstart/wsgi.py new file mode 100644 index 00000000..9f3e21bf --- /dev/null +++ b/examples/quickstart/wsgi.py @@ -0,0 +1,32 @@ +""" +WSGI config for example project. + +This module contains the WSGI application used by Django's development server +and any production WSGI deployments. It should expose a module-level variable +named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover +this application via the ``WSGI_APPLICATION`` setting. + +Usually you will have the standard Django WSGI application here, but it also +might make sense to replace the whole Django WSGI application with a custom one +that later delegates to the Django one. For example, you could introduce WSGI +middleware here, or combine a Django application with an application of another +framework. + +""" +import os + +# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks +# if running multiple sites in the same mod_wsgi process. To fix this, use +# mod_wsgi daemon mode with each site in its own daemon process, or use +# os.environ["DJANGO_SETTINGS_MODULE"] = "example.settings" +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") + +# This application object is used by any WSGI server configured to use this +# file. This includes Django's development server, if the WSGI_APPLICATION +# setting points here. +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() + +# Apply WSGI middleware here. +# from helloworld.wsgi import HelloWorldApplication +# application = HelloWorldApplication(application) diff --git a/examples/requirements_djangocms.txt b/examples/requirements_djangocms.txt index dc8b1305..302e88f3 100644 --- a/examples/requirements_djangocms.txt +++ b/examples/requirements_djangocms.txt @@ -3,4 +3,5 @@ django-cms==3.0.6 djangocms-picture djangocms-snippet djangocms-text-ckeditor -django-mptt \ No newline at end of file +django-mptt +djangocms-admin-style \ No newline at end of file diff --git a/examples/simple/local_settings.example b/examples/simple/local_settings.example index e8a8d57a..953f8f9a 100644 --- a/examples/simple/local_settings.example +++ b/examples/simple/local_settings.example @@ -27,7 +27,6 @@ DEFAULT_FROM_EMAIL = '' FOBI_DEBUG = True FOBI_RESTRICT_PLUGIN_ACCESS = False -FOBI_RESTRICT_FIELDS_ACCESS = False #FOBI_DEFAULT_THEME = 'foundation5' WAIT_BETWEEN_TEST_STEPS = 0 diff --git a/examples/simple/runserver-djangocms-admin-style-theme-djangocms-integration.sh b/examples/simple/runserver-djangocms-admin-style-theme-djangocms-integration.sh new file mode 100755 index 00000000..6d649518 --- /dev/null +++ b/examples/simple/runserver-djangocms-admin-style-theme-djangocms-integration.sh @@ -0,0 +1,2 @@ +#workon fobi +./manage.py runserver 0.0.0.0:8003 --settings=settings_djangocms_admin_style_theme_djangocms --traceback -v 3 diff --git a/examples/simple/settings.py b/examples/simple/settings.py index a2c528c5..a20a890c 100644 --- a/examples/simple/settings.py +++ b/examples/simple/settings.py @@ -282,6 +282,9 @@ LOCALE_INDEPENDENT_PATHS = ( #r'^/dashboard/', ) +PACKAGE_NAME_FILEBROWSER = "filebrowser_safe" # Just for tests +PACKAGE_NAME_GRAPPELLI = "grappelli_safe" # Just for tests + # ************************************************************** # ************************ Fobi settings *********************** # ************************************************************** diff --git a/examples/simple/settings_djangocms_admin_style_theme_djangocms.py b/examples/simple/settings_djangocms_admin_style_theme_djangocms.py new file mode 100644 index 00000000..7aadd9c5 --- /dev/null +++ b/examples/simple/settings_djangocms_admin_style_theme_djangocms.py @@ -0,0 +1,68 @@ +from settings import * + +INSTALLED_APPS = list(INSTALLED_APPS) +INSTALLED_APPS.remove('django.contrib.admin') +INSTALLED_APPS += [ + 'cms', # DjangoCMS + 'mptt', + 'menus', + 'sekizai', + #'djangocms_admin_style', + + # Some plugins + 'djangocms_picture', + 'djangocms_snippet', + + 'fobi.contrib.apps.djangocms_integration', # Fobi DjangoCMS app + + # Django-CMS admin style + 'djangocms_admin_style', + 'django.contrib.admin', + 'fobi.contrib.themes.djangocms_admin_style_theme', +] + +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' +FOBI_DEFAULT_THEME = 'djangocms_admin_style_theme' + +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' diff --git a/examples/simple/templates/admin/base_site.html b/examples/simple/templates/admin/__base_site.html similarity index 100% rename from examples/simple/templates/admin/base_site.html rename to examples/simple/templates/admin/__base_site.html diff --git a/examples/simple/urls.py b/examples/simple/urls.py index 2ad76b0c..f4528ef1 100644 --- a/examples/simple/urls.py +++ b/examples/simple/urls.py @@ -24,7 +24,7 @@ fobi_home_template = fobi_theme_home_template_mapping.get( ) FOBI_EDIT_URLS_PREFIX = '' -if 'simple' == DEFAULT_THEME: +if DEFAULT_THEME in ('simple', 'djangocms_admin_style_theme'): FOBI_EDIT_URLS_PREFIX = 'admin/' urlpatterns = patterns('', diff --git a/make_pypi_long_description.sh b/make_pypi_long_description.sh deleted file mode 100755 index 6894053d..00000000 --- a/make_pypi_long_description.sh +++ /dev/null @@ -1,2 +0,0 @@ -python setup.py --long-description | rst2html.py > builddocs/pypi.html -#python setup.py --long-description | rst2html.py | cat \ No newline at end of file diff --git a/make_release.sh b/make_release.sh deleted file mode 100755 index 30c5bed5..00000000 --- a/make_release.sh +++ /dev/null @@ -1,2 +0,0 @@ -python setup.py register -python setup.py sdist bdist_wheel upload \ No newline at end of file diff --git a/reinstall.sh b/reinstall.sh deleted file mode 100755 index bc765b33..00000000 --- a/reinstall.sh +++ /dev/null @@ -1,3 +0,0 @@ -reset -./uninstall.sh -./install.sh \ No newline at end of file diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh new file mode 100755 index 00000000..6ffead85 --- /dev/null +++ b/scripts/build_docs.sh @@ -0,0 +1,8 @@ +./scripts/uninstall.sh +./scripts/install.sh +#cd .. +cat README.rst SCREENSHOTS.rst docs/documentation.rst.distrib > docs/index.rst +cat QUICK_START.rst > docs/quickstart.rst +sphinx-build -n -a -b html docs builddocs +cd builddocs && zip -r ../builddocs.zip . -x ".*" && cd .. +#cd scripts diff --git a/clean_up.sh b/scripts/clean_up.sh similarity index 78% rename from clean_up.sh rename to scripts/clean_up.sh index a60c2a05..cbe9155b 100755 --- a/clean_up.sh +++ b/scripts/clean_up.sh @@ -1,3 +1,5 @@ +#cd .. find . -name "*.pyc" -exec rm -rf {} \; rm -rf build/ rm -rf dist/ +#cd scripts \ No newline at end of file diff --git a/install.sh b/scripts/install.sh similarity index 86% rename from install.sh rename to scripts/install.sh index fb45d72f..df1dcced 100755 --- a/install.sh +++ b/scripts/install.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt python setup.py install mkdir -p examples/logs examples/db examples/media examples/media/static examples/media/fobi_plugins/content_image @@ -6,4 +7,5 @@ mkdir -p examples/media/fobi_plugins/file python examples/simple/manage.py collectstatic --noinput python examples/simple/manage.py syncdb --noinput python examples/simple/manage.py migrate --noinput -python examples/simple/manage.py fobi_create_test_data \ No newline at end of file +python examples/simple/manage.py fobi_create_test_data +#cd scripts \ No newline at end of file diff --git a/install3.sh b/scripts/install3.sh similarity index 83% rename from install3.sh rename to scripts/install3.sh index 8c6f5091..2a6fe1db 100755 --- a/install3.sh +++ b/scripts/install3.sh @@ -1,3 +1,4 @@ +#cd .. pip install -r examples/requirements.txt pip install -r examples/requirements3.txt python setup.py install @@ -5,4 +6,5 @@ mkdir -p examples/logs examples/db examples/media examples/media/static examples python examples/simple/manage.py collectstatic --noinput python examples/simple/manage.py syncdb --noinput python examples/simple/manage.py migrate --noinput -python examples/simple/manage.py fobi_create_test_data \ No newline at end of file +python examples/simple/manage.py fobi_create_test_data +#cd scripts \ No newline at end of file diff --git a/install_captcha.sh b/scripts/install_captcha.sh similarity index 97% rename from install_captcha.sh rename to scripts/install_captcha.sh index 4268dc80..b0267e89 100755 --- a/install_captcha.sh +++ b/scripts/install_captcha.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip uninstall django-recaptcha -y pip install -r examples/requirements_captcha.txt @@ -9,3 +10,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_boo python examples/simple/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_captcha --traceback -v 3 python examples/simple/manage.py migrate --noinput --settings=settings_bootstrap3_theme_captcha --traceback -v 3 python examples/simple/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_captcha --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_django17.sh b/scripts/install_django17.sh similarity index 97% rename from install_django17.sh rename to scripts/install_django17.sh index b79f0bb5..5cf8eb9e 100755 --- a/install_django17.sh +++ b/scripts/install_django17.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt python setup.py install mkdir -p examples/logs examples/db examples/media examples/media/static examples/media/fobi_plugins/content_image @@ -7,3 +8,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_boo python examples/simple/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_django17 --traceback -v 3 python examples/simple/manage.py migrate --noinput --settings=settings_bootstrap3_theme_django17 --traceback -v 3 python examples/simple/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_django17 --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_djangocms.sh b/scripts/install_djangocms.sh similarity index 97% rename from install_djangocms.sh rename to scripts/install_djangocms.sh index 7c0835db..76b2ea6a 100755 --- a/install_djangocms.sh +++ b/scripts/install_djangocms.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip install -r examples/requirements_djangocms.txt python setup.py install @@ -8,3 +9,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_boo 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 +#cd scripts \ No newline at end of file diff --git a/install_djangocms_2.sh b/scripts/install_djangocms_2.sh similarity index 97% rename from install_djangocms_2.sh rename to scripts/install_djangocms_2.sh index 0d5a88f5..990a5008 100755 --- a/install_djangocms_2.sh +++ b/scripts/install_djangocms_2.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip install -r examples/requirements_djangocms_2.txt python setup.py install @@ -8,3 +9,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_boo python examples/simple/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_djangocms_2 --traceback -v 3 python examples/simple/manage.py migrate --noinput --settings=settings_bootstrap3_theme_djangocms_2 --traceback -v 3 python examples/simple/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_djangocms_2 --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/scripts/install_djangocms_djangocms_admin_style.sh b/scripts/install_djangocms_djangocms_admin_style.sh new file mode 100755 index 00000000..5330be12 --- /dev/null +++ b/scripts/install_djangocms_djangocms_admin_style.sh @@ -0,0 +1,12 @@ +#pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. +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_djangocms_admin_style_theme_djangocms --traceback -v 3 +python examples/simple/manage.py syncdb --noinput --settings=settings_djangocms_admin_style_theme_djangocms --traceback -v 3 +python examples/simple/manage.py migrate --noinput --settings=settings_djangocms_admin_style_theme_djangocms --traceback -v 3 +python examples/simple/manage.py fobi_create_test_data --settings=settings_djangocms_admin_style_theme_djangocms --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_feincms.sh b/scripts/install_feincms.sh similarity index 97% rename from install_feincms.sh rename to scripts/install_feincms.sh index b408d27a..e93eb2fd 100755 --- a/install_feincms.sh +++ b/scripts/install_feincms.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip install -r examples/requirements_feincms.txt python setup.py install @@ -8,3 +9,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_fou python examples/simple/manage.py syncdb --noinput --settings=settings_foundation5_theme_feincms --traceback -v 3 python examples/simple/manage.py migrate --noinput --settings=settings_foundation5_theme_feincms --traceback -v 3 python examples/simple/manage.py fobi_create_test_data --settings=settings_foundation5_theme_feincms --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_mezzanine.sh b/scripts/install_mezzanine.sh similarity index 98% rename from install_mezzanine.sh rename to scripts/install_mezzanine.sh index 966ba7fb..93cec4d6 100755 --- a/install_mezzanine.sh +++ b/scripts/install_mezzanine.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip install -r examples/mezzanine_example/requirements.txt python setup.py install @@ -8,3 +9,4 @@ python examples/mezzanine_example/manage.py collectstatic --noinput --settings=s python examples/mezzanine_example/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_mezzanine --traceback -v 3 python examples/mezzanine_example/manage.py migrate --delete-ghost-migrations --noinput --settings=settings_bootstrap3_theme_mezzanine --traceback -v 3 python examples/mezzanine_example/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_mezzanine --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_pypi.sh b/scripts/install_pypi.sh similarity index 86% rename from install_pypi.sh rename to scripts/install_pypi.sh index 9304aedf..14962472 100755 --- a/install_pypi.sh +++ b/scripts/install_pypi.sh @@ -1,4 +1,5 @@ #pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip install django-fobi mkdir -p examples/logs examples/db examples/media examples/media/static examples/media/fobi_plugins/content_image @@ -6,4 +7,5 @@ mkdir -p examples/media/fobi_plugins/file python examples/simple/manage.py collectstatic --noinput python examples/simple/manage.py syncdb --noinput python examples/simple/manage.py migrate --noinput -python examples/simple/manage.py fobi_create_test_data \ No newline at end of file +python examples/simple/manage.py fobi_create_test_data +#cd scripts \ No newline at end of file diff --git a/install_recaptcha.sh b/scripts/install_recaptcha.sh similarity index 86% rename from install_recaptcha.sh rename to scripts/install_recaptcha.sh index 52cc7b31..5c6a3a37 100755 --- a/install_recaptcha.sh +++ b/scripts/install_recaptcha.sh @@ -1,4 +1,5 @@ -pi#pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#pip install -r examples/requirements.txt --allow-all-external --allow-unverified django-admin-tools +#cd .. pip install -r examples/requirements.txt pip uninstall django-simple-captcha -y pip install -r examples/requirements_recaptcha.txt @@ -9,3 +10,4 @@ python examples/simple/manage.py collectstatic --noinput --settings=settings_boo python examples/simple/manage.py syncdb --noinput --settings=settings_bootstrap3_theme_recaptcha --traceback -v 3 python examples/simple/manage.py migrate --noinput --settings=settings_bootstrap3_theme_recaptcha --traceback -v 3 python examples/simple/manage.py fobi_create_test_data --settings=settings_bootstrap3_theme_recaptcha --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/install_verbose.sh b/scripts/install_verbose.sh similarity index 80% rename from install_verbose.sh rename to scripts/install_verbose.sh index de8ded76..8ab5e025 100644 --- a/install_verbose.sh +++ b/scripts/install_verbose.sh @@ -1,3 +1,4 @@ +#cd .. pip install -r examples/requirements.txt python setup.py install mkdir examples/logs @@ -7,4 +8,5 @@ mkdir examples/media/static python examples/simple/manage.py collectstatic --noinput python examples/simple/manage.py syncdb --noinput python examples/simple/manage.py migrate --noinput -python examples/simple/manage.py fobi_create_test_data \ No newline at end of file +python examples/simple/manage.py fobi_create_test_data +#cd scripts \ No newline at end of file diff --git a/make_messages.sh b/scripts/make_messages.sh similarity index 93% rename from make_messages.sh rename to scripts/make_messages.sh index 2622deff..fae70e30 100755 --- a/make_messages.sh +++ b/scripts/make_messages.sh @@ -1,3 +1,4 @@ +#cd .. echo 'Making messages for django-fobi...' cd src/fobi/ django-admin.py makemessages -l hy @@ -9,3 +10,5 @@ cd ../../examples/simple/ django-admin.py makemessages -l hy django-admin.py makemessages -l nl django-admin.py makemessages -l ru + +#cd ../../scripts \ No newline at end of file diff --git a/scripts/make_pypi_long_description.sh b/scripts/make_pypi_long_description.sh new file mode 100755 index 00000000..91c86013 --- /dev/null +++ b/scripts/make_pypi_long_description.sh @@ -0,0 +1,4 @@ +#cd .. +python setup.py --long-description | rst2html.py > builddocs/pypi.html +#python setup.py --long-description | rst2html.py | cat +#cd scripts \ No newline at end of file diff --git a/scripts/make_release.sh b/scripts/make_release.sh new file mode 100755 index 00000000..47dbb260 --- /dev/null +++ b/scripts/make_release.sh @@ -0,0 +1,4 @@ +#cd .. +python setup.py register +python setup.py sdist bdist_wheel upload +#cd scripts \ No newline at end of file diff --git a/rebuild_docs.sh b/scripts/rebuild_docs.sh similarity index 77% rename from rebuild_docs.sh rename to scripts/rebuild_docs.sh index 55e25cd2..60f31294 100755 --- a/rebuild_docs.sh +++ b/scripts/rebuild_docs.sh @@ -1,6 +1,8 @@ ./uninstall.sh ./install.sh +#cd .. rm docs/*.rst rm -rf builddocs/ sphinx-apidoc src/fobi --full -o docs -H 'django-fobi' -A 'Artur Barseghyan ' -V '0.1' -f -d 20 -cp docs/conf.distrib docs/conf.py \ No newline at end of file +cp docs/conf.distrib docs/conf.py +#cd scripts \ No newline at end of file diff --git a/scripts/reinstall.sh b/scripts/reinstall.sh new file mode 100755 index 00000000..fd9e22cd --- /dev/null +++ b/scripts/reinstall.sh @@ -0,0 +1,3 @@ +reset +./scripts/uninstall.sh +./scripts/install.sh \ No newline at end of file diff --git a/reinstall3.sh b/scripts/reinstall3.sh similarity index 100% rename from reinstall3.sh rename to scripts/reinstall3.sh diff --git a/reinstall_captcha.sh b/scripts/reinstall_captcha.sh similarity index 100% rename from reinstall_captcha.sh rename to scripts/reinstall_captcha.sh diff --git a/reinstall_django17.sh b/scripts/reinstall_django17.sh similarity index 100% rename from reinstall_django17.sh rename to scripts/reinstall_django17.sh diff --git a/reinstall_djangocms.sh b/scripts/reinstall_djangocms.sh similarity index 100% rename from reinstall_djangocms.sh rename to scripts/reinstall_djangocms.sh diff --git a/reinstall_djangocms_2.sh b/scripts/reinstall_djangocms_2.sh similarity index 100% rename from reinstall_djangocms_2.sh rename to scripts/reinstall_djangocms_2.sh diff --git a/scripts/reinstall_djangocms_djangocms_admin_style.sh b/scripts/reinstall_djangocms_djangocms_admin_style.sh new file mode 100755 index 00000000..1aa885a1 --- /dev/null +++ b/scripts/reinstall_djangocms_djangocms_admin_style.sh @@ -0,0 +1,3 @@ +reset +./scripts/uninstall.sh +./scripts/install_djangocms_djangocms_admin_style.sh \ No newline at end of file diff --git a/reinstall_feincms.sh b/scripts/reinstall_feincms.sh similarity index 100% rename from reinstall_feincms.sh rename to scripts/reinstall_feincms.sh diff --git a/reinstall_mezzanine.sh b/scripts/reinstall_mezzanine.sh similarity index 100% rename from reinstall_mezzanine.sh rename to scripts/reinstall_mezzanine.sh diff --git a/reinstall_recaptcha.sh b/scripts/reinstall_recaptcha.sh similarity index 100% rename from reinstall_recaptcha.sh rename to scripts/reinstall_recaptcha.sh diff --git a/source_install.sh b/scripts/source_install.sh similarity index 100% rename from source_install.sh rename to scripts/source_install.sh diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000..cb8c7bf0 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,6 @@ +reset +./uninstall.sh +./install.sh +#cd .. +python examples/simple/manage.py test fobi +#cd scripts \ No newline at end of file diff --git a/scripts/test3.sh b/scripts/test3.sh new file mode 100755 index 00000000..6edb4710 --- /dev/null +++ b/scripts/test3.sh @@ -0,0 +1,6 @@ +reset +./uninstall.sh +./install3.sh +#cd .. +python examples/simple/manage.py test fobi --traceback +#cd scripts \ No newline at end of file diff --git a/test_django17.sh b/scripts/test_django17.sh similarity index 88% rename from test_django17.sh rename to scripts/test_django17.sh index 7125dfea..c3691d14 100755 --- a/test_django17.sh +++ b/scripts/test_django17.sh @@ -1,4 +1,6 @@ reset ./uninstall.sh ./install.sh +#cd .. python examples/simple/manage.py test fobi --settings=settings_bootstrap3_theme_django17 --traceback -v 3 +#cd scripts \ No newline at end of file diff --git a/scripts/test_pypi.sh b/scripts/test_pypi.sh new file mode 100755 index 00000000..00d0fbc9 --- /dev/null +++ b/scripts/test_pypi.sh @@ -0,0 +1,6 @@ +reset +./uninstall.sh +./install_pypi.sh +#cd .. +python examples/simple/manage.py test fobi +#cd scripts \ No newline at end of file diff --git a/scripts/test_verbose.sh b/scripts/test_verbose.sh new file mode 100644 index 00000000..18c3579f --- /dev/null +++ b/scripts/test_verbose.sh @@ -0,0 +1,6 @@ +reset +./uninstall.sh +./install.sh +#cd .. +python examples/simple/manage.py test fobi --traceback +#cd scripts \ No newline at end of file diff --git a/uninstall.sh b/scripts/uninstall.sh similarity index 78% rename from uninstall.sh rename to scripts/uninstall.sh index 4d26d1c7..43d685d1 100755 --- a/uninstall.sh +++ b/scripts/uninstall.sh @@ -1,7 +1,9 @@ pip uninstall django-fobi -y +#cd .. rm build -rf rm dist -rf rm src/django_fobi.egg-info -rf rm src/django-fobi.egg-info -rf rm builddocs.zip -rm builddocs/ -rf \ No newline at end of file +rm builddocs/ -rf +#cd scripts \ No newline at end of file diff --git a/setup.py b/setup.py index fd9d16a6..bb2f4b41 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ template_dirs = [ "src/fobi/contrib/themes/foundation5/templates/foundation5", # Foundation 5 "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/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme", # djangocms_admin_style_theme "src/fobi/contrib/apps/djangocms_integration/templates/djangocms_integration", # DjangoCMS integration #"src/fobi/contrib/apps/feincms_integration/templates/feincms_integration", # FeinCMS integration @@ -36,6 +37,7 @@ static_dirs = [ "src/fobi/contrib/themes/bootstrap3/static", # Bootstrap3 "src/fobi/contrib/themes/foundation5/static", # Foundation5 "src/fobi/contrib/themes/simple/static", # Simple + "src/fobi/contrib/themes/djangocms_admin_style_theme/static", # djangocms_admin_style_theme "src/fobi/contrib/plugins/form_handlers/db_store/static", # DB Store @@ -61,7 +63,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.4.15' +version = '0.4.16' install_requires = [ 'Pillow>=2.0.0', diff --git a/src/fobi/__init__.py b/src/fobi/__init__.py index 035ed454..61c5026c 100644 --- a/src/fobi/__init__.py +++ b/src/fobi/__init__.py @@ -1,6 +1,6 @@ __title__ = 'django-fobi' -__version__ = '0.4.15' -__build__ = 0x00001e +__version__ = '0.4.16' +__build__ = 0x00001f __author__ = 'Artur Barseghyan ' __copyright__ = 'Copyright (c) 2014-2015 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' diff --git a/src/fobi/base.py b/src/fobi/base.py index 098d9f8c..7d7265e2 100644 --- a/src/fobi/base.py +++ b/src/fobi/base.py @@ -1748,10 +1748,8 @@ def assemble_form_field_widget_class(base_class, plugin): """ widget = plugin.get_widget() if widget.hasattr('render') and callable(widget.render): - #print 'rendered using fobi' return widget.render(name, value, attrs=attrs) else: - #print 'rendered using standard' super(DeclarativeMetaclass, self).render( name, value, attrs=attrs ) diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/README.rst b/src/fobi/contrib/themes/djangocms_admin_style_theme/README.rst new file mode 100644 index 00000000..7dfba63e --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/README.rst @@ -0,0 +1,43 @@ +=============================================== +fobi.contrib.themes.djangocms_admin_style_theme +=============================================== +A ``django-fobi`` theme in a style of ``djangocms-admin-style`` admin. +Relies on ``djangocms-admin-style`` package and some jQuery UI only. + +jQuery UI "Smoothness" theme comes from `here `_. + +Installation +=============================================== +Install `djangocms-admin-style` +----------------------------------------------- +See the original `installation instructions +`_. + +1. Install the ``djangocms-admin-style`` package. + +.. code-block:: none + + $ pip install djangocms-admin-style + +2. Add 'djangocms_admin_style' to your INSTALLED_APPS just before + 'django.contrib.admin'. + +Install `fobi.contrib.themes.djangocms_admin_style_theme` theme +--------------------------------------------------------------- +1. Add ``fobi.contrib.themes.djangocms_admin_style_theme`` to the + ``INSTALLED_APPS`` in your ``settings.py``. + +.. code-block:: python + + INSTALLED_APPS = ( + # ... + 'fobi.contrib.themes.djangocms_admin_style_theme', + # ... + ) + +2. Specify ``djangocms_admin_style_theme`` as a default theme in your + ``settings.py``: + +.. code-block:: python + + FOBI_DEFAULT_THEME = 'djangocms_admin_style_theme' diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/__init__.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/__init__.py new file mode 100644 index 00000000..fdf5fb81 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/__init__.py @@ -0,0 +1,9 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2015 Artur Barseghyan' +__license__ = 'GPL 2.0/LGPL 2.1' +__all__ = ('default_app_config', 'UID',) + +default_app_config = 'fobi.contrib.themes.djangocms_admin_style_theme.apps.Config' + +UID = 'djangocms_admin_style_theme' diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py new file mode 100644 index 00000000..ffa7a0f7 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py @@ -0,0 +1,14 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.apps' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2015 Artur Barseghyan' +__license__ = 'GPL 2.0/LGPL 2.1' +__all__ = ('Config',) + +try: + from django.apps import AppConfig + + class Config(AppConfig): + name = label = 'fobi.contrib.themes.djangocms_admin_style_theme' + +except ImportError: + pass diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py new file mode 100644 index 00000000..f07d5fd1 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py @@ -0,0 +1,149 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2014 Artur Barseghyan' +__license__ = 'GPL 2.0/LGPL 2.1' +__all__ = ('DjangoCMSAdminStyleTheme',) + +from django.utils.translation import ugettext_lazy as _ + +from fobi.base import BaseTheme, theme_registry +from fobi.contrib.themes.djangocms_admin_style_theme import UID + +class DjangoCMSAdminStyleTheme(BaseTheme): + """ + A theme that has a native ``djangocms-admin-style`` style. + """ + uid = UID + name = _("DjangoCMS admin style") + + media_css = ( + #'admin/css/base.css', + #'admin/css/forms.css', + #'admin/css/widgets.css', + 'djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.css', + 'jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css', + #'admin_tools/css/menu.css', # TODO at least a conditional insert + ) + + media_js = ( + 'js/jquery-1.10.2.min.js', + 'jquery-ui/js/jquery-ui-1.10.4.custom.min.js', + 'js/jquery.slugify.js', + 'js/fobi.core.js', + #'js/fobi.simple.js', + ) + + #footer_text = '© django-fobi example site 2014' + + # ************************************************************************* + # ********************** Form HTML specific ******************************* + # ************************************************************************* + form_element_html_class = 'vTextField' + form_radio_element_html_class = 'radiolist' + form_element_checkbox_html_class = 'checkbox' + + # Important + form_edit_form_entry_option_class = 'glyphicon glyphicon-edit' + + # Important + form_delete_form_entry_option_class = 'glyphicon glyphicon-remove' + + # Important + form_list_container_class = 'list-inline' + + # ************************************************************************* + # ********************** Templates specific ******************************* + # ************************************************************************* + master_base_template = 'djangocms_admin_style_theme/_base.html' + base_template = 'djangocms_admin_style_theme/base.html' + base_view_template = 'djangocms_admin_style_theme/base_view.html' + base_edit_template = 'djangocms_admin_style_theme/base_edit.html' + + form_ajax = 'djangocms_admin_style_theme/snippets/form_ajax.html' + form_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_snippet.html' + form_view_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_view_snippet.html' + form_edit_ajax = 'djangocms_admin_style_theme/snippets/form_edit_ajax.html' + form_edit_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_edit_snippet.html' + form_properties_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_properties_snippet.html' + messages_snippet_template_name = 'djangocms_admin_style_theme/snippets/messages_snippet.html' + + add_form_element_entry_template = 'djangocms_admin_style_theme/add_form_element_entry.html' + add_form_element_entry_ajax_template = 'djangocms_admin_style_theme/add_form_element_entry_ajax.html' + + add_form_handler_entry_template = 'djangocms_admin_style_theme/add_form_handler_entry.html' + add_form_handler_entry_ajax_template = 'djangocms_admin_style_theme/add_form_handler_entry_ajax.html' + + create_form_entry_template = 'djangocms_admin_style_theme/create_form_entry.html' + create_form_entry_ajax_template = 'djangocms_admin_style_theme/create_form_entry_ajax.html' + + dashboard_template = 'djangocms_admin_style_theme/dashboard.html' + + edit_form_element_entry_template = 'djangocms_admin_style_theme/edit_form_element_entry.html' + edit_form_element_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_element_entry_ajax.html' + + edit_form_entry_template = 'djangocms_admin_style_theme/edit_form_entry.html' + edit_form_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_entry_ajax.html' + + edit_form_handler_entry_template = 'djangocms_admin_style_theme/edit_form_handler_entry.html' + edit_form_handler_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_handler_entry_ajax.html' + + form_entry_submitted_template = 'djangocms_admin_style_theme/form_entry_submitted.html' + form_entry_submitted_ajax_template = 'djangocms_admin_style_theme/form_entry_submitted_ajax.html' + + view_form_entry_template = 'djangocms_admin_style_theme/view_form_entry.html' + view_form_entry_ajax_template = 'djangocms_admin_style_theme/view_form_entry_ajax.html' + + + form_edit_form_entry_option_class = 'edit' + form_delete_form_entry_option_class = 'deletelink' + + @classmethod + def edit_form_entry_edit_option_html(cls): + """ + For adding the edit link to edit form entry view. + + :return str: + """ + return """ +
  • + {edit_text} +
  • + """.format( + edit_url = "{edit_url}", + edit_option_class = cls.form_edit_form_entry_option_class, + edit_text = "{edit_text}", + ) + + @classmethod + def edit_form_entry_help_text_extra(cls): + """ + For adding the edit link to edit form entry view. + + :return str: + """ + return """ + + + + """.format( + container_class = cls.form_list_container_class, + edit_option_html = "{edit_option_html}", + delete_url = "{delete_url}", + delete_option_class = cls.form_delete_form_entry_option_class, + delete_text = "{delete_text}", + form_element_position = "{form_element_position}", + counter = "{counter}", + form_element_pk = "{form_element_pk}", + ) + + +theme_registry.register(DjangoCMSAdminStyleTheme) diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tool-left.gif b/src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tool-left.gif new file mode 100644 index 0000000000000000000000000000000000000000..011490ff3a0100bea63eca7d8a3f821edecf6d3f GIT binary patch literal 197 zcmV;$06PCiNk%w1VF>^d0K@+9+1 z>Fn(6>gwvFqods1+`_`bsi~>N#Kh<4=efDLot>Sks;aTEvEJU^(b3W4U|5d-nPB=MNq{xOeZ~wr$(``}?0g zdp3Xm{Fg6Zwzjt3y?giHzkgr9e*ORde?vn9!zdUHfx#C7ia%Mvj?w{lD0p`BHNuZH8`gv5jGtilW#8Ul-s@(Rm3u`n_%YH1afFWM53xbWyi0reSoZU`=F zW>B;|HRonfOG771<|UO1;}pj!{KgMbG6N3=Of=;-YN#}Nd4NeFEUKo%!I@!YFuRjN h0z*m|qaatng9}?1vhrtKUbNTY0V7A3A`=sXH2_xRgyR4J literal 0 HcmV?d00001 diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tooltag-add_over.gif b/src/fobi/contrib/themes/djangocms_admin_style_theme/static/admin/img/tooltag-add_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..bfc52f10de75998687154585752513a27a02e5c4 GIT binary patch literal 336 zcmZ?wbhEHb6lM@)xXQp_AKmol&!20zAN~IQ+b5;fJ+bBa>km(!zx7XVkIL_<>s=I* z-Fg4<%i9m06*kQ}fA#LqpFhjm=B8Ioc1vhpx_)m~&D4mz?loHv1!s0R#56sA{$|&q zv$L0NTfOzr<~=7olUmZNro(_t( z{<*|8FIl(u()IiQ|Npm*YGNP-DE?#tE7t*$AU`p%OuD z64&(xJYQ3LjTSFY75~+{EbMWTq?Tj+^`lM+ch;D9HZb0eJO28{% if title %} › {{ title }}{% endif %} + {% endwith %} + › {% blocktrans with form_element_plugin.name as plugin_name %}Add "{{ plugin_name }}" element to the form{% endblocktrans %} + {% endif %} +{% endblock breadcrumbs-inner %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_element_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_element_entry_ajax.html new file mode 100644 index 00000000..58a70ef4 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_element_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/add_form_element_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry.html new file mode 100644 index 00000000..245504fb --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry.html @@ -0,0 +1,12 @@ +{% extends "fobi/generic/add_form_handler_entry.html" %} + +{% load i18n %} + +{% block breadcrumbs-inner %} + {% if form_entry %} + {% with form_entry.name as title %} + {% if title %} › {{ title }}{% endif %} + {% endwith %} + › {% blocktrans with form_handler_plugin.name as plugin_name %}Add "{{ plugin_name }}" handler to the form{% endblocktrans %} + {% endif %} +{% endblock breadcrumbs-inner %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry_ajax.html new file mode 100644 index 00000000..c1c34e8c --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/add_form_handler_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/add_form_handler_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base.html new file mode 100644 index 00000000..2ddac678 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base.html @@ -0,0 +1 @@ +{% extends "djangocms_admin_style_theme/_base.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_edit.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_edit.html new file mode 100644 index 00000000..4c2c4820 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_edit.html @@ -0,0 +1,152 @@ +{% load i18n staticfiles future_compat %}{#% load firstof from future %#} + + +{% block page-title %}{% endblock page-title %} | {% block site-title %}{% endblock site-title %} +{% block extrastyle %}{% include 'admin/inc/extrastyle.html' %}{% endblock %} + + + + + + +{% if LANGUAGE_BIDI %}{% endif %} + + +{% 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 %} + + + +{% include 'admin/inc/extrahead.html' %} +{% endblock extrahead %} + +{% block blockbots %}{% endblock %} + +{% load i18n %} + + +{% block main-wrapper %} + +
    + + {% if not is_popup %} + + + + {% block breadcrumbs %} + + {% endblock %} + {% endif %} + + {% block messages %} + {% if messages %} +
      {% for message in messages %} + {{ message|capfirst }} + {% endfor %}
    + {% endif %} + {% endblock messages %} + + {% block main-content-wrapper %} + +
    + {% block main-content %} + {% block content-wrapper %} + {% block pretitle %}{% endblock %} + {% block content_title %}{% if title %}

    {{ title }}

    {% endif %}{% endblock %} + {% block content %} + {% block object-tools %}{% endblock %} + {{ 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 %} + + + diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_view.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_view.html new file mode 100644 index 00000000..d0ce01d8 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/base_view.html @@ -0,0 +1,97 @@ +{% load static future_compat %}{#% load firstof from future %#} + + +{% block page-title %}{% endblock page-title %} | {% block site-title %}{% 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 %} + +{% load i18n %} + + +{% block main-wrapper %} + +
    + + + {% block messages %} + {% if messages %} +
      {% for message in messages %} + {{ message|capfirst }} + {% endfor %}
    + {% 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 %} + + + diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry.html new file mode 100644 index 00000000..5dc66a4e --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry.html @@ -0,0 +1,6 @@ +{% extends "fobi/generic/create_form_entry.html" %} +{% load i18n %} + +{% block breadcrumbs-inner %} + › {% trans "Create form" %} +{% endblock breadcrumbs-inner %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry_ajax.html new file mode 100644 index 00000000..cdda84a0 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/create_form_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/create_form_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html new file mode 100644 index 00000000..4cb72dc8 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html @@ -0,0 +1,99 @@ +{% extends fobi_theme.base_edit_template %} + +{% load i18n admin_static %} + +{% block page-title %}{% trans "Dashboard" %}{% endblock page-title %} + +{% block stylesheets %} + + {##} +{% endblock stylesheets %} + +{% block navbar-menu-content %} +{% endblock navbar-menu-content %} + +{% block bodyclass %}{% if is_popup %}popup {% endif %}change-list{% if fobi_theme %} theme {{ fobi_theme.html_class }}{% endif %}{% endblock %} + +{% block main-content-inner-attrs %}{% endblock main-content-inner-attrs %} + +{% block coltype %}flex{% endblock %} + +{% block content-wrapper %} + +

    {% trans "Your forms" %}

    + +
    + + +
    + + + +
    + + + + + + + {% comment %}{% endcomment %} + + + + + {% for form_entry in form_entries %} + + + + {##} + + + {% endfor %} + +
    +
    + {% trans "Name" %} +
    +
    +
    +
    + {% trans "Public?" %} +
    +
    +
    +
    + {% trans "Cloneable?" %} +
    +
    +
    +
    + {% trans "Actions" %} +
    +
    +
    {{ form_entry.name }}{{ form_entry.is_public }}{{ form_entry.is_cloneable }} + +
    +
    + +
    + +
    +{% endblock content-wrapper %} + +{% block sidebar-wrapper %} +{% endblock sidebar-wrapper %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry.html new file mode 100644 index 00000000..46ae0b12 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry.html @@ -0,0 +1,12 @@ +{% extends "fobi/generic/edit_form_element_entry.html" %} + +{% load i18n %} + +{% block breadcrumbs-inner %} + {% if form_entry %} + {% with form_entry.name as title %} + {% if title %} › {{ title }}{% endif %} + {% endwith %} + › {% blocktrans with form_element_plugin.name as plugin_name %}Edit "{{ plugin_name }}" form element{% endblocktrans %} + {% endif %} +{% endblock breadcrumbs-inner %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry_ajax.html new file mode 100644 index 00000000..45ea723a --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_element_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/edit_form_element_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry.html new file mode 100644 index 00000000..b479d0e3 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry.html @@ -0,0 +1,7 @@ +{% extends "fobi/generic/edit_form_entry.html" %} + +{% load i18n admin_static %} + +{% block stylesheets %} + +{% endblock stylesheets %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html new file mode 100644 index 00000000..4db990d2 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html @@ -0,0 +1,173 @@ +{% load i18n fobi_tags %} + +

    {% trans "Edit form" %}

    + +
    +
    + + +
    + +
    +

    {% trans "Change form elements" %}

    +
    + +
    +
    + + +
    +
    +
    + {% csrf_token %} + {% with assembled_form as form %} + {% include fobi_theme.form_edit_snippet_template_name %} + {% endwith %} + + {{ form_element_entry_formset.management_form }} +
    + +
    + +
    +
    +
    + +
    +
    + +
    + + +
    + + +
    +

    {% trans "Change form handlers" %}

    +
    + +
    +
    + + +
    + + {% if form_handlers %} +
    +
    + + + + + {% comment %} + + {% endcomment %} + + + + + {% for form_handler in form_handlers %} + {% with form_handler.get_plugin as plugin %} + {% if plugin %} + + + + + {% endif %} + {% endwith %} + {% endfor %} + +
    +
    {% trans "Handler" %}
    +
    +
    +
    {% trans "Settings" %}
    +
    +
    +
    {% trans "Actions" %}
    +
    +
    {{ form_handler.plugin_name }} + {% if form_handler.plugin_data %} + + ? + + {% endif %} + +
      + {% if form_handler.plugin_data %} +
    • {% trans "Edit" %}
    • + {% endif %} +
    • {% trans "Delete" %}
    • + {% get_fobi_form_handler_plugin_custom_actions plugin form_entry as form_handler_plugin_custom_actions %} + {% for action in form_handler_plugin_custom_actions %} +
    • {{ action.1 }}
    • + {% endfor %} +
    +
    +
    +
    + {% endif %} +
    +
    +
    + + +
    + +
    +

    {% trans "Change form properties" %}

    +
    +
    +
    + +
    +
    +
    + {% csrf_token %} + {% include fobi_theme.form_properties_snippet_template_name %} +
    +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry.html new file mode 100644 index 00000000..514b6141 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry.html @@ -0,0 +1,12 @@ +{% extends "fobi/generic/edit_form_handler_entry.html" %} + +{% load i18n %} + +{% block breadcrumbs-inner %} + {% if form_entry %} + {% with form_entry.name as title %} + {% if title %} › {{ title }}{% endif %} + {% endwith %} + › {% blocktrans with form_handler_plugin.name as plugin_name %}Edit "{{ plugin_name }}" form handler{% endblocktrans %} + {% endif %} +{% endblock breadcrumbs-inner %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry_ajax.html new file mode 100644 index 00000000..c8d88d34 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_handler_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/edit_form_handler_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted.html new file mode 100644 index 00000000..339e8e20 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted.html @@ -0,0 +1 @@ +{% extends "fobi/generic/form_entry_submitted.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted_ajax.html new file mode 100644 index 00000000..da8b011f --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/form_entry_submitted_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/form_entry_submitted_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_ajax.html new file mode 100644 index 00000000..033e7f3c --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_ajax.html @@ -0,0 +1,11 @@ +{% extends "fobi/generic/snippets/form_ajax.html" %} + +{% block form_page_header_html_class %}page-header{% endblock %} + +{% block form_html_class %}form-horizontal{% endblock %} + +{% block form_button_outer_wrapper_html_class %}control-group{% endblock %} + +{% block form_button_wrapper_html_class %}controls{% endblock %} + +{% block form_primary_button_html_class %}btn btn-primary{% endblock %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_ajax.html new file mode 100644 index 00000000..ff1df4d8 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_ajax.html @@ -0,0 +1,18 @@ +
    +

    {% block form_page_title %}{% endblock %}

    + +
    +
    +
    + {% csrf_token %} + {% include fobi_theme.form_edit_snippet_template_name %} +
    +
    + {% block form_buttons %} + + {% endblock form_buttons %} +
    + +
    +
    +
    diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_snippet.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_snippet.html new file mode 100644 index 00000000..4f218a94 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_edit_snippet.html @@ -0,0 +1,32 @@ +{% load i18n fobi_tags %} + +{% comment %} +
    + {% blocktrans %}Fields marked with * are required{% endblocktrans %} +
    +{% endcomment %} + +{% for field in form %} +{% get_form_field_type field as form_field_type %} +
    + {% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %} + + + {% if not form.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} + {% if form_field_type.is_checkbox %} + {{ field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }} + {% if field.is_readonly %} +

    {{ field.contents|linebreaksbr }}

    + {% else %} + {{ field }} + {% endif %} + {% endif %} + {% if field.field.help_text %} +

    {{ field.field.help_text|safe }}

    + {% endif %} +
    + + +{% endfor %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_properties_snippet.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_properties_snippet.html new file mode 100644 index 00000000..51c82486 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_properties_snippet.html @@ -0,0 +1,30 @@ +{% load i18n %} + {% comment %} +
    + {% blocktrans %}Fields marked with * are required{% endblocktrans %} +
    + {% endcomment %} + + {% for field in form %} +
    + {% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %} + + + {% if not form.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} + {% if field.is_checkbox %} + {{ field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }} + {% if field.is_readonly %} +

    {{ field.contents|linebreaksbr }}

    + {% else %} + {{ field }} + {% endif %} + {% endif %} + {% if field.field.help_text %} +

    {{ field.field.help_text|safe }}

    + {% endif %} +
    + + + {% endfor %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_snippet.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_snippet.html new file mode 100644 index 00000000..a954e86b --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_snippet.html @@ -0,0 +1,37 @@ +{% load i18n fobi_tags %} + {% comment %} +
    + {% blocktrans %}Fields marked with * are required{% endblocktrans %} +
    + {% endcomment %} + + {% block form_non_field_and_hidden_errors %} + {% get_form_hidden_fields_errors form as form_hidden_fields_errors %} + {% if form.non_field_errors or form_hidden_fields_errors %} + {% include fobi_theme.form_non_field_and_hidden_errors_snippet_template %} + {% endif %} + {% endblock form_non_field_and_hidden_errors %} + + {% for field in form %} +
    + {% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %} + + + {% if not form.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} + {% if field.is_checkbox %} + {{ field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }} + {% if field.is_readonly %} +

    {{ field.contents|linebreaksbr }}

    + {% else %} + {{ field }} + {% endif %} + {% endif %} + {% if field.field.help_text %} +

    {{ field.field.help_text|safe }}

    + {% endif %} +
    + + + {% endfor %} diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_view_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_view_ajax.html new file mode 100644 index 00000000..20c7832b --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/form_view_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/snippets/form_view_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/messages_snippet.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/messages_snippet.html new file mode 100644 index 00000000..f7816704 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/snippets/messages_snippet.html @@ -0,0 +1 @@ +{% extends "fobi/generic/snippets/messages_snippet.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/theme.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/theme.html new file mode 100644 index 00000000..1ce8bfe5 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/theme.html @@ -0,0 +1,108 @@ +{% load i18n static %} + + + + + + + + + + {% block favicon %} + + {% endblock favicon %} + + {% block page-title %}{% endblock page-title %} | {% block site-title %}{% endblock site-title %} + + {% block stylesheets %} + + + {% endblock stylesheets %} + + {% block layout-stylesheets %} + + + {% endblock layout-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 content-wrapper %} + + + +
    + {% block messages-wrapper %} + {% include "fobi/snippets/messages_snippet.html" %} + {% endblock messages-wrapper %} + + + {% block content %} + + {% endblock content %} + +
    + + {% endblock content-wrapper %} + + {% block javascripts %} + + + + + {% endblock javascripts %} + + {% block theme-javascripts %}{% endblock theme-javascripts %} + + + diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry.html new file mode 100644 index 00000000..001575c9 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry.html @@ -0,0 +1 @@ +{% extends "fobi/generic/view_form_entry.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry_ajax.html b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry_ajax.html new file mode 100644 index 00000000..4c60b71d --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/view_form_entry_ajax.html @@ -0,0 +1 @@ +{% extends "fobi/generic/view_form_entry_ajax.html" %} \ No newline at end of file diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/__init__.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/__init__.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/README.rst b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/README.rst new file mode 100644 index 00000000..e9db1da4 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/README.rst @@ -0,0 +1,26 @@ +============================================================================== +fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store +============================================================================== +A ``db_store`` form handler plugin widget for Simple theme. +was used. + +Installation +=============================================== +1. Add ``fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store`` + 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_handlers.db_store', + 'fobi.contrib.plugins.form_handlers.db_store', + # ... + ) + +2. Specify ``djangocms_admin_style_theme`` as a default theme in your ``settings.py``: + +.. code-block:: python + + FOBI_DEFAULT_THEME = 'djangocms_admin_style_theme' diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/__init__.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/__init__.py new file mode 100644 index 00000000..3bedc69f --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/__init__.py @@ -0,0 +1,7 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2015 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_handlers.db_store.apps.Config' diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/apps.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/apps.py new file mode 100644 index 00000000..a1ec38da --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/apps.py @@ -0,0 +1,14 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.apps' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2015 Artur Barseghyan' +__license__ = 'GPL 2.0/LGPL 2.1' +__all__ = ('Config',) + +try: + from django.apps import AppConfig + + class Config(AppConfig): + name = label = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store' + +except ImportError: + pass diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/fobi_form_elements.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/fobi_form_elements.py new file mode 100644 index 00000000..dd293883 --- /dev/null +++ b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/fobi_form_elements.py @@ -0,0 +1,23 @@ +__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.fobi_form_elements' +__author__ = 'Artur Barseghyan ' +__copyright__ = 'Copyright (c) 2015 Artur Barseghyan' +__license__ = 'GPL 2.0/LGPL 2.1' +__all__ = ('DbStorePluginWidget',) + +from fobi.base import form_handler_plugin_widget_registry +from fobi.contrib.themes.djangocms_admin_style_theme import UID +from fobi.contrib.plugins.form_handlers.db_store.widgets import ( + BaseDbStorePluginWidget +) + +class DbStorePluginWidget(BaseDbStorePluginWidget): + """ + DbStore plugin widget for djangocms_admin_style_theme theme. + """ + theme_uid = UID + view_entries_icon_class = '' + export_entries_icon_class = '' + + +# Registering the widget +form_handler_plugin_widget_registry.register(DbStorePluginWidget) diff --git a/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/models.py b/src/fobi/contrib/themes/djangocms_admin_style_theme/widgets/form_handlers/db_store/models.py new file mode 100644 index 00000000..e69de29b diff --git a/src/fobi/fields.py b/src/fobi/fields.py index 0eacda09..c4ff6090 100644 --- a/src/fobi/fields.py +++ b/src/fobi/fields.py @@ -25,3 +25,6 @@ class NoneField(Field): a bit differently. """ return initial + + def validate(self, value): + return True diff --git a/test.sh b/test.sh deleted file mode 100755 index e67186ad..00000000 --- a/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -reset -./uninstall.sh -./install.sh -python examples/simple/manage.py test fobi \ No newline at end of file diff --git a/test3.sh b/test3.sh deleted file mode 100755 index 321c9db9..00000000 --- a/test3.sh +++ /dev/null @@ -1,4 +0,0 @@ -reset -./uninstall.sh -./install3.sh -python examples/simple/manage.py test fobi --traceback \ No newline at end of file diff --git a/test_pypi.sh b/test_pypi.sh deleted file mode 100755 index ba5a1060..00000000 --- a/test_pypi.sh +++ /dev/null @@ -1,4 +0,0 @@ -reset -./uninstall.sh -./install_pypi.sh -python examples/simple/manage.py test fobi \ No newline at end of file diff --git a/test_verbose.sh b/test_verbose.sh deleted file mode 100644 index cddb9ab8..00000000 --- a/test_verbose.sh +++ /dev/null @@ -1,4 +0,0 @@ -reset -./uninstall.sh -./install.sh -python examples/simple/manage.py test fobi --traceback \ No newline at end of file