diff farol/producttree.py @ 106:4ea7966dcc99

Show where a Product is referenced in the Document.
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 14 Oct 2014 16:52:55 +0200
parents 0b9f19f51d79
children 5e9237340630
line wrap: on
line diff
--- a/farol/producttree.py	Tue Oct 14 14:36:31 2014 +0200
+++ b/farol/producttree.py	Tue Oct 14 16:52:55 2014 +0200
@@ -144,7 +144,9 @@
         product = cvrf.getProductForID(productid)
     except IndexError:
         abort(404)
-    return render_template('producttree/view_product.j2', product=product, cvrf=cvrf)
+    return render_template('producttree/view_product.j2',
+        product=product, groups=[g for g in cvrf._producttree._groups if productid in g._productids],
+        cvrf=cvrf)
 
 @producttree.route('/product/<productid>/edit', methods=['GET', 'POST'])
 @document_required

http://farol.wald.intevation.org