Modify ↓
Opened 17 years ago
Closed 17 years ago
#2422 closed defect (fixed)
[patch] Discussion shows ctxtnav x 2 with Trac 0.11b1
Reported by: | osimons | Owned by: | Radek Bartoň |
---|---|---|---|
Priority: | normal | Component: | DiscussionPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Trac 0.11b1 now includes <div id="ctxtnav">...
by default. As the plugin also adds it for its own needs, it lists twice - one is empty, the other with content. It may not show well on a default Trac (other than some extra white space), but with custom styling of navigation it becomes very obvious.
Here is a patch for adding the items through code instead:
-
(a) api.py vs. (b) (clipboard)
a b 4 4 5 5 from trac.core import * 6 6 from trac.perm import PermissionError 7 from trac.web.chrome import add_stylesheet, add_script 7 from trac.web.chrome import add_stylesheet, add_script, add_ctxtnav 8 8 from trac.wiki.formatter import format_to_html, format_to_oneliner 9 9 from trac.util.datefmt import to_timestamp, to_datetime, utc, \ 10 10 format_datetime, pretty_timedelta … … 85 85 self.data['mode'] = modes[-1] 86 86 self.data['time'] = format_datetime(datetime.now(utc)) 87 87 self.data['realm'] = context.resource.realm 88 89 # Add Context Navigation. 90 if forum: 91 add_ctxtnav(context.req, 'Forum Index', 92 href=context.req.href.discussion()) 93 if topic: 94 add_ctxtnav(context.req, forum['subject'], 95 href=context.req.href.discussion(forum['id'])) 96 if message: 97 add_ctxtnav(context.req, topic['subject'], 98 href=context.req.href.discussion(forum['id'], topic['id'])) 88 99 89 100 # Add CSS styles and scripts. 90 101 add_stylesheet(context.req, 'common/css/wiki.css')
When that is implemented, it is just a matter of removing all the lines in all the templates, and removing the <xi:include href="wiki-discussion-header.html"/>
discussion-header.html
from the project as it is no longer needed as far as i can tell.
Attachments (0)
Note: See
TracTickets for help on using
tickets.
Thanks, finally Trac has common mechanism for context navigation. I have applied patch to source.