Commit 777205d1 authored by Raphaël Hertzog's avatar Raphaël Hertzog

Handle properly the lack of VCS URL

If we have VCS data but no VCS URL, we were displaying broken links both
in a <link> entry in the <head> and in the general panel.
parent 3f384276
Pipeline #1786 passed with stages
in 24 minutes and 14 seconds
......@@ -7,8 +7,8 @@
<link href="{% static 'css/dense.css' %}" rel="stylesheet" media="screen">
{% for panel in panels.left %}
{% with ctx=panel.context %}
{% if panel.context.vcs %}
<link rel="vcs-{{ ctx.vcs.type }}" href="{{ ctx.vcs.url}}" title="{{ ctx.vcs.type }} repository for {{ package.name }}">
{% if ctx.vcs and ctx.vcs.url %}
<link rel="vcs-{{ ctx.vcs.type }}" href="{{ ctx.vcs.url }}" title="{{ ctx.vcs.type }} repository for {{ package.name }}">
{% endif %}
{% endwith %}
{% endfor %}
......
......@@ -92,7 +92,11 @@
{% if vcs|lower == "cvs" %}
<span title="{{ ctx.vcs.url }}">{{ vcs }}</span>
{% else %}
<a rel="vcs-{{ ctx.vcs.type }}" href="{{ ctx.vcs.url }}">{{ vcs }}</a>
{% if ctx.vcs.url %}
<a rel="vcs-{{ ctx.vcs.type }}" href="{{ ctx.vcs.url }}">{{ vcs }}</a>
{% else %}
{{ vcs }}
{% endif %}
{% endif %}
{% if ctx.vcs.extra_links %}
({% for name, url in ctx.vcs.extra_links %}<a href="{{ url }}">{{ name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment