Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1757 closed enhancement (invalid)

make tracnav friendly to wikinegotiator

Reported by: phpxcache Owned by: Alec Thomas
Priority: normal Component: TracHacks
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

see #1756

  • tracnav/tracnav.py

     
    121121        #needed several times
    122122        self.preview = req.args.get('preview', '')
    123123        self.curpage = req.args.get('page', 'WikiStart')
     124        self.curpagename = req.args.get('page_name')
     125        self.curpagelang = req.args.get('page_langsuffix')
    124126        self.modify = req.perm.has_permission('WIKI_MODIFY')
    125127
    126128        # parse arguments
     
    138140        Fetch the wiki page containing the toc, if available.
    139141        """
    140142        if self.preview and name == self.curpage:
    141             return self.req.args.get('text', '')
     143            return self.req.args.get('text', ''), name
     144        elif self.curpagelang and WikiSystem(self.env).has_page(name + '.' + self.curpagelang):
     145            name = name + '.' + self.curpagelang
     146            return WikiPage(self.env, name).text, name
    142147        elif WikiSystem(self.env).has_page(name):
    143             return WikiPage(self.env, name).text
     148            return WikiPage(self.env, name).text, name
    144149        else:
    145             return ''
     150            return '', name
    146151
    147152    def get_toc_entry(self, toc_text):
    148153        """
     
    223228
    224229        # add TOCs
    225230        for name in (self.names or ["TOC"]):
    226             toc = self.parse_toc(self.get_toc(name))
     231            toc, name = self.get_toc(name)
     232            toc = self.parse_toc(toc)
    227233            if not toc:
    228234                toc = self.parse_toc(' * TOC "%s" is empty!' % name)
    229235            found, filtered = self.filter_toc(toc)
     
    243249        result = []
    244250        for name, title, sub in toc:
    245251            if sub == None:
    246                 if name == self.curpage:
     252                if name == self.curpage or self.curpagename and name == self.curpagename:
    247253                    found = True
    248254                result.append((name, title, None))
    249255            else:
     
    273279        for name, title, sub in toc:
    274280            li_style = ' style="padding-left: %dem;"' % (depth + 1)
    275281            if sub == None:
    276                 if name == self.curpage:
     282                if name == self.curpage or self.curpagename and name == self.curpagename:
    277283                    cls = ' class="active"'
    278284                else:
    279285                    cls = ''

(i cannot find tracnav component)

Attachments (0)

Change History (2)

comment:1 Changed 17 years ago by Alec Thomas

Resolution: invalid
Status: newclosed

If you can't find it, what makes you think it's on TracHacks, and why would I be able to find it?

comment:2 Changed 17 years ago by phpxcache

as i saw it in http://trac-hacks.org/wiki/TracNav. but sorry for my careless

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.