Threaded Replies

classic Classic list List threaded Threaded
4 messages Options
bas
Reply | Threaded
Open this post in threaded view
|

Threaded Replies

bas
Administrator
I added a threaded replies module, which indents comments based on which comment they are replying to. The code to enable it is:

require "site:/modules/threaded_replies/ThreadedReplies.luan"
Reply | Threaded
Open this post in threaded view
|

Re: Threaded Replies

fschmidt
Administrator
Thanks.  I will fix this up and then you can see the changes in Mercurial and then we can discuss this.  This is a good exercise to understand how things work.  I probably won't have time to work on this before Saturday.
Reply | Threaded
Open this post in threaded view
|

Re: Threaded Replies

fschmidt
Administrator
In reply to this post by bas
I committed changes.

I haven't worked with this code in a long time, so I made some changes to conform to what I do now.  In particular I now use longs for IDs.  This change breaks the database, so delete your current lucene.

You don't need to put everything in do-end blocks.  I use these blocks for small chunks of independent code to make this clear.

I changed your Post.luan to only add to my Post.luan .  This is critical if modules will be combined.  If code is replicated than modules can conflict.

I added Post.reply() and Thread.new_thread() to clean up the code.  This also makes the code more extensible.  And this eliminates the need for your Reply_page.luan which can be deleted.

Your code makes clear that my Thread_page.respond() is overcomplicated.  In particular my "unread" code is useless in the threaded case.  I should probably make an "unread" module which shouldn't be combined with "threaded_replies".  Then we can see how to clean up this part.

We can discuss this tomorrow.
Reply | Threaded
Open this post in threaded view
|

Re: Threaded Replies

fschmidt
Administrator
In reply to this post by bas
I finished making changes.  threaded_replies/Reply_page.luan and threaded_replies/Post.luan aren't needed and can be removed.