# HG changeset patch
# User Thierry Florac
# Date 1506948208 -7200
# Node ID 4a7679f7f16c86fd074193a9287c7df6fc461aa9
# Parent a94f92bb4839c46ae651e29e414caa5ac6c1974c
Updated review comments presentation
diff -r a94f92bb4839 -r 4a7679f7f16c src/pyams_content/shared/common/zmi/review.py
--- a/src/pyams_content/shared/common/zmi/review.py Fri Sep 29 16:23:09 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/review.py Mon Oct 02 14:43:28 2017 +0200
@@ -21,7 +21,7 @@
from pyams_content.shared.common.interfaces import IWfSharedContent
from pyams_security.interfaces import ISecurityManager
from pyams_security.interfaces.profile import IPublicProfile
-from pyams_skin.interfaces.viewlet import IContextActions
+from pyams_skin.interfaces.viewlet import IContextActions, IWidgetTitleViewletManager
from pyams_skin.layer import IPyAMSLayer
from pyams_zmi.interfaces.menu import IContentManagementMenu
from pyams_zmi.layer import IAdminLayer
@@ -34,9 +34,9 @@
from pyams_pagelet.pagelet import pagelet_config
from pyams_security.schema import PrincipalsSet
from pyams_skin.viewlet.menu import MenuItem
-from pyams_skin.viewlet.toolbar import ToolbarMenuItem
+from pyams_skin.viewlet.toolbar import ToolbarMenuItem, JsToolbarAction
from pyams_template.template import template_config, get_view_template
-from pyams_utils.date import get_age
+from pyams_utils.date import get_age, format_datetime
from pyams_utils.registry import get_utility, query_utility
from pyams_viewlet.viewlet import viewlet_config
from pyams_zmi.form import AdminDialogAddForm
@@ -192,10 +192,23 @@
def get_avatar(self, principal):
return IPublicProfile(principal).avatar
+ def get_date(self, comment):
+ return format_datetime(comment.creation_date)
+
def get_age(self, comment):
return get_age(comment.creation_date)
+@viewlet_config(name='add-review-comment.action', context=IWfSharedContent, layer=IAdminLayer,
+ view=SharedContentReviewCommentsView, manager=IWidgetTitleViewletManager,
+ permission=COMMENT_CONTENT_PERMISSION)
+class SharedContentReviewAddCommentAction(JsToolbarAction):
+ """Shared content review add comment action"""
+
+ label = _("Add comment...")
+ url = 'PyAMS_content.review.addCommentAction'
+
+
@view_config(name='get-last-review-comments.json', context=IWfSharedContent, request_type=IPyAMSLayer,
permission=COMMENT_CONTENT_PERMISSION, renderer='json', xhr=True)
@template_config(template='templates/review-comments-json.pt')
diff -r a94f92bb4839 -r 4a7679f7f16c src/pyams_content/shared/common/zmi/templates/review-add-comment.pt
--- a/src/pyams_content/shared/common/zmi/templates/review-add-comment.pt Fri Sep 29 16:23:09 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/templates/review-add-comment.pt Mon Oct 02 14:43:28 2017 +0200
@@ -8,8 +8,19 @@
- just now
- Owner
+
+
+ Review query from
+
+ Owner
+
+
+ (as reviewer)
+
+ just now
+
diff -r a94f92bb4839 -r 4a7679f7f16c src/pyams_content/shared/common/zmi/templates/review-comments-json.pt
--- a/src/pyams_content/shared/common/zmi/templates/review-comments-json.pt Fri Sep 29 16:23:09 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/templates/review-comments-json.pt Mon Oct 02 14:43:28 2017 +0200
@@ -9,8 +9,22 @@
- age
- Owner
+
+
+ Review query from
+
+ Owner
+
+
+ (as reviewer)
+
+ age
+
diff -r a94f92bb4839 -r 4a7679f7f16c src/pyams_content/shared/common/zmi/templates/review-comments.pt
--- a/src/pyams_content/shared/common/zmi/templates/review-comments.pt Fri Sep 29 16:23:09 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/templates/review-comments.pt Mon Oct 02 14:43:28 2017 +0200
@@ -26,8 +26,22 @@
- age
- Owner
+
+
+ Review query from
+
+ Owner
+
+
+ (as reviewer)
+
+ age
+
diff -r a94f92bb4839 -r 4a7679f7f16c src/pyams_content/shared/common/zmi/templates/review-notification.pt
--- a/src/pyams_content/shared/common/zmi/templates/review-notification.pt Fri Sep 29 16:23:09 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/templates/review-notification.pt Mon Oct 02 14:43:28 2017 +0200
@@ -7,21 +7,45 @@
+
Hello,
- You have been requested by sender
- to make a review of a content called « title »
- which has been created on publication platform « Service name ».
+ You have been requested by sender , contributor
+ of « Service name »
+ website, to make a review of a content.
- Comment associated with this request is:
+
+ sender added the following message to his
+ request:
+
comment
To review and comment this publication, please use the following link:
+ tal:content="i18n:context.title">.
+ After reading this content, please use the « Comments » menu entry.
+ If you don't want to reply to this request, please contact
+ sender directly by replying to this mail.
+ Thank you.
- signature
+ signature