implement contact form

- implement contact_form.forms.ContactForm
- implement contact_form.views.ContactFormView and
  contact_form.views.ContactSuccessView
- add new URL patterns 'contact_form' and 'contact_success' in
  contact_form.urls
- add contact_form templates base.html, contact_form.html, contact_form.txt,
  contact_form_subject.txt and contact_success.html
- add german translation for new strings
- add contact_form to .coveragerc
- add generated code documentation for contact_form app
- add changelog entry
This commit is contained in:
Jan Dittberner 2015-02-01 18:55:24 +01:00
parent 2b0f1f9f89
commit 385838580b
15 changed files with 256 additions and 4 deletions

View file

@ -0,0 +1 @@
{% extends "base.html" %}

View file

@ -0,0 +1,21 @@
{% extends "contact_form/base.html" %}
{% load i18n crispy_forms_tags %}
{% block title %}{{ block.super }} - {% trans "Contact" %}{% endblock title %}
{% block page_title %}{% trans "Contact" %}{% endblock page_title %}
{% block content %}
{% crispy form %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
if ($('input[type=text]').first().val() != '') {
$('textarea').first().focus();
} else {
$('input[type=text]').first().focus();
}
});
</script>
{% endblock extra_js %}

View file

@ -0,0 +1,5 @@
User {{ name }} <{{ email }}> from IP address {{ request.META.REMOTE_ADDR }}
sent the following message via the contact form at
{{ site }}{% url 'contact_form' %}:
{{ body }}

View file

@ -0,0 +1 @@
[{{ site.name }}] message from {{ name }} via contact form

View file

@ -0,0 +1,9 @@
{% extends "contact_form/base.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "Contact" %}{% endblock title %}
{% block page_title %}{% trans "Contact" %}{% endblock page_title %}
{% block content %}
<p class="text-success">{% trans "Your message has been sent successfully." %}</p>
{% endblock %}