Commit 2616a41c475ccab4cec1f593f1e1509b58f91bf4

Authored by Gust
1 parent 2867a315
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Remove people search filter, fix searchs

Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
lib/mpog_software_plugin.rb
@@ -104,6 +104,17 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -104,6 +104,17 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
104 @searches[@asset] = {:results => results} 104 @searches[@asset] = {:results => results}
105 @search = results 105 @search = results
106 render :action => :communities 106 render :action => :communities
  107 + elsif params[:type] == "Institution"
  108 + institutions = Institution.search_institution(params[:intitution_name])
  109 + communities = []
  110 + institutions.each do |s|
  111 + communities << s.community
  112 + end
  113 + results = communities
  114 + results = results.paginate(:per_page => 24, :page => params[:page])
  115 + @searches[@asset] = {:results => results}
  116 + @search = results
  117 + render :action => :communities
107 #FIXME: Careful while merginging, this else must be the default action 118 #FIXME: Careful while merginging, this else must be the default action
108 else 119 else
109 unfiltered_list = visible_profiles(Community).select{ |com| com.name =~ /#{params[:query]}/} 120 unfiltered_list = visible_profiles(Community).select{ |com| com.name =~ /#{params[:query]}/}
@@ -122,18 +133,6 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -122,18 +133,6 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
122 render :action => :communities 133 render :action => :communities
123 end 134 end
124 135
125 - if params[:type] == "Institution"  
126 - institutions = Institution.search_institution(params[:intitution_name])  
127 - communities = []  
128 - institutions.each do |s|  
129 - communities << s.community  
130 - end  
131 - results = communities  
132 - results = results.paginate(:per_page => 24, :page => params[:page])  
133 - @searches[@asset] = {:results => results}  
134 - @search = results  
135 - render :action => :communities  
136 - end  
137 end 136 end
138 137
139 people_block = proc do 138 people_block = proc do
@@ -415,9 +414,7 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -415,9 +414,7 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
415 end 414 end
416 415
417 def add_new_search_filter 416 def add_new_search_filter
418 - if context.params[:action] == "people"  
419 - expanded_template('search/search_user_filter.html.erb')  
420 - elsif context.params[:action] == "communities" 417 + if context.params[:action] == "communities"
421 @active_type = if context.params[:type] == "Software" 418 @active_type = if context.params[:type] == "Software"
422 "software" 419 "software"
423 elsif context.params[:type] == "Institution" 420 elsif context.params[:type] == "Institution"
views/search/search_user_filter.html.erb
@@ -1,29 +0,0 @@ @@ -1,29 +0,0 @@
1 -<form action="/search/people" name="user_filter" method="POST" class="search_form">  
2 - <div id="user_filter_content">  
3 - <div class="mpog_search_form_fields">  
4 -  
5 - <table class="mpog_search_form_table">  
6 - <tr>  
7 - <td> <%= label_tag :name, _("Name") %> </td>  
8 - <td> <%= text_field_tag :name %> </td>  
9 - </tr>  
10 - <tr>  
11 - <td> <%= label_tag :state, _("State") %> </td>  
12 - <td> <%= text_field_tag :state %> </td>  
13 - </tr>  
14 - <tr>  
15 - <td> <%= label_tag :city, _("City") %> </td>  
16 - <td> <%= text_field_tag :city %> </td>  
17 - </tr>  
18 - <tr>  
19 - <td> <%= label_tag :email, _("Email") %> </td>  
20 - <td> <%= text_field_tag :email %> </td>  
21 - </tr>  
22 - <tr>  
23 - <td> </td>  
24 - <td> <%= submit_button(:search, _('Search')) %> </td>  
25 - </tr>  
26 - </table>  
27 - </div>  
28 - </div>  
29 -</form>  
30 \ No newline at end of file 0 \ No newline at end of file