From 2616a41c475ccab4cec1f593f1e1509b58f91bf4 Mon Sep 17 00:00:00 2001 From: Gust Date: Mon, 10 Nov 2014 15:30:23 -0200 Subject: [PATCH] Remove people search filter, fix searchs --- lib/mpog_software_plugin.rb | 27 ++++++++++++--------------- views/search/search_user_filter.html.erb | 29 ----------------------------- 2 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 views/search/search_user_filter.html.erb diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index c57fe1c..f1e5daa 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -104,6 +104,17 @@ class MpogSoftwarePlugin < Noosfero::Plugin @searches[@asset] = {:results => results} @search = results render :action => :communities + elsif params[:type] == "Institution" + institutions = Institution.search_institution(params[:intitution_name]) + communities = [] + institutions.each do |s| + communities << s.community + end + results = communities + results = results.paginate(:per_page => 24, :page => params[:page]) + @searches[@asset] = {:results => results} + @search = results + render :action => :communities #FIXME: Careful while merginging, this else must be the default action else unfiltered_list = visible_profiles(Community).select{ |com| com.name =~ /#{params[:query]}/} @@ -122,18 +133,6 @@ class MpogSoftwarePlugin < Noosfero::Plugin render :action => :communities end - if params[:type] == "Institution" - institutions = Institution.search_institution(params[:intitution_name]) - communities = [] - institutions.each do |s| - communities << s.community - end - results = communities - results = results.paginate(:per_page => 24, :page => params[:page]) - @searches[@asset] = {:results => results} - @search = results - render :action => :communities - end end people_block = proc do @@ -415,9 +414,7 @@ class MpogSoftwarePlugin < Noosfero::Plugin end def add_new_search_filter - if context.params[:action] == "people" - expanded_template('search/search_user_filter.html.erb') - elsif context.params[:action] == "communities" + if context.params[:action] == "communities" @active_type = if context.params[:type] == "Software" "software" elsif context.params[:type] == "Institution" diff --git a/views/search/search_user_filter.html.erb b/views/search/search_user_filter.html.erb deleted file mode 100644 index ea39459..0000000 --- a/views/search/search_user_filter.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
- - - - - - - - - - - - - - - - - - - - - - -
<%= label_tag :name, _("Name") %> <%= text_field_tag :name %>
<%= label_tag :state, _("State") %> <%= text_field_tag :state %>
<%= label_tag :city, _("City") %> <%= text_field_tag :city %>
<%= label_tag :email, _("Email") %> <%= text_field_tag :email %>
<%= submit_button(:search, _('Search')) %>
-
-
-
\ No newline at end of file -- libgit2 0.21.2