#188 — List comments in reverse order

by (anonymous) — last modified Jan 07, 2009 11:45 AM
State Unconfirmed
Version:
Area Functionality
Issue type Patch
Severity Low
Submitted by (anonymous)
Submitted on Sep 05, 2008
Responsible
Target release:
I need to present the comments in a conversation in reverse order, i.e. the most recent first. I think this is a much needed feature. I made a few modifications to the 2.0 code. Find the changes included below, just in case somebody needs it, or for the maintainers to merge. Please criticise or correct as needed.

Best regards and thank you for the great product.


Steps to get the functionality:

1. Modify

Add this at around line 109 ( new method in class ConversationView ):

    def comments_reverse(self):
        batchSize = 30
        batchStart = int(self.request.get('b_start', 0))
        numComments = self.context.getNumberOfComments()
        return Batch(self._getComments_reverse, numComments, batchSize, batchStart, orphan=1)

2. in ZMI, Customise portal_skins/ploneboard_templates/conversation_view and change:

    <div class="boardConversation"
         metal:define-macro="view_comments"
- tal:define="batch view/comments">
+ tal:define="batch view/comments_reverse">


Apparently, it is working fine in a production site at the moment, and it does with previous content too. I think it would be good to add an option to switch this on/off at the forum level.

Pablo.


Added by (anonymous) on Sep 10, 2008 12:17 PM
bump++

I just started using PloneBoard and sort order is the very first feature I went looking to find.
Added by (anonymous) on Dec 13, 2008 02:24 AM
you forgot the function _getComments_reverse, didn't you?
Added by (anonymous) on Dec 15, 2008 12:13 AM
Hello! I am using ploneboard for 2 years and I am very happy with it. But I always missed an easy function, sorting the comments to reverse order. I am no python or plone expert (shame on me). Can anybody provide the missing parts of the above code? Thanks for this great product!
Steve.

No responses can be added.