[PATCH 4/4] templates: don't emit tags for empty URLs, allow both web_url & webscm_url

Jeremy Kerr jk at ozlabs.org
Sun Mar 27 15:53:06 AEDT 2016


Rather than always outputting one of web_url or webscm_url, only output
when these are present. This prevents us from emitting empty links if
both are missing.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 patchwork/templates/patchwork/projects.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/patchwork/templates/patchwork/projects.html b/patchwork/templates/patchwork/projects.html
index afaf6ab..0db1227 100644
--- a/patchwork/templates/patchwork/projects.html
+++ b/patchwork/templates/patchwork/projects.html
@@ -30,7 +30,8 @@
         </p>
 {% if p.web_url %}
       <p><a href="{{p.web_url}}">{{p.web_url}}</a></p>
-{% else %}
+{% endif %}
+{% if p.webscm_url %}
       <p><a href="{{p.webscm_url}}">{{p.webscm_url}}</a></p>
 {% endif %}
      </div>
-- 
2.5.0



More information about the Patchwork mailing list