|
|
|
|
@ -8,6 +8,9 @@ from djangocms_picture.cms_plugins import PicturePlugin as _PicturePlugin
|
|
|
|
|
from djangocms_text_ckeditor.cms_plugins import TextPlugin as _TextPlugin
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
from mailchimp3 import MailChimp
|
|
|
|
|
from aldryn_forms.cms_plugins import Field
|
|
|
|
|
from snowpenguin.django.recaptcha2.fields import ReCaptchaField
|
|
|
|
|
from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget
|
|
|
|
|
|
|
|
|
|
from project.forms import NewsletterSubscriptionForm
|
|
|
|
|
from project.models import Section, Quote, SliderItem, SectionText, Video, DownloadSection, DownloadSectionFolder, \
|
|
|
|
|
@ -206,6 +209,24 @@ class FormPlugin(_FormPlugin):
|
|
|
|
|
'SubmitButton', 'ReCaptchaFieldPlugin']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@plugin_pool.register_plugin
|
|
|
|
|
class ReCaptchaFieldPlugin(Field):
|
|
|
|
|
name = 'ReCaptcha Field'
|
|
|
|
|
render_template = True
|
|
|
|
|
allow_children = False
|
|
|
|
|
form_field = ReCaptchaField
|
|
|
|
|
form_field_widget = ReCaptchaWidget
|
|
|
|
|
|
|
|
|
|
form_field_enabled_options = [
|
|
|
|
|
'error_messages',
|
|
|
|
|
]
|
|
|
|
|
fieldset_general_fields = []
|
|
|
|
|
fieldset_advanced_fields = []
|
|
|
|
|
|
|
|
|
|
def get_form_field_widget_kwargs(self, instance):
|
|
|
|
|
return {'explicit': True}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SocialMediaListItemInlineAdmin(admin.TabularInline):
|
|
|
|
|
model = SocialMediaListItem
|
|
|
|
|
extra = 0
|
|
|
|
|
|