Added Facebook account and application ID
authorThierry Florac <thierry.florac@onf.fr>
Mon, 21 Jan 2019 17:43:30 +0100
changeset 1247 2b1abe98ff47
parent 1246 e36091c14393
child 1248 2419d4bad22b
Added Facebook account and application ID
src/pyams_content/features/share/container.py
src/pyams_content/features/share/interfaces.py
src/pyams_content/features/share/zmi/container.py
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po
src/pyams_content/locales/pyams_content.pot
--- a/src/pyams_content/features/share/container.py	Fri Jan 18 15:42:19 2019 +0100
+++ b/src/pyams_content/features/share/container.py	Mon Jan 21 17:43:30 2019 +0100
@@ -34,6 +34,8 @@
 
     twitter_account = FieldProperty(ISocialShareInfo['twitter_account'])
     twitter_creator_account = FieldProperty(ISocialShareInfo['twitter_creator_account'])
+    fb_account = FieldProperty(ISocialShareInfo['fb_account'])
+    fb_app_id = FieldProperty(ISocialShareInfo['fb_app_id'])
 
 
 @adapter_config(context=ISocialShareManagerTarget, provides=ISocialShareInfo)
--- a/src/pyams_content/features/share/interfaces.py	Fri Jan 18 15:42:19 2019 +0100
+++ b/src/pyams_content/features/share/interfaces.py	Mon Jan 21 17:43:30 2019 +0100
@@ -40,6 +40,14 @@
                                                      "will be used"),
                                        required=False)
 
+    fb_account = TextLine(title=_("Facebook account"),
+                          description=_("Complete URL of Facebook account used for content attribution"),
+                          required=False)
+
+    fb_app_id = TextLine(title=_("Facebook AppID"),
+                         description=_("ID of a Facebook App matching your web site"),
+                         required=False)
+
 
 class ISocialShareItem(Interface):
     """Social network share item interface"""
--- a/src/pyams_content/features/share/zmi/container.py	Fri Jan 18 15:42:19 2019 +0100
+++ b/src/pyams_content/features/share/zmi/container.py	Mon Jan 21 17:43:30 2019 +0100
@@ -223,7 +223,11 @@
 
     def updateGroups(self):
         self.add_group(NamedWidgetsGroup(self, 'twitter', self.widgets,
-                                         getFieldNamesInOrder(ISocialShareInfo),
+                                         ('twitter_account', 'twitter_creator_account'),
                                          legend=_("Twitter account"),
                                          css_class='inner'))
+        self.add_group(NamedWidgetsGroup(self, 'facebook', self.widgets,
+                                         ('fb_account', 'fb_app_id'),
+                                         legend=_("Facebook account"),
+                                         css_class='inner'))
         super(SocialShareInfoEditForm, self).updateGroups()
Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed
--- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Fri Jan 18 15:42:19 2019 +0100
+++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Mon Jan 21 17:43:30 2019 +0100
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2019-01-17 18:03+0100\n"
+"POT-Creation-Date: 2019-01-21 16:50+0100\n"
 "PO-Revision-Date: 2015-09-10 10:42+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -155,7 +155,7 @@
 #: src/pyams_content/component/paragraph/interfaces/audio.py:46
 #: src/pyams_content/component/paragraph/interfaces/verbatim.py:44
 #: src/pyams_content/component/video/interfaces.py:42
-#: src/pyams_content/shared/resource/interfaces.py:66
+#: src/pyams_content/shared/resource/interfaces.py:65
 msgid "Author"
 msgstr "Auteur"
 
@@ -1308,7 +1308,7 @@
 #: src/pyams_content/component/paragraph/interfaces/pictogram.py:46
 #: src/pyams_content/component/links/interfaces.py:43
 #: src/pyams_content/shared/common/interfaces/types.py:59
-#: src/pyams_content/features/share/interfaces.py:67
+#: src/pyams_content/features/share/interfaces.py:75
 #: src/pyams_content/features/menu/interfaces.py:81
 msgid "Pictogram"
 msgstr "Pictogramme"
