-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
413 additions
and
611 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
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# -*- coding:utf-8 -*- | ||
from plone.app.registry.browser import controlpanel | ||
from sc.social.like import LikeMessageFactory as _ | ||
from sc.social.like.config import DEFAULT_ENABLED_CONTENT_TYPES | ||
from sc.social.like.config import DEFAULT_PLUGINS_ENABLED | ||
from zope import schema | ||
from zope.interface import Interface | ||
from zope.schema.vocabulary import SimpleTerm | ||
from zope.schema.vocabulary import SimpleVocabulary | ||
|
||
|
||
CONTENT_TYPES = 'plone.app.vocabularies.ReallyUserFriendlyTypes' | ||
|
||
styles = SimpleVocabulary([ | ||
SimpleTerm(value=u'horizontal', title=_(u'horizontal')), | ||
SimpleTerm(value=u'vertical', title=_(u'vertical')), | ||
]) | ||
|
||
|
||
class ISocialLikeSettings(Interface): | ||
|
||
"""Schema for the control panel form.""" | ||
|
||
enabled_portal_types = schema.Tuple( | ||
title=_(u'Content types'), | ||
description=_( | ||
u'help_portal_types', | ||
default=u'Please select content types in which the ' | ||
u'viewlet will be applied.', | ||
), | ||
required=True, | ||
default=DEFAULT_ENABLED_CONTENT_TYPES, | ||
value_type=schema.Choice(vocabulary=CONTENT_TYPES) | ||
) | ||
|
||
plugins_enabled = schema.Tuple( | ||
title=_(u'Plugins'), | ||
description=_( | ||
u'help_enabled_plugins', | ||
default=u'Please select which plugins will be used', | ||
), | ||
required=False, | ||
default=DEFAULT_PLUGINS_ENABLED, | ||
value_type=schema.Choice(vocabulary='sc.social.likes.plugins') | ||
) | ||
|
||
typebutton = schema.Choice( | ||
title=_(u'Button style'), | ||
description=_( | ||
u'help_selected_buttons', | ||
default=u'Choose your button style.', | ||
), | ||
required=True, | ||
default=_(u'horizontal'), | ||
vocabulary=styles, | ||
) | ||
|
||
do_not_track = schema.Bool( | ||
title=_(u'Do not track users'), | ||
description=_( | ||
u'help_do_not_track', | ||
default=u'If enabled, the site will not provide advanced sharing ' | ||
u'widgets , instead simple links will be used.\n' | ||
u'This will limits user experience and features ' | ||
u'(like the share count) but will enhance users privacy: ' | ||
u'no 3rd party cookies will be sent to users.' | ||
), | ||
default=False, | ||
) | ||
|
||
|
||
class SocialLikeSettingsEditForm(controlpanel.RegistryEditForm): | ||
|
||
"""Control panel edit form.""" | ||
|
||
schema = ISocialLikeSettings | ||
label = _(u'Social Like') | ||
description = _(u'Settings for the sc.social.like package') | ||
|
||
|
||
class SocialLikeSettingsControlPanel(controlpanel.ControlPanelFormWrapper): | ||
|
||
"""Control panel form wrapper.""" | ||
|
||
form = SocialLikeSettingsEditForm |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.