Modify

Opened 10 years ago

Closed 10 years ago

Last modified 3 years ago

#1347 closed enhancement (duplicate)

For each wanted page list the page on which it is referenced

Reported by: Gregory Burd <gburd@…> Owned by: Justin Francis
Priority: normal Component: WantedPagesMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Each item in the wanted pages list is a wiki term that does not yet have a page. I thought it would be nice to list the page or pages on which that term is used. This makes it much easier to go back and review the use of the term before creating the page. In some cases the term shouldn't really be a wiki term so this helps you find those mistaken terms and escape them with the '!' prefix.

Here is the patch:

Index: wanted_pages/wanted_pages.py =================================================================== --- wanted_pages/wanted_pages.py (revision 2103) +++ wanted_pages/wanted_pages.py (working copy) @@ -49,9 +49,16 @@

pages = self.findBrokenLinks(texts, req).values()

wikiList =

+ referers =

pages.sort() for page in pages:

  • wikiList += (' * %s\n' % page)

+ referers = + db = self.env.get_db_cnx() + cursor = db.cursor() + cursor.execute("select name n from wiki where text like '%" + page + "%' and version = (select max(version) from wiki where name = n)") + for (name) in cursor: + referers += (' %s? ' % name) + wikiList += " * " + page + " (" + referers + ")\n"

return wiki_to_html(wikiList, self.env, req)

Attachments (0)

Change History (2)

comment:1 Changed 10 years ago by Justin Francis

Resolution: duplicate
Status: newclosed

Thanks for the patch. I have added it to #714 and marked this as a duplicate of that ticket.

comment:2 Changed 3 years ago by Ryan J Ollos

Component: WantedPagesPluginWantedPagesMacro

Renaming plugin from WantedPagesPlugin to WantedPagesMacro.

Modify Ticket

Action
as closed The owner will remain Justin Francis.
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.