Fix redirections to empty tabs

Whenever href (url) attribute was omitted or had no value
the click action would do nothing. With no URLs defined and
`target="_blank"` attributes, which were recently added,
anchor tags now redirect users to new blank tabs (side effect).

This PR solves the issues by adding conditions
before applying `target="_blank"` or in some cases by
ommiting entire entities (e.g. the view_certificate button).
This commit is contained in:
chutified 2021-04-04 20:16:54 +02:00
parent cb3df73d53
commit ac9d173e13
5 changed files with 16 additions and 6 deletions

View file

@ -4,7 +4,7 @@
>
<div class="card mt-1">
<div class="card">
<a class="card-header" href="{{ if .repo }}{{ .repo }}{{ else if .url }}{{ .url }}{{ else }}javascript:void(0){{ end }}" target="_blank">
<a class="card-header" href="{{ if .repo }}{{ .repo }}{{ else if .url }}{{ .url }}{{ else }}javascript:void(0){{ end }}" {{ if or .repo .url }}target="_blank"{{ end }}>
<div>
<div class="d-flex">
{{ if .logo }}