\n"
15 | "Language: \n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 |
20 | #: cmsplugin_contact/admin.py:20
21 | msgid "Akismet API Key"
22 | msgstr ""
23 |
24 | #: cmsplugin_contact/admin.py:20
25 | msgid "Get a Wordpress Key from http://akismet.com/"
26 | msgstr ""
27 |
28 | #: cmsplugin_contact/admin.py:21
29 | msgid "ReCAPTCHA Public Key"
30 | msgstr ""
31 |
32 | #: cmsplugin_contact/admin.py:21 cmsplugin_contact/admin.py:22
33 | msgid "Get this from http://www.google.com/recaptcha"
34 | msgstr ""
35 |
36 | #: cmsplugin_contact/admin.py:22
37 | msgid "ReCAPTCHA Private Key"
38 | msgstr ""
39 |
40 | #: cmsplugin_contact/admin.py:40
41 | msgid ""
42 | "Akismet library is not installed. Use \"easy_install akismet\" or \"pip "
43 | "install akismet\"."
44 | msgstr ""
45 |
46 | #: cmsplugin_contact/admin.py:54
47 | msgid "The API Key is not valid."
48 | msgstr ""
49 |
50 | #: cmsplugin_contact/admin.py:62
51 | msgid ""
52 | "ReCAPTCHA library is not installed. Use \"easy_install recaptcha-client\" or "
53 | "\"pip install recaptcha-client\"."
54 | msgstr ""
55 |
56 | #: cmsplugin_contact/cms_plugins.py:30
57 | #: cmsplugin_contact/templates/cmsplugin_contact/subject.txt:1
58 | msgid "Contact Form"
59 | msgstr ""
60 |
61 | #: cmsplugin_contact/cms_plugins.py:43
62 | msgid "Redirection"
63 | msgstr ""
64 |
65 | #: cmsplugin_contact/cms_plugins.py:46
66 | msgid "Spam Protection"
67 | msgstr ""
68 |
69 | #: cmsplugin_contact/forms.py:7
70 | msgid "Email"
71 | msgstr ""
72 |
73 | #: cmsplugin_contact/forms.py:8
74 | msgid "Subject"
75 | msgstr "Zadeva"
76 |
77 | #: cmsplugin_contact/forms.py:9
78 | msgid "Content"
79 | msgstr ""
80 |
81 | #: cmsplugin_contact/models.py:17
82 | msgid "Light"
83 | msgstr ""
84 |
85 | #: cmsplugin_contact/models.py:18
86 | msgid "Dark"
87 | msgstr ""
88 |
89 | #: cmsplugin_contact/models.py:21
90 | msgid "Normal"
91 | msgstr ""
92 |
93 | #: cmsplugin_contact/models.py:22
94 | msgid "Compact"
95 | msgstr ""
96 |
97 | #: cmsplugin_contact/models.py:24
98 | msgid "Form name"
99 | msgstr ""
100 |
101 | #: cmsplugin_contact/models.py:27
102 | msgid "Used to distinguish multiple contact forms on the same site."
103 | msgstr ""
104 |
105 | #: cmsplugin_contact/models.py:28
106 | msgid "Form Layout"
107 | msgstr ""
108 |
109 | #: cmsplugin_contact/models.py:30
110 | msgid "Choose the layout of contact form"
111 | msgstr ""
112 |
113 | #: cmsplugin_contact/models.py:33
114 | msgid "Email recipient"
115 | msgstr ""
116 |
117 | #: cmsplugin_contact/models.py:36
118 | msgid "Thanks message"
119 | msgstr ""
120 |
121 | #: cmsplugin_contact/models.py:37
122 | msgid "Message displayed on successful submit"
123 | msgstr ""
124 |
125 | #: cmsplugin_contact/models.py:38
126 | msgid "Thank you for your message."
127 | msgstr "Hvala za tvoje sporočilo."
128 |
129 | #: cmsplugin_contact/models.py:39
130 | msgid "Submit button value"
131 | msgstr ""
132 |
133 | #: cmsplugin_contact/models.py:40
134 | msgid "Submit"
135 | msgstr "Pošlji"
136 |
137 | #: cmsplugin_contact/models.py:43
138 | msgid "Spam protection method"
139 | msgstr ""
140 |
141 | #: cmsplugin_contact/models.py:53
142 | msgid "ReCAPTCHA theme"
143 | msgstr ""
144 |
145 | #: cmsplugin_contact/models.py:57
146 | msgid "ReCAPTCHA size"
147 | msgstr ""
148 |
149 | #: cmsplugin_contact/models.py:59
150 | msgid "URL Redirection"
151 | msgstr ""
152 |
153 | #: cmsplugin_contact/models.py:60
154 | msgid "If it is set, the form redirect to url when the form is valid"
155 | msgstr ""
156 |
157 | #: cmsplugin_contact/nospam/fields.py:13
158 | msgid "Please don't check this box."
159 | msgstr "Ne označi tega polja."
160 |
161 | #: cmsplugin_contact/nospam/widgets.py:12
162 | msgid "Are you a robot?"
163 | msgstr "Si robot?"
164 |
165 | #: cmsplugin_contact/settings.py:7
166 | msgid "default"
167 | msgstr ""
168 |
169 | #: cmsplugin_contact/templates/cmsplugin_contact/email.txt:1
170 | #, fuzzy
171 | #| msgid "Message"
172 | msgid "Message from"
173 | msgstr "Sporočilo"
174 |
175 | #~ msgid "Your email address"
176 | #~ msgstr "Naslov tvoje elektronske pošte"
177 |
178 | #~ msgid "Please enter the two words on the image separated by a space:"
179 | #~ msgstr "Prepiši besedi prikazani na sliki, loči ju s presledkom:"
180 |
181 | #~ msgid "You did not enter any of the words."
182 | #~ msgstr "Nisi prepisal/a dveh besed prikazanih na sliki."
183 |
184 | #~ msgid "You did not enter the two words shown in the image."
185 | #~ msgstr "Nisi prepisal/a dveh besed prikazanih na sliki."
186 |
187 | #~ msgid "The words you entered did not match the image."
188 | #~ msgstr "Prepisani besedi se nista ujemali s sliko."
189 |
190 | #~ msgid "Incorrect please try again"
191 | #~ msgstr "Nepravilno. Poskusi znova."
192 |
193 | #~ msgid "Enter the words above:"
194 | #~ msgstr "Prepiši besedi odzgoraj:"
195 |
196 | #~ msgid "Enter the numbers you hear:"
197 | #~ msgstr "Vnesi števila, ki jih slišiš:"
198 |
199 | #~ msgid "Get another CAPTCHA"
200 | #~ msgstr "Ponudi drugo CAPTCHA"
201 |
202 | #~ msgid "Get an audio CAPTCHA"
203 | #~ msgstr "Ponudi zvočno CAPTCHA"
204 |
205 | #~ msgid "Get an image CAPTCHA"
206 | #~ msgstr "Ponudi slikovno CAPTCHA"
207 |
208 | #~ msgid "Help"
209 | #~ msgstr "Pomoč"
210 |
--------------------------------------------------------------------------------
/cmsplugin_contact/middleware.py:
--------------------------------------------------------------------------------
1 |
2 | class ForceResponseMiddleware:
3 |
4 | def process_response(self, request, response):
5 | if getattr(request, 'django_cms_contact_redirect_to', None) :
6 | return request.django_cms_contact_redirect_to
7 | return response
8 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | import datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 | class Migration(SchemaMigration):
8 |
9 | def forwards(self, orm):
10 |
11 | # Adding model 'Contact'
12 | db.create_table('cmsplugin_contact', (
13 | ('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
14 | ('site_email', self.gf('django.db.models.fields.EmailField')(max_length=75)),
15 | ('email_label', self.gf('django.db.models.fields.CharField')(default=u'Your email address', max_length=100)),
16 | ('subject_label', self.gf('django.db.models.fields.CharField')(default=u'Subject', max_length=200)),
17 | ('content_label', self.gf('django.db.models.fields.CharField')(default=u'Message', max_length=100)),
18 | ('thanks', self.gf('django.db.models.fields.CharField')(default=u'Thank you for your message.', max_length=200)),
19 | ('submit', self.gf('django.db.models.fields.CharField')(default=u'Submit', max_length=30)),
20 | ('spam_protection_method', self.gf('django.db.models.fields.SmallIntegerField')(default=0)),
21 | ('akismet_api_key', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
22 | ('recaptcha_public_key', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
23 | ('recaptcha_private_key', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
24 | ('recaptcha_theme', self.gf('django.db.models.fields.CharField')(default='clean', max_length=20)),
25 | ))
26 | db.send_create_signal('cmsplugin_contact', ['Contact'])
27 |
28 |
29 | def backwards(self, orm):
30 |
31 | # Deleting model 'Contact'
32 | db.delete_table('cmsplugin_contact')
33 |
34 |
35 | models = {
36 | 'cms.cmsplugin': {
37 | 'Meta': {'object_name': 'CMSPlugin'},
38 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
39 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
40 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
41 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
42 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
43 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
44 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
45 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
46 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
47 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
48 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
49 | },
50 | 'cms.placeholder': {
51 | 'Meta': {'object_name': 'Placeholder'},
52 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
53 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
55 | },
56 | 'cmsplugin_contact.contact': {
57 | 'Meta': {'object_name': 'Contact', 'db_table': "'cmsplugin_contact'", '_ormbases': ['cms.CMSPlugin']},
58 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
59 | 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
60 | 'content_label': ('django.db.models.fields.CharField', [], {'default': "u'Message'", 'max_length': '100'}),
61 | 'email_label': ('django.db.models.fields.CharField', [], {'default': "u'Your email address'", 'max_length': '100'}),
62 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
63 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
64 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
65 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
66 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
67 | 'subject_label': ('django.db.models.fields.CharField', [], {'default': "u'Subject'", 'max_length': '200'}),
68 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
69 | 'thanks': ('django.db.models.fields.CharField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
70 | }
71 | }
72 |
73 | complete_apps = ['cmsplugin_contact']
74 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0002_auto__chg_field_contact_thanks.py:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 | import datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 | class Migration(SchemaMigration):
8 |
9 | def forwards(self, orm):
10 |
11 | # Changing field 'Contact.thanks'
12 | db.alter_column('cmsplugin_contact', 'thanks', self.gf('django.db.models.fields.TextField')(max_length=200))
13 |
14 |
15 | def backwards(self, orm):
16 |
17 | # Changing field 'Contact.thanks'
18 | db.alter_column('cmsplugin_contact', 'thanks', self.gf('django.db.models.fields.CharField')(max_length=200))
19 |
20 |
21 | models = {
22 | 'cms.cmsplugin': {
23 | 'Meta': {'object_name': 'CMSPlugin'},
24 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
25 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
26 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
27 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
28 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
29 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
30 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
31 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
32 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
33 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
34 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
35 | },
36 | 'cms.placeholder': {
37 | 'Meta': {'object_name': 'Placeholder'},
38 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
39 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
40 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
41 | },
42 | 'cmsplugin_contact.contact': {
43 | 'Meta': {'object_name': 'Contact', 'db_table': "'cmsplugin_contact'", '_ormbases': ['cms.CMSPlugin']},
44 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
45 | 'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
46 | 'content_label': ('django.db.models.fields.CharField', [], {'default': "u'Message'", 'max_length': '100'}),
47 | 'email_label': ('django.db.models.fields.CharField', [], {'default': "u'Your email address'", 'max_length': '100'}),
48 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
49 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
50 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
51 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
52 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
53 | 'subject_label': ('django.db.models.fields.CharField', [], {'default': "u'Subject'", 'max_length': '200'}),
54 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
55 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
56 | }
57 | }
58 |
59 | complete_apps = ['cmsplugin_contact']
60 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0003_auto__add_field_contact_form_name.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 |
8 | class Migration(SchemaMigration):
9 |
10 | def forwards(self, orm):
11 | # Adding field 'Contact.form_name'
12 | db.add_column(u'cmsplugin_contact', 'form_name',
13 | self.gf('django.db.models.fields.CharField')(default='', max_length=60, blank=True),
14 | keep_default=False)
15 |
16 |
17 | def backwards(self, orm):
18 | # Deleting field 'Contact.form_name'
19 | db.delete_column(u'cmsplugin_contact', 'form_name')
20 |
21 |
22 | models = {
23 | 'cms.cmsplugin': {
24 | 'Meta': {'object_name': 'CMSPlugin'},
25 | 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
26 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
27 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
28 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
29 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
30 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
31 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
32 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
33 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
34 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
35 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
36 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
37 | },
38 | 'cms.placeholder': {
39 | 'Meta': {'object_name': 'Placeholder'},
40 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
41 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
43 | },
44 | u'cmsplugin_contact.contact': {
45 | 'Meta': {'object_name': 'Contact', 'db_table': "u'cmsplugin_contact'"},
46 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
47 | u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
48 | 'content_label': ('django.db.models.fields.CharField', [], {'default': "u'Message'", 'max_length': '100'}),
49 | 'email_label': ('django.db.models.fields.CharField', [], {'default': "u'Your email address'", 'max_length': '100'}),
50 | 'form_name': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
51 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
52 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
53 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
54 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
55 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
56 | 'subject_label': ('django.db.models.fields.CharField', [], {'default': "u'Subject'", 'max_length': '200'}),
57 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
58 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
59 | }
60 | }
61 |
62 | complete_apps = ['cmsplugin_contact']
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0004_add_field_Contact_form_layout.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 |
8 | class Migration(SchemaMigration):
9 |
10 | def forwards(self, orm):
11 | # Adding field 'Contact.form_layout'
12 | db.add_column(u'cmsplugin_contact', 'form_layout',
13 | self.gf('django.db.models.fields.CharField')(default='cmsplugin_contact.forms.ContactForm', max_length=255),
14 | keep_default=False)
15 |
16 |
17 | def backwards(self, orm):
18 | # Deleting field 'Contact.form_layout'
19 | db.delete_column(u'cmsplugin_contact', 'form_layout')
20 |
21 |
22 | models = {
23 | 'cms.cmsplugin': {
24 | 'Meta': {'object_name': 'CMSPlugin'},
25 | 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
26 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
27 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
28 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
29 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
30 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
31 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
32 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
33 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
34 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
35 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
36 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
37 | },
38 | 'cms.placeholder': {
39 | 'Meta': {'object_name': 'Placeholder'},
40 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
41 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
43 | },
44 | u'cmsplugin_contact.contact': {
45 | 'Meta': {'object_name': 'Contact', 'db_table': "u'cmsplugin_contact'"},
46 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
47 | u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
48 | 'content_label': ('django.db.models.fields.CharField', [], {'default': "u'Message'", 'max_length': '100'}),
49 | 'email_label': ('django.db.models.fields.CharField', [], {'default': "u'Your email address'", 'max_length': '100'}),
50 | 'form_layout': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
51 | 'form_name': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
52 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
53 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
54 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
55 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
56 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
57 | 'subject_label': ('django.db.models.fields.CharField', [], {'default': "u'Subject'", 'max_length': '200'}),
58 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
59 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
60 | }
61 | }
62 |
63 | complete_apps = ['cmsplugin_contact']
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0005_auto__del_field_contact_content_label__del_field_contact_subject_label.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 |
8 | class Migration(SchemaMigration):
9 |
10 | def forwards(self, orm):
11 | # Deleting field 'Contact.content_label'
12 | db.delete_column(u'cmsplugin_contact', 'content_label')
13 |
14 | # Deleting field 'Contact.subject_label'
15 | db.delete_column(u'cmsplugin_contact', 'subject_label')
16 |
17 | # Deleting field 'Contact.email_label'
18 | db.delete_column(u'cmsplugin_contact', 'email_label')
19 |
20 |
21 | def backwards(self, orm):
22 | # Adding field 'Contact.content_label'
23 | db.add_column(u'cmsplugin_contact', 'content_label',
24 | self.gf('django.db.models.fields.CharField')(default=u'Message', max_length=100),
25 | keep_default=False)
26 |
27 | # Adding field 'Contact.subject_label'
28 | db.add_column(u'cmsplugin_contact', 'subject_label',
29 | self.gf('django.db.models.fields.CharField')(default=u'Subject', max_length=200),
30 | keep_default=False)
31 |
32 | # Adding field 'Contact.email_label'
33 | db.add_column(u'cmsplugin_contact', 'email_label',
34 | self.gf('django.db.models.fields.CharField')(default=u'Your email address', max_length=100),
35 | keep_default=False)
36 |
37 |
38 | models = {
39 | 'cms.cmsplugin': {
40 | 'Meta': {'object_name': 'CMSPlugin'},
41 | 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
42 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
43 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
44 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
45 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
46 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
47 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
48 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
49 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
50 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
51 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
52 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
53 | },
54 | 'cms.placeholder': {
55 | 'Meta': {'object_name': 'Placeholder'},
56 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
57 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
58 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
59 | },
60 | u'cmsplugin_contact.contact': {
61 | 'Meta': {'object_name': 'Contact', 'db_table': "u'cmsplugin_contact'"},
62 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
63 | u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
64 | 'form_layout': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
65 | 'form_name': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
66 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
67 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
68 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
69 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
70 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
71 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
72 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
73 | }
74 | }
75 |
76 | complete_apps = ['cmsplugin_contact']
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0006_fix_table_names.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from south.utils import datetime_utils as datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 |
8 | class Migration(SchemaMigration):
9 |
10 | def forwards(self, orm):
11 | db.rename_table('cmsplugin_contact', 'cmsplugin_contact_contact')
12 |
13 | def backwards(self, orm):
14 | db.rename_table('cmsplugin_contact_contact', 'cmsplugin_contact')
15 |
16 | models = {
17 | 'cms.cmsplugin': {
18 | 'Meta': {'object_name': 'CMSPlugin'},
19 | 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
20 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
21 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
22 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
23 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
24 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
25 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
26 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
27 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
28 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
29 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
30 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
31 | },
32 | 'cms.placeholder': {
33 | 'Meta': {'object_name': 'Placeholder'},
34 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
35 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
36 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
37 | },
38 | u'cmsplugin_contact.contact': {
39 | 'Meta': {'object_name': 'Contact'},
40 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
41 | u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
42 | 'form_layout': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
43 | 'form_name': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
44 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
45 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
46 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
47 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
48 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
49 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
50 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'})
51 | }
52 | }
53 |
54 | complete_apps = ['cmsplugin_contact']
55 |
56 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/0007_add_url_field.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from south.utils import datetime_utils as datetime
3 | from south.db import db
4 | from south.v2 import SchemaMigration
5 | from django.db import models
6 |
7 |
8 | class Migration(SchemaMigration):
9 |
10 | def forwards(self, orm):
11 | db.add_column(u'cmsplugin_contact_contact', 'redirect_url',
12 | self.gf('django.db.models.fields.URLField')(blank=True, default=''),
13 | keep_default=False)
14 |
15 | def backwards(self, orm):
16 | db.delete_column(u'cmsplugin_contact_contact', 'redirect_url')
17 |
18 | models = {
19 | 'cms.cmsplugin': {
20 | 'Meta': {'object_name': 'CMSPlugin'},
21 | 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
22 | 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
23 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
24 | 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
25 | 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
26 | 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
27 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
28 | 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
29 | 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
30 | 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
31 | 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
32 | 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
33 | },
34 | 'cms.placeholder': {
35 | 'Meta': {'object_name': 'Placeholder'},
36 | 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
37 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
38 | 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
39 | },
40 | u'cmsplugin_contact.contact': {
41 | 'Meta': {'object_name': 'Contact'},
42 | 'akismet_api_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
43 | u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
44 | 'form_layout': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
45 | 'form_name': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
46 | 'recaptcha_private_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
47 | 'recaptcha_public_key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
48 | 'recaptcha_theme': ('django.db.models.fields.CharField', [], {'default': "'clean'", 'max_length': '20'}),
49 | 'site_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
50 | 'spam_protection_method': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
51 | 'submit': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '30'}),
52 | 'thanks': ('django.db.models.fields.TextField', [], {'default': "u'Thank you for your message.'", 'max_length': '200'}),
53 | 'redirect_url': ('django.db.models.fields.URLField', [], {'blank': 'True'})
54 | }
55 | }
56 |
57 | complete_apps = ['cmsplugin_contact']
58 |
59 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maccesch/cmsplugin-contact/6bb275958d231c1d18da3578d5a6ba196aee9943/cmsplugin_contact/migrations/__init__.py
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/0001_initial.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('cms', '0003_auto_20140926_2347'),
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='Contact',
16 | fields=[
17 | ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
18 | ('form_name', models.CharField(help_text='Used to distinguish multiple contact forms on the same site.', max_length=60, verbose_name='Form name', blank=True)),
19 | ('form_layout', models.CharField(help_text='Choice the layout of contact form', max_length=255, verbose_name='Form Layout', choices=[(b'cmsplugin_contact.forms.ContactForm', b'Default')])),
20 | ('site_email', models.EmailField(max_length=75, verbose_name='Email recipient')),
21 | ('thanks', models.TextField(default='Thank you for your message.', help_text='Message displayed on successful submit', max_length=200, verbose_name='Thanks message')),
22 | ('submit', models.CharField(default='Submit', max_length=30, verbose_name='Submit button value')),
23 | ('spam_protection_method', models.SmallIntegerField(default=0, verbose_name='Spam protection method', choices=[(0, b'Honeypot'), (1, b'Akismet'), (2, b'ReCAPTCHA')])),
24 | ('akismet_api_key', models.CharField(max_length=255, blank=True)),
25 | ('recaptcha_public_key', models.CharField(max_length=255, blank=True)),
26 | ('recaptcha_private_key', models.CharField(max_length=255, blank=True)),
27 | ('recaptcha_theme', models.CharField(default=b'clean', max_length=20, verbose_name='ReCAPTCHA theme', choices=[(b'clean', b'Clean'), (b'red', b'Red'), (b'white', b'White'), (b'blackglass', b'Black Glass'), (b'custom', b'Custom')])),
28 | ('redirect_url', models.URLField(help_text='If it is set, the form redirect to url when the form is valid', verbose_name='URL Redirection', blank=True)),
29 | ],
30 | options={
31 | 'abstract': False,
32 | },
33 | bases=('cms.cmsplugin',),
34 | ),
35 | ]
36 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/0002_auto_20160810_1130.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import migrations, models
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('cmsplugin_contact', '0001_initial'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterField(
15 | model_name='contact',
16 | name='form_layout',
17 | field=models.CharField(help_text='Choice the layout of contact form', max_length=255, verbose_name='Form Layout', choices=[(b'dashcare_website.contact_form.forms.CustomContactForm', b'Custom')]),
18 | ),
19 | migrations.AlterField(
20 | model_name='contact',
21 | name='site_email',
22 | field=models.EmailField(max_length=254, verbose_name='Email recipient'),
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/0003_auto_20161107_1614.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.9.9 on 2016-11-07 15:14
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations, models
6 | import django.db.models.deletion
7 |
8 |
9 | class Migration(migrations.Migration):
10 |
11 | dependencies = [
12 | ('cmsplugin_contact', '0002_auto_20160810_1130'),
13 | ]
14 |
15 | operations = [
16 | migrations.AlterField(
17 | model_name='contact',
18 | name='cmsplugin_ptr',
19 | field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='cmsplugin_contact_contact', serialize=False, to='cms.CMSPlugin'),
20 | ),
21 | migrations.AlterField(
22 | model_name='contact',
23 | name='form_layout',
24 | field=models.CharField(choices=[(b'cmsplugin_contact.forms.ContactForm', 'default')], help_text='Choice the layout of contact form', max_length=255, verbose_name='Form Layout'),
25 | ),
26 | ]
27 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/0004_auto_20180630_0050.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.11.13 on 2018-06-29 21:50
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | dependencies = [
11 | ('cmsplugin_contact', '0003_auto_20161107_1614'),
12 | ]
13 |
14 | operations = [
15 | migrations.RenameField(
16 | model_name='contact',
17 | old_name='submit',
18 | new_name='submit_text',
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/0005_auto_20180701_1611.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # Generated by Django 1.11.13 on 2018-07-01 13:11
3 | from __future__ import unicode_literals
4 |
5 | from django.db import migrations, models
6 |
7 |
8 | class Migration(migrations.Migration):
9 |
10 | dependencies = [
11 | ('cmsplugin_contact', '0004_auto_20180630_0050'),
12 | ]
13 |
14 | operations = [
15 | migrations.AddField(
16 | model_name='contact',
17 | name='recaptcha_size',
18 | field=models.CharField(choices=[(b'normal', 'Normal'), (b'compact', 'Compact')], default=b'normal', max_length=20, verbose_name='ReCAPTCHA size'),
19 | ),
20 | migrations.AlterField(
21 | model_name='contact',
22 | name='form_layout',
23 | field=models.CharField(choices=[(b'cmsplugin_contact.forms.ContactForm', 'default')], help_text='Choose the layout of contact form', max_length=255, verbose_name='Form Layout'),
24 | ),
25 | migrations.AlterField(
26 | model_name='contact',
27 | name='recaptcha_theme',
28 | field=models.CharField(choices=[(b'light', 'Light'), (b'dark', 'Dark')], default=b'light', max_length=20, verbose_name='ReCAPTCHA theme'),
29 | ),
30 | ]
31 |
--------------------------------------------------------------------------------
/cmsplugin_contact/migrations_django/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maccesch/cmsplugin-contact/6bb275958d231c1d18da3578d5a6ba196aee9943/cmsplugin_contact/migrations_django/__init__.py
--------------------------------------------------------------------------------
/cmsplugin_contact/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from django.utils.translation import ugettext_lazy as _
3 | from cms.models import CMSPlugin
4 |
5 | # Feel free to extend this class instead of Contact.
6 | from cmsplugin_contact import settings
7 |
8 |
9 | class BaseContact(CMSPlugin):
10 | SPAM_PROTECTION_CHOICES = (
11 | (0, 'Honeypot'),
12 | (1, 'Akismet'),
13 | (2, 'ReCAPTCHA'),
14 | )
15 |
16 | THEME_CHOICES = (
17 | ('light', _('Light')),
18 | ('dark', _('Dark')),
19 | )
20 | SIZE_CHOICES = (
21 | ('normal', _('Normal')),
22 | ('compact', _('Compact')),
23 | )
24 | form_name = models.CharField(_('Form name'),
25 | blank=True,
26 | max_length=60,
27 | help_text=_('Used to distinguish multiple contact forms on the same site.'))
28 | form_layout = models.CharField(_('Form Layout'),
29 | max_length=255,
30 | help_text=_('Choose the layout of contact form'),
31 | choices=settings.CMSPLUGIN_CONTACT_FORMS
32 | )
33 | site_email = models.EmailField(_('Email recipient'))
34 |
35 | thanks = models.TextField(
36 | verbose_name=_("Thanks message"),
37 | help_text=_('Message displayed on successful submit'),
38 | default=_('Thank you for your message.'), max_length=200)
39 | submit_text = models.CharField(_('Submit button value'),
40 | default=_('Submit'), max_length=30)
41 |
42 | spam_protection_method = models.SmallIntegerField(
43 | verbose_name=_('Spam protection method'),
44 | choices=SPAM_PROTECTION_CHOICES, default=0)
45 |
46 | akismet_api_key = models.CharField(max_length=255, blank=True)
47 |
48 | recaptcha_public_key = models.CharField(max_length=255, blank=True)
49 | recaptcha_private_key = models.CharField(max_length=255, blank=True)
50 | recaptcha_theme = models.CharField(max_length=20,
51 | choices=THEME_CHOICES,
52 | default='light',
53 | verbose_name=_('ReCAPTCHA theme'))
54 | recaptcha_size = models.CharField(max_length=20,
55 | choices=SIZE_CHOICES,
56 | default='normal',
57 | verbose_name=_('ReCAPTCHA size'))
58 |
59 | redirect_url = models.URLField(_('URL Redirection'),
60 | help_text=_('If it is set, the form redirect to url '
61 | 'when the form is valid'), blank=True)
62 |
63 | class Meta:
64 | abstract = True
65 |
66 | def __unicode__(self):
67 | return self.site_email
68 |
69 |
70 | class Contact(BaseContact):
71 | pass
72 |
--------------------------------------------------------------------------------
/cmsplugin_contact/nospam/__init__.py:
--------------------------------------------------------------------------------
1 | #Don't use import * - causes all sorts of namespace clashes
2 |
3 | from .widgets import HoneypotWidget
4 | from .fields import HoneypotField
5 | from .forms import BaseForm, AkismetForm, RecaptchaForm, HoneyPotForm, SuperSpamKillerForm
6 |
--------------------------------------------------------------------------------
/cmsplugin_contact/nospam/fields.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from django.core.exceptions import ValidationError
3 | from django.utils.translation import ugettext_lazy as _
4 |
5 | from .widgets import HoneypotWidget
6 |
7 |
8 | class HoneypotField(forms.BooleanField):
9 | def __init__(self, *args, **kwargs):
10 | super(HoneypotField, self).__init__(
11 | widget = HoneypotWidget,
12 | required = False,
13 | error_messages = { 'checked': _("Please don't check this box.") },
14 | *args, **kwargs)
15 |
16 | def clean(self, value):
17 | val = super(HoneypotField, self).clean(value)
18 | if val:
19 | raise ValidationError(self.error_messages['checked'])
20 | return val
21 |
--------------------------------------------------------------------------------
/cmsplugin_contact/nospam/forms.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 |
3 | from ..nospam import utils
4 | from .fields import HoneypotField
5 |
6 |
7 | class BaseForm(forms.Form):
8 |
9 | def __init__(self, request, *args, **kwargs):
10 | self._request = request
11 | super(BaseForm, self).__init__(*args, **kwargs)
12 |
13 |
14 | class AkismetForm(BaseForm):
15 |
16 | akismet_fields = {
17 | 'comment_author': 'name',
18 | 'comment_author_email': 'email',
19 | 'comment_author_url': 'url',
20 | 'comment_content': 'comment',
21 | }
22 | akismet_api_key = None
23 |
24 | def akismet_check(self):
25 | fields = {}
26 | for key, value in self.akismet_fields.items():
27 | fields[key] = self.cleaned_data[value]
28 | return utils.akismet_check(self._request, akismet_api_key=self.akismet_api_key, **fields)
29 |
30 |
31 | class RecaptchaForm(BaseForm):
32 | pass
33 |
34 |
35 | class HoneyPotForm(BaseForm):
36 | accept_terms = HoneypotField()
37 |
38 |
39 | class SuperSpamKillerForm(RecaptchaForm, HoneyPotForm, AkismetForm):
40 | pass
41 |
--------------------------------------------------------------------------------
/cmsplugin_contact/nospam/utils.py:
--------------------------------------------------------------------------------
1 | from django.contrib.sites.models import Site
2 | from django.core.exceptions import ImproperlyConfigured
3 | from django.conf import settings
4 |
5 |
6 | def akismet_check(request=None, comment_author='', comment_author_email='', comment_author_url='', comment_content='', akismet_api_key=None):
7 | """
8 | Connects to Akismet and returns True if Akismet marks this content as
9 | spam. Otherwise returns False.
10 | """
11 |
12 | # Check if the akismet library is installed
13 | try:
14 | from akismet import Akismet
15 | except ImportError:
16 | raise ImportError('Akismet library is not installed. "easy_install akismet" does the job.')
17 |
18 | # Check if the akismet api key is set, fail silently if
19 | # settings.DEBUG is False and return False (not moderated)
20 | AKISMET_API_KEY = akismet_api_key or getattr(settings, 'AKISMET_API_KEY', False)
21 | if not AKISMET_API_KEY:
22 | raise ImproperlyConfigured('You must set AKISMET_API_KEY with your api key in your settings file.')
23 |
24 | ak = Akismet(
25 | key = AKISMET_API_KEY,
26 | blog_url = 'http://%s/' % Site.objects.get(pk=settings.SITE_ID).domain
27 | )
28 |
29 | if ak.verify_key():
30 | if request is not None:
31 | data = {
32 | 'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),
33 | 'user_agent': request.META.get('HTTP_USER_AGENT', ''),
34 | 'referrer': request.META.get('HTTP_REFERER', ''),
35 | }
36 | else:
37 | data = {
38 | 'user_ip': '',
39 | 'user_agent': '',
40 | 'referrer': '',
41 | }
42 | data.update({'comment_author': comment_author.encode('utf-8')})
43 | data.update({'comment_author_email': comment_author_email.encode('utf-8')})
44 | data.update({'comment_author_url': comment_author_url.encode('utf-8')})
45 | # Send the request to Akismet
46 | if ak.comment_check(comment_content.encode('utf-8'), data=data, build_data=True):
47 | return True
48 |
49 | return False
--------------------------------------------------------------------------------
/cmsplugin_contact/nospam/widgets.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from django.utils.translation import ugettext as _
3 | from django.utils.safestring import mark_safe
4 |
5 |
6 | # Honeypot widget -- most automated spam posters will check any checkbox
7 | # assuming it's an "I accept terms and conditions" box
8 | class HoneypotWidget(forms.CheckboxInput):
9 | is_hidden = True
10 |
11 | def render(self, *args, **kwargs):
12 | wrapper_html = u'%%s
' % (_('Are you a robot?'))
13 | return mark_safe(wrapper_html % super(HoneypotWidget, self).render(*args, **kwargs))
14 |
--------------------------------------------------------------------------------
/cmsplugin_contact/settings.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | from django.utils.translation import ugettext_lazy as _
3 |
4 | from django.conf import settings as project_settings
5 |
6 | CMSPLUGIN_CONTACT_FORMS = getattr(project_settings, "CMSPLUGIN_CONTACT_FORMS", (
7 | ('cmsplugin_contact.forms.ContactForm', _('default')),
8 | )
9 | )
10 |
--------------------------------------------------------------------------------
/cmsplugin_contact/templates/cmsplugin_contact/admin/plugin_change_form.html:
--------------------------------------------------------------------------------
1 | {% extends parent_template %}
2 |
3 | {% block extrahead %}{{ block.super }}
4 |
35 |
36 | {% endblock extrahead %}
37 |
38 | {% block extrastyle %}{{ block.super }}
39 |
69 | {% endblock extrastyle %}
70 |
--------------------------------------------------------------------------------
/cmsplugin_contact/templates/cmsplugin_contact/contact.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 |
3 | {% if form %}
4 |
27 |
28 | {% else %}
29 | {{ contact.thanks|safe }}
30 | {% endif %}
31 |
--------------------------------------------------------------------------------
/cmsplugin_contact/templates/cmsplugin_contact/email.txt:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% trans "Message from" %}: {{ data.email }}
2 |
3 | {{ data.content|safe }}
4 |
--------------------------------------------------------------------------------
/cmsplugin_contact/templates/cmsplugin_contact/subject.txt:
--------------------------------------------------------------------------------
1 | [{{ form_name|default:_("Contact Form") }}] {{ data.subject|safe }}
2 |
--------------------------------------------------------------------------------
/cmsplugin_contact/utils.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | import importlib
3 |
4 |
5 | def class_for_path(class_path):
6 | module_name, class_name = class_path.rsplit(".", 1)
7 | m = importlib.import_module(module_name)
8 | c = getattr(m, class_name)
9 | return c
10 |
11 |
--------------------------------------------------------------------------------
/examples/cmsplugin_custom_contact/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maccesch/cmsplugin-contact/6bb275958d231c1d18da3578d5a6ba196aee9943/examples/cmsplugin_custom_contact/__init__.py
--------------------------------------------------------------------------------
/examples/cmsplugin_custom_contact/cms_plugins.py:
--------------------------------------------------------------------------------
1 | from django.utils.translation import ugettext_lazy as _
2 |
3 | from cms.plugin_pool import plugin_pool
4 |
5 | from cmsplugin_contact.cms_plugins import ContactPlugin
6 | from models import CustomContact
7 |
8 | class CustomContactPlugin(ContactPlugin):
9 | name = _("Custom Contact Form")
10 |
11 | model = CustomContact
12 |
13 | # Important: You have to add the following to your settings.py
14 | # CMSPLUGIN_CONTACT_FORMS = (
15 | # ('cmsplugin_contact.forms.ContactForm', _('default')),
16 | # ('cmsplugin_custom_contact.forms.CustomContactForm', _('custom')),
17 | # )
18 | # if you're only using your custom plugin you can omit the first line
19 |
20 | # We're using the original cmsplugin_contact render templates here which
21 | # works fine but requires that the original plugin is in INSTALLED_APPS.
22 | render_template = "cmsplugin_contact/contact.html"
23 |
24 | # Custom email template to incorporate you custom data
25 | email_template = "cmsplugin_custom_contact/email.txt"
26 |
27 | fieldsets = (
28 | (None, {
29 | 'fields': ('form_name', 'form_layout', 'site_email', 'submit_text', 'custom_label'),
30 | }),
31 | (_('Redirection'), {
32 | 'fields': ('thanks', 'redirect_url' ),
33 | } ),
34 | (_('Spam Protection'), {
35 | 'fields': ('spam_protection_method', 'akismet_api_key',
36 | 'recaptcha_public_key', 'recaptcha_private_key', 'recaptcha_theme')
37 | })
38 | )
39 |
40 | plugin_pool.register_plugin(CustomContactPlugin)
41 |
--------------------------------------------------------------------------------
/examples/cmsplugin_custom_contact/forms.py:
--------------------------------------------------------------------------------
1 | from django import forms
2 | from cmsplugin_contact.forms import ContactForm
3 |
4 | class CustomContactForm(ContactForm):
5 | custom = forms.CharField()
6 |
--------------------------------------------------------------------------------
/examples/cmsplugin_custom_contact/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | from cmsplugin_contact.models import BaseContact
3 | from django.utils.translation import ugettext_lazy as _
4 |
5 | class CustomContact(BaseContact):
6 | custom_label = models.CharField(
7 | _('Custom sender label'),
8 | default=_('Your custom value'), max_length=20)
9 |
--------------------------------------------------------------------------------
/examples/cmsplugin_custom_contact/templates/cmsplugin_custom_contact/email.txt:
--------------------------------------------------------------------------------
1 | {% load i18n %}{% trans "Message from" %}: {{ data.email }}
2 |
3 | {{ data.content|safe }}
4 |
5 | The awesome custom value:
6 | {{ data.custom }}
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup, find_packages
2 |
3 | setup(
4 | name='cmsplugin-contact',
5 | version='1.1.3',
6 | description='Extendable contact form plugin for Django CMS with spam protection and i18n',
7 | long_description=open('README.rst').read(),
8 | author='Maccesch',
9 | author_email='maccesch@gmail.com',
10 | url='http://github.com/maccesch/cmsplugin-contact',
11 | packages=find_packages(),
12 | keywords='contact form django cms django-cms spam protection email',
13 | classifiers=[
14 | 'Development Status :: 5 - Production/Stable',
15 | 'Environment :: Web Environment',
16 | 'Intended Audience :: Developers',
17 | 'License :: OSI Approved :: BSD License',
18 | 'Operating System :: OS Independent',
19 | 'Programming Language :: Python',
20 | 'Framework :: Django',
21 | ],
22 | include_package_data=True,
23 | zip_safe=False,
24 | install_requires=[],
25 | )
26 |
--------------------------------------------------------------------------------