Added "header" attribute to shared contents
authorThierry Florac <thierry.florac@onf.fr>
Tue, 28 Aug 2018 09:21:46 +0200
changeset 893 3eb9eb650335
parent 892 1d2f9975056e
child 894 e99bef811332
Added "header" attribute to shared contents
src/pyams_content/shared/common/__init__.py
src/pyams_content/shared/common/interfaces/__init__.py
src/pyams_content/shared/common/zmi/properties.py
--- a/src/pyams_content/shared/common/__init__.py	Tue Aug 28 09:21:20 2018 +0200
+++ b/src/pyams_content/shared/common/__init__.py	Tue Aug 28 09:21:46 2018 +0200
@@ -134,6 +134,7 @@
     creator = FieldProperty(IWfSharedContent['creator'])
     modifiers = FieldProperty(IWfSharedContent['modifiers'])
     last_modifier = FieldProperty(IWfSharedContent['last_modifier'])
+    header = FieldProperty(IWfSharedContent['header'])
     description = FieldProperty(IWfSharedContent['description'])
     keywords = FieldProperty(IWfSharedContent['keywords'])
     notepad = FieldProperty(IWfSharedContent['notepad'])
--- a/src/pyams_content/shared/common/interfaces/__init__.py	Tue Aug 28 09:21:20 2018 +0200
+++ b/src/pyams_content/shared/common/interfaces/__init__.py	Tue Aug 28 09:21:46 2018 +0200
@@ -151,10 +151,14 @@
     last_update_label = TextLine(title=_("Last update"),
                                  readonly=True)
 
-    description = I18nTextField(title=_("Description"),
+    header = I18nTextField(title=_("Header"),
+                           description=_("Content's header is generally displayed in page header"),
+                           required=False)
+
+    description = I18nTextField(title=_("Meta-description"),
                                 description=_("The content's description is 'hidden' into HTML's page headers; but it "
                                               "can be seen, for example, in some search engines results as content's "
-                                              "description"),
+                                              "description; if description is empty, content's header will be used."),
                                 required=False)
 
     keywords = TextLineListField(title=_("Keywords"),
--- a/src/pyams_content/shared/common/zmi/properties.py	Tue Aug 28 09:21:20 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/properties.py	Tue Aug 28 09:21:46 2018 +0200
@@ -83,7 +83,7 @@
     legend = _("Content properties")
 
     fields = field.Fields(IWfSharedContent).select('title', 'short_name', 'content_url',
-                                                   'description', 'notepad')
+                                                   'header', 'description', 'notepad')
     fields['title'].widgetFactory = I18nSEOTextLineFieldWidget
 
     def updateWidgets(self, prefix=None):