more on preparing for the release

This commit is contained in:
Artur Barseghyan 2017-06-15 23:59:18 +02:00
parent 6c6e28754a
commit 9a88fa71dd
12 changed files with 145 additions and 34 deletions

View file

@ -15,6 +15,12 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.
0.12
----
2017-06-dd (not release yet)
- Wagtail integration.
0.11.13
-------
2017-06-10

View file

@ -41,6 +41,7 @@ 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 *
recursive-include src/fobi/contrib/apps/mezzanine_integration/templates *
recursive-include src/fobi/contrib/apps/wagtail_integration/templates *
recursive-include src/fobi/contrib/plugins/form_elements/content/content_image/templates *
recursive-include src/fobi/contrib/plugins/form_elements/content/content_image_url/templates *

View file

@ -4,7 +4,7 @@ import sys
from distutils.version import LooseVersion
from setuptools import setup, find_packages
version = '0.11.13'
version = '0.12'
# ***************************************************************************
# ************************** Python version *********************************
@ -122,6 +122,10 @@ template_dirs = [
"src/fobi/contrib/apps/mezzanine_integration/templates/"
"mezzanine_integration",
# Wagtail integration
"src/fobi/contrib/apps/wagtail_integration/templates/"
"wagtail_integration",
# Content image
"src/fobi/contrib/plugins/form_elements/content/content_image/"
"templates/content_image",

View file

@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.11.13'
__build__ = 0x000088
__version__ = '0.12'
__build__ = 0x000089
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'

View file

@ -32,8 +32,15 @@ See the `example settings file
'fobi.contrib.apps.wagtail_integration', # Wagtail integration app
]
your_project/page/models.py
###########################
your_project/your_app/models.py
###############################
If existing ``fobi.contrib.apps.wagtail_integration.models.FobiFormPage``
model does not fit your needs and you want to extend, there's a
``fobi.contrib.apps.wagtail_integration.abstract.AbstractFobiFormPage``
abstract model which you can extend. If so, remove the
``fobi.contrib.apps.wagtail_integration`` from ``INSTALLED_APPS`` and add
path to the app with your customised ``FobiFormPage`` model.
.. code-block:: python
from fobi.contrib.apps.wagtail_integration.models import AbstractFobiFormPage
@ -43,6 +50,17 @@ your_project/page/models.py
# ... customise your form page further
And then:
.. code-block:: python
INSTALLED_APPS = [
# ... standard wagtail apps
# ... standard django-fobi apps
'your_app', # Customised `FobiFormPage` model app
]
Information for developers
##########################

View file

@ -216,6 +216,7 @@ class AbstractFobiFormPage(Page):
"""Serve the page in Wagtail's 'preview' mode."""
if mode == 'success':
fobi_form_processor = FobiFormProcessor()
# TODO: Returning HttpResponse seems dirty. See if it can be
# replaced with TemplateResponse.
return HttpResponse(

View file

@ -11,3 +11,6 @@ __all__ = ('FobiFormPage',)
class FobiFormPage(AbstractFobiFormPage):
"""Fobi form page."""
form_template = 'wagtail_integration/fobi_form_page.html'
success_template = 'wagtail_integration/fobi_form_page_success.html'

View file

@ -1,23 +0,0 @@
{% extends "pages/page.html" %}
{% load static %}
{% block extra_css %}
{{ block.super }}
{% for css_file in fobi_theme.get_media_css %}
<link href="{% static css_file %}" rel="stylesheet" media="all" />
{% endfor %}
{% endblock extra_css %}
{% block main %}
{{ block.super }}
{% if not fobi_hide_form_title and fobi_form_title %}<h2>{{ fobi_form_title }}</h2>{% endif %}
{% include fobi_theme.form_snippet_template_name %}
{% endblock main %}
{% block extra_js %}
{{ block.super }}
{% for js_file in fobi_theme.get_media_js %}
<script src="{% static js_file %}"></script>
{% endfor %}
{% endblock extra_js %}

View file

@ -1,6 +0,0 @@
{% extends "pages/page.html" %}
{% block main %}
<h1>{{ fobi_success_page_title }}</h1>
<p>{{ fobi_success_page_text }}</p>
{% endblock main %}

View file

@ -0,0 +1,12 @@
Example templates for ``wagtail_integration`` app.
Both pages extend from "page/base.html", which does not exist, unless
you make it.
**fobi_form_page.html**
Rendering the form page.
**fobi_form_page_success.html**
Rendering the success page.

View file

@ -0,0 +1,56 @@
{% extends "page/base.html" %}
{% load i18n static %}
{% block extra_css %}
{{ block.super }}
{% for css_file in fobi_theme.get_media_css %}
<link href="{% static css_file %}" rel="stylesheet" media="all" />
{% endfor %}
{% endblock extra_css %}
{% block form_page_header_wrapper %}
<div class="alert alert-info" role="alert">
{% blocktrans with fobi_theme.uid as fobi_theme_uid %}This is just an example of how can we use a custom
template for rendering the form for the theme {{ fobi_theme_uid }} given.{% endblocktrans %}
</div>
{{ block.super }}
{% endblock %}
{% block content %}
{% include fobi_theme.view_embed_form_entry_ajax_template %}
{% endblock %}
{% block extra_js %}
{{ block.super }}
{% for js_file in fobi_theme.get_media_js %}
<script src="{% static js_file %}"></script>
{% endfor %}
{% endblock extra_js %}
{% comment %}
{% extends "demo/base.html" %}
{% load static %}
{% block extra_css %}
{{ block.super }}
{% for css_file in fobi_theme.get_media_css %}
<link href="{% static css_file %}" rel="stylesheet" media="all" />
{% endfor %}
{% endblock extra_css %}
{% block content %}
{{ block.super }}
{% if not fobi_hide_form_title and fobi_form_title %}<h2>{{ fobi_form_title }}</h2>{% endif %}
{% include fobi_theme.form_snippet_template_name %}
{% endblock content %}
{% block extra_js %}
{{ block.super }}
{% for js_file in fobi_theme.get_media_js %}
<script src="{% static js_file %}"></script>
{% endfor %}
{% endblock extra_js %}
{% endcomment %}

View file

@ -0,0 +1,39 @@
{% extends "page/base.html" %}
{% load i18n static %}
{% block extra_css %}
{{ block.super }}
{% for css_file in fobi_theme.get_media_css %}
<link href="{% static css_file %}" rel="stylesheet" media="all" />
{% endfor %}
{% endblock extra_css %}
{% block form_page_header_wrapper %}
<div class="alert alert-info" role="alert">
{% blocktrans with fobi_theme.uid as fobi_theme_uid %}This is just an example of how can we use a custom
template for rendering the form for the theme {{ fobi_theme_uid }} given.{% endblocktrans %}
</div>
{{ block.super }}
{% endblock %}
{% block content %}
{% include fobi_theme.embed_form_entry_submitted_ajax_template %}
{% endblock %}
{% block extra_js %}
{{ block.super }}
{% for js_file in fobi_theme.get_media_js %}
<script src="{% static js_file %}"></script>
{% endfor %}
{% endblock extra_js %}
{% comment %}
{% extends "pages/page.html" %}
{% block main %}
<h1>{{ fobi_success_page_title }}</h1>
<p>{{ fobi_success_page_text }}</p>
{% endblock main %}
{% endcomment %}