tangentlabs / django-fancypages

A Content Enhancement System for Django
https://django-fancypages.readthedocs.org
BSD 3-Clause "New" or "Revised" License
34 stars 11 forks source link

Add block to insert configurable form #52

Closed roadsideseb closed 10 years ago

roadsideseb commented 10 years ago

This PR adds a new content block called FormBlock that allows pre-defined forms to be selected. The available forms are defined in the settings by adding the appropriate configuration. To make a form available, a dotted path to a Django form class is required as well as a URL to submit the form to. A example configuration would look like this:

FP_FORM_BLOCK_CHOICES = {
    'contact-us': {
        'name': "Contact Us Form",
        'form': 'contact_us.forms.ContactUsForm',
        'url': 'contact-us',
        'template_name': 'contact_us/contact_us_form.html',
    }
}

This would look something like this:

screenshot from 2014-07-08 17 10 02