From 59fed55ccc8357b97e197e62b4d008821bd1e50e Mon Sep 17 00:00:00 2001 From: isubas Date: Wed, 26 Sep 2018 14:59:25 +0300 Subject: [PATCH 01/33] =?UTF-8?q?Dersler=20i=C3=A7in=20aramalar=C4=B1=20te?= =?UTF-8?q?kille=C5=9Ftir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Akıllı arama ile detaylı arama birleştirilerek tek bir arama formundan aramaların yapılması sağlandı. --- app/models/concerns/dynamic_search.rb | 5 +-- .../courses/_search.html.erb | 31 ++++++++++--------- config/locales/defaults/en.yml | 1 + config/locales/defaults/tr.yml | 1 + .../locales/models/course_management/en.yml | 5 ++- .../locales/models/course_management/tr.yml | 5 ++- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/app/models/concerns/dynamic_search.rb b/app/models/concerns/dynamic_search.rb index 74ba73bc0..b6aa5087d 100644 --- a/app/models/concerns/dynamic_search.rb +++ b/app/models/concerns/dynamic_search.rb @@ -16,9 +16,10 @@ def dynamic_search_keys def dynamic_search(params = {}) raise ArgumentError, 'parameter must be Hash' unless [ActionController::Parameters, Hash].include?(params.class) - return search(params[:term]) if params[:term].present? - dynamic_where(params) + results = dynamic_where(params) + + params[:term].present? ? results.search(params[:term]) : results end private diff --git a/app/views/course_management/courses/_search.html.erb b/app/views/course_management/courses/_search.html.erb index 2909ab50b..507cf4d9d 100644 --- a/app/views/course_management/courses/_search.html.erb +++ b/app/views/course_management/courses/_search.html.erb @@ -1,38 +1,41 @@
- - <%= render 'layouts/shared/smart_search', - search_path: courses_path, - placeholder: t('.smart_search_placeholder') %> -
-