Package: collective.z3cform.norobots
collective.z3cform.norobotsTable of Contentscollective.z3cform.norobotsOverviewRequirementsScreenshotInstallationUsage as aplone.app.discussion(Plone Discussions) captcha pluginUsage in a z3c formUsage as a macro in a custom formPossible problemsCreditsSource codeHow to contribute and submit a patch ?ContributorsChangelogOverviewcollective.z3cform.norobotsprovides a “human” captcha widget based on a list of
question/answer(s).This captcha can be used :as aplone.app.discussion(Plone Discussions) captcha pluginas az3c formfieldas a macro in a custom formas a PloneFormGen field withcollective.pfg.norobotsThe widget is based on z3c.form.TextWidget.Since version 1.4, questions configuration uses a dedicated control panel (usingplone.app.registry)
instead of a simple properties sheet. An upgrade step provides migration from earlier versions.Interface is translated in the following languages: Czech [cs], Danish [da], German [de],
Basque [eu], Spanish [es], Suomeksi [fi], French [fr], Dutch [nl], Simplified Chinese [zh_CN],
Italian [it] and Russian [ru].RequirementsI have tested this release with Plone 4.3.10, Plone 5.0.5.
Since version 2.0 Plone 6 is supported.See previous releases for old Plone versions.ScreenshotInstallationGetting the moduleAddcollective.z3cform.norobotsto yourplone.recipe.zope2instancebuildout section e.g.:[instance]
...
eggs =
    Plone
    ...
    collective.z3cform.norobots

...

zcml =
    ...
    collective.z3cform.norobotsOr, you can add it as a dependency on your own productsetup.py:install_requires=[
    ...
    'collective.z3cform.norobots',
],Enabling the moduleIn the Addons control panel, install “Norobots captcha field (collective.z3cform.norobots)”.Add a new questionIn the “Norobots widget settings” control panel, add a new line in the field “Norobots question::answer”:your_question::the_answer

Example : What is 10 + 12 ?::22Answer can contain multiple values delimited by semicolon:your_question::the_answer;another_answer

Example : What is 5 + 5 ?::10;tenQuickly test ?Downloadcollective.z3cform.norobotsand usevirtualenvandbuildoutto test the module:easy_install virtualenv
cd collective.z3cform.norobots
virtualenv .
source bin/activate
(collective.z3cform.norobots) easy_install zc.buildout
!!! check the buildout config file ``test-plone-base.cfg`` before running !!!
(collective.z3cform.norobots) ln -s test-plone-5.0.x.cfg buildout.cfg
(collective.z3cform.norobots) python bootstrap.py
(collective.z3cform.norobots) bin/buildout
[...] be patient... [...]
(collective.z3cform.norobots) ./bin/instance fgGo tohttp://localhost:8080, add a new Plone Site and install collective.z3cform.norobots (see above).Launch tests:(collective.z3cform.norobots) pip install unittest2
(collective.z3cform.norobots) ./bin/test -s collective.z3cform.norobotsLaunch code coverage:(collective.z3cform.norobots) bin/coverage
(collective.z3cform.norobots) bin/report
And open with a browser htmlcov/index.htmlUsage as aplone.app.discussion(Plone Discussions) captcha pluginIn the Discussion control panel, activate anonymous comments then select “Norobots” for the captcha.
This enable the captcha for anonymous users.Usage in a z3c formYou can use this widget setting the “widgetFactory” property of a form field:from zope import interface, schema
from z3c.form import interfaces, form, field, button, validator
from plone.app.z3cform.layout import wrap_form

from collective.z3cform.norobots.i18n import MessageFactory as _
from collective.z3cform.norobots.widget import NorobotsFieldWidget
from collective.z3cform.norobots.validator import NorobotsValidator

class INorobotsForm(interface.Interface):
    norobots = schema.TextLine(title=_(u'Are you a human ?'),
                               description=_(u'In order to avoid spam, please answer the question below.'),
                               required=True)

class NorobotsForm(form.Form):
    fields = field.Fields(INorobotsForm)
    fields['norobots'].widgetFactory = NorobotsFieldWidget

# wrap the form with plone.app.z3cform's Form wrapper
NorobotsFormView = wrap_form(NorobotsForm)

