plone.app.discussion/moderation: Make moderation view changes less invasive.

ksuess <jenkins-z4DKO/[email protected]> Fri, 28 Jul 2017 12:34:18 -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:47Z
Author: Katja Süss (ksuess) <[email protected]>
Commit: https://github.com/plone/plone.app.discussion/commit/fb7c68d5e5781500cdd6cf7ce04076ed3ef3edc2

Make moderation view changes less invasive.

Files changed:
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/plone/app/discussion/browser/moderation.pt b/plone/app/discussion/browser/moderation.pt
index b76c98de..24b2fe67 100644
--- a/plone/app/discussion/browser/moderation.pt
+++ b/plone/app/discussion/browser/moderation.pt
@@ -88,7 +88,8 @@
                     <tbody>
                         <tal:block repeat="item batch">
                             <tr class="commentrow"
-                                tal:define="even repeat/item/even"
+                                tal:define="even repeat/item/even;
+                                   email python:getattr(item.getObject(), 'author_email')"
                                 tal:attributes="class python: even and 'odd' or 'even'">
                                 <td class="notDraggable">
                                     <input type="checkbox"
@@ -105,11 +106,12 @@
                                 </td>
                                 <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>
+                                    <tal:email tal:condition="email"><br /><a 
+                                        tal:attributes="href string:mailto:$email"
+                                        tal:content="email">Email</a></tal:email>
                                 </td>
-                                <td tal:content="python:toLocalizedTime(item.ModificationDate, long_format=1)" />
+                                <td tal:content="python:toLocalizedTime(item.ModificationDate, 
+                                      long_format=1)" />
                                 <td>
                                     <a tal:attributes="href item/getURL"
                                        tal:content="item/in_response_to" />
diff --git a/plone/app/discussion/profiles/default/catalog.xml b/plone/app/discussion/profiles/default/catalog.xml
index a911f510..3dbd4f9c 100644
--- a/plone/app/discussion/profiles/default/catalog.xml
+++ b/plone/app/discussion/profiles/default/catalog.xml
@@ -14,6 +14,5 @@
     <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 7db3ebf7..8d4083e2 100644
--- a/plone/app/discussion/upgrades.py
+++ b/plone/app/discussion/upgrades.py
@@ -61,7 +61,3 @@ 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')
diff --git a/plone/app/discussion/upgrades.zcml b/plone/app/discussion/upgrades.zcml
index 5b660c41..9fa258c6 100644
--- a/plone/app/discussion/upgrades.zcml
+++ b/plone/app/discussion/upgrades.zcml
@@ -50,15 +50,5 @@
         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