Mercurial > moin > 2.0
changeset 2272:b1c0a532235d
Added fqname support to wanteds and orphans view.
author | Ashutosh Singla <ashu1461@gmail.com> |
---|---|
date | Sat, 14 Sep 2013 02:00:50 +0530 |
parents | 8db46c3b7760 |
children | a8e67947f130 |
files | MoinMoin/apps/frontend/views.py |
diffstat | 1 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py Sat Sep 14 01:05:40 2013 +0530 +++ b/MoinMoin/apps/frontend/views.py Sat Sep 14 02:00:50 2013 +0530 @@ -1060,17 +1060,24 @@ def _compute_item_sets(): """ - compute sets of existing, linked, transcluded and no-revision item names + compute sets of existing, linked, transcluded and no-revision item fqnames """ linked = set() transcluded = set() existing = set() revs = flaskg.storage.documents(wikiname=app.cfg.interwikiname) for rev in revs: - existing.add(rev.name) + existing |= set(rev.fqnames) linked.update(rev.meta.get(ITEMLINKS, [])) transcluded.update(rev.meta.get(ITEMTRANSCLUSIONS, [])) - return existing, linked, transcluded + return existing, set(split_fqname_list(linked)), set(split_fqname_list(transcluded)) + + +def split_fqname_list(names): + """ + Converts a list of names to a list of fqnames. + """ + return [split_fqname(name) for name in names] @frontend.route('/+wanteds') @@ -1087,7 +1094,7 @@ return render_template('link_list_no_item_panel.html', headline=_(u'Wanted Items'), title_name=title_name, - item_names=wanteds) + fq_names=wanteds) @frontend.route('/+orphans') @@ -1103,7 +1110,7 @@ return render_template('link_list_no_item_panel.html', title_name=title_name, headline=_(u'Orphaned Items'), - item_names=orphans) + fq_names=orphans) @frontend.route('/+quicklink/<itemname:item_name>')