From 9ae8b31cd1635380dab40defffeb48ca68a43c4c Mon Sep 17 00:00:00 2001 From: schminitz Date: Thu, 23 May 2013 10:29:23 +0200 Subject: [PATCH 1/3] Add button type option to social like control_panel refs #4892 --- sc/social/like/controlpanel/likes.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sc/social/like/controlpanel/likes.py b/sc/social/like/controlpanel/likes.py index d98bb24c..d9d50b70 100644 --- a/sc/social/like/controlpanel/likes.py +++ b/sc/social/like/controlpanel/likes.py @@ -23,6 +23,11 @@ from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm +buttonTypes = SimpleVocabulary([ + SimpleTerm(value=u'like', title=_(u'Like')), + SimpleTerm(value=u'share_this', title=_(u'Share this')), +]) + verbs = SimpleVocabulary([ SimpleTerm(value=u'like', title=_(u'Like')), SimpleTerm(value=u'recommend', title=_(u'Recommend')), @@ -90,13 +95,21 @@ class IFbSchema(Interface): required=False, ) + fb_typebutton = Choice( + title=_(u"Choose the type of button you want"), + required=True, + default=u'like', + vocabulary=buttonTypes, + ) + fbaction = Choice( title=_(u'Verb to display'), description=_( u'help_verb_display', default=u"The verb to display in the facebook button. " u"Currently only 'like' and 'recommend' are " - u"supported.", + u"supported." + u"Only used for 'Like' button type.", ), required=True, default=u'like', @@ -158,6 +171,7 @@ class FbControlPanelAdapter(BaseControlPanelAdapter): implements(IFbSchema) fb_enabled = ProxyFieldProperty(IFbSchema['fb_enabled']) + fb_typebutton = ProxyFieldProperty(IFbSchema['fb_typebutton']) fbaction = ProxyFieldProperty(IFbSchema['fbaction']) fbadmins = ProxyFieldProperty(IFbSchema['fbadmins']) From 9730fd5f287854ab6e3c33e03e6d1a99677e5c11 Mon Sep 17 00:00:00 2001 From: schminitz Date: Thu, 23 May 2013 11:54:46 +0200 Subject: [PATCH 2/3] merge --- .../like/browser/stylesheets/social_like.css | 16 +++- .../like/browser/templates/sociallikes.pt | 83 ++++++++++++------- sc/social/like/browser/viewlets.py | 2 + .../like/profiles/default/propertiestool.xml | 1 + .../like/profiles/to2000/propertiestool.xml | 1 + 5 files changed, 69 insertions(+), 34 deletions(-) diff --git a/sc/social/like/browser/stylesheets/social_like.css b/sc/social/like/browser/stylesheets/social_like.css index 0010776e..475da7bd 100644 --- a/sc/social/like/browser/stylesheets/social_like.css +++ b/sc/social/like/browser/stylesheets/social_like.css @@ -1,5 +1,17 @@ #viewlet-social-like {margin-top: 5px;} #viewlet-social-like .twitter-count-horizontal {height: 20px !important;} #viewlet-social-like .fb_edge_widget_with_comment {position: relative; margin-top: 0px;} -.twitter-share-button {margin-top: 0.8px;} -.horizontal .fb_iframe_widget iframe {height: 23px !important;} \ No newline at end of file + +#viewlet-social-like ul.like-buttons{ +float: left; +list-style: none; +margin: 5px 0 5px 0; +padding: 0; +width: 100%; +list-style-type: none; +} + +#viewlet-social-like ul.like-buttons li{ + display: block; + float: left; +} diff --git a/sc/social/like/browser/templates/sociallikes.pt b/sc/social/like/browser/templates/sociallikes.pt index a1acdfb4..12c7574b 100644 --- a/sc/social/like/browser/templates/sociallikes.pt +++ b/sc/social/like/browser/templates/sociallikes.pt @@ -1,35 +1,54 @@ + i18n:domain="sc.social.like" tal:condition="view/enabled"> + + + diff --git a/sc/social/like/browser/viewlets.py b/sc/social/like/browser/viewlets.py index e15a93e5..f9492bc1 100644 --- a/sc/social/like/browser/viewlets.py +++ b/sc/social/like/browser/viewlets.py @@ -50,6 +50,7 @@ class BaseLikeViewlet(ViewletBase): twitter_enabled = False twittvia = '' fb_enabled = False + fb_typebutton = '' fbaction = '' fbadmins = '' gp_enabled = False @@ -74,6 +75,7 @@ def __init__(self, context, request, view, manager): self.twitter_enabled = self.sheet.getProperty("twitter_enabled", True) self.twittvia = self.sheet.getProperty("twittvia", "") self.fb_enabled = self.sheet.getProperty("fb_enabled", True) + self.fb_typebutton = self.sheet.getProperty("fb_typebutton", "") self.fbaction = self.sheet.getProperty("fbaction", "") self.fbadmins = self.sheet.getProperty("fbadmins", "") self.gp_enabled = self.sheet.getProperty("gp_enabled", True) diff --git a/sc/social/like/profiles/default/propertiestool.xml b/sc/social/like/profiles/default/propertiestool.xml index 528d6ebe..e3432309 100644 --- a/sc/social/like/profiles/default/propertiestool.xml +++ b/sc/social/like/profiles/default/propertiestool.xml @@ -11,6 +11,7 @@ True True + True diff --git a/sc/social/like/profiles/to2000/propertiestool.xml b/sc/social/like/profiles/to2000/propertiestool.xml index 4f68dc91..eba9cc21 100644 --- a/sc/social/like/profiles/to2000/propertiestool.xml +++ b/sc/social/like/profiles/to2000/propertiestool.xml @@ -10,6 +10,7 @@ True True + False From deaafaaf05fff99ab8d756ff55a19d5f5cb03256 Mon Sep 17 00:00:00 2001 From: schminitz Date: Thu, 23 May 2013 15:31:28 +0200 Subject: [PATCH 3/3] Do not directly send url, let social networks use opengraph metatags refs #4892 --- .../like/browser/templates/sociallikes.pt | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/sc/social/like/browser/templates/sociallikes.pt b/sc/social/like/browser/templates/sociallikes.pt index 12c7574b..67490c77 100644 --- a/sc/social/like/browser/templates/sociallikes.pt +++ b/sc/social/like/browser/templates/sociallikes.pt @@ -14,40 +14,29 @@
  • - - - +
    + - -
    - - -
    -
    +