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:
parent
2b0f1f9f89
commit
385838580b
15 changed files with 256 additions and 4 deletions
1
gnuviechadmin/templates/contact_form/base.html
Normal file
1
gnuviechadmin/templates/contact_form/base.html
Normal file
|
@ -0,0 +1 @@
|
|||
{% extends "base.html" %}
|
21
gnuviechadmin/templates/contact_form/contact_form.html
Normal file
21
gnuviechadmin/templates/contact_form/contact_form.html
Normal 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 %}
|
5
gnuviechadmin/templates/contact_form/contact_form.txt
Normal file
5
gnuviechadmin/templates/contact_form/contact_form.txt
Normal 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 }}
|
|
@ -0,0 +1 @@
|
|||
[{{ site.name }}] message from {{ name }} via contact form
|
|
@ -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 %}
|
Loading…
Add table
Add a link
Reference in a new issue