-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
-e git://github.com/maxicecilia/django_site_news.git@7d320097cedec159e396ad3d223b3919d6449c3e#egg=django_site_news-0.1.1 | ||
-e git://github.com/maxicecilia/[email protected]#egg=django_contact_us | ||
-e git://github.com/bfirsh/django-ordered-model.git#egg=django-ordered-model | ||
argparse==1.2.1 | ||
django-bootstrap3==5.1.1 | ||
django-dropbox==0.0.2 | ||
|
@@ -20,3 +19,4 @@ django-grappelli==2.6.4 | |
django-memcache-status==1.1 | ||
django-ordered-model==0.4.0 | ||
python-memcached==1.54 | ||
django-recaptcha2==v1.0.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.forms import ModelForm | ||
from snowpenguin.django.recaptcha2.fields import ReCaptchaField | ||
from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget | ||
|
||
from contact_us.models import SimpleContact | ||
|
||
|
||
class CaptchaContactForm(ModelForm): | ||
captcha = ReCaptchaField(widget=ReCaptchaWidget()) | ||
''' | ||
Cpatcha enabled default form model for collect contact data. | ||
''' | ||
class Meta: | ||
model = SimpleContact | ||
fields = ('from_name', 'from_email', 'from_phone', 'message') | ||
|
||
|
||
class SimpleCaptchaContactForm(ModelForm): | ||
captcha = ReCaptchaField(widget=ReCaptchaWidget(explicit=True)) | ||
''' | ||
Cpatcha enabled simplified contact form, ignore phone input. | ||
''' | ||
class Meta: | ||
model = SimpleContact | ||
fields = ('from_name', 'from_email', 'message') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.conf import settings | ||
from contact_us.views import ContactUsFormView as ContactUsFormViewExt | ||
from contact_us.forms import ContactForm, SimpleContactForm | ||
|
||
from forms import CaptchaContactForm, SimpleCaptchaContactForm | ||
|
||
class ContactUsFormView(ContactUsFormViewExt): | ||
|
||
def get_form_class(self): | ||
""" | ||
Returns the form class to use in this view | ||
""" | ||
if settings.CONTACT_US_FORM_STYLE == 'simple': | ||
self.form_class = SimpleContactForm | ||
if settings.CONTACT_US_FORM_STYLE == 'captcha': | ||
self.form_class = CaptchaContactForm | ||
if settings.CONTACT_US_FORM_STYLE == 'simplecaptcha': | ||
self.form_class = SimpleCaptchaContactForm | ||
return super(ContactUsFormView, self).get_form_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
'sitetree', | ||
'tinymce', | ||
'ordered_model', | ||
'snowpenguin.django.recaptcha2', | ||
'simple_classroom.apps.core', | ||
'simple_classroom.apps.classroom', | ||
'simple_classroom.apps.downloads', | ||
|
@@ -143,6 +144,10 @@ | |
DROPBOX_ACCESS_TOKEN = '' | ||
DROPBOX_ACCESS_TOKEN_SECRET = '' | ||
|
||
# ReCaptcha Site and Secret keys. | ||
RECAPTCHA_PRIVATE_KEY = '' | ||
RECAPTCHA_PUBLIC_KEY = '' | ||
|
||
# Title used to retrieve the default download file. | ||
ASSIGNMENT_DEFAULT_DOWNLOAD = 'evaluativo' | ||
|
||
|
@@ -161,7 +166,7 @@ | |
|
||
# Contact-us settings | ||
CONTACT_US_RECIPIENTS_LIST = ['[email protected]', ] | ||
CONTACT_US_FORM_STYLE = 'simple' | ||
CONTACT_US_FORM_STYLE = 'simplecaptcha' | ||
|
||
# Grappelli | ||
GRAPPELLI_ADMIN_TITLE = u'Administracion' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters