[Groonga-commit] ranguba/epub-searcher at 66b1c53 [master] Show the number of search results

Back to archive index

KITAITI Makoto null+****@clear*****
Sun Sep 20 17:42:19 JST 2015


KITAITI Makoto	2015-09-20 17:42:19 +0900 (Sun, 20 Sep 2015)

  New Revision: 66b1c53e3d18a5565a7c44f158c239717fe99a42
  https://github.com/ranguba/epub-searcher/commit/66b1c53e3d18a5565a7c44f158c239717fe99a42

  Message:
    Show the number of search results

  Modified files:
    app/controllers/main-controller.rb
    app/locale/en.yml
    app/locale/ja.yml
    app/views/index.haml

  Modified: app/controllers/main-controller.rb (+1 -0)
===================================================================
--- app/controllers/main-controller.rb    2015-09-20 17:33:12 +0900 (fe487c9)
+++ app/controllers/main-controller.rb    2015-09-20 17:42:19 +0900 (057cc25)
@@ -9,6 +9,7 @@ EPUBSearcher::App.controllers do
       results = search_from_groonga(@query_words)
       @results = results.records
       @drilldowns = results.drilldowns
+      @hits = results.n_hits
     else
       @drilldowns = author_drilldowns_from_groonga.drilldowns
     end

  Modified: app/locale/en.yml (+1 -1)
===================================================================
--- app/locale/en.yml    2015-09-20 17:33:12 +0900 (cb2dac3)
+++ app/locale/en.yml    2015-09-20 17:42:19 +0900 (606580d)
@@ -1,5 +1,5 @@
 en:
-  search_results: "Search results for %{query_words}"
+  search_results: "Search results for %{query_words}(%{hits})"
   form_search:
     button: Search
   books:

  Modified: app/locale/ja.yml (+1 -1)
===================================================================
--- app/locale/ja.yml    2015-09-20 17:33:12 +0900 (02830df)
+++ app/locale/ja.yml    2015-09-20 17:42:19 +0900 (43f8db8)
@@ -1,5 +1,5 @@
 ja:
-  search_results: "%{query_words}の検索結果"
+  search_results: "%{query_words}の検索結果(%{hits})"
   form_search:
     button: 検索
   books:

  Modified: app/views/index.haml (+2 -2)
===================================================================
--- app/views/index.haml    2015-09-20 17:33:12 +0900 (0b21989)
+++ app/views/index.haml    2015-09-20 17:42:19 +0900 (0b4969b)
@@ -1,10 +1,10 @@
-- content_for(:title) {t('search_results', query_words: @query_words)} if @results
+- content_for(:title) {t('search_results', query_words: @query_words, hits: @hits)} if @results
 %div{:class => 'container'}
 
   = partial 'authors_drilldown'
 
   %div{:class => 'page-header'}
-    %h1= t'search_results', query_words: @query_words if @results
+    %h1= t'search_results', query_words: @query_words, hits: @hits if @results
 
   = partial 'form_search'
 
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index