Package: collective.messagesviewlet
collective.messagesviewletAdd-on displaying manager defined messages in a viewletFeaturesMessages 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 viewletmessage 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 onlyThe collective.behavior.talcondition is enabled, providing 2 attributes.tal condition : optional tal expression evaluated on viewlet contextbypassing roles : optional roles bypassing the tal conditionA workflow is provided with the following states:inactive : not displayedactivated : displayedThe 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 siteThere is also a PseudoMessage class that can be instantiated and used in viewlet templates.ImprovementsModify hidden_uid when some fields are changed: end when gone, can_hide (to unchecked), start when end is goneMessage definition from file systemMessage definition from rss feedTranslationsThis product has been translated intoEnglishFrenchInstallationInstall collective.messagesviewlet by adding it to your buildout:[buildout]

 ...

 eggs =
     collective.messagesviewletand then running “bin/buildout”ContributeIssue Tracker:https://github.com/collective/collective.messagesviewlet/issuesSource Code:https://github.com/collective/collective.messagesviewletSupportIf you are having issues, please let us know.LicenseThe project is licensed under the GPLv2.ContributorsIMIO Team,support@imio.beChangelog0.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 parametercaching=Truetoutils.get_messages_to_show, ifTrue,
the method result is cached in the request for givencontext.
[gbastien]0.19 (2019-07-15)Added PseudoMessage class that be be used in viewlet template.
[sgeulette]0.18 (2019-05-27)Define version to2000inmetadata.xmlof plone4 profile or upgrade step
to 2000 is always displayed.
[gbastien]0.17 (2019-04-23)Evaluate TAL condition using behaviorevaluatemethod instead calling
directly submethodutils.evaluateExpressionForso behavior methodcomplete_extra_expr_ctxis 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]MovedMessagesViewlet.getAllMessagescode toutils.get_messages_to_showso 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 fieldsIMessage.can_hideandIMessage.use_local_rolesso 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]