Giter VIP home page Giter VIP logo

cmsplugin-contact's People

Contributors

arkanister avatar atiberghien avatar bounder avatar d3ph avatar dsh2dsh avatar dylanncordel avatar ebertti avatar fsbraun avatar genbit avatar gfavre avatar ikresoft avatar itbabu avatar julsam avatar lacrymology avatar m000 avatar maccesch avatar mactory avatar masarliev avatar mitar avatar nop33 avatar okfish avatar rfleschenberg avatar stefanocrosta avatar tpresthus avatar william-gr avatar xdml avatar yohanboniface avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmsplugin-contact's Issues

Javascript on ReCaptcha unencoded

Hello, great plugin!

I am having an issue with the ReCaptcha javascript being unencoded when the page renders.

The javascript gets rendered inside

tags and has all < and > tangs converted to < and &rt;

Any ideas as to how to solve this?
Thanks!

setup instructions

Hi, the setup instructions are missing the 'migrate' step so that tables are created in the database.

Problem when extending the plugin

I created an app as described in the examples/cmsplugin_custom_contact, to subclass cmsplugin_contact and add custom fields. I am also trying to use my own template. Everything looks fine expect from the fact that when submitting the form, the page refreshes and there is no email sent.

My files for the cmsplugin_custom_contact app look like this:
https://gist.github.com/nop33/27b6be6d2e1819d7441a

Any idea what the problem is?
Thanks

It is not working with djangocms_text_ckeditor

I have django-cms 3 with django 1.6 and 'djangocms_text_ckeditor' in INSTALLES_APPS.
Although the in docs it is stated that "If you have the package 'djangocms_text_ckeditor' in your INSTALLES_APPS CKEditor is used", I am getting errors about 'USE_TINYMCE'

Custom contact form template not loaded

I have an issue and cannot load a form from a custom template.

I use a subclass for ContactForm to overwrite the template class variable to something like "bootstrap/contactform.html" and register the alternative form in the project's settings file as described in the docs. However, no matter what I do, only the standard template "cmsplugin_contact/contact.html" is loaded.

If I look into cms_plugins.py it seems to me that the render method of the ContactPlugin class does not change its own render_template variable but only the plugin instance's variable. (Actually I am not sure why this is not the same.) With a quick and dirty check I get the desired result if I add the line self.render_template = instance.render_template after line 167 if file cms_plugins.py. Can you check this?

Thanks very much! Fabian

Safe method in .txt templates

We shoud use the safe method in the both .txt templates to prevent for ascii chars in the contact emails.
The code sending the content from the form as text/plain MIME what should not get to problems in Email Clients.

What you think?

cannot use with django-cms >= 3.0

Error when rendering {% cms_toolbar %}:

Reverse for 'cms_usersettings_change' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

pip freeze:

Django==1.6.5
Pillow==2.4.0
South==0.8.4
argparse==1.2.1
cmsplugin-contact==1.0.0
django-classy-tags==0.5.1
django-cms==3.0.2
django-mptt==0.6.0
django-polymorphic==0.5.5
django-sekizai==0.7
djangocms-admin-style==0.2.2
djangocms-file==0.0.1
djangocms-flash==0.0.2
djangocms-googlemap==0.0.5
djangocms-inherit==0.0.1
djangocms-link==1.3.4
djangocms-picture==0.0.2
djangocms-snippet==1.0.2
djangocms-teaser==0.0.1
djangocms-text-ckeditor==2.1.4
djangocms-video==0.0.1
easy-thumbnails==2.0.1
html5lib==0.999
six==1.6.1
wsgiref==0.1.2

Plugin not available

Plugin is not available.
Django-1.2.4
Latest Django-cms
akismet-0.2.0
I use virtualenv, if this is relevant

Contact plugin not syncing with DB and not available

Hi,

I know this issue was opened before twice and I went over those issues but still couldn't get the plugin to show up.

I'm on Django 1.3, Python 2.6.6 and tried versions 0.9.7, 0.9.8 and latest.

Also tried installing stopspam but it doesn't show up either.

Could you publish an up-to-date list of steps of how to get this working?

