From 88c69634f4205efc47365004b3cb94dbbf7cccf1 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Thu, 20 Jun 2024 11:22:31 +0200 Subject: [PATCH] Only link to search result when we have the result (#26) --- server/views/search.pug | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/views/search.pug b/server/views/search.pug index cbf2fa4..d02e03e 100644 --- a/server/views/search.pug +++ b/server/views/search.pug @@ -117,7 +117,10 @@ block content td span.icon-text span - a(href=test.result_url) #{test.url ? shortURL(test.url, true) : test.scripting_name} + if test.result_url + a(href=test.result_url) #{test.url ? shortURL(test.url, true) : test.scripting_name} + else + span #{test.url ? shortURL(test.url, true) : test.scripting_name} - let urlOnClick = test.url ? `addToSearch('url:${test.url}')` : `addToSearch('name:${ test.scripting_name}')`; a(role='button' onclick=urlOnClick) span.icon.is-small