-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from collective/global-action
Added option to show action globally, regardless of blocked portlets.
- Loading branch information
Showing
15 changed files
with
250 additions
and
64 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
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
|
||
from zope.i18nmessageid import MessageFactory | ||
|
||
|
||
_ = MessageFactory('collective.calltoaction') |
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,16 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.calltoaction import _ | ||
from collective.calltoaction.interfaces import ICollectiveCalltoactionSettings | ||
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper | ||
from plone.app.registry.browser.controlpanel import RegistryEditForm | ||
from plone.z3cform import layout | ||
from z3c.form import form | ||
|
||
|
||
class CalltoactionControlPanelForm(RegistryEditForm): | ||
form.extends(RegistryEditForm) | ||
schema = ICollectiveCalltoactionSettings | ||
|
||
CalltoactionControlPanelView = layout.wrap_form( | ||
CalltoactionControlPanelForm, ControlPanelFormWrapper) | ||
CalltoactionControlPanelView.label = _(u'Call to action settings') |
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
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 |
---|---|---|
@@ -1,8 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Module where all interfaces, events and exceptions live.""" | ||
|
||
from collective.calltoaction import _ | ||
from zope import schema | ||
from zope.interface import Interface | ||
from zope.publisher.interfaces.browser import IDefaultBrowserLayer | ||
|
||
|
||
class ICollectiveCalltoactionLayer(IDefaultBrowserLayer): | ||
"""Marker interface that defines a browser layer.""" | ||
|
||
|
||
class ICollectiveCalltoactionSettings(Interface): | ||
show_global = schema.Bool( | ||
title=_(u'Show global action'), | ||
description=_( | ||
u'description_global_action', | ||
default=( | ||
u'This looks for a portlet in the navigation root, ' | ||
u'which usually is the portal root. ' | ||
u'It shows it on every page. ' | ||
u'The timeout before showing the call to action, ' | ||
u'is calculated from the first page visit. ' | ||
u'The time spent on the site so far is stored on a cookie.')), | ||
default=False, | ||
) |
20 changes: 20 additions & 0 deletions
20
src/collective/calltoaction/profiles/default/controlpanel.xml
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,20 @@ | ||
<?xml version="1.0"?> | ||
<object | ||
name="portal_controlpanel" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
i18n:domain="collective.calltoaction"> | ||
|
||
<configlet | ||
title="Call to action settings" | ||
action_id="collective.calltoaction.settings" | ||
appId="collective.calltoaction" | ||
category="Products" | ||
condition_expr="" | ||
url_expr="string:${portal_url}/@@calltoaction-controlpanel" | ||
icon_expr="string:${portal_url}/product_icon.png" | ||
visible="True" | ||
i18n:attributes="title"> | ||
<permission>Manage portal</permission> | ||
</configlet> | ||
|
||
</object> |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata> | ||
<version>1000</version> | ||
<version>1001</version> | ||
<dependencies> | ||
</dependencies> | ||
</metadata> |
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,3 @@ | ||
<registry> | ||
<records interface="collective.calltoaction.interfaces.ICollectiveCalltoactionSettings" /> | ||
</registry> |
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
Oops, something went wrong.