@@ -3401,7 +3401,7 @@
 #: src/pyams_content/shared/common/interfaces/types.py:43
 #: src/pyams_content/shared/form/interfaces.py:60
 #: src/pyams_content/shared/form/zmi/field.py:167
-#: src/pyams_content/features/share/interfaces.py:54
+#: src/pyams_content/features/share/interfaces.py:62
 #: src/pyams_content/features/share/zmi/container.py:155
 #: src/pyams_content/features/menu/zmi/__init__.py:218
 msgid "Label"
@@ -3737,120 +3737,120 @@
 msgid "Maximum age"
 msgstr "Âge maximum"
 
-#: src/pyams_content/shared/resource/interfaces.py:31
+#: src/pyams_content/shared/resource/interfaces.py:30
 msgid "Resource"
 msgstr "Ressource"
 
-#: src/pyams_content/shared/resource/interfaces.py:60
+#: src/pyams_content/shared/resource/interfaces.py:59
 msgid "Original country"
 msgstr "Pays d'origine"
 
-#: src/pyams_content/shared/resource/interfaces.py:63
+#: src/pyams_content/shared/resource/interfaces.py:62
 msgid "Original title"
 msgstr "Titre original"
 
-#: src/pyams_content/shared/resource/interfaces.py:69
+#: src/pyams_content/shared/resource/interfaces.py:68
 msgid "Translator"
 msgstr "Traducteur"
 
-#: src/pyams_content/shared/resource/interfaces.py:72
+#: src/pyams_content/shared/resource/interfaces.py:71
 msgid "Illustrator"
 msgstr "Illustrateur"
 
-#: src/pyams_content/shared/resource/interfaces.py:75
+#: src/pyams_content/shared/resource/interfaces.py:74
 msgid "Drawer"
 msgstr "Dessinateur"
 
-#: src/pyams_content/shared/resource/interfaces.py:78
+#: src/pyams_content/shared/resource/interfaces.py:77
 msgid "Colourist"
 msgstr "Coloriste"
 
-#: src/pyams_content/shared/resource/interfaces.py:81
+#: src/pyams_content/shared/resource/interfaces.py:80
 msgid "Lettering"
 msgstr "Lettrage"
 
-#: src/pyams_content/shared/resource/interfaces.py:84
+#: src/pyams_content/shared/resource/interfaces.py:83
 msgid "Producer"
 msgstr "Producteur"
 
-#: src/pyams_content/shared/resource/interfaces.py:87
+#: src/pyams_content/shared/resource/interfaces.py:86
 msgid "Director"
 msgstr "Réalisateur"
 
-#: src/pyams_content/shared/resource/interfaces.py:90
+#: src/pyams_content/shared/resource/interfaces.py:89
 msgid "Actors"
 msgstr "Acteurs"
 
-#: src/pyams_content/shared/resource/interfaces.py:93
+#: src/pyams_content/shared/resource/interfaces.py:92
 msgid "Editor"
 msgstr "Éditeur"
 
-#: src/pyams_content/shared/resource/interfaces.py:96
+#: src/pyams_content/shared/resource/interfaces.py:95
 msgid "Collection"
 msgstr "Collection"
 
-#: src/pyams_content/shared/resource/interfaces.py:99
+#: src/pyams_content/shared/resource/interfaces.py:98
 msgid "Series"
 msgstr "Série"
 
-#: src/pyams_content/shared/resource/interfaces.py:102
+#: src/pyams_content/shared/resource/interfaces.py:101
 msgid "Volume"
 msgstr "Volume"
 
-#: src/pyams_content/shared/resource/interfaces.py:105
+#: src/pyams_content/shared/resource/interfaces.py:104
 msgid "Format"
 msgstr "Format"
 
-#: src/pyams_content/shared/resource/interfaces.py:108
+#: src/pyams_content/shared/resource/interfaces.py:107
 msgid "Nb pages"
 msgstr "Nombre de pages"
 
