Skip to content

Commit

Permalink
Make number of results more friendly in Bento view
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbergja committed Jan 6, 2020
1 parent 6b43d50 commit 2c5ce93
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ gem 'activerecord-session_store'
gem 'ebsco-eds', :github => 'sandbergja/edsapi-ruby'
gem 'evergreen_holdings', '>=0.3.0'
gem 'blacklight-citeproc', '>=0.0.4'
gem 'rails-i18n'
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (6.0.2.1)
actionpack (= 6.0.2.1)
activesupport (= 6.0.2.1)
Expand Down Expand Up @@ -346,6 +349,7 @@ DEPENDENCIES
material_design_icons
puma (~> 4.1)
rails (~> 6.0.1)
rails-i18n
rsolr (>= 1.0, < 3)
sass-rails (~> 5.1.0)
selenium-webdriver
Expand Down
1 change: 1 addition & 0 deletions app/views/bento/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<fieldset>
<div class="row align-items-center">
<input name="q" type="text" class="form-control form-control-lg" aria-label="search terms" autofocus />
<input name="locale" type="hidden" value="<%= I18n.locale %>" />
</div>
<div class="row search-option-buttons">
<button type="submit" class="btn btn-success btn-lg col-xs-offset-1 col-xs-10 col-sm-4" style="white-space: normal;"><span class="fa fa-search" aria-hidden="true"></span> Search</button>
Expand Down
4 changes: 2 additions & 2 deletions app/views/bento/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% end %>
</ol>
<%= mdi_svg('arrow-right-circle').html_safe %>
<%= link_to t('bento.all_articles', number: @num_article_hits), request.query_parameters.merge({controller: 'articles'}) %>
<%= link_to t('bento.all_articles', number: number_to_human(@num_article_hits)), request.query_parameters.merge({controller: 'articles'}) %>

<hr>

Expand All @@ -29,7 +29,7 @@
<% end %>
</ol>
<%= mdi_svg('arrow-right-circle').html_safe %>
<%= link_to t('bento.all_catalog', number: @num_catalog_hits), request.query_parameters.merge({controller: 'catalog'}) %>
<%= link_to t('bento.all_catalog', number: number_to_human(@num_catalog_hits)), request.query_parameters.merge({controller: 'catalog'}) %>
</section>

<section id="sidebar" class="page-sidebar col-lg-3 order-first">
Expand Down
3 changes: 3 additions & 0 deletions config/locales/findit.es.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
es:
about:
h1: Bienvenidos a Find It
bento:
all_articles: "Ver los %{number} artículos"
all_catalog: "Ver los %{number} libros y videos"
obtain:
ebook: Leer ebook
source: "Proporcionado por %{source}"
Expand Down

0 comments on commit 2c5ce93

Please sign in to comment.