Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make label in search result configurable #46

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ search:
resultPerPage: 100
# Show slug column in search result
showSlug: false

# Show the label column in the search result
showLabel: true
## Configure the GUI
html:
css:
Expand Down
10 changes: 6 additions & 4 deletions server/views/search.pug
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ block content
table.table.is-striped.is-fullwidth
tr
th #{getText('search.result.urlscriptname')}
th #{getText('search.result.label')}
if nconf.get('search:showLabel') === true
th #{getText('search.result.label')}
if nconf.get('search:showSlug') === true
th #{getText('search.result.slug')}
th #{getText('search.result.rundate')}
Expand All @@ -134,9 +135,10 @@ block content
a(role='button' onclick=urlOnClick)
span.icon.is-small
img(src='/img/icons/content-copy.svg' alt='Go to URL')
td
- let labelOnClick = `addToSearch('label:${test.label}')`;
a(role='button' onclick=labelOnClick) #{test.label}
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}')`;
Expand Down