From a9b736b528ab284ddcfd8ba9b91039529f4a75fa Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 31 Jul 2024 13:08:20 +0200 Subject: [PATCH] Merge label/slug column (#68) --- server/config/default.yaml | 4 ++-- server/views/search.pug | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/config/default.yaml b/server/config/default.yaml index 5f8d56c..37eee7e 100644 --- a/server/config/default.yaml +++ b/server/config/default.yaml @@ -41,9 +41,9 @@ disableSearchGUI: false # How many max entries do you want per page? search: resultPerPage: 100 - # Show slug column in search result + # Show slug in search result showSlug: false - # Show the label column in the search result + # Show the label in the search result showLabel: true ## Configure the GUI html: diff --git a/server/views/search.pug b/server/views/search.pug index 0d5e7e2..353a687 100644 --- a/server/views/search.pug +++ b/server/views/search.pug @@ -112,10 +112,11 @@ block content table.table.is-striped.is-fullwidth tr th #{getText('search.result.urlscriptname')} - if nconf.get('search:showLabel') === true - th #{getText('search.result.label')} - if nconf.get('search:showSlug') === true - th #{getText('search.result.slug')} + th + if nconf.get('search:showLabel') === true + | #{getText('search.result.label')} + if nconf.get('search:showSlug') === true + | #{getText('search.result.slug')} th #{getText('search.result.rundate')} th #{getText('search.result.location')} th #{getText('search.result.type')} @@ -135,14 +136,13 @@ block content a(role='button' onclick=urlOnClick) span.icon.is-small img(src='/img/icons/content-copy.svg' alt='Go to URL') - if nconf.get('search:showLabel') === true td - let labelOnClick = `addToSearch('label:${test.label}')`; - a(role='button' onclick=labelOnClick) #{test.label} - if nconf.get('search:showSlug') === true - td - let slugOnClick = `addToSearch('slug:${test.slug}')`; - a(role='button' onclick=slugOnClick) #{test.slug} + if nconf.get('search:showLabel') === true + a(role='button' onclick=labelOnClick) #{test.label} + if nconf.get('search:showSlug') === true + a(role='button' onclick=slugOnClick) #{test.slug} td.run-date #{test.run_date ? dayjs(test.run_date).format(nconf.get('dateformat')): ''} td - let locationOnClick = 'addToSearch(\'location:' + test.location + '\')';