Modify

Opened 7 years ago

Closed 7 years ago

Last modified 6 months ago

#1347 closed enhancement (duplicate)

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

Reported by: Gregory Burd <gburd@…> Owned by: jfrancis
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 7 years ago by jfrancis

  • Resolution set to duplicate
  • Status changed from new to closed

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

comment:2 Changed 6 months ago by rjollos

  • Component changed from WantedPagesPlugin to WantedPagesMacro

Renaming plugin from WantedPagesPlugin to WantedPagesMacro.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from jfrancis. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.