Move contact_form templates to contact_form app

This commit is contained in:
Jan Dittberner 2023-04-22 13:14:24 +02:00
parent 10628ee45f
commit 806ee80a85
7 changed files with 15 additions and 11 deletions

View file

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: contact_form\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-16 22:07+0200\n"
"PO-Revision-Date: 2023-04-16 18:25+0200\n"
"POT-Creation-Date: 2023-04-22 13:01+0200\n"
"PO-Revision-Date: 2023-04-22 13:01+0200\n"
"Last-Translator: Jan Dittberner <jan@dittberner.info>\n"
"Language-Team: Jan Dittberner <jan@dittberner.info>\n"
"Language: de\n"
@ -34,3 +34,14 @@ msgstr "Ihre Nachricht"
#: contact_form/forms.py:39
msgid "Send message"
msgstr "Nachricht senden"
#: contact_form/templates/contact_form/contact_form.html:4
#: contact_form/templates/contact_form/contact_form.html:5
#: contact_form/templates/contact_form/contact_success.html:4
#: contact_form/templates/contact_form/contact_success.html:5
msgid "Contact"
msgstr "Kontakt"
#: contact_form/templates/contact_form/contact_success.html:8
msgid "Your message has been sent successfully."
msgstr "Ihre Nachricht wurde erfolgreich übermittelt."

View file

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

View file

@ -0,0 +1,23 @@
{% extends "contact_form/base.html" %}
{% load i18n crispy_forms_tags %}
{% block title %}{{ block.super }} - {% translate "Contact" %}{% endblock title %}
{% block page_title %}{% translate "Contact" %}{% endblock page_title %}
{% block content %}
{% crispy form %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
let textFields = document.querySelectorAll("input[type=text]");
if (textFields[0].val() !== '') {
document.getElementsByTagName("textarea")[0].focus();
} else {
textFields[0].focus();
}
});
</script>
{% endblock extra_js %}

View file

@ -0,0 +1,5 @@
User {{ name }} <{{ email }}> from IP address {{ remote_ip }}
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 }} - {% translate "Contact" %}{% endblock title %}
{% block page_title %}{% translate "Contact" %}{% endblock page_title %}
{% block content %}
<p class="text-success">{% translate "Your message has been sent successfully." %}</p>
{% endblock %}