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

search: configurable slug column #41

Merged
merged 1 commit into from
Jun 27, 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
2 changes: 2 additions & 0 deletions server/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ disableSearchGUI: false
# How many max entries do you want per page?
search:
resultPerPage: 100
# Show slug column in search result
showSlug: false

## Configure the GUI
html:
Expand Down
1 change: 1 addition & 0 deletions server/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"search.result.compare": "Compare",
"search.result.nomatch": "No tests found matching the search criteria.",
"search.result.showing": "Showing %s - %s of %s",
"search.result.slug": "Slug",
"search.result.of": "of",
"search.pagetitle": "Search for tests",
"search.pagedescription": "Here you can search for finished tests.",
Expand Down
6 changes: 6 additions & 0 deletions server/views/search.pug
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ block content
tr
th #{getText('search.result.urlscriptname')}
th #{getText('search.result.label')}
if nconf.get('search:showSlug') === true
th #{getText('search.result.slug')}
th #{getText('search.result.rundate')}
th #{getText('search.result.location')}
th #{getText('search.result.type')}
Expand All @@ -135,6 +137,10 @@ block content
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}
td #{test.run_date ? dayjs(test.run_date).format(nconf.get('dateformat')): ''}
td
- let locationOnClick = 'addToSearch(\'location:' + test.location + '\')';
Expand Down