Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
register globalstatus message viewlet
Conflicts: plone/app/layout/viewlets/configure.zcml
- Loading branch information
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<tal:statusmsg tal:define="messages view/messages" | ||
tal:repeat="message messages"> | ||
|
||
<dl tal:define="mtype message/type | nothing;" | ||
tal:attributes="class string:portalMessage ${mtype};"> | ||
<dt i18n:translate="" tal:content="python:mtype.captialize()">Info</dt> | ||
<dd tal:content="message/message | nothing" i18n:translate=""> | ||
The status message. | ||
</dd> | ||
</dl> | ||
|
||
</tal:statusmsg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | ||
from plone.app.layout.viewlets.common import ViewletBase | ||
from Products.statusmessages.interfaces import IStatusMessage | ||
|
||
|
||
class GlobalStatusMessage(ViewletBase): | ||
"""Display messages to the current user""" | ||
|
||
index = ViewPageTemplateFile('globalstatusmessage.pt') | ||
|
||
def update(self): | ||
self.status = IStatusMessage(self.request) | ||
self.messages = self.status.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters