Simple application, that provides customizable email form tempalte tag.You can specify form fields and optionally enable dedicated view to render feedback page.
Project description
Usage
Add feedback to INSTALLED_APPS
INSTALLED_APPS = [ ... 'feedback', ... ]
Load feedback template tags:
{% load feedback_tags %}
Insert template tag in your template
{% show_feedback [key] %},
where key is feedback form key. Default key value is default.
Include something like
(r'^feedback', include('feedback.urls'))
in urlpatterns. That’s all!
Requriments
Note that feedback uses ajax form based on jQuery, so you need to include jQuery in your page. You can install it from Google hosting. Just include
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
in <head> element.
Settings
DIRECT_TO_TEMPLATE - When True, application will show default feedback form with template fedback/feedback_page.html where feedback urls were included. If you set this setting to False you should display feedback form manually, by including {% show_feedback [key] %} tag into template.
Customize
If you want to customize default feedback form, or add your own, you have to create an application with your forms. All feedback forms should be subclasses of feedback.forms.BaseFeedbackForm. Here is an example of custom feedback class:
from django import forms from feedback.forms import BaseFeedbackForm class OrderForm(BaseFeedbackForm): name = forms.CharField(label=u'Your name', max_length=200) email = forms.EmailField(label=u'Your Email', max_length=200) phone = forms.CharField(label=u'Phone', max_length=200) address = forms.CharField(label=u'Your address', max_length=200) date = forms.CharField(label=u'Date and time', max_length=200) response = forms.CharField(label=u'Comment', max_length=500, widget=forms.Textarea(attrs={'cols':'30', 'rows':'5'})) subject = u'Custom order form'
subject attribute appears in email subject.
Than, you need to put feedback forms in your settings.py:
FEEDBACK_FORMS - dictionary object, describes feedback forms on your site. Every key-value pair stands for feedback form object. For example:
FEEDBACK_FORMS = { 'default': 'mysite.custom_feedback.forms.OrderForm' }
We have overrided default feedback form.
Now we can include {% show_feedback default %} in template and get overriden form.
What’s new
0.1.3 - Improved email template. Now verbose names of fields and checkbox values rendered humanized way :)
0.1.4 - Fixed server email setting.
0.1.5 - Fixed select boxes in forms
0.1.6 - Added class “feedback_form” for form in template
Redsolution CMS classifiers:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for redsolutioncms.django-simple-feedback-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8040049eb65a8a8c2626c6c584fba695bfea43f1237f6fe687e834f3c6887a6c |
|
MD5 | 8d7fc96a1b27da47f40ade1f3cc9def8 |
|
BLAKE2b-256 | 3a69a8fdeb8cc1669d27de4ce1be005cc9ec72e6cfecdae59756039605a320d2 |