Thanks!
~Y

Captcha not displaying.

Hi There,

Under the message box I get a bunch of HTML where the captcha should be. It looks like this:

<script> var RecaptchaOptions = { theme: 'clean' }; </script> <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LeTmMMSAAAAAObtPtIT-0rewsCeWAlQAF1E42TB"></script> <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LeTmMMSAAAAAObtPtIT-0rewsCeWAlQAF1E42TB" height="300" width="500" frameborder="0"></iframe>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> You did not enter any of the words.

Also please note that when i first tried to create the contact form in admin it would not let me proceed because it said a field was missing but would not tell me what field it was missing. Once I added the RECAPTCHA_PUBLIC_KEY & RECAPTCHA_PRIVATE_KEY to settings.py it allowed me to create the form. However it will not work.

Any thoughts?

Migration issue

I have this error when I run manage.py makemigrations

  File "/home/opt/python-virtual-env/django-cms/lib/python3.7/site-packages/cmsplugin_contact/migrations/0003_auto__add_field_contact_form_name.py", line 3, in <module>
    from south.db import db
  File "/home/opt/python-virtual-env/django-cms/lib/python3.7/site-packages/south/db/__init__.py", line 84, in <module>
    db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'

File upload TODO

Add file upload field to default template? (commented out?)
Security Concerns?

Overwriting form

Hi,

I'm trying to use a custom contact form with your plugin. In cms_plugins.py there is:
from forms import AkismetContactForm, RecaptchaContactForm, HoneyPotContactForm
which uses the supplied forms.py file. Is there a pythonic way of overwriting this? Putting a forms.py in my main project's directory doesn't seem to work. Any pointers welcome.

Multiple forms

When having multiple forms on one page, configured to send e-mail to different contacts, a post in one form sends the message to all contacts.

Example: one contact form for tech@... and one for customerservice@...

Both recipients will receive the message no matter what form was posted to.

App not found?

Installed 1.1.2 and ran the migration with MIGRATION_MODULES set up.

I can't create a contact page. Is this related to #63?

Problem to install cmsplugin-contact with django-cms version 2.4.2

Hi,

