diff --git a/assets/controllers/elements/part_livesearch_controller.js b/assets/controllers/elements/part_livesearch_controller.js index 5ded2df2..d5facbea 100644 --- a/assets/controllers/elements/part_livesearch_controller.js +++ b/assets/controllers/elements/part_livesearch_controller.js @@ -27,7 +27,8 @@ import {marked} from "marked"; import { trans, SEARCH_PLACEHOLDER, - SEARCH_SUBMIT + SEARCH_SUBMIT, + STATISTICS_PARTS } from '../../translator'; export default class extends Controller { @@ -42,6 +43,9 @@ export default class extends Controller { // The URL template for the part detail pages const part_detail_uri_template = this.element.dataset.detailUrl; + //The URL of the placeholder picture + const placeholder_image = this.element.dataset.placeholderImage; + const that = this; const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({ @@ -106,25 +110,28 @@ export default class extends Controller { }, templates: { header({ html }) { - return html`Parts + return html`${trans(STATISTICS_PARTS)}
`; }, item({item, components, html}) { const details_url = part_detail_uri_template.replace('__ID__', item.id); - return html`
- ${item.name} + ${item.name}
- ${components.Highlight({hit: item, attribute: 'name'})} + + ${components.Highlight({hit: item, attribute: 'name'})} +
${components.Snippet({hit: item, attribute: 'description'})} + ${item.category ? html`

${item.category}

` : ""} + ${item.footprint ? html`

${item.footprint}

` : ""}
diff --git a/templates/_navbar_search.html.twig b/templates/_navbar_search.html.twig index 1dc2ae36..4b954b62 100644 --- a/templates/_navbar_search.html.twig +++ b/templates/_navbar_search.html.twig @@ -71,6 +71,7 @@ {# It is important that this element has an id field. Otherwise the dropdown panel wont appear after some link clicks #}