Skip to content

Commit

Permalink
search: adapt suggestions to the locale
Browse files Browse the repository at this point in the history
- Presents the suggestions as the query is typed to the user defined
  locale.
- Closes #1509.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Jan 26, 2021
1 parent 3fb0cf4 commit 3eeac5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 11 additions & 2 deletions rero_ils/theme/templates/rero_ils/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,20 @@ <h2>{{ _('A wealth of knowledge just a click away') }}</h2>
</header>

<div class="container d-none d-md-block">
<main-search-bar placeholder="{{ _('What\'s on your mind?') }}" size="large" viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"></main-search-bar>
<main-search-bar
placeholder="{{ _('What\'s on your mind?') }}"
viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"
language="{{ current_i18n.locale.language[:2] }}"
size="large"
></main-search-bar>
</div>

<div class="container d-block d-md-none">
<main-search-bar placeholder="{{ _('What\'s on your mind?') }}" viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"></main-search-bar>
<main-search-bar
placeholder="{{ _('What\'s on your mind?') }}"
viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"
language="{{ current_i18n.locale.language[:2] }}"
></main-search-bar>
</div>

<footer class="text-center bg-danger text-white">
Expand Down
6 changes: 5 additions & 1 deletion rero_ils/theme/templates/rero_ils/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@

{%- block navbar_search %}
<div class="align-self-center pr-2 flex-grow-1">
<main-search-bar placeholder="{{ _('Search') }}" viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"></main-search-bar>
<main-search-bar
placeholder="{{ _('Search') }}"
viewcode="{{ viewcode or config.RERO_ILS_SEARCH_GLOBAL_VIEW_CODE }}"
language="{{ current_i18n.locale.language[:2] }}"
></main-search-bar>
</div>
{%- endblock navbar_search %}

Expand Down

0 comments on commit 3eeac5b

Please sign in to comment.