collective.messagesviewlet


Namecollective.messagesviewlet JSON
Version 0.23 PyPI version JSON
download
home_pagehttp://pypi.python.org/pypi/collective.messagesviewlet
SummaryAdd-on displaying manager defined messages in a viewlet
upload_time2020-04-17 13:37:46
maintainer
docs_urlNone
authorIMIO Team
requires_python
licenseGPL version 2
keywords python plone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://travis-ci.org/collective/collective.messagesviewlet.svg?branch=master
    :target: https://travis-ci.org/collective/collective.messagesviewlet
.. image:: https://coveralls.io/repos/collective/collective.messagesviewlet/badge.svg?branch=master
  :target: https://coveralls.io/github/collective/collective.messagesviewlet?branch=master


.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide_addons.html
   This text does not appear on pypi or github. It is a comment.

==============================================================================
collective.messagesviewlet
==============================================================================

Add-on displaying manager defined messages in a viewlet

.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinaction.png
    :alt: The three message types.
    :width: 1300
    :height: 495
    :align: center

Features
--------

Messages are defined in control panel.

Multiple messages can be displayed together in the viewlet.

A message contains the following configuration attributes:

* text : displayed text in the viewlet
* message type : info, significant, warning (different layout in the viewlet)
* can hide : if checked, the user can hide the message (mark as read)
* start date : displaying start date (optional)
* end date : displaying end date (optional)
* required roles : user must have one of the required roles (optional)
* use local roles : message displayed for users having Reader local role on message (optional)
* location : full site or homepage only

The collective.behavior.talcondition is enabled, providing 2 attributes.

* tal condition : optional tal expression evaluated on viewlet context
* bypassing roles : optional roles bypassing the tal condition

.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinconfiguration.png
    :alt: The management interface.
    :width: 1252
    :height: 1362
    :align: center


A workflow is provided with the following states:

* inactive : not displayed
* activated : displayed

The hiding functionality uses a cookie. It is necessary to (re-)activate a message to "reset" the cookie.
After new activation, the message will be displayed again even for users that hide it.

The optional 'messages' profile adds some usefull examples that can be activated when needed:

* message for scheduled maintenance (limited to Member)
* message for imminent or current maintenance : (given to anonymous)
* message for staging site

There is also a PseudoMessage class that can be instantiated and used in viewlet templates.

Improvements
------------

* Modify hidden_uid when some fields are changed: end when gone, can_hide (to unchecked), start when end is gone
* Message definition from file system
* Message definition from rss feed

Translations
------------

This product has been translated into

- English
- French


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

Install collective.messagesviewlet by adding it to your buildout::

   [buildout]

    ...

    eggs =
        collective.messagesviewlet


and then running "bin/buildout"


Contribute
----------

- Issue Tracker: https://github.com/collective/collective.messagesviewlet/issues
- Source Code: https://github.com/collective/collective.messagesviewlet


Support
-------

If you are having issues, please let us know.


License
-------

The project is licensed under the GPLv2.

Contributors
============

- IMIO Team, support@imio.be

Changelog
=========