-#: src/pyams_content/shared/resource/interfaces.py:112
+#: src/pyams_content/shared/resource/interfaces.py:111
 msgid "Duration"
 msgstr "Durée"
 
-#: src/pyams_content/shared/resource/interfaces.py:115
+#: src/pyams_content/shared/resource/interfaces.py:114
 msgid "Age range"
 msgstr "Tranche d'âge"
 
-#: src/pyams_content/shared/resource/interfaces.py:118
+#: src/pyams_content/shared/resource/interfaces.py:117
 msgid "Release year"
 msgstr "Année de parution"
 
-#: src/pyams_content/shared/resource/interfaces.py:122
+#: src/pyams_content/shared/resource/interfaces.py:121
 msgid "Awards"
 msgstr "Récompenses"
 
-#: src/pyams_content/shared/resource/interfaces.py:125
+#: src/pyams_content/shared/resource/interfaces.py:124
 msgid "Editor reference"
 msgstr "Référence chez l'éditeur"
 
-#: src/pyams_content/shared/resource/interfaces.py:128
+#: src/pyams_content/shared/resource/interfaces.py:127
 msgid "ISBN number"
 msgstr "Numéro ISBN"
 
-#: src/pyams_content/shared/resource/interfaces.py:131
+#: src/pyams_content/shared/resource/interfaces.py:130
 msgid "Price"
 msgstr "Prix"
 
-#: src/pyams_content/shared/resource/interfaces.py:135
+#: src/pyams_content/shared/resource/interfaces.py:134
 msgid "Source URI"
 msgstr "URI source"
 
-#: src/pyams_content/shared/resource/interfaces.py:136
+#: src/pyams_content/shared/resource/interfaces.py:135
 msgid "External URL used to get more information about resource"
 msgstr ""
 "URI externe utilisée pour accéder à plus d'informations sur la ressource"
 
-#: src/pyams_content/shared/resource/interfaces.py:139
+#: src/pyams_content/shared/resource/interfaces.py:138
 msgid "Summary"
 msgstr "Sommaire"
 
-#: src/pyams_content/shared/resource/interfaces.py:142
+#: src/pyams_content/shared/resource/interfaces.py:141
 msgid "Synopsis"
 msgstr "Synopsis"
 
-#: src/pyams_content/shared/resource/interfaces.py:145
+#: src/pyams_content/shared/resource/interfaces.py:144
 msgid "Publisher's words"
 msgstr "Le mot du site"
 
@@ -5840,23 +5840,40 @@
 "utilisé pour l'attribution des contenus ; si aucun compte n'est indiqué, "
 "c'est le compte général qui sera utilisé"
 
-#: src/pyams_content/features/share/interfaces.py:49
+#: src/pyams_content/features/share/interfaces.py:43
+#: src/pyams_content/features/share/zmi/container.py:231
+msgid "Facebook account"
+msgstr "Compte Facebook"
+
+#: src/pyams_content/features/share/interfaces.py:44
+msgid "Complete URL of Facebook account used for content attribution"
+msgstr "URL complète du compte Facebook utilisé pour l'attribution des contenus"
+
+#: src/pyams_content/features/share/interfaces.py:47
+msgid "Facebook AppID"
+msgstr "Application ID"
+
+#: src/pyams_content/features/share/interfaces.py:48
+msgid "ID of a Facebook App matching your web site"
+msgstr "ID d'une application Facebook correspondant à votre site"
+
+#: src/pyams_content/features/share/interfaces.py:57
 msgid "Active item?"
 msgstr "Partage actif ?"
 
-#: src/pyams_content/features/share/interfaces.py:50
+#: src/pyams_content/features/share/interfaces.py:58
 msgid "If 'no', selected item is inactive"
 msgstr "Si 'non', ce mode de partage est désactivé"
 
