Control: tag -1 + patch
On Wed, 27 Aug 2014 17:42:46 +0200 "Thijs Kinkhorst" <th...@debian.org>
wrote:
> When a package has a Vcs-something field but not a Vcs-Browser field, the
> tracker does display a browse link but with an empty href:
Please find attached a possible patch.
--
Sophie Brun
>From 2cb138161b019cd901b6fe54eeb011c815e942ff Mon Sep 17 00:00:00 2001
From: Sophie Brun <sop...@freexian.com>
Date: Fri, 5 Sep 2014 16:39:23 +0200
Subject: [PATCH] Drop invalid browse link when no vcs-browser field defined
---
distro_tracker/core/templates/core/panels/general.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/distro_tracker/core/templates/core/panels/general.html b/distro_tracker/core/templates/core/panels/general.html
index d0d5ff5..bffd981 100644
--- a/distro_tracker/core/templates/core/panels/general.html
+++ b/distro_tracker/core/templates/core/panels/general.html
@@ -103,7 +103,10 @@
<div class="list-item-key"><b>VCS:</b></div>
<div class="list-item-value">
{% with vcs=ctx.vcs.full_name|default:ctx.vcs.type %}
- <a href="{{ ctx.vcs.url }}">{{ vcs }}</a> (<a href="{{ ctx.vcs.browser }}">Browse</a>)
+ <a href="{{ ctx.vcs.url }}">{{ vcs }}</a>
+ {% if ctx.vcs.browser %}
+ (<a href="{{ ctx.vcs.browser }}">Browse</a>)
+ {% endif %}
{% endwith %}
</div>
<div class="clear"></div>
--
2.1.0