I'm trying to update my website running django-cms 2.4.2 with the latest version of cmsplugin-contact and occured the error bellow

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/cms/views.py", line 148, in details
    return render_to_response(template_name, context_instance=context)

  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py", line 20, in render_to_response
    return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 176, in render_to_string
    return t.render(context_instance)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render
    return self._render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
    return self.nodelist.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
    bit = self.render_node(node, context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, in render_node
    return node.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 123, in render
    return compiled_parent._render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
    return self.nodelist.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
    bit = self.render_node(node, context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, in render_node
    return node.render(context)

  File "/usr/local/lib/python2.7/dist-packages/classytags/core.py", line 106, in render
    return self.render_tag(context, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/sekizai/templatetags/sekizai_tags.py", line 76, in render_tag
    rendered_contents = nodelist.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
    bit = self.render_node(node, context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, in render_node
    return node.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render
    bit = self.render_node(node, context)

  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, in render_node
    return node.render(context)

  File "/usr/local/lib/python2.7/dist-packages/classytags/core.py", line 106, in render
    return self.render_tag(context, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/cms/templatetags/cms_tags.py", line 264, in render_tag
    content = get_placeholder_content(context, request, page, name, inherit)

  File "/usr/local/lib/python2.7/dist-packages/cms/templatetags/cms_tags.py", line 182, in get_placeholder_content
    content = render_placeholder(placeholder, context, name)

  File "/usr/local/lib/python2.7/dist-packages/cms/plugin_rendering.py", line 127, in render_placeholder
    content.extend(render_plugins(plugins, context, placeholder, processors))

  File "/usr/local/lib/python2.7/dist-packages/cms/plugin_rendering.py", line 81, in render_plugins
    out.append(plugin.render_plugin(context, placeholder, processors=processors))

  File "/usr/local/lib/python2.7/dist-packages/cms/models/pluginmodel.py", line 173, in render_plugin
    context = plugin.render(context, instance, placeholder_slot)

  File "/home/blabla/production/web_app/portal/src/cmsplugin-contact/cmsplugin_contact/cms_plugins.py", line 150, in render
    form = self.create_form(instance, request)

  File "/home/blabla/production/web_app/portal/src/cmsplugin-contact/cmsplugin_contact/cms_plugins.py", line 82, in create_form
    ContactFormBase = class_for_path(instance.form_layout)

  File "/home/blabla/production/web_app/portal/src/cmsplugin-contact/cmsplugin_contact/utils.py", line 6, in class_for_path
    module_name, class_name = class_path.rsplit(".", 1)

ValueError: need more than 1 value to unpack

I'm running with django 1.4.7, python 2.7.3, ubuntu 12.04 and mysql 5.1

Any Ideas?

Workflow for custom contact plugin

I love this plugin, but wish there was a 'proposed way with best practices' to get the custom plugin showing up.

  • Is it best to copy the example custom plugin (good start)
  • Should I disable the original plugin?
  • How can I overwrite fields that are already in the base model (e.g. what if I don't want the subject line to show up?)

I know 'everyone' does it differently, but I would really love a plugin that is easy to install and covers many use cases. Maybe it's even better to include a few different use case that are ready to plugin pluggable. I know it's hard for model-based apps, but how many different contact-form variations are out there? Usually I need no more than 3 fields displayed to the end user, mine just happens to be:

  • name
  • e-mail
  • message

And the default here is:

  • e-mail
  • subject
  • message

I'm thinking: keep 4 fields (or more) and use and admin template choice to display only some.

I'm happy to help out where I can. Just wanted to start a discussion.

Missing dot in error message

Currently untranslated error message is:

The words you entered did not match the image

The dot is missing at the end. This is ugly. ;-) But if we change this, also translations have to be changed. It is OK if I change this?

Documentation after installing

Hello,

I would like to ask if someone would be willing to write a few lines. It does not have to be 200 pages long just maybe a page or two what someone has to do after downloading, installing and syncing the db.

Sorry if this is the wrong section for such a request still new to github

kind regards

ed-Media
Michael

Edit:

Well I have read the cms-tutorial but somehow I'm missing something...

I did what you wrote in your read me

  • downloaded it
  • ran the setup.py
  • added it to my installed apps
  • synced db
  • startet my local server with 0 errors

But what do I have to do now? You said something about placeholders.

In the Read me it says admin interface? Does that mean localhost:8000/admin ?

Tag release ?

Hi,

Do you plan to release a tag soon to be able to use pip ?

Ajax form ;)

Hi guys, I have two simple (or not) questions :)

  1. How to use ajax on this plugin. I tried to use action for '/' but it returns me whole website without errors.
  2. And second: What path and with what key data I should send?
$.ajax({
        url : "/", 
        type : "POST",
        data : { SOME_KEY_?? : $('#contact-form').val() },

        success : function(json) {
            console.log(json);
            console.log("success");
        },

        // handle a non-successful response
        error : function(xhr,errmsg,err) {
            console.log(xhr.status + ": " + xhr.responseText); 
        }
    });

@maccesch @mitar @rfleschenberg @daanzap

pypi with latest version ?

Hi
is the pypi with the latest version of the code ?

I've managed to install it from zip in my local machine with your latest "from email changes " but I can't do the same on my heroku app.

Do you have any idea how I can install it manually on heroku or are planning to update the pypi soon ?

Thanks,

honeypot escaping issue

Line 67 in contact.html should be {{ form.accept_terms|safe }} not {{ form.accept_terms }}.

Thanks! Great plugin!

Can't subclass models.Contact

Hello!

Could you change models.py a little and convert Contact class into abstract class? Something like

class BaseContact(CMSPlugin):
    class Meta:
        abstract = True

    # all fields here

class Contact(BaseContact):
    pass

I'd like to add more fields into my contact form, but I can't subclass non abstract model. Django CMS doesn't allow it. After that change I could subclass BaseContact and add more fileds into my new subclassed model.

Also, it would be nice to change cms_plugin.ContactPlugin for easier subclassing. May be something like

class ContactPlugin(CMSPluginBase):
    contact_form = ContactForm
    email_template = "cmsplugin_contact/email.txt"

    def create_form(self, instance, request):
        if instance.get_spam_protection_method_display() == 'Akismet':
            AkismetContactForm.aksimet_api_key = instance.akismet_api_key
            class ContactForm(self.contact_form, AkismetContactForm):
                pass
            FormClass = ContactForm
        elif instance.get_spam_protection_method_display() == 'ReCAPTCHA':
            RecaptchaContactForm.recaptcha_public_key = getattr(
                settings, "RECAPTCHA_PUBLIC_KEY",
                instance.recaptcha_public_key)
            RecaptchaContactForm.recaptcha_private_key = getattr(
                settings, "RECAPTCHA_PRIVATE_KEY",
                instance.recaptcha_private_key)
            RecaptchaContactForm.recaptcha_theme = instance.recaptcha_theme
            class ContactForm(self.contact_form, RecaptchaContactForm):
                pass
            FormClass = ContactForm
        else:
            class ContactForm(self.contact_form, HoneyPotContactForm):
                pass
            FormClass = ContactForm

        if request.method == "POST":
            return FormClass(request, data=request.POST)
        else:
            return FormClass(request)

    def send(self, form, site_email):
        subject = form.cleaned_data['subject']
        if not subject:
            subject = _('No subject')
        email_message = EmailMessage(
            render_to_string("cmsplugin_contact/subject.txt", {
                'subject': subject,
            }),
            render_to_string(self.email_template, {
                'data': form.cleaned_data,
            }),
            form.cleaned_data['email'],
            [site_email],
            headers = {
                'Reply-To': form.cleaned_data['email']
            },)
        email_message.send(fail_silently=True)

In this case anyone can subclass ContactPlugin and override model, form, contact_form and email_template properties without copying some code from ContactPlugin.

Thank you!

Reuse plugin instance in several pages

Hello,
This is not an issue, I just wanted to ask a question. Is it possible to reuse the same plugin instance that was added in a page into other pages? For example, I want to have a custom contact form in the sidebar of many pages. The only solution I see right now is to add one instance in every page separately. And then the same for every language of the site..
Thanks.

Using django-cms 2.4, cmsplugin-contact doesn't pick up ckeditor

When installed, cmsplugin-contact comes up with a 'TemplateDoesNotExist at /admin/cms/page/5/edit-plugin/138/ cms/plugins/widgets/wymeditor.html'
I have 'djangocms_text_ckeditor' in front of the 'cms' app as per instructions on djangcms_text_ckeditor, and that plugin on itself is working as expected.

Using Django 1.5, django-cms 2.4 and djangocms-text-ckedito 1.0.9

Add a way to disable csrf token for contact form

Hello,

we get a 403 csrf token validation failed during some tests with cmsplugin-contact and we are looking for a way to disable csrf token for our contact form. Our site is a public site, without authentification and we don't want to add some frictions for our clients to contact us.

But we DO use online edition and we don't want to turn off CSRF for the whole site.

I've some django experience but no django-cms experience and didn't see where I could add a conditional @csrf_exempt.

Contact not showing up as optional plugin

Hi Maccesch

I have struggled and searched and can't get cmsplugin-contact working. I am developing in an Ubuntu VE using Python 2.7, Django 1.3, and Django CMS 2.1.3. I have the standard plugins installed that ship with Django CMS (text, twitter, etc); however, can't seem to get cmsplugin-contact to show up as an option. Am I looking in the correct place?

FYI: I have added 'cmsplugin_contact' to my INSTALLED_APPS and syncdb and I believe have properly migrated with South.

Any thoughts? Need more info?

Thanks

Clayton

This plugin doesn't auto-redirect on submit?

I realize that whenever I refresh the page localhost/contact/ the browser prompts me a form resubmission warning. Doesn't the plugin redirect after rendering the form. The same goes to when the form is submitted and the thank you message is displayed.

Is it something I need to configure or is it a bug?

Thanks

Continuous loading when adding contact form.

When adding the contact form to a page using the structure mode of the GUI, the spinner will continue indefinitely. Can anyone help I have installed as per the instructions on the page.

image

Django 1.8 support (aka "ImportError: cannot import name find_template")

I'm trying to upgrade a project that uses cmsplugin-contact to Django 1.8.4 and django CMS 3.1.2 (using Python 2.7.5+ on Ubuntu).

Django 1.8 has introduced changes to the templates (multiple template engine support), and this seems to break backwards compatibility. I now get the following error with cmsplugin-contact==1.1.0 when I run python manage.py runserver:

  ...
  File "<site-packages>/cmsplugin_contact/cms_plugins.py", line 8, in <module>
    from django.template.loader import render_to_string, find_template, TemplateDoesNotExist
ImportError: cannot import name find_template

I've done a quick research, but no solution so far where find_template() has gone in 1.8 and what to use instead (if applicable). Here are some links I found:

Sending the message using the user-supplied address is setting the From on the email

Hi

I have install the plugin an im getting exactly the error below:

"Sending the message using the user-supplied address to set From: header of the email is currently not supported. This is because many servers will reject emails that use From: addresses not registered with that server."

When filling the form the user-supplied address in being place as the from header of the email.

any ideas?

Cheers,

form ContactAdminForm needs updating (RemovedInDjango18Warning)

C:\Python27\lib\site-packages\cmsplugin_contact-1.1.1-py2.7.egg\cmsplugin_contact\admin.py:15: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or th
e 'exclude' attribute is deprecated - form ContactAdminForm needs updating
class ContactAdminForm(ModelForm):

mail via public servers

Most of public servers reject "mail from" different with connection account (or not confirmed in it).
For these need to keep only "reply to" with email from form, but in "sender" need to be email from settings.

uwsgi falls

i have a litle modifed plugin and customized plugins installed in cms.
if customized plugin enabled UWSGI falls..

Unwanted migration with django 1.7

Running makemigrations creates unwanted migrations.

class Migration(migrations.Migration):

dependencies = [
    ('cmsplugin_contact', '0001_initial'),
]

operations = [
    migrations.AlterField(
        model_name='contact',
        name='form_layout',
        field=models.CharField(help_text='Choice the layout of contact form', max_length=255, verbose_name='Form Layout', choices=[(b'cmsplugin_contact.forms.ContactForm', 'default')]),
        preserve_default=True,
    ),
]

RECAPTCHA_*KEY semantics

with * == (public|private), of course

The form class uses self.recaptcha_*_key as preferred value, falling back to settings.RECAPTCHA_*_KEY when it's absent.

https://github.com/maccesch/cmsplugin-contact/blob/master/cmsplugin_contact/nospam/forms.py#L66

but the plugin, when it instantiates the form, does it the other way around: it uses the setting if present, and falls back to the instance value if it's not

https://github.com/maccesch/cmsplugin-contact/blob/master/cmsplugin_contact/cms_plugins.py#L84

what is the preferred semantics? Is the setting a default, to be overriden by the instance value, or the other way around?

I'd EXPECT it to be the former: have the instance to take precedence before the global setting. Is this a bug? Should I fix it?

remove newlines from subject string

the subject text created from the subject.txt template needs to have new lines stripped.

splitlines isn't enough.

cmsplugin_contact/cmsplugins.py:100

render_to_string(self.subject_template, {
                'subject': subject,
            }).strip("\n")

Conctact form name (my_name) is required

Hi,
I am using your plugin and noticed that after an update it stopped working for me. I've looked at the form and noticed that it passes that some field is missing. After inspection I found that form is not valid because of id_my_name field.

Quick search gave this

form.fields['my_name'] = forms.CharField(max_length=len(instance.form_name), widget=forms.HiddenInput, label='', initial=instance.form_name)

Contact form name is required, while in editing form in cms it's marked as not required. Not sure about your plans, but it would be great if ether form would require this field since without it does not send emails due to invalid form or you would changed that to handle empty form name.

Cannot migrate w/ django 1.11

Hey its trying to run the south migrations, not sure how to run the normal django migrations when running ./manage.py migrate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.