#2911 closed enhancement (fixed)
RFE: Add Ability to Define a Default Display Mode
Reported by: | Owned by: | Radek Bartoň | |
---|---|---|---|
Priority: | normal | Component: | DiscussionPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Right now the forum defaults to a tree view, which can get crowded towards the right side of the screen after a while. It would be really nice if administrators could control the default display mode. I read through the code base, and I think I found where the default mode is set:
http://trac-hacks.org/browser/discussionplugin/0.11/tracdiscussion/api.py#L763
Attachments (0)
Change History (4)
comment:1 Changed 17 years ago by
Status: | new → assigned |
---|---|
Summary: | Add Ability to Define a Default Display Mode → RFE: Add Ability to Define a Default Display Mode |
comment:2 Changed 17 years ago by
Cool, I successfully isolated the right line of code. The more I read, the better I'm getting at this Python stuff. I still wouldn't feel safe trying to make a really big change - I'm liable to break something!
In the mean time, I managed to make an ugly nasty evil hack to do what I wanted by reorganizing the structure of that if-elseif-else block:
# Prepare display of messages. display = context.req.session.get('message-list-display') self.data['display'] = display if display == 'flat-asc': self.data['messages'] = self.get_flat_messages(context, topic['id'], visit_time) elif display == 'flat-desc': self.data['messages'] = self.get_flat_messages(context, topic['id'], visit_time, 'ORDER BY time DESC') elif display == 'tree': self.data['messages'] = self.get_messages(context, topic['id'], visit_time) else: self.data['messages'] = self.get_flat_messages(context, topic['id'], visit_time)
I would not suggest it for anything beyond my site (which didn't blow up, so I guess it works).
comment:3 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Implemented in r3518.
Ok. Actually the modification should be done at http://trac-hacks.org/browser/discussionplugin/0.11/tracdiscussion/api.py#L764 where will be test if display type is present in session and if not loaded from configuration option which will be defined at the top...