-#: src/pyams_content/features/share/interfaces.py:55
+#: src/pyams_content/features/share/interfaces.py:63
 msgid "This label will be associated to share link"
 msgstr "Ce libellé sera associé au lien de partage"
 
-#: src/pyams_content/features/share/interfaces.py:58
+#: src/pyams_content/features/share/interfaces.py:66
 msgid "Content share URL"
 msgstr "URL de partage"
 
-#: src/pyams_content/features/share/interfaces.py:59
+#: src/pyams_content/features/share/interfaces.py:67
 #, python-format
 msgid ""
 "URL used to share this content on given network; {url} string will be "
@@ -5867,7 +5884,7 @@
 "remplacée automatiquement par l'URL canonique du contenu, et la chaîne "
 "« {title} » (si elle est indiquée) par son titre"
 
-#: src/pyams_content/features/share/interfaces.py:68
+#: src/pyams_content/features/share/interfaces.py:76
 msgid "Name of pictogram associated with this social network"
 msgstr "Pictogramme à associer à ce mode de partage"
 
--- a/src/pyams_content/locales/pyams_content.pot	Fri Jan 18 15:42:19 2019 +0100
+++ b/src/pyams_content/locales/pyams_content.pot	Mon Jan 21 17:43:30 2019 +0100
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2019-01-17 18:03+0100\n"
+"POT-Creation-Date: 2019-01-21 16:50+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -149,7 +149,7 @@
 #: ./src/pyams_content/component/paragraph/interfaces/audio.py:46
 #: ./src/pyams_content/component/paragraph/interfaces/verbatim.py:44
 #: ./src/pyams_content/component/video/interfaces.py:42
-#: ./src/pyams_content/shared/resource/interfaces.py:66
+#: ./src/pyams_content/shared/resource/interfaces.py:65
 msgid "Author"
 msgstr ""
 
@@ -1231,7 +1231,7 @@
 #: ./src/pyams_content/component/paragraph/interfaces/pictogram.py:46
 #: ./src/pyams_content/component/links/interfaces.py:43
 #: ./src/pyams_content/shared/common/interfaces/types.py:59
-#: ./src/pyams_content/features/share/interfaces.py:67
+#: ./src/pyams_content/features/share/interfaces.py:75
 #: ./src/pyams_content/features/menu/interfaces.py:81
 msgid "Pictogram"
 msgstr ""
@@ -3192,7 +3192,7 @@
 #: ./src/pyams_content/shared/common/interfaces/types.py:43
 #: ./src/pyams_content/shared/form/interfaces.py:60
 #: ./src/pyams_content/shared/form/zmi/field.py:167
-#: ./src/pyams_content/features/share/interfaces.py:54
+#: ./src/pyams_content/features/share/interfaces.py:62
 #: ./src/pyams_content/features/share/zmi/container.py:155
 #: ./src/pyams_content/features/menu/zmi/__init__.py:218
 msgid "Label"
@@ -3485,119 +3485,119 @@
 msgid "Maximum age"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:31
+#: ./src/pyams_content/shared/resource/interfaces.py:30
 msgid "Resource"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:60
+#: ./src/pyams_content/shared/resource/interfaces.py:59
 msgid "Original country"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:63
+#: ./src/pyams_content/shared/resource/interfaces.py:62
 msgid "Original title"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:69
+#: ./src/pyams_content/shared/resource/interfaces.py:68
 msgid "Translator"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:72
+#: ./src/pyams_content/shared/resource/interfaces.py:71
 msgid "Illustrator"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:75
+#: ./src/pyams_content/shared/resource/interfaces.py:74
 msgid "Drawer"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:78
+#: ./src/pyams_content/shared/resource/interfaces.py:77
 msgid "Colourist"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:81
+#: ./src/pyams_content/shared/resource/interfaces.py:80
 msgid "Lettering"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:84
+#: ./src/pyams_content/shared/resource/interfaces.py:83
 msgid "Producer"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:87
+#: ./src/pyams_content/shared/resource/interfaces.py:86
 msgid "Director"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:90