0.23 (2020-04-17)
-----------------
- Fix tests & travis build (#8)
  [laulaz]
- Prevent a bug when compare 2 dates with different timezone format.
  [boulch]


0.22 (2020-01-15)
-----------------

- Fix bug when message configuration don't permit to hide this message (close button stayed).
  [boulch]
- Adapted code for Plone5.2/Py3.
  [gbastien]

0.21 (2019-10-14)
-----------------

- Bypass allowed content types contraint when (post)install messagesConfig container
  [boulch]


0.20 (2019-08-23)
-----------------

- Added parameter `caching=True` to `utils.get_messages_to_show`, if `True`,
  the method result is cached in the request for given `context`.
  [gbastien]

0.19 (2019-07-15)
-----------------

- Added PseudoMessage class that be be used in viewlet template.
  [sgeulette]

0.18 (2019-05-27)
-----------------

- Define version to `2000` in `metadata.xml` of plone4 profile or upgrade step
  to 2000 is always displayed.
  [gbastien]

0.17 (2019-04-23)
-----------------

- Evaluate TAL condition using behavior `evaluate` method instead calling
  directly submethod `utils.evaluateExpressionFor` so behavior method
  `complete_extra_expr_ctx` is called.
  [gbastien]
- Call JS on portal_url so it can be cached by the browser.
  [gbastien]
- Tests on Plone5 and Plone4.
  [bsuttor]
- Manage profiles differently
  [sgeulette]
- Moved `MessagesViewlet.getAllMessages` code to `utils.get_messages_to_show`
  so it is easily callable from outside.
  [gbastien]
- Be defensive while managing TZ of message dates : do not set it if already
  set, it fails, moreover, indexing a metadata from a date attribute that had
  no TZ to one having TZ fails so undindex/reindex the entire message.
  [gbastien]

0.16 (2018-10-18)
-----------------

- Corrected import step dependencies to avoid unresolved warning. Save really changes !
  [sgeulette]

0.15 (2018-10-11)
-----------------

- Corrected import step dependencies to avoid unresolved warning.
  [sgeulette]

0.14 (2018-07-23)
-----------------

- Generate new uid when message is activated or re-activated.
  [sgeulette]

0.13 (2018-06-13)
-----------------

- Add <span> around cross <img> to ease override.
  [mgennart]

0.12 (2017-05-30)
-----------------

- Corrected image path.
  [sgeulette]
- Decrease space between messages
  [sgeulette]

0.11 (2017-03-16)
-----------------

- Added default message to warn that application only runs correctly on Firefox
  and Chrome, in addition to the already existing message that warned about the
  application only running correctly on Firefox.
  [gbastien]
- Use CheckBoxWidget for IMessage.required_roles` to ease selection when
  displaying several elements.
  [gbastien]
- Use RadioFieldWidget for Bool fields `IMessage.can_hide` and
  `IMessage.use_local_roles` so it is displayed correctly on the view,
  especially when it is False.
  [gbastien]


0.10 (2017-02-06)
-----------------

- Use INavigationRoot instead of IPloneSiteRoot to check if context is homepage.
  [bsuttor]


0.9 (2016-03-30)
----------------

- Increased coverage by using vocabulary methods instead of redefining it in tests.
  [gbastien]
- Added new example message: bad browser (not Firefox) warning
  [sgeulette]
- Use plone.formwidget.datetime to have hour at 0 by default.
  [sgeulette]
- CSS fix : display 'cursor: pointer;' when hovering the close button.
  [gbastien]
- Added 'MessagesConfig' to site_properties.types_not_searched.
  [gbastien]


0.8 (2016-01-18)
----------------

- Added parameter 'activate' to utils.add_message that makes it possible to create
  an 'activated' message directly.
  [gbastien]
- Adapted tests to use utils.add_message instead of duplicating this code.
  [gbastien]


0.7 (2015-11-17)
----------------

- Do not pass a default 'context' in utils._ to avoid strange ConnectionStateError.
  [gbastien]
- Give context to translate method.
  [sgeulette]
- Corrected and added icon type images.
  [sgeulette]


0.6 (2015-09-18)
----------------

- Simplify workflow. Only one activated state. Unrestricted search results before filtering.
  Added 'use local role' boolean attribute.
  [sgeulette]
- Updated default messages
  [sgeulette]
- Added local roles test
  [sgeulette]
- Renamed bad transition name
  [sgeulette]


0.5 (2015-09-14)
----------------

- Removed useless dependency on z3c.jbot.
  [gbastien]
- Corrected rst in readme.
  [sgeulette]


0.4 (2015-09-10)
----------------

- Use full url for readme images to display correctly on pypi.
  [sgeulette]


0.3 (2015-09-10)
----------------

- Translate title configuration folder.
  [sgeulette]


0.2 (2015-09-09)
----------------

- Added utils method to create message. Added example profile to add some messages.
  [sgeulette]


0.1 (2015-09-08)
----------------

- Initial release.
  [sgeulette, anuyens, DieKatze, boulch]




            

Raw data

            {
    "_id": null,
    "home_page": "http://pypi.python.org/pypi/collective.messagesviewlet",
    "name": "collective.messagesviewlet",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Python Plone",
    "author": "IMIO Team",
    "author_email": "support@imio.be",
    "download_url": "https://files.pythonhosted.org/packages/ac/1a/0d0d861051fea84ab5324f81859bc554989d034ae65073062ca24a7b1dd3/collective.messagesviewlet-0.23.tar.gz",
    "platform": "",
    "description": ".. image:: https://travis-ci.org/collective/collective.messagesviewlet.svg?branch=master\n    :target: https://travis-ci.org/collective/collective.messagesviewlet\n.. image:: https://coveralls.io/repos/collective/collective.messagesviewlet/badge.svg?branch=master\n  :target: https://coveralls.io/github/collective/collective.messagesviewlet?branch=master\n\n\n.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide_addons.html\n   This text does not appear on pypi or github. It is a comment.\n\n==============================================================================\ncollective.messagesviewlet\n==============================================================================\n\nAdd-on displaying manager defined messages in a viewlet\n\n.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinaction.png\n    :alt: The three message types.\n    :width: 1300\n    :height: 495\n    :align: center\n\nFeatures\n--------\n\nMessages are defined in control panel.\n\nMultiple messages can be displayed together in the viewlet.\n\nA message contains the following configuration attributes:\n\n* text : displayed text in the viewlet\n* message type : info, significant, warning (different layout in the viewlet)\n* can hide : if checked, the user can hide the message (mark as read)\n* start date : displaying start date (optional)\n* end date : displaying end date (optional)\n* required roles : user must have one of the required roles (optional)\n* use local roles : message displayed for users having Reader local role on message (optional)\n* location : full site or homepage only\n\nThe collective.behavior.talcondition is enabled, providing 2 attributes.\n\n* tal condition : optional tal expression evaluated on viewlet context\n* bypassing roles : optional roles bypassing the tal condition\n\n.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinconfiguration.png\n    :alt: The management interface.\n    :width: 1252\n    :height: 1362\n    :align: center\n\n\nA workflow is provided with the following states:\n\n* inactive : not displayed\n* activated : displayed\n\nThe hiding functionality uses a cookie. It is necessary to (re-)activate a message to \"reset\" the cookie.\nAfter new activation, the message will be displayed again even for users that hide it.\n\nThe optional 'messages' profile adds some usefull examples that can be activated when needed:\n\n* message for scheduled maintenance (limited to Member)\n* message for imminent or current maintenance : (given to anonymous)\n* message for staging site\n\nThere is also a PseudoMessage class that can be instantiated and used in viewlet templates.\n\nImprovements\n------------\n\n* Modify hidden_uid when some fields are changed: end when gone, can_hide (to unchecked), start when end is gone\n* Message definition from file system\n* Message definition from rss feed\n\nTranslations\n------------\n\nThis product has been translated into\n\n- English\n- French\n\n\nInstallation\n------------\n\nInstall collective.messagesviewlet by adding it to your buildout::\n\n   [buildout]\n\n    ...\n\n    eggs =\n        collective.messagesviewlet\n\n\nand then running \"bin/buildout\"\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/collective/collective.messagesviewlet/issues\n- Source Code: https://github.com/collective/collective.messagesviewlet\n\n\nSupport\n-------\n\nIf you are having issues, please let us know.\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\nContributors\n============\n\n- IMIO Team, support@imio.be\n\nChangelog\n=========\n\n\n0.23 (2020-04-17)\n-----------------\n- Fix tests & travis build (#8)\n  [laulaz]\n- Prevent a bug when compare 2 dates with different timezone format.\n  [boulch]\n\n\n0.22 (2020-01-15)\n-----------------\n\n- Fix bug when message configuration don't permit to hide this message (close button stayed).\n  [boulch]\n- Adapted code for Plone5.2/Py3.\n  [gbastien]\n\n0.21 (2019-10-14)\n-----------------\n\n- Bypass allowed content types contraint when (post)install messagesConfig container\n  [boulch]\n\n\n0.20 (2019-08-23)\n-----------------\n\n- Added parameter `caching=True` to `utils.get_messages_to_show`, if `True`,\n  the method result is cached in the request for given `context`.\n  [gbastien]\n\n0.19 (2019-07-15)\n-----------------\n\n- Added PseudoMessage class that be be used in viewlet template.\n  [sgeulette]\n\n0.18 (2019-05-27)\n-----------------\n\n- Define version to `2000` in `metadata.xml` of plone4 profile or upgrade step\n  to 2000 is always displayed.\n  [gbastien]\n\n0.17 (2019-04-23)\n-----------------\n\n- Evaluate TAL condition using behavior `evaluate` method instead calling\n  directly submethod `utils.evaluateExpressionFor` so behavior method\n  `complete_extra_expr_ctx` is called.\n  [gbastien]\n- Call JS on portal_url so it can be cached by the browser.\n  [gbastien]\n- Tests on Plone5 and Plone4.\n  [bsuttor]\n- Manage profiles differently\n  [sgeulette]\n- Moved `MessagesViewlet.getAllMessages` code to `utils.get_messages_to_show`\n  so it is easily callable from outside.\n  [gbastien]\n- Be defensive while managing TZ of message dates : do not set it if already\n  set, it fails, moreover, indexing a metadata from a date attribute that had\n  no TZ to one having TZ fails so undindex/reindex the entire message.\n  [gbastien]\n\n0.16 (2018-10-18)\n-----------------\n\n- Corrected import step dependencies to avoid unresolved warning. Save really changes !\n  [sgeulette]\n\n0.15 (2018-10-11)\n-----------------\n\n- Corrected import step dependencies to avoid unresolved warning.\n  [sgeulette]\n\n0.14 (2018-07-23)\n-----------------\n\n- Generate new uid when message is activated or re-activated.\n  [sgeulette]\n\n0.13 (2018-06-13)\n-----------------\n\n- Add <span> around cross <img> to ease override.\n  [mgennart]\n\n0.12 (2017-05-30)\n-----------------\n\n- Corrected image path.\n  [sgeulette]\n- Decrease space between messages\n  [sgeulette]\n\n0.11 (2017-03-16)\n-----------------\n\n- Added default message to warn that application only runs correctly on Firefox\n  and Chrome, in addition to the already existing message that warned about the\n  application only running correctly on Firefox.\n  [gbastien]\n- Use CheckBoxWidget for IMessage.required_roles` to ease selection when\n  displaying several elements.\n  [gbastien]\n- Use RadioFieldWidget for Bool fields `IMessage.can_hide` and\n  `IMessage.use_local_roles` so it is displayed correctly on the view,\n  especially when it is False.\n  [gbastien]\n\n\n0.10 (2017-02-06)\n-----------------\n\n- Use INavigationRoot instead of IPloneSiteRoot to check if context is homepage.\n  [bsuttor]\n\n\n0.9 (2016-03-30)\n----------------\n\n- Increased coverage by using vocabulary methods instead of redefining it in tests.\n  [gbastien]\n- Added new example message: bad browser (not Firefox) warning\n  [sgeulette]\n- Use plone.formwidget.datetime to have hour at 0 by default.\n  [sgeulette]\n- CSS fix : display 'cursor: pointer;' when hovering the close button.\n  [gbastien]\n- Added 'MessagesConfig' to site_properties.types_not_searched.\n  [gbastien]\n\n\n0.8 (2016-01-18)\n----------------\n\n- Added parameter 'activate' to utils.add_message that makes it possible to create\n  an 'activated' message directly.\n  [gbastien]\n- Adapted tests to use utils.add_message instead of duplicating this code.\n  [gbastien]\n\n\n0.7 (2015-11-17)\n----------------\n\n- Do not pass a default 'context' in utils._ to avoid strange ConnectionStateError.\n  [gbastien]\n- Give context to translate method.\n  [sgeulette]\n- Corrected and added icon type images.\n  [sgeulette]\n\n\n0.6 (2015-09-18)\n----------------\n\n- Simplify workflow. Only one activated state. Unrestricted search results before filtering.\n  Added 'use local role' boolean attribute.\n  [sgeulette]\n- Updated default messages\n  [sgeulette]\n- Added local roles test\n  [sgeulette]\n- Renamed bad transition name\n  [sgeulette]\n\n\n0.5 (2015-09-14)\n----------------\n\n- Removed useless dependency on z3c.jbot.\n  [gbastien]\n- Corrected rst in readme.\n  [sgeulette]\n\n\n0.4 (2015-09-10)\n----------------\n\n- Use full url for readme images to display correctly on pypi.\n  [sgeulette]\n\n\n0.3 (2015-09-10)\n----------------\n\n- Translate title configuration folder.\n  [sgeulette]\n\n\n0.2 (2015-09-09)\n----------------\n\n- Added utils method to create message. Added example profile to add some messages.\n  [sgeulette]\n\n\n0.1 (2015-09-08)\n----------------\n\n- Initial release.\n  [sgeulette, anuyens, DieKatze, boulch]\n\n\n\n",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "Add-on displaying manager defined messages in a viewlet",
    "version": "0.23",
    "project_urls": {
        "Homepage": "http://pypi.python.org/pypi/collective.messagesviewlet"
    },
    "split_keywords": [
        "python",
        "plone"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6985e448b28b01977672ee4cd19e0737abd03050e01d3da637689fe494ebe9da",
                "md5": "b4da44d826e34d0c56e0c02175b52424",
                "sha256": "6bc5835ff968780d541610ae79c7d8a7a98bd4ec1beabeeb30cb4a71cbe8f935"
            },
            "downloads": -1,
            "filename": "collective.messagesviewlet-0.23-py2-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4da44d826e34d0c56e0c02175b52424",
            "packagetype": "bdist_wheel",
            "python_version": "py2",
            "requires_python": null,
            "size": 63894,
            "upload_time": "2020-04-17T13:37:43",
            "upload_time_iso_8601": "2020-04-17T13:37:43.904755Z",
            "url": "https://files.pythonhosted.org/packages/69/85/e448b28b01977672ee4cd19e0737abd03050e01d3da637689fe494ebe9da/collective.messagesviewlet-0.23-py2-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac1a0d0d861051fea84ab5324f81859bc554989d034ae65073062ca24a7b1dd3",
                "md5": "ee44ba2fce4ec2085310f8c0ac1699dc",
                "sha256": "6b221700a1584e5babab2de5f5aed11220876f33444bcda27d6a0d16ac9d93c5"
            },
            "downloads": -1,
            "filename": "collective.messagesviewlet-0.23.tar.gz",
            "has_sig": false,
            "md5_digest": "ee44ba2fce4ec2085310f8c0ac1699dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 205027,
            "upload_time": "2020-04-17T13:37:46",
            "upload_time_iso_8601": "2020-04-17T13:37:46.768509Z",
            "url": "https://files.pythonhosted.org/packages/ac/1a/0d0d861051fea84ab5324f81859bc554989d034ae65073062ca24a7b1dd3/collective.messagesviewlet-0.23.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-04-17 13:37:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "collective.messagesviewlet"
}
        
Elapsed time: 0.10286s