diff options
author | Dan McGee <dan@archlinux.org> | 2015-04-12 09:50:13 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2015-04-12 09:50:13 -0500 |
commit | a2b020ed3554b47c0b27982cf47431126c103ef4 (patch) | |
tree | af079b96a1eae0cb464028d9322ff7236c971560 /templates/packages/details.html.jinja | |
parent | 57198b5cb45fb390b2fa75faff371d323de27dab (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.html.jinja')
-rw-r--r-- | templates/packages/details.html.jinja | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 2215f8dc..9a72622d 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -103,7 +103,7 @@ {% endif %} <tr> <th>Description:</th> - <td class="wrap" itemprop="description">{{ pkg.pkgdesc|default("") }}</td> + <td class="wrap" itemprop="description">{{ pkg.pkgdesc|default("", true) }}</td> </tr><tr> <th>Upstream URL:</th> <td>{% if pkg.url %}<a itemprop="url" href="{{ pkg.url }}" @@ -186,7 +186,7 @@ {% if user.is_authenticated() %}{% with flag_request = pkg.flag_request() %}{% if flag_request %}<tr> <th>Last Flag Request:</th> <td class="wrap">From {{ flag_request.who() }} on {{ flag_request.created|date }}:<br/> - <div class="userdata">{{ flag_request.message|linebreaksbr|default("{no message}") }}</div></td> + <div class="userdata">{{ flag_request.message|linebreaksbr|default("{no message}", true) }}</div></td> </tr>{% endif %}{% endwith %}{% endif %} </table> </div> |