Permalink
Browse files

Template cleaning.

  • Loading branch information...
1 parent 57f9c96 commit db69ac5d62e3593b5b0b8d4a00997ef3215b92e2 @mitar mitar committed Aug 11, 2011
View
@@ -14,7 +14,7 @@ Dependencies
Python Libs
-----------
-If you decide to use the ReCAPTCHA spam protection method you need to install the python library "recaptcha-client".
+If you decide to use the ReCAPTCHA spam protection method you need to install the python library "recaptcha-client" (package ``python-recaptcha`` in Debian).
If you use Akismet for spam protection "akismet" is needed. You also need to set your domain url in django admin "sites".
@@ -56,4 +56,4 @@ If you don't want to enter the ReCATPCHA keys in the admin interface you can pro
AKISMET_API_KEY
---------------
-The same as for ReCAPTCHA goes fo Akismet.
+The same as for ReCAPTCHA goes fo Akismet.
@@ -88,7 +88,7 @@ def send(self, form, site_email):
email_message = EmailMessage(
render_to_string("cmsplugin_contact/subject.txt", {
'subject': subject,
- }),
+ }).splitlines()[0],
render_to_string("cmsplugin_contact/email.txt", {
'data': form.cleaned_data,
}),
@@ -8,7 +8,7 @@ class RecaptchaResponse(forms.Widget):
def render(self, *args, **kwargs):
from recaptcha.client import captcha as recaptcha
- recaptcha_options = "<script> var RecaptchaOptions = { theme: '" + self.theme + \
+ recaptcha_options = """<script type="text/javascript"> var RecaptchaOptions = { theme: '""" + self.theme + \
"', lang: '" + get_language()[0:2] + \
("', custom_theme_widget: 'recaptcha_widget'" if self.theme == 'custom' else "'") + " }; </script>\n"
return mark_safe(recaptcha_options + recaptcha.displayhtml(self.public_key))
@@ -27,5 +27,5 @@ def render(self, *args, **kwargs):
class HoneypotWidget(forms.CheckboxInput):
is_hidden = True
def render(self, *args, **kwargs):
- wrapper_html = '<div style="display:none"><label for="id_accept_terms">' + _('Are you a robot?') + '</label>%s</div>'
- return mark_safe(wrapper_html % super(HoneypotWidget, self).render(*args, **kwargs))
+ wrapper_html = '<div style="display: none;"><label for="id_accept_terms">' + _('Are you a robot?') + '</label>%s</div>'
+ return mark_safe(wrapper_html % super(HoneypotWidget, self).render(*args, **kwargs))
@@ -1,8 +1,8 @@
{% load i18n %}
{% if form %}
- <form action='' method="POST">
- <p {% if form.email.errors %}class="error"{% endif %}>
+ <form action="" method="post">
+ <p{% if form.email.errors %} class="error"{% endif %}>
<label>{{ contact.email_label }}</label>
{{ form.email }}
{% if form.email.errors %}
@@ -11,7 +11,7 @@
{% endfor %}
{% endif %}
</p>
- <p {% if form.subject.errors %}class="error"{% endif %}>
+ <p{% if form.subject.errors %} class="error"{% endif %}>
<label>{{ contact.subject_label }}</label>
{{ form.subject }}
{% if form.subject.errors %}
@@ -20,7 +20,7 @@
{% endfor %}
{% endif %}
</p>
- <p {% if form.content.errors %}class="error"{% endif %}>
+ <p{% if form.content.errors %} class="error"{% endif %}>
<label>{{ contact.content_label }}</label>
{{ form.content }}
{% if form.content.errors %}
@@ -30,28 +30,28 @@
{% endif %}
</p>
{% if form.recaptcha_challenge_field %}
- <p {% if form.recaptcha_response_fiel.errors %}class="error"{% endif %}>
+ <p{% if form.recaptcha_response_fiel.errors %} class="error"{% endif %}>
{{ form.recaptcha_challenge_field }}
{% if form.recaptcha_theme == "custom" %}
- <div id="recaptcha_widget" style="display:none">
-
- <div id="recaptcha_image"></div>
- <span class="recaptcha_only_if_incorrect_sol error_msg">{% trans "Incorrect please try again" %}</span>
-
+ <div id="recaptcha_widget" style="display:none">
+
+ <div id="recaptcha_image"></div>
+ <span class="recaptcha_only_if_incorrect_sol error_msg">{% trans "Incorrect please try again" %}</span>
+
<label>
- <span class="recaptcha_only_if_image">{% trans "Enter the words above:" %}</span>
- <span class="recaptcha_only_if_audio">{% trans "Enter the numbers you hear:" %}</span>
- </label>
-
- <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
-
- <div><a href="javascript:Recaptcha.reload()">{% trans "Get another CAPTCHA" %}</a></div>
- <div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">{% trans "Get an audio CAPTCHA" %}</a></div>
- <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">{% trans "Get an image CAPTCHA" %}</a></div>
-
- <div><a href="javascript:Recaptcha.showhelp()">{% trans "Help" %}</a>
-
- </div>
+ <span class="recaptcha_only_if_image">{% trans "Enter the words above:" %}</span>
+ <span class="recaptcha_only_if_audio">{% trans "Enter the numbers you hear:" %}</span>
+ </label>
+
+ <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
+
+ <div><a href="javascript:Recaptcha.reload()">{% trans "Get another CAPTCHA" %}</a></div>
+ <div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">{% trans "Get an audio CAPTCHA" %}</a></div>
+ <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">{% trans "Get an image CAPTCHA" %}</a></div>
+
+ <div><a href="javascript:Recaptcha.showhelp()">{% trans "Help" %}</a>
+
+ </div>
{% endif %}
{{ form.recaptcha_response_field }}

0 comments on commit db69ac5

Please sign in to comment.