plone.app.discussion/moderation: Show email in moderation view

ksuess <jenkins-z4DKO/[email protected]> Fri, 28 Jul 2017 12:34:09 -0700 (PDT)
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: plone.app.discussion
Branch: refs/heads/moderation
Date: 2017-07-28T19:12:01Z
Author: Katja Süss (ksuess) <[email protected]>
Commit: https://github.com/plone/plone.app.discussion/commit/8e344cbf2b672dc3cdfcd103f79c2dcdde9e216a

Show email in moderation view

Files changed:
M CHANGES.rst
M plone/app/discussion/browser/moderation.pt
M plone/app/discussion/profiles/default/catalog.xml
M plone/app/discussion/upgrades.py
M plone/app/discussion/upgrades.zcml

diff --git a/CHANGES.rst b/CHANGES.rst
index 17628e74..b646add8 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -14,6 +14,8 @@ New features:
 
 Bug fixes:
 
+- Show email in moderation view [ksuess]
+
 - Remove plone.app.robotframework extras (reload and ride).
   They are not needed and they are not Python 3 compatible.
   [gforcada]
diff --git a/plone/app/discussion/browser/moderation.pt b/plone/app/discussion/browser/moderation.pt
index d89fff09..13936c9a 100644
--- a/plone/app/discussion/browser/moderation.pt
+++ b/plone/app/discussion/browser/moderation.pt
@@ -103,7 +103,10 @@
                                     <input type="hidden" name="selected_obj_paths:list" value="#"
                                            tal:attributes="value item/getURL" />
                                 </td>
-                                <td tal:content="python:item.author_name or item.Creator" />
+										  <td>
+										  		<span tal:content="python:item.author_name or item.Creator">Name</span>
+												<div tal:condition="item/author_email"><a tal:attributes="href string:mailto:${item/author_email}" tal:content="item/author_email">Email</a></div>
+										  </td>
                                 <td tal:content="python:toLocalizedTime(item.ModificationDate, long_format=1)" />
                                 <td>
                                     <a tal:attributes="href item/getURL"
diff --git a/plone/app/discussion/profiles/default/catalog.xml b/plone/app/discussion/profiles/default/catalog.xml
index 3dbd4f9c..a911f510 100644
--- a/plone/app/discussion/profiles/default/catalog.xml
+++ b/plone/app/discussion/profiles/default/catalog.xml
@@ -14,5 +14,6 @@
     <column value="commentators" />
     <column value="in_response_to" />
     <column value="author_name" />
+    <column value="author_email" />
 
 </object>
diff --git a/plone/app/discussion/upgrades.py b/plone/app/discussion/upgrades.py
index 8d4083e2..56a4e5f0 100644
--- a/plone/app/discussion/upgrades.py
+++ b/plone/app/discussion/upgrades.py
@@ -61,3 +61,7 @@ def upgrade_comment_workflows(context):
             comment.reindexObjectSecurity()
         except (AttributeError, KeyError):
             logger.info('Could not reindex comment %s' % brain.getURL())
+
+
+def update_catalog(context):
+    context.runImportStepFromProfile(default_profile, 'catalog')
\ No newline at end of file
diff --git a/plone/app/discussion/upgrades.zcml b/plone/app/discussion/upgrades.zcml
index 9fa258c6..5b660c41 100644
--- a/plone/app/discussion/upgrades.zcml
+++ b/plone/app/discussion/upgrades.zcml
@@ -50,5 +50,15 @@
         handler=".upgrades.upgrade_comment_workflows"
         />
   </genericsetup:upgradeSteps>
+  
+  <genericsetup:upgradeStep
+      title="show email in moderation view"
+      description="reload catalog config to add author_email in metadata.'"
+      source="1000"
+      destination="1001"
+      handler=".upgrades.update_catalog"
+      sortkey="1"
+      profile="plone.app.discussion:default"
+      />
 
 </configure>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot