With [#1549], it's now possible to set sticky flag for a thread, but threads are not sorted by it actually. That's because:
class ForumController(DiscussionController): @expose('jinja:discussion/index.html') def index(self, threads=None, limit=None, page=0, count=0, **kw): if self.discussion.deleted and not has_artifact_access('configure', app=c.app)(): redirect(self.discussion.url()+'deleted') limit, page, start = g.handle_paging(limit, page) threads = DM.ForumThread.query.find(dict(discussion_id=self.discussion._id)).sort('mod_date', pymongo.DESCENDING) return super(ForumController, self).index(threads=threads.skip(start).limit(int(limit)).all(), limit=limit, page=page, count=threads.count(), **kw)
I.e., the list is sorted just on mod_date (which brings own problems, sent mail to the allura list), nothing else.
What should be said that there's Forum.threads property, which returns threads in the order according to flags, but in its turn, doesn't order by date. Also, its efficiency leaves much to be desired (it unions thread groups in python space).
So, something full-functional and efficient should be devised instead.
Originally by: *anonymous
mod_date sorting issue is ticketed as [#1565]
Related
Tickets:
#1565Last edit: Anonymous 2015-06-07
To verify: Create a thread, then set a Sticky flag on it via moderation pull-down dialog (pencil icon in title bar). Create few more threads. Ensure that Sticky one still stays on the top.
ps/1560