mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-03-16 22:10:28 +00:00
more on preparing the 0.4.16; adding docs
This commit is contained in:
parent
fc2b7470e3
commit
9f5d08ffd7
116 changed files with 2411 additions and 77 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 *
|
||||
|
|
|
|||
204
QUICK_START.rst
Normal file
204
QUICK_START.rst
Normal file
|
|
@ -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
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/fobi/contrib/plugins/form_elements/security/captcha/>`_
|
||||
or `fobi.contrib.plugins.form_elements.security.recaptcha
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/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
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L253>`_
|
||||
- `fobi.models.FormElementEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L427>`_
|
||||
- `fobi.models.FormHandlerEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L463>`_
|
||||
- `fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/contrib/plugins/form_handlers/db_store/models.py#L52>`_
|
||||
12
README.rst
12
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
|
||||
<https://github.com/divio/djangocms-admin-style>`_).
|
||||
- Implemented `integration with FeinCMS
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/fobi/contrib/apps/feincms_integration>`_
|
||||
(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
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/fobi/contrib/themes/simple/>`_:
|
||||
Basic theme. Form editing is in a style of Django admin.
|
||||
- `Simple
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/fobi/contrib/themes/djangocms_admin_style_theme/>`_:
|
||||
Basic theme. Form editing is in a style of `djangocms-admin-style
|
||||
<https://github.com/divio/djangocms-admin-style>`_.
|
||||
|
||||
HTML5 fields
|
||||
===============================================
|
||||
|
|
|
|||
13
TODOS.rst
13
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
|
||||
<https://github.com/divio/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).
|
||||
|
|
|
|||
|
|
@ -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 ..
|
||||
|
|
@ -7,6 +7,7 @@ Contents:
|
|||
:maxdepth: 20
|
||||
|
||||
fobi
|
||||
quickstart
|
||||
|
||||
Indices and tables
|
||||
===============================================
|
||||
|
|
|
|||
|
|
@ -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
|
||||
===============================================
|
||||
|
|
|
|||
204
docs/quickstart.rst
Normal file
204
docs/quickstart.rst
Normal file
|
|
@ -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
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/fobi/contrib/plugins/form_elements/security/captcha/>`_
|
||||
or `fobi.contrib.plugins.form_elements.security.recaptcha
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/stable/src/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
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L253>`_
|
||||
- `fobi.models.FormElementEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L427>`_
|
||||
- `fobi.models.FormHandlerEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/models.py#L463>`_
|
||||
- `fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry
|
||||
<https://github.com/barseghyanartur/django-fobi/blob/stable/src/fobi/contrib/plugins/form_handlers/db_store/models.py#L52>`_
|
||||
0
examples/quickstart/__init__.py
Normal file
0
examples/quickstart/__init__.py
Normal file
31
examples/quickstart/local_settings.example
Normal file
31
examples/quickstart/local_settings.example
Normal file
|
|
@ -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 = '<no-reply@dev.django-fobi.mail.example.com>'
|
||||
|
||||
# Fobi settings
|
||||
FOBI_DEBUG = True
|
||||
FOBI_RESTRICT_PLUGIN_ACCESS = False
|
||||
|
||||
10
examples/quickstart/manage.py
Executable file
10
examples/quickstart/manage.py
Executable file
|
|
@ -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)
|
||||
283
examples/quickstart/settings.py
Normal file
283
examples/quickstart/settings.py
Normal file
|
|
@ -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',
|
||||
)
|
||||
44
examples/quickstart/urls.py
Normal file
44
examples/quickstart/urls.py
Normal file
|
|
@ -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)
|
||||
32
examples/quickstart/wsgi.py
Normal file
32
examples/quickstart/wsgi.py
Normal file
|
|
@ -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)
|
||||
|
|
@ -3,4 +3,5 @@ django-cms==3.0.6
|
|||
djangocms-picture
|
||||
djangocms-snippet
|
||||
djangocms-text-ckeditor
|
||||
django-mptt
|
||||
django-mptt
|
||||
djangocms-admin-style
|
||||
|
|
@ -27,7 +27,6 @@ DEFAULT_FROM_EMAIL = '<no-reply@dev.django-fobi.mail.example.com>'
|
|||
|
||||
FOBI_DEBUG = True
|
||||
FOBI_RESTRICT_PLUGIN_ACCESS = False
|
||||
FOBI_RESTRICT_FIELDS_ACCESS = False
|
||||
#FOBI_DEFAULT_THEME = 'foundation5'
|
||||
|
||||
WAIT_BETWEEN_TEST_STEPS = 0
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
#workon fobi
|
||||
./manage.py runserver 0.0.0.0:8003 --settings=settings_djangocms_admin_style_theme_djangocms --traceback -v 3
|
||||
|
|
@ -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 ***********************
|
||||
# **************************************************************
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
@ -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('',
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
python setup.py --long-description | rst2html.py > builddocs/pypi.html
|
||||
#python setup.py --long-description | rst2html.py | cat
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
python setup.py register
|
||||
python setup.py sdist bdist_wheel upload
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
reset
|
||||
./uninstall.sh
|
||||
./install.sh
|
||||
8
scripts/build_docs.sh
Executable file
8
scripts/build_docs.sh
Executable file
|
|
@ -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
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
#cd ..
|
||||
find . -name "*.pyc" -exec rm -rf {} \;
|
||||
rm -rf build/
|
||||
rm -rf dist/
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
python examples/simple/manage.py fobi_create_test_data
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
python examples/simple/manage.py fobi_create_test_data
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
12
scripts/install_djangocms_djangocms_admin_style.sh
Executable file
12
scripts/install_djangocms_djangocms_admin_style.sh
Executable file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
python examples/simple/manage.py fobi_create_test_data
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
python examples/simple/manage.py fobi_create_test_data
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
4
scripts/make_pypi_long_description.sh
Executable file
4
scripts/make_pypi_long_description.sh
Executable file
|
|
@ -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
|
||||
4
scripts/make_release.sh
Executable file
4
scripts/make_release.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#cd ..
|
||||
python setup.py register
|
||||
python setup.py sdist bdist_wheel upload
|
||||
#cd scripts
|
||||
|
|
@ -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 <artur.barseghyan@gmail.com>' -V '0.1' -f -d 20
|
||||
cp docs/conf.distrib docs/conf.py
|
||||
cp docs/conf.distrib docs/conf.py
|
||||
#cd scripts
|
||||
3
scripts/reinstall.sh
Executable file
3
scripts/reinstall.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
reset
|
||||
./scripts/uninstall.sh
|
||||
./scripts/install.sh
|
||||
3
scripts/reinstall_djangocms_djangocms_admin_style.sh
Executable file
3
scripts/reinstall_djangocms_djangocms_admin_style.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
reset
|
||||
./scripts/uninstall.sh
|
||||
./scripts/install_djangocms_djangocms_admin_style.sh
|
||||
6
scripts/test.sh
Executable file
6
scripts/test.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
reset
|
||||
./uninstall.sh
|
||||
./install.sh
|
||||
#cd ..
|
||||
python examples/simple/manage.py test fobi
|
||||
#cd scripts
|
||||
6
scripts/test3.sh
Executable file
6
scripts/test3.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
reset
|
||||
./uninstall.sh
|
||||
./install3.sh
|
||||
#cd ..
|
||||
python examples/simple/manage.py test fobi --traceback
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
6
scripts/test_pypi.sh
Executable file
6
scripts/test_pypi.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
reset
|
||||
./uninstall.sh
|
||||
./install_pypi.sh
|
||||
#cd ..
|
||||
python examples/simple/manage.py test fobi
|
||||
#cd scripts
|
||||
6
scripts/test_verbose.sh
Normal file
6
scripts/test_verbose.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
reset
|
||||
./uninstall.sh
|
||||
./install.sh
|
||||
#cd ..
|
||||
python examples/simple/manage.py test fobi --traceback
|
||||
#cd scripts
|
||||
|
|
@ -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
|
||||
rm builddocs/ -rf
|
||||
#cd scripts
|
||||
4
setup.py
4
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',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
__title__ = 'django-fobi'
|
||||
__version__ = '0.4.15'
|
||||
__build__ = 0x00001e
|
||||
__version__ = '0.4.16'
|
||||
__build__ = 0x00001f
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = 'Copyright (c) 2014-2015 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 <http://jqueryui.com/>`_.
|
||||
|
||||
Installation
|
||||
===============================================
|
||||
Install `djangocms-admin-style`
|
||||
-----------------------------------------------
|
||||
See the original `installation instructions
|
||||
<https://pypi.python.org/pypi/djangocms-admin-style#installation>`_.
|
||||
|
||||
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'
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__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'
|
||||
14
src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py
Normal file
14
src/fobi/contrib/themes/djangocms_admin_style_theme/apps.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.apps'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__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
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
__title__ = 'fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__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 """
|
||||
<li><a href="{edit_url}" class="{edit_option_class}">
|
||||
<span>{edit_text}</span></a>
|
||||
</li>
|
||||
""".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 """
|
||||
<ul class="{container_class}">
|
||||
{edit_option_html}
|
||||
<li><a href="{delete_url}" class="{delete_option_class}">
|
||||
<span>{delete_text}</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
<input type="hidden" value="{form_element_position}"
|
||||
name="form-{counter}-position"
|
||||
id="id_form-{counter}-position"
|
||||
class="form-element-position">
|
||||
<input type="hidden" value="{form_element_pk}"
|
||||
name="form-{counter}-id" id="id_form-{counter}-id">
|
||||
""".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)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 197 B |
Binary file not shown.
|
After Width: | Height: | Size: 932 B |
Binary file not shown.
|
After Width: | Height: | Size: 336 B |
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
Document : fobi.djangocms_admin_style_theme.css
|
||||
Created on : July 25, 2014, 01:55:27 AM
|
||||
Author : Artur Barseghyan (artur.barseghyan@gmail.com)
|
||||
Description:
|
||||
`django-fobi` "djangocms_admin_style_theme" theme main styles.
|
||||
*/
|
||||
/*
|
||||
* Style tweaks
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden; /* Prevent scroll on narrow devices */
|
||||
}
|
||||
body.fobi-home {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.form-element-position {
|
||||
/*position: absolute;
|
||||
left: -9999px;*/
|
||||
}
|
||||
|
||||
/*
|
||||
* Off Canvas
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
@media screen and (max-width: 767px) {
|
||||
.row-offcanvas {
|
||||
position: relative;
|
||||
-webkit-transition: all 0.25s ease-out;
|
||||
-moz-transition: all 0.25s ease-out;
|
||||
transition: all 0.25s ease-out;
|
||||
}
|
||||
|
||||
.row-offcanvas-right
|
||||
.sidebar-offcanvas {
|
||||
right: -50%; /* 6 columns */
|
||||
}
|
||||
|
||||
.row-offcanvas-left
|
||||
.sidebar-offcanvas {
|
||||
left: -50%; /* 6 columns */
|
||||
}
|
||||
|
||||
.row-offcanvas-right.active {
|
||||
right: 50%; /* 6 columns */
|
||||
}
|
||||
|
||||
.row-offcanvas-left.active {
|
||||
left: 50%; /* 6 columns */
|
||||
}
|
||||
|
||||
.sidebar-offcanvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 50%; /* 6 columns */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Plugin specific
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
Document : fobi.djangocms_admin_style_theme.edit.css
|
||||
Created on : July 25, 2014, 01:55:27 AM
|
||||
Author : Artur Barseghyan (artur.barseghyan@gmail.com)
|
||||
Description:
|
||||
`django-fobi` "djangocms_admin_style_theme" theme main admin interface
|
||||
styles.
|
||||
*/
|
||||
.theme.theme-djangocms_admin_style_theme {
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .list-inline {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .list-inline li {
|
||||
list-style: none;
|
||||
padding-right: 10px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .list-inline li a span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown {
|
||||
background: url("../../admin/img/tool-left.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
|
||||
display: block;
|
||||
float: left;
|
||||
height: 16px;
|
||||
margin-left: 2px;
|
||||
padding: 0 0 0 8px;
|
||||
list-style-type: square;
|
||||
min-width: 175px;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-toggle {
|
||||
background: #999 url(../../admin/img/tooltag-add.gif) top right no-repeat;
|
||||
padding-right: 28px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
float: left;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-toggle:hover {
|
||||
background: #5b80b2 url(../../admin/img/tooltag-add_over.gif) top right no-repeat;
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-menu {
|
||||
background-color: #fff;
|
||||
margin-top: 20px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 0 10px 5px 10px;
|
||||
right: 0;
|
||||
border-bottom: #ddd 1px solid;
|
||||
border-right: #ddd 1px solid;
|
||||
border-left: #ddd 1px solid;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-menu li {
|
||||
list-style: none;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-menu .dropdown-header {
|
||||
color: #999;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .dropdown .dropdown-menu .divider {
|
||||
border-top: #ddd 1px solid;
|
||||
margin: 7px 0 5px 0;
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .form-horizontal {
|
||||
padding-top: 35px;
|
||||
/*float: left;
|
||||
clear: both;*/
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .form-row {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .row .col-main {
|
||||
/*float: left;
|
||||
width: 70%;*/
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .row .col-sidebar {
|
||||
/*float: right;
|
||||
width: 30%;*/
|
||||
}
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .table.table-striped {
|
||||
padding-top: 35px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#tab-form-elemenets .nav.pull-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#tab-form-handlers .nav.pull-right {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 60px;
|
||||
}
|
||||
|
||||
/* Extra styling form elements */
|
||||
|
||||
.theme.theme-djangocms_admin_style_theme .form-row.radiolist {
|
||||
margin-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.theme.theme-djangocms_admin_style_theme .form-row.radiolist li {
|
||||
list-style-type: none;
|
||||
margin-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
;
|
||||
$(document).ready(function(){
|
||||
// Menu toggling
|
||||
$(".dropdown .dropdown-menu").hide();
|
||||
$(".dropdown .dropdown-toggle").click(function(){
|
||||
var parent = $(this).parent('li').parent('ul');
|
||||
parent.find(".dropdown .dropdown-menu").toggle();
|
||||
});
|
||||
|
||||
// Handling tabs
|
||||
$("#tabs").tabs({heightStyle: "auto"});
|
||||
|
||||
fobiCore.init({
|
||||
// Configure?
|
||||
});
|
||||
fobiCore.handleTabs('#tabs ul.tab-links li');
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Draggable form elements.
|
||||
*/
|
||||
$(function() {
|
||||
// Matching regex with jQuery
|
||||
$.expr[':'].regex = function(elem, index, match) {
|
||||
var matchParams = match[3].split(','),
|
||||
validLabels = /^(data|css):/,
|
||||
attr = {
|
||||
method: matchParams[0].match(validLabels) ?
|
||||
matchParams[0].split(':')[0] : 'attr',
|
||||
property: matchParams.shift().replace(validLabels,'')
|
||||
},
|
||||
regexFlags = 'ig',
|
||||
regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
|
||||
return regex.test($(elem)[attr.method](attr.property));
|
||||
}
|
||||
|
||||
formElementPositionElements = $('.form-element-position');
|
||||
if (formElementPositionElements.length) {
|
||||
$('.form-horizontal .form-row').css({ 'cursor': 'move' });
|
||||
|
||||
$('.form-horizontal').sortable({
|
||||
axis: 'y',
|
||||
items: ".form-row",
|
||||
update: function(){
|
||||
$.each($('.form-horizontal .form-row'), function(i){
|
||||
$(this).find('input:regex(name, .*-position)').val(i + 1);
|
||||
});
|
||||
|
||||
//$(this).find('.form-row').removeClass('row1').removeClass('row2');
|
||||
|
||||
//$(this).find('.form-row:odd').addClass('row2');
|
||||
//$(this).find('.form-row:even').addClass('row1');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{% extends "fobi/generic/_base.html" %}
|
||||
|
||||
{# djangocms_admin_style_theme master base template #}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{% extends "fobi/generic/add_form_element_entry.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs-inner %}
|
||||
{% if form_entry %}
|
||||
{% with form_entry.name as title %}
|
||||
<a href="{% url 'fobi.edit_form_entry' form_entry.pk %}">{% if title %} › {{ title }}{% endif %}</a>
|
||||
{% endwith %}
|
||||
› {% blocktrans with form_element_plugin.name as plugin_name %}Add "{{ plugin_name }}" element to the form{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/add_form_element_entry_ajax.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 %}
|
||||
<a href="{% url 'fobi.edit_form_entry' form_entry.pk %}">{% if title %} › {{ title }}{% endif %}</a>
|
||||
{% endwith %}
|
||||
› {% blocktrans with form_handler_plugin.name as plugin_name %}Add "{{ plugin_name }}" handler to the form{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/add_form_handler_entry_ajax.html" %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "djangocms_admin_style_theme/_base.html" %}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
{% load i18n staticfiles future_compat %}{#% load firstof from future %#}<!DOCTYPE html>
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}{% block html-attributes %}{% endblock html-attributes %}>
|
||||
<head>
|
||||
<title>{% block page-title %}{% endblock page-title %} | {% block site-title %}{% endblock site-title %}</title>
|
||||
{% block extrastyle %}{% include 'admin/inc/extrastyle.html' %}{% endblock %}
|
||||
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static 'admin/css/base.css' %}{% endblock %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/widgets.css' %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'cms/css/cms.pagetree.css' %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.edit.css' %}" />
|
||||
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
|
||||
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
|
||||
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
|
||||
|
||||
{% block stylesheets %}
|
||||
{#<!-- Additional core CSS files that somehow can't be put into the python theme -->#}
|
||||
{% endblock stylesheets %}
|
||||
|
||||
{% block theme-stylesheets %}
|
||||
{#<!-- This is where stylesheets declared in the Python theme are listed -->#}
|
||||
|
||||
{% for css_file in fobi_theme.get_media_css %}
|
||||
<link href="{% static css_file %}" rel="stylesheet" media="all" />
|
||||
{% endfor %}
|
||||
|
||||
{% endblock theme-stylesheets %}
|
||||
|
||||
{% block extra-stylesheets %}{% endblock extra-stylesheets %}
|
||||
|
||||
{% block head-javascripts %}
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{% endblock head-javascripts %}
|
||||
|
||||
{% block extra-head-javascripts %}{% endblock extra-head-javascripts %}
|
||||
|
||||
{% block extrahead %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'djangocms_admin_style/css/djangocms-admin.css' %}" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<script type="text/javascript">
|
||||
if (window.self!==window.top) { document.write('<link rel="stylesheet" type="text/css" href="{% static 'djangocms_admin_style/css/djangocms-admin-frontend.css' %}" />'); }
|
||||
</script>
|
||||
{% include 'admin/inc/extrahead.html' %}
|
||||
{% endblock extrahead %}
|
||||
|
||||
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
|
||||
</head>
|
||||
{% load i18n %}
|
||||
|
||||
<body class="{% block bodyclass %}{% if is_popup %}popup {% endif %}change-form{% if fobi_theme %} theme {{ fobi_theme.html_class }}{% endif %}{% endblock %}">
|
||||
{% block main-wrapper %}
|
||||
<!-- Container -->
|
||||
<div id="container">
|
||||
|
||||
{% if not is_popup %}
|
||||
<!-- Header -->
|
||||
<div id="header">
|
||||
<div id="branding">
|
||||
{% block branding %}<h1 id="site-name">{% trans 'Django administration' %}</h1>{% endblock %}
|
||||
</div>
|
||||
{% if user.is_active and user.is_staff %}
|
||||
<div id="user-tools">
|
||||
{% trans 'Welcome,' %}
|
||||
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
|
||||
{% block userlinks %}
|
||||
{% url 'django-admindocs-docroot' as docsroot %}
|
||||
{% if docsroot %}
|
||||
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
|
||||
{% endif %}
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block nav-global %}{% endblock %}
|
||||
</div>
|
||||
<!-- END Header -->
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> ›
|
||||
{% url 'fobi.dashboard' as fobi_dashboard_url %}
|
||||
<a href="{{ fobi_dashboard_url }}">{% trans 'Fobi' %}</a>
|
||||
{% block breadcrumbs-inner %}
|
||||
{% if form_entry %}
|
||||
{% with form_entry.name as title %}
|
||||
{% if title %} › {{ title }}{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block messages %}
|
||||
{% if messages %}
|
||||
<ul class="messagelist">{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
|
||||
{% endfor %}</ul>
|
||||
{% endif %}
|
||||
{% endblock messages %}
|
||||
|
||||
{% block main-content-wrapper %}
|
||||
<!-- Content -->
|
||||
<div id="content" class="{% block coltype %}colM{% endblock %}">
|
||||
{% block main-content %}
|
||||
{% block content-wrapper %}
|
||||
{% block pretitle %}{% endblock %}
|
||||
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
|
||||
{% block content %}
|
||||
{% block object-tools %}{% endblock %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
{% endblock content-wrapper %}
|
||||
|
||||
{% block sidebar-wrapper %}
|
||||
{% block sidebar %}{% endblock %}
|
||||
{% endblock sidebar-wrapper %}
|
||||
<br class="clear" />
|
||||
|
||||
{% endblock main-content %}
|
||||
</div>
|
||||
<!-- END Content -->
|
||||
|
||||
{% block footer-wrapper %}
|
||||
{% block footer %}<div id="footer"></div>{% endblock %}
|
||||
{% endblock footer-wrapper %}
|
||||
|
||||
{% endblock main-content-wrapper %}
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END Container -->
|
||||
|
||||
{% endblock main-wrapper %}
|
||||
|
||||
{% block javascripts %}
|
||||
{#<!-- Theme core JavaScript that somehow can't be put into the Python theme -->#}
|
||||
{#<!-- Placed at the end of the document so the pages load faster, although might be changed, if plugins need it to be otherwise -->#}
|
||||
{% endblock javascripts %}
|
||||
|
||||
{% block theme-javascripts %}
|
||||
{#<!-- This is where javascripts declared in the Python theme are listed -->#}
|
||||
{% for js_file in fobi_theme.get_media_js %}
|
||||
<script src="{% static js_file %}"></script>
|
||||
{% endfor %}
|
||||
<script src="{% static 'djangocms_admin_style_theme/js/fobi.djangocms_admin_style_theme.edit.js' %}"></script>
|
||||
{% endblock theme-javascripts %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
{% load static future_compat %}{#% load firstof from future %#}<!DOCTYPE html>
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}{% block html-attributes %}{% endblock html-attributes %}>
|
||||
<head>
|
||||
<title>{% block page-title %}{% endblock page-title %} | {% block site-title %}{% endblock site-title %}</title>
|
||||
{% block extrastyle %}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{#<!-- Additional core CSS files that somehow can't be put into the python theme -->#}
|
||||
{% endblock stylesheets %}
|
||||
|
||||
{% block theme-stylesheets %}
|
||||
{#<!-- This is where stylesheets declared in the Python theme are listed -->#}
|
||||
|
||||
{% for css_file in fobi_theme.get_media_css %}
|
||||
<link href="{% static css_file %}" rel="stylesheet" media="all" />
|
||||
{% endfor %}
|
||||
|
||||
{% endblock theme-stylesheets %}
|
||||
|
||||
{% block extra-stylesheets %}{% endblock extra-stylesheets %}
|
||||
|
||||
{% block head-javascripts %}
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{% endblock head-javascripts %}
|
||||
|
||||
{% block extra-head-javascripts %}{% endblock extra-head-javascripts %}
|
||||
|
||||
{% block extrahead %}{% endblock extrahead %}
|
||||
|
||||
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
|
||||
</head>
|
||||
{% load i18n %}
|
||||
|
||||
<body class="{% block bodyclass %}{% if fobi_theme %} theme {{ fobi_theme.html_class }}{% endif %}{% endblock %}">
|
||||
{% block main-wrapper %}
|
||||
<!-- Container -->
|
||||
<div id="container">
|
||||
|
||||
|
||||
{% block messages %}
|
||||
{% if messages %}
|
||||
<ul class="messagelist">{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
|
||||
{% endfor %}</ul>
|
||||
{% endif %}
|
||||
{% endblock messages %}
|
||||
|
||||
{% block main-content-wrapper %}
|
||||
<!-- Content -->
|
||||
|
||||
{% 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 %}
|
||||
|
||||
<!-- END Content -->
|
||||
|
||||
{% block footer-wrapper %}
|
||||
{% block footer %}<div id="footer"></div>{% endblock %}
|
||||
{% endblock footer-wrapper %}
|
||||
|
||||
{% endblock main-content-wrapper %}
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END Container -->
|
||||
|
||||
{% endblock main-wrapper %}
|
||||
|
||||
{% block javascripts %}
|
||||
{#<!-- Theme core JavaScript that somehow can't be put into the Python theme -->#}
|
||||
{#<!-- Placed at the end of the document so the pages load faster, although might be changed, if plugins need it to be otherwise -->#}
|
||||
{% endblock javascripts %}
|
||||
|
||||
{% block theme-javascripts %}
|
||||
{#<!-- This is where javascripts declared in the Python theme are listed -->#}
|
||||
{% for js_file in fobi_theme.get_media_js %}
|
||||
<script src="{% static js_file %}"></script>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock theme-javascripts %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{% extends "fobi/generic/create_form_entry.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs-inner %}
|
||||
› {% trans "Create form" %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/create_form_entry_ajax.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 %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/changelists.css' %}" />
|
||||
{#<link rel="stylesheet" type="text/css" href="{% static 'cms/css/cms.pagetree.css' %}" />#}
|
||||
{% 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 %}
|
||||
|
||||
<h1>{% trans "Your forms" %}</h1>
|
||||
|
||||
<div id="content-main">
|
||||
<ul class="object-tools">
|
||||
<li>
|
||||
<a class="addlink" href="{% url 'fobi.create_form_entry' %}">{% trans "Create form"%}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="changelist" class="module">
|
||||
<!-- Forms -->
|
||||
|
||||
|
||||
<div class="results" id="sitemap">
|
||||
|
||||
<table id="result_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="text">
|
||||
<span>{% trans "Name" %}</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="text">
|
||||
<span>{% trans "Public?" %}</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
{% comment %}<th>
|
||||
<div class="text">
|
||||
<span>{% trans "Cloneable?" %}</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</th>{% endcomment %}
|
||||
<th>
|
||||
<div class="text">
|
||||
<span>{% trans "Actions" %}</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for form_entry in form_entries %}
|
||||
<tr class="{% if forloop.counter|divisibleby:2 %}row2{% else %}row1{% endif %}">
|
||||
<th><a href="{% url 'fobi.view_form_entry' form_entry.slug %}">{{ form_entry.name }}</a></th>
|
||||
<td>{{ form_entry.is_public }}</td>
|
||||
{#<td>{{ form_entry.is_cloneable }}</td>#}
|
||||
<td>
|
||||
<ul class="list-inline">
|
||||
<li>
|
||||
<a href="{% url 'fobi.edit_form_entry' form_entry.pk %}" class="edit">
|
||||
<span>{% trans "Edit" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'fobi.delete_form_entry' form_entry.pk %}" class="deletelink">
|
||||
<span>{% trans "Delete" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div><!-- /#changelist -->
|
||||
|
||||
</div><!-- /#content-main -->
|
||||
{% endblock content-wrapper %}
|
||||
|
||||
{% block sidebar-wrapper %}
|
||||
{% endblock sidebar-wrapper %}
|
||||
|
|
@ -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 %}
|
||||
<a href="{% url 'fobi.edit_form_entry' form_entry.pk %}">{% if title %} › {{ title }}{% endif %}</a>
|
||||
{% endwith %}
|
||||
› {% blocktrans with form_element_plugin.name as plugin_name %}Edit "{{ plugin_name }}" form element{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/edit_form_element_entry_ajax.html" %}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "fobi/generic/edit_form_entry.html" %}
|
||||
|
||||
{% load i18n admin_static %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/changelists.css' %}" />
|
||||
{% endblock stylesheets %}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
{% load i18n fobi_tags %}
|
||||
|
||||
<h1>{% trans "Edit form" %}</h1>
|
||||
|
||||
<div class="row" id="tabs">
|
||||
<div id="sitemap">
|
||||
<ul class="tab-links">
|
||||
<li><a href="#tab-form-elemenets">{% trans "Elements" %}</a></li>
|
||||
<li><a href="#tab-form-handlers">{% trans "Handlers" %}</a></li>
|
||||
<li><a href="#tab-form-properties">{% trans "Properties" %}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="col col-form-elements" id="tab-form-elemenets">
|
||||
<!-- Form element plugins -->
|
||||
<div>
|
||||
<h2 id="form_elements">{% trans "Change form elements" %}</h2>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<ul class="nav pull-right">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
|
||||
{% trans "Add form element" %} <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for group, plugins in user_form_element_plugins.items %}
|
||||
{% if not forloop.first %}
|
||||
<li class="divider"></li>
|
||||
{% endif %}
|
||||
<li class="dropdown-header">{{ group }}</li>
|
||||
{% for form_element_uid, form_element_name in plugins %}
|
||||
<li><a href="{% url 'fobi.add_form_element_entry' form_entry.pk form_element_uid %}">{{ form_element_name }}</a></li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form method="post" action="{{ request.path }}?active_tab=tab-form-elements" novalidate="novalidate" class="form-horizontal">
|
||||
<div>
|
||||
<fieldset class="module aligned">
|
||||
{% csrf_token %}
|
||||
{% with assembled_form as form %}
|
||||
{% include fobi_theme.form_edit_snippet_template_name %}
|
||||
{% endwith %}
|
||||
|
||||
{{ form_element_entry_formset.management_form }}
|
||||
</fieldset>
|
||||
|
||||
<div class="submit-row">
|
||||
<input type="submit" name="ordering" class="default" value="{% trans 'Save ordering' %}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /#tab-form-elemenets -->
|
||||
|
||||
|
||||
<div class="col col-form-handlers" id="tab-form-handlers">
|
||||
|
||||
<!-- Form handler plugins -->
|
||||
<div>
|
||||
<h2 id="form_handlers">{% trans "Change form handlers" %}</h2>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<ul class="nav pull-right">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
|
||||
{% trans "Add form handler" %} <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for form_handler_uid, form_handler_name in user_form_handler_plugins %}
|
||||
<li><a href="{% url 'fobi.add_form_handler_entry' form_entry.pk form_handler_uid %}">{{ form_handler_name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
{% if form_handlers %}
|
||||
<div class="module">
|
||||
<div class="change-list">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="text">{% trans "Handler" %}</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
{% comment %}
|
||||
<th>
|
||||
<div class="text">{% trans "Settings" %}</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
{% endcomment %}
|
||||
<th>
|
||||
<div class="text">{% trans "Actions" %}</div>
|
||||
<div class="clear"></div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for form_handler in form_handlers %}
|
||||
{% with form_handler.get_plugin as plugin %}
|
||||
{% if plugin %}
|
||||
<tr class="{% if forloop.counter|divisibleby:2 %}row2{% else %}row1{% endif %}">
|
||||
<td>{{ form_handler.plugin_name }}
|
||||
{% if form_handler.plugin_data %}
|
||||
<a class="popover-link" href="javascript:;" data-toggle="popover" data-content="{% spaceless %}{{ plugin.plugin_data_repr|safe }}{% endspaceless %}" role="button">
|
||||
<span class="badge" title="{% trans 'Info' %}">?</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="list-inline">
|
||||
{% if form_handler.plugin_data %}
|
||||
<li><a href="{% url 'fobi.edit_form_handler_entry' form_handler.pk %}" class="edit"><span>{% trans "Edit" %}</span></a></li>
|
||||
{% endif %}
|
||||
<li><a href="{% url 'fobi.delete_form_handler_entry' form_handler.pk %}" class="deletelink"><span>{% trans "Delete" %}</span> </a></li>
|
||||
{% get_fobi_form_handler_plugin_custom_actions plugin form_entry as form_handler_plugin_custom_actions %}
|
||||
{% for action in form_handler_plugin_custom_actions %}
|
||||
<li><a href="{{ action.0 }}"><span class="{{ action.2 }}"></span> {{ action.1 }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /#tab-form-handlers -->
|
||||
|
||||
|
||||
<div class="col col-form-properties" id="tab-form-properties">
|
||||
<!-- Form properties -->
|
||||
<div>
|
||||
<h2 id="form_properties">{% trans "Change form properties" %}</h2>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<form method="post" action="{{ request.path }}?active_tab=tab-form-properties" enctype="multipart/form-data" class="form-horizontal">
|
||||
<div>
|
||||
<fieldset class="module aligned">
|
||||
{% csrf_token %}
|
||||
{% include fobi_theme.form_properties_snippet_template_name %}
|
||||
</fieldset>
|
||||
<div class="submit-row">
|
||||
<input type="submit" class="default" value="{% trans 'Save' %}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- /#tab-form-properties -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -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 %}
|
||||
<a href="{% url 'fobi.edit_form_entry' form_entry.pk %}">{% if title %} › {{ title }}{% endif %}</a>
|
||||
{% endwith %}
|
||||
› {% blocktrans with form_handler_plugin.name as plugin_name %}Edit "{{ plugin_name }}" form handler{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endblock breadcrumbs-inner %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/edit_form_handler_entry_ajax.html" %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/form_entry_submitted.html" %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/form_entry_submitted_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 %}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<div id="content-main">
|
||||
<h1>{% block form_page_title %}{% endblock %}</h1>
|
||||
|
||||
<form method="{% block form_method %}post{% endblock %}" action="{% block form_action %}{{ request.path }}{% endblock %}" {% block form_enctype %}enctype="multipart/form-data"{% endblock %} class="{% block form_html_class %}{% endblock %}" {% block form_extra_attrs %}{% endblock %}>
|
||||
<div>
|
||||
<fieldset class="module aligned">
|
||||
{% csrf_token %}
|
||||
{% include fobi_theme.form_edit_snippet_template_name %}
|
||||
</fieldset>
|
||||
<div class="{% block form_button_wrapper_html_class %}submit-row{% endblock %}">
|
||||
{% block form_buttons %}
|
||||
<input type="submit" class="{% block form_primary_button_html_class %}default{% endblock %}" value="{% block form_primary_button_text %}{% endblock %}"/>
|
||||
{% endblock form_buttons %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{% load i18n fobi_tags %}
|
||||
|
||||
{% comment %}
|
||||
<div class="alert-box secondary alert-box-larger">
|
||||
{% blocktrans %}Fields marked with <span class="required-field">*</span> are required{% endblocktrans %}
|
||||
</div>
|
||||
{% endcomment %}
|
||||
|
||||
{% for field in form %}
|
||||
{% get_form_field_type field as form_field_type %}
|
||||
<div class="form-row{% if form_field_type.is_radio %} radiolist{% endif %}{% if form.fields|length_is:'1' and form.errors %} errors{% endif %}{% for field in form %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
||||
{% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %}
|
||||
|
||||
<div{% if not form.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% 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 %}
|
||||
<p>{{ field.contents|linebreaksbr }}</p>
|
||||
{% else %}
|
||||
{{ field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{% load i18n %}
|
||||
{% comment %}
|
||||
<div class="alert-box secondary alert-box-larger">
|
||||
{% blocktrans %}Fields marked with <span class="required-field">*</span> are required{% endblocktrans %}
|
||||
</div>
|
||||
{% endcomment %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-row{% if form.fields|length_is:'1' and form.errors %} errors{% endif %}{% for field in form %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
||||
{% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %}
|
||||
|
||||
<div{% if not form.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% 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 %}
|
||||
<p>{{ field.contents|linebreaksbr }}</p>
|
||||
{% else %}
|
||||
{{ field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{% load i18n fobi_tags %}
|
||||
{% comment %}
|
||||
<div class="alert-box secondary alert-box-larger">
|
||||
{% blocktrans %}Fields marked with <span class="required-field">*</span> are required{% endblocktrans %}
|
||||
</div>
|
||||
{% 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 %}
|
||||
<div class="form-row{% if form.fields|length_is:'1' and form.errors %} errors{% endif %}{% for field in form %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
||||
{% if form.fields|length_is:'1' %}{{ form.errors }}{% endif %}
|
||||
|
||||
<div{% if not form.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% 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 %}
|
||||
<p>{{ field.contents|linebreaksbr }}</p>
|
||||
{% else %}
|
||||
{{ field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{% extends "fobi/generic/snippets/form_view_ajax.html" %}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue