Bug#759486: creates invalid browse link when no vcs-browser field defined
- To: 759486@bugs.debian.org
- Subject: Bug#759486: creates invalid browse link when no vcs-browser field defined
- From: Sophie Hertzog <sophie@ouaza.com>
- Date: Fri, 05 Sep 2014 17:05:19 +0200
- Message-id: <[🔎] 5409D12F.6010507@ouaza.com>
- Reply-to: Sophie Hertzog <sophie@ouaza.com>, 759486@bugs.debian.org
- In-reply-to: <2f059faeb51fa6d7170ec35149b06b56.squirrel@aphrodite.kinkhorst.nl>
- References: <2f059faeb51fa6d7170ec35149b06b56.squirrel@aphrodite.kinkhorst.nl> <2f059faeb51fa6d7170ec35149b06b56.squirrel@aphrodite.kinkhorst.nl>
Control: tag -1 + patch
On Wed, 27 Aug 2014 17:42:46 +0200 "Thijs Kinkhorst" <thijs@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 <sophie@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
Reply to: