Updated management interface
authorThierry Florac <thierry.florac@onf.fr>
Mon, 18 Jan 2016 17:43:34 +0100
changeset 16 8c652535a9a2
parent 15 d498aa030d6b
child 17 eb468be7c127
Updated management interface
src/pyams_content/shared/news/zmi/__init__.py
src/pyams_content/shared/news/zmi/properties.py
--- a/src/pyams_content/shared/news/zmi/__init__.py	Mon Jan 18 17:42:56 2016 +0100
+++ b/src/pyams_content/shared/news/zmi/__init__.py	Mon Jan 18 17:43:34 2016 +0100
@@ -52,7 +52,7 @@
     def title(self):
         translate = self.request.localizer.translate
         return translate(_("News topic « {title} »")).format(
-            title=II18n(self.context).query_attribute('short_name', request=self.request))
+            title=II18n(self.context).query_attribute('title', request=self.request))
 
 
 @viewlet_config(name='add-shared-content.action', context=INewsManager, layer=IAdminLayer, view=Interface,
@@ -66,11 +66,11 @@
 
 
 @pagelet_config(name='add-shared-content.html', context=INewsManager, layer=IPyAMSLayer,
-                permission='pyams.CreateContent')
+                permission=CREATE_CONTENT_PERMISSION)
 class NewsEventAddForm(SharedContentAddForm):
     """News event add form"""
 
-    legend = _("Add new news topic")
+    legend = _("Add news topic")
 
 
 @view_config(name='add-shared-content.json', context=INewsManager, request_type=IPyAMSLayer,
--- a/src/pyams_content/shared/news/zmi/properties.py	Mon Jan 18 17:42:56 2016 +0100
+++ b/src/pyams_content/shared/news/zmi/properties.py	Mon Jan 18 17:43:34 2016 +0100
@@ -21,11 +21,11 @@
 from pyams_skin.layer import IPyAMSLayer
 
 # import packages
-from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm
-from pyams_form.form import InnerEditForm
+from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm, \
+    SharedContentPropertiesSummaryDisplayForm
 from pyams_utils.adapter import adapter_config
+from pyams_zmi.form import InnerAdminEditForm, InnerAdminDisplayForm
 from z3c.form import field
-from zope.interface import implementer
 
 from pyams_content import _
 
@@ -33,11 +33,22 @@
 @adapter_config(name='publication',
                 context=(IWfNewsEvent, IPyAMSLayer, SharedContentPropertiesEditForm),
                 provides=IInnerSubForm)
-@implementer(IInnerSubForm)
-class NewsEventPropertiesEditForm(InnerEditForm):
+class NewsEventPropertiesEditForm(InnerAdminEditForm):
     """News event properties edit form extension"""
 
     legend = _("Publication settings")
     fieldset_class = 'bordered no-x-margin margin-y-10'
 
     fields = field.Fields(IWfNewsEvent).select('displayed_publication_date', 'push_end_date')
+
+
+@adapter_config(name='publication-summary',
+                context=(IWfNewsEvent, IPyAMSLayer, SharedContentPropertiesSummaryDisplayForm),
+                provides=IInnerSubForm)
+class NewsEventPropertiesSummaryDisplayForm(InnerAdminDisplayForm):
+    """News event properties summary display form"""
+
+    legend = _("Publication settings")
+    fields = field.Fields(IWfNewsEvent).select('displayed_publication_date', 'push_end_date')
+
+    weight = 50