summaryrefslogtreecommitdiff
path: root/templates/packages/details_depend.html.jinja
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2015-04-12 09:50:13 -0500
committerDan McGee <dan@archlinux.org>2015-04-12 09:50:13 -0500
commita2b020ed3554b47c0b27982cf47431126c103ef4 (patch)
treeaf079b96a1eae0cb464028d9322ff7236c971560 /templates/packages/details_depend.html.jinja
parent57198b5cb45fb390b2fa75faff371d323de27dab (diff)
Add true parameter to Jinja2 default filter
We need this to make it act more like the Django filter, which prints the default value not only when the variable is undefined, but also when it evaluates to being false (such as a None value). Noticed by felixonmars on packages that provided other packages; None was always showing as the comparison operator. More embarrassing is that our file lists were always showing 'None' concatenated onto all directory entries. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/packages/details_depend.html.jinja')
-rw-r--r--templates/packages/details_depend.html.jinja6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/packages/details_depend.html.jinja b/templates/packages/details_depend.html.jinja
index 404793b6..a2d3a010 100644
--- a/templates/packages/details_depend.html.jinja
+++ b/templates/packages/details_depend.html.jinja
@@ -1,8 +1,8 @@
{% import 'packages/details_link.html.jinja' as details %}<li>{% if depend.pkg == None %}
-{% if depend.providers %}{{ depend.dep.name }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }} <span class="virtual-dep">({% for pkg in depend.providers %}{{ details.details_link(pkg) }}{% if not loop.last %}, {% endif %}{% endfor %})</span>
-{% else %}{{ depend.dep.name }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }} <span class="virtual-dep">(virtual)</span>
+{% if depend.providers %}{{ depend.dep.name }}{{ depend.dep.comparison|default("", true) }}{{ depend.dep.version|default("", true) }} <span class="virtual-dep">({% for pkg in depend.providers %}{{ details.details_link(pkg) }}{% if not loop.last %}, {% endif %}{% endfor %})</span>
+{% else %}{{ depend.dep.name }}{{ depend.dep.comparison|default("", true) }}{{ depend.dep.version|default("", true) }} <span class="virtual-dep">(virtual)</span>
{% endif %}{% else %}
-{{ details.details_link(depend.pkg) }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }}
+{{ details.details_link(depend.pkg) }}{{ depend.dep.comparison|default("", true) }}{{ depend.dep.version|default("", true) }}
{% if depend.pkg.repo.testing %} <span class="testing-dep"> (testing)</span>
{% endif %}{% if depend.pkg.repo.staging %} <span class="staging-dep"> (staging)</span>
{% endif %}{% endif %}