Metadata-Version: 2.1
Name: cioppino.twothumbs
Version: 2.2.1
Summary: Rating widget based on thumbs up and down.
Home-page: https://github.com/collective/cioppino.twothumbs
Author: eleddy
Author-email: elizabeth.leddy@gmail.com
License: GPL
Keywords: rating,content,thumbs
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.3
Classifier: Framework :: Plone :: 5.0
Classifier: Framework :: Plone :: 5.1
Classifier: Framework :: Plone :: 5.2
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.6
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Requires-Dist: Plone
Requires-Dist: plone.behavior
Requires-Dist: setuptools
Requires-Dist: six
Provides-Extra: test
Requires-Dist: plone.app.testing ; extra == 'test'

Introduction
============
This will add those terribly "delish" little thumbs all over facebook
to products of your choosing. By default, only logged in users can rate
a product, and once they are logged in they can vote once (and change
their vote at any time)


Installation
------------

.. image:: https://secure.travis-ci.org/collective/cioppino.twothumbs.png
    :target: http://travis-ci.org/#!/collective/cioppino.twothumbs

.. image:: https://coveralls.io/repos/collective/cioppino.twothumbs/badge.png?branch=master
    :alt: Coverage
    :target: https://coveralls.io/r/collective/cioppino.twothumbs


Your mission, should you choose to accept it is to add the package to
your buildout config and rerun buildout. If you want it as a viewlet
below the content title, you must follow the viewlet directions below
before restarting and installing. Otherwise install immediately and then
skip to the section on browser views.

Make sure you have installed or "Activated" the product if things aren't
working as expected.


Compatibility
-------------

cioppino.twothumbs works with Plone 4.3, 5.1, 5.2.
It works on Python 2.7, and for Plone 5.2 it also works on Python 3.6.
Those are the versions that are automatically tested.


As a Viewlet
------------

Archetypes
^^^^^^^^^^
Then, in the configure.zcml
in the base of your product you need to tell which content types should
display the thumbs. For example, with the PloneSoftwareCenter product,
the configure.zcml has the lines::

    <include package="cioppino.twothumbs" />
    <class class=".content.project.PSCProject">
       <implements interface="cioppino.twothumbs.interfaces.ILoveThumbsDontYou" />
    </class>

That little diddy would add the thumbs viewlet to the PSCProject
product only. You only need to include the package 1 time but you
need to add the class block for every content type you would like
to show the thumbs.

Dexterity
^^^^^^^^^
Cioppino.TwoThumbs provides a behavior for dexterity content types. In
the dexterity configuration UI, it will be listed under "Behaviors".

You may also manually add this behavior to your type by adding the following
to ``../path/to/profiles/default/types/your_type.xml``::

    ...
    <property name="behaviors">
        <element value="cioppino.twothumbs.interfaces.ILoveThumbsDontYou" />
        ...
    </property>
    ...


As a Browser View
-----------------
Additionally, you can generate the widget on any content page in any place
by just adding a few lines to your template::

    <div tal:content="structure here/@@rate-if-you-dare"/>

Note that this ONLY works if the browser view is in context of a content
type since it requires access to content object annotations.


Migration
---------
If you used to use plone.contentratings and want to migrate to the thumbs
product, there is an example in PloneSoftwareCenter. It's
pretty easy. Please see https://github.com/collective/Products.PloneSoftwareCenter/blob/master/Products/PloneSoftwareCenter/Extensions/migrateratings.py for an example.


Anonymous Voting
----------------
Anonymous voting is possible, but **weak**. An unique identifier is
generated and set as cookie on first vote. Then the uid is used as
identifier for later display/changes. To enable anonymous voting go to
Plones configuration registry, search for ``cioppino.twothumbs.anonymous``
entry and edit it. Alternativly you can add your own ``registry.xml`` to
your sites profile::

    <?xml version="1.0"?>
    <registry>
        <record name="cioppino.twothumbs.anonymousvoting">
            <value>True</value>
        </record>
    </registry>

It's easy to fake anonymous votes, so dont trust them much. A todo here
is to add a captcha, which would make automated vote-faking impossible.