# Register Norobots validator for the correponding field in the IContactInfo interface
validator.WidgetValidatorDiscriminators(NorobotsValidator, field=INorobotsForm['norobots'])For more information seecontact_info.pyin theplone_formsdirectory.To activate this example, add<includepackage=".plone_forms"/>in the package’sconfigure.zmlfile and openhttp://localhost:8080/Plone/@@z3cform-contact-infoUsage as a macro in a custom formSeebrowser/norobots_macro.ptavailable through @@norobots_macro browser page.Possible problemsIn a fresh Plone 5.0.5 the captcha widget does not appear in the comments form even ifNorobotsis the selected captcha. Installing an other captcha likeplone.formwidget.captchasolve
this problem (sic!). In my website, updated from Plone 5.0.4 to 5.0.5, all is ok.I have the following error when launching the tests: “ImportError: No module named lxml.html”
=> In order to run the tests you need lxml. You can add for example
“z3c.form [test]” to your buildout. Seehttp://plone.293351.n2.nabble.com/Custom-Dexterity-Widgets-td5594532.htmlfor more details.CreditsSylvain Boureliou [sylvainb] -GitHub-WebsiteMakina CorpusMakina CorpusSource codeSource codeis hosted on Github.How to contribute and submit a patch ?Source codeand anissue trackeris hosted on Github.ContributorsSylvain Boureliou [sylvainb]Mikel Larreategi [erral]Aijun JianRadim Novotny [naro]Thomas Clement Mogensen [tmog]Peter Mathis [petschki]Petri Savolainen [petri]Helmut ToplitzerLuca Fabbri [keul]Andrea Cecchi [cekk][serge73]Changelog2.1 (2022-08-18)Add an adapter to show the controlpanel in Volto
[erral]2.0 (2022-03-21)Add Plone 6 support, remove <includeDependencies />Update testHousekeeping CodeUpdate setup, tox.ini
[1letter]Remove Plone 5.0 classifier as this version is not tested anymore.
[thet]Format code according to Plone standards: black, isort, zpretty.
[thet]Add uninstall profile.
[thet]Update to Python3
[1letter]Add plone.autoform.directives Support for WidgetAdd css klass to Widget
[1letter]Add missing english translation file
[thomasmassmann]Update translations.
[thomasmassmann]1.4.4 (2016-07-20)Add Russian translation
[serge73]1.4.3 (2016-07-08)Add macro for html forms
[cekk]1.4.2.2 (2013-04-25)added italian translation
[keul]1.4.2.1 (2013-01-17)add Dutch Translations
[maartenkling]1.4.2 (2012-10-03)Add compatibility for collective.pfg.norobots : allow to use the Norobots captcha with PloneFormGen.
[sylvainb]Fix widget template to allow good redirection when the answer is bad in plone.app.discussion forms.
[sylvainb]Move source code in “src” directory.
[sylvainb]Update tests, buildouts and add test coverage. Plone 4.0 is no longer supported.
[sylvainb]Change MessageFactory name to get translations picked up by Plone
[erral]Updated basque translation and added Spanish translation.
[erral]1.4.1 (2012-07-02)Fix Unicode error when a question contains non-ascii char.
[sylvainb, Helmut Toplitzer]1.4 (2012-06-22)Use plone.app.registry instead of a property sheet for the questions configuration.
Questions can now be added using a dedicated control panel.
[sylvainb]Add an upgrade step (1 -> 2) to copy questions from the old properties sheet to plone.app.registry.
[sylvainb]Fix the widget template for use with plone.app.discussion (there was no redirection to
the comment form when only the captcha is wrong).
[sylvainb]Update translations (some new strings added).
[sylvainb]Add Basque translation
[erral]1.3.1 (2012-03-28)Add simplified chinese translation
[Aijun Jian]1.3 (2012-02-27)Allow multiple answers for a question
[naro]Added danish translation
[tmog]1.2.1 (2010-11-05)Added german translation
[petschki]1.2 (2010-10-31)Fix tests for Plone 4
[sylvainb]Added Czech translation
[naro]1.1 (2010-09-15)Support for using as a plone.app.discussion captcha plugin (Plone 4)
[Petri Savolainen]Finnish translations
[Petri Savolainen]1.0 (2010-01-13)Initial release
[sylvainb]