From 605f0206d3fd4801f9c3e3207e890a66fe9f5a27 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Sat, 15 Nov 2014 13:57:17 -0300 Subject: [PATCH] [search-improvements] Use ajax also on profile search --- app/views/profile_search/_results-list.html.erb | 15 +++++++++++++++ app/views/profile_search/index.html.erb | 14 ++------------ app/views/profile_search/index.js.erb | 1 + 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 app/views/profile_search/_results-list.html.erb create mode 100644 app/views/profile_search/index.js.erb diff --git a/app/views/profile_search/_results-list.html.erb b/app/views/profile_search/_results-list.html.erb new file mode 100644 index 0000000..5b68f41 --- /dev/null +++ b/app/views/profile_search/_results-list.html.erb @@ -0,0 +1,15 @@ +
+ <% if @results %> +
+ <%= _("%s results found") % @results.total_entries %> +
+ + + + <%= pagination_links @results %> + <% end %> +
diff --git a/app/views/profile_search/index.html.erb b/app/views/profile_search/index.html.erb index 4d50023..8eedad7 100644 --- a/app/views/profile_search/index.html.erb +++ b/app/views/profile_search/index.html.erb @@ -3,17 +3,7 @@ <%= render :partial => 'shared/profile_search_form' %> - <% if @results %> -
- <%= _("%s results found") % @results.total_entries %> -
+ <%= render :partial => 'results-list' %> - - - <%= pagination_links @results %> - <% end %> +<%= javascript_include_tag 'search' %> diff --git a/app/views/profile_search/index.js.erb b/app/views/profile_search/index.js.erb new file mode 100644 index 0000000..466b9cf --- /dev/null +++ b/app/views/profile_search/index.js.erb @@ -0,0 +1 @@ +jQuery('#search-content').html('<%= escape_javascript(render :partial => "results-list") %>'); -- libgit2 0.21.2