Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: includes/product-topics-accordion.tmpl

Issue 29754555: Noissue - Use selectattr() filter to filter page metadata
Patch Set: Created April 17, 2018, 6:18 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | templates/product-home.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: includes/product-topics-accordion.tmpl
diff --git a/includes/product-topics-accordion.tmpl b/includes/product-topics-accordion.tmpl
index c705a5e83aece1638efddd555981a8df70024b2d..77d6973efedbc4af84838f76b0c4ee24aefd368e 100644
--- a/includes/product-topics-accordion.tmpl
+++ b/includes/product-topics-accordion.tmpl
@@ -1,6 +1,8 @@
<dl id="product-topics-accordion" class="accordion">
{% for category in product.help_categories %}
- {% set articles = get_pages_metadata({ "product_id": product_id, "template": "article", "category": category.name }) %}
+ {% set articles = get_pages_metadata()|selectattr("product_id", "equalto", product_id)
+ |selectattr("template", "equalto", "article")
+ |selectattr("category", "equalto", category.name)|list %}
{% if articles %}
<dt role="heading" aria-level="3" class="accordion-heading">
<button aria-expanded="true" aria-controls="sect-{{ category.slug }}" id="heading-{{ category.slug }}" class="accordion-toggle-button">
« no previous file with comments | « no previous file | templates/product-home.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld