diff options
-rw-r--r-- | app/controllers/general_controller.rb | 9 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 4 | ||||
-rw-r--r-- | public/javascripts/general.js | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index cefc3c020..55abea3b7 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -125,7 +125,7 @@ class GeneralController < ApplicationController return end [:latest_status, :request_variety, :request_date_after, :request_date_before, :query, :tags].each do |x| - params[x] = session[x] + params[x] = session[x] if params[x].nil? end combined = params[:combined] @sortby = nil @@ -160,14 +160,17 @@ class GeneralController < ApplicationController @bodies = false @requests = false @users = true + else + @variety_postfix = "all" end - else - @variety_postfix = "all" end @query = combined.join("/") if params[:query].nil? params[:query] = @query end + if @variety_postfix != "all" && @requests + @query, _ = make_query_from_params + end @inputted_sortby = @sortby @common_query = get_tags_from_params if @sortby.nil? diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index ba060d33c..4c5ea974c 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -58,9 +58,9 @@ <% for variety, label in labels %> <% if @variety_postfix != variety %> <% if variety != "users" %> - <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix), :method => :get %> + <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix) %> <% else %> - <%= link_to label, search_url(params[:query], variety, @sort_postfix), :method => :get %> + <%= link_to label, search_url(params[:query], variety, @sort_postfix) %> <% end %> <% else %> <%= label %> diff --git a/public/javascripts/general.js b/public/javascripts/general.js index 3d6aae0d8..ab74cf318 100644 --- a/public/javascripts/general.js +++ b/public/javascripts/general.js @@ -36,4 +36,12 @@ $(document).ready(function() { }); $('.close-button').click(function() { $(this).parent().hide() }); + $('div#variety-filter a').each(function() { + $(this).click(function() { + var form = $('form#search_form'); + form.attr('action', $(this).attr('href')); + form.submit(); + return false; + }) + }) })
\ No newline at end of file |