Bugs/Suggestions/Help
---------------------
Please file bugs at https://github.com/collective/cioppino.twothumbs.


Credits
-------
This product was initially developed at the Plone Cioppino Sprint in
Bodega Bay 2011. The source code is filled with plenty of inside jokes
and may only be maintainable after drinking copious numbers of
Manhattans. Without the [drink] support of everyone there, this may not
have been made possible. Big ups.

Changelog
=========

2.2.1 (2021-11-22)
------------------

- Add name to behavior.
  [pbauer]

- Prevent csrf-confirmation when initializing annotations.
  [pbauer]


2.2.0 (2019-10-09)
------------------

- Register collection criterions for our positive ratings field.
  Using it as a sorting criterion works.
  Using it as a selection criterion (X thumbs or less/more than X thumbs)
  needs a `fix in plone.app.querystring <https://github.com/plone/plone.app.querystring/issues/93>`_,
  specifically version 1.2.13 (Plone 4) or 1.4.12 (Plone 5.1) or higher.
  [maurits]

- Fixed error: nulltranslate has no "context" argument.
  Fixes `issue 24 <https://github.com/collective/cioppino.twothumbs/issues/24>`_.
  [maurits]


2.1.2 (2019-01-05)
------------------

- Fix like/dislike inline popup text translations for composed language domains like nl-be.
  [fredvd]

- Prepare for Python 2 / 3 compatibility [Andreas Mantke]


2.1.1 (2016-09-12)
------------------

- Re-release 2.1.
  [timo]


2.1 (2016-09-12)
----------------

- Mv docs/HISTORY.txt -> CHANGES.rst to follow common best practice.
  [timo]

- Added upgrade for Plone 5 to recognize css- and js-file.
  [andreasma]

- Complete Plone 4 and Plone 5 compat using resource registries and splitted GS
  profiles
  [sneridagh]


2.0 (2016-03-09)
----------------

- Add compatability for Plone 5.
  [pbauer]

- Make visual appearance more discreet by moving the number of votes next to
  the thumbs and dropping the summary. Similar to the rating on youtube.
  [pbauer]

- HTML render fixes.
  [andreasma]

- Fix bug in like view that prevented authenticated user id from being used
  in votes when anonymous voting was enabled
  [cguardia]


1.8 (2014-11-07)
----------------
- allow anonyoums voting if configured (registry.xml) protected by weak
  cookie [jensens]
- fix duplicated ID for accessibility [simahawk]
- fix rendering under plone 4.3 [simahawk]
- feat: add event and triggers for content rules [Gagaro]
- qa: add travis and coverage support [toutp]
- qa: pep8 fixes [toutp,Gagaro,jensens]

1.7 (2013-06-04)
----------------
- Add french translation [toutpt]
- Make the template being 'index' to be customizable with zcml + browser layer
  [toutpt]
- Add catalan translation [mpampols]

1.6 (2012-06-11)
----------------
- Fix requirements for instances where dexterity is not installed [tschorr]

1.5 (2012-06-07)
----------------
- Add support for dexterity behaviors [eleddy]
- Fix confirmation message alignment for default plone sites [eleddy]

1.4 (2012-05-15)
----------------
- German translation added. [jensens]
- Added Brazilian Portuguese translation. [agnogueira]
- Add support for Plone 3 [rochecompaan]
- Enable use of the twotumbs widget outside the content div [rochecompaan]

1.3 (2011-09-22)
----------------
- Turn thumbs background images into a sprite [marcosfromero]
- Improve accessibility: non AJAX/JavaScript support [marcosfromero]
- Improve i18n and added new Spanish translations [marcosfromero]
- Improve feedback for anonymous users and after voting [marcosfromero]

1.2 (2011-05-27)
----------------
- Initial i18n and Spanish translation [hvelarde]


1.1 (2011-02-15)
----------------
- switch to absolute patch for form actions since it breaks when
  under the influence of rewriting [eleddy]


1 (2011-02-14)
--------------
- Initial release [eleddy on code, spanktar on graphics]


