Skip to content

Commit

Permalink
Merge branch 'master' into plone5
Browse files Browse the repository at this point in the history
  • Loading branch information
sgeulette committed Sep 11, 2018
2 parents 50a0ce8 + 58a32c8 commit b826e79
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
15 changes: 14 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Changelog
=========


0.13 (unreleased)
0.15 (unreleased)
-----------------

- Call JS on portal_url so it can be cached by the browser.
Expand All @@ -12,6 +12,19 @@ Changelog
- Manage profiles differently
[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)
-----------------

Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ collective.messagesviewlet

Add-on displaying manager defined messages in a viewlet

.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinaction.png
.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinaction.png
:alt: The three message types.
:width: 1300
:height: 495
Expand All @@ -25,25 +25,25 @@ Features

Messages are defined in control panel.

Multiple messages can be displayed together in the viewlet.
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, warning, important (different layout 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.
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
.. image:: https://raw.githubusercontent.com/collective/collective.messagesviewlet/master/docs/messageviewletinconfiguration.png
:alt: The management interface.
:width: 1252
:height: 1362
Expand All @@ -55,8 +55,8 @@ A workflow is provided with the following states:
* inactive : not displayed
* activated : displayed

The hiding functionality uses a cookie. It is necessary to deactivate a message to "reset" the cookie.
When activating again, the message will be displayed again even for users that hide it.
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:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='collective.messagesviewlet',
version='0.13.dev0',
version='0.15.dev0',
description="Add-on displaying manager defined messages in a viewlet",
long_description=long_description,
# Get more from http://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
13 changes: 7 additions & 6 deletions src/collective/messagesviewlet/browser/messagesviewlet.pt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
<dd>
<tal tal:replace="structure python: message.text.output"></tal>
</dd>
<img tal:condition="message/can_hide"
class="close-button"
tal:attributes="src string:${view/portal_url}/pb_close.png"
i18n:attributes='alt close_alt;
title close_title'
/>
<span class="close-button" i18n:attributes='title close_title'>
<img tal:condition="message/can_hide"
tal:attributes="src string:${view/portal_url}/pb_close.png"
i18n:attributes='alt close_alt;
title close_title'
/>
</span>
</dl>
</tal:message>
</div>
4 changes: 2 additions & 2 deletions src/collective/messagesviewlet/subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def change_hidden_uid(message, event):
"""
Generate a new uid if the message is deactivated
Generate a new uid if the message is activated
"""
if event.action == 'deactivate':
if event.action == 'activate':
message.hidden_uid = generate_uid()
2 changes: 1 addition & 1 deletion versions.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
ipdb = 0.8
ipython = 2.1.0
ipython = 5.7.0
zc.buildout = 2.10.0
setuptools =
zc.recipe.egg = 2.0.1
Expand Down

0 comments on commit b826e79

Please sign in to comment.