+#: ./src/pyams_content/shared/resource/interfaces.py:89
 msgid "Actors"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:93
+#: ./src/pyams_content/shared/resource/interfaces.py:92
 msgid "Editor"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:96
+#: ./src/pyams_content/shared/resource/interfaces.py:95
 msgid "Collection"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:99
+#: ./src/pyams_content/shared/resource/interfaces.py:98
 msgid "Series"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:102
+#: ./src/pyams_content/shared/resource/interfaces.py:101
 msgid "Volume"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:105
+#: ./src/pyams_content/shared/resource/interfaces.py:104
 msgid "Format"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:108
+#: ./src/pyams_content/shared/resource/interfaces.py:107
 msgid "Nb pages"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:112
+#: ./src/pyams_content/shared/resource/interfaces.py:111
 msgid "Duration"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:115
+#: ./src/pyams_content/shared/resource/interfaces.py:114
 msgid "Age range"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:118
+#: ./src/pyams_content/shared/resource/interfaces.py:117
 msgid "Release year"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:122
+#: ./src/pyams_content/shared/resource/interfaces.py:121
 msgid "Awards"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:125
+#: ./src/pyams_content/shared/resource/interfaces.py:124
 msgid "Editor reference"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:128
+#: ./src/pyams_content/shared/resource/interfaces.py:127
 msgid "ISBN number"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:131
+#: ./src/pyams_content/shared/resource/interfaces.py:130
 msgid "Price"
 msgstr ""
 
+#: ./src/pyams_content/shared/resource/interfaces.py:134
+msgid "Source URI"
+msgstr ""
+
 #: ./src/pyams_content/shared/resource/interfaces.py:135
-msgid "Source URI"
-msgstr ""
-
-#: ./src/pyams_content/shared/resource/interfaces.py:136
 msgid "External URL used to get more information about resource"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:139
+#: ./src/pyams_content/shared/resource/interfaces.py:138
 msgid "Summary"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:142
+#: ./src/pyams_content/shared/resource/interfaces.py:141
 msgid "Synopsis"
 msgstr ""
 
-#: ./src/pyams_content/shared/resource/interfaces.py:145
+#: ./src/pyams_content/shared/resource/interfaces.py:144
 msgid "Publisher's words"
 msgstr ""
 
@@ -5444,23 +5444,40 @@
 "attribution; if empty, general Twitter account will be used"
 msgstr ""
 
-#: ./src/pyams_content/features/share/interfaces.py:49
+#: ./src/pyams_content/features/share/interfaces.py:43
+#: ./src/pyams_content/features/share/zmi/container.py:231
+msgid "Facebook account"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:44
+msgid "Complete URL of Facebook account used for content attribution"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:47
+msgid "Facebook AppID"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:48
+msgid "ID of a Facebook App matching your web site"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:57
 msgid "Active item?"
 msgstr ""
 
-#: ./src/pyams_content/features/share/interfaces.py:50
-msgid "If 'no', selected item is inactive"
-msgstr ""
-
-#: ./src/pyams_content/features/share/interfaces.py:55
-msgid "This label will be associated to share link"
-msgstr ""
-
 #: ./src/pyams_content/features/share/interfaces.py:58
+msgid "If 'no', selected item is inactive"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:63
+msgid "This label will be associated to share link"
+msgstr ""
+
+#: ./src/pyams_content/features/share/interfaces.py:66
 msgid "Content share URL"
 msgstr ""
 
-#: ./src/pyams_content/features/share/interfaces.py:59
+#: ./src/pyams_content/features/share/interfaces.py:67
 #, python-format
 msgid ""
 "URL used to share this content on given network; {url} string will be "
@@ -5468,7 +5485,7 @@
 " (if required)"
 msgstr ""
 
-#: ./src/pyams_content/features/share/interfaces.py:68
+#: ./src/pyams_content/features/share/interfaces.py:76
 msgid "Name of pictogram associated with this social network"
 msgstr ""