Commit 34c2b8b60a5a5aec91d51956a63378ec677c091b

Authored by Gabriela Navarro
Committed by Arthur Esposte
1 parent d96494d9
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

Removing unused methods.

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
controllers/software_communities_plugin_controller.rb
@@ -77,18 +77,6 @@ class SoftwareCommunitiesPluginController &lt; ApplicationController @@ -77,18 +77,6 @@ class SoftwareCommunitiesPluginController &lt; ApplicationController
77 render :json => list.to_json 77 render :json => list.to_json
78 end 78 end
79 79
80 - def get_categories  
81 - redirect_to "/" if !request.xhr? || params[:query].blank?  
82 -  
83 - list = []  
84 -  
85 - Category.where("name ILIKE ?", "%#{params[:query]}%").collect { |c|  
86 - list << {:label=>c.name, :id=>c.id} if c.name != "Software"  
87 - }  
88 -  
89 - render :json => list.to_json  
90 - end  
91 -  
92 def get_brazil_states 80 def get_brazil_states
93 redirect_to "/" unless request.xhr? 81 redirect_to "/" unless request.xhr?
94 82
controllers/software_communities_plugin_myprofile_controller.rb
@@ -30,13 +30,6 @@ class SoftwareCommunitiesPluginMyprofileController &lt; MyProfileController @@ -30,13 +30,6 @@ class SoftwareCommunitiesPluginMyprofileController &lt; MyProfileController
30 update_new_software_errors 30 update_new_software_errors
31 end 31 end
32 32
33 - def search_offerers  
34 - arg = params[:q].downcase  
35 - result = environment.people.find(:all,  
36 - :conditions => [ 'LOWER(name) LIKE ?', "%#{arg}%"])  
37 - render :text => prepare_to_token_input(result).to_json  
38 - end  
39 -  
40 def edit_software 33 def edit_software
41 update_software_atributes 34 update_software_atributes
42 35
@@ -70,9 +63,6 @@ class SoftwareCommunitiesPluginMyprofileController &lt; MyProfileController @@ -70,9 +63,6 @@ class SoftwareCommunitiesPluginMyprofileController &lt; MyProfileController
70 !environment.admins.include?(current_user.person) 63 !environment.admins.include?(current_user.person)
71 end 64 end
72 65
73 - def community_must_be_approved  
74 - end  
75 -  
76 private 66 private
77 67
78 def add_software_erros 68 def add_software_erros
lib/software_communities_plugin.rb
@@ -177,13 +177,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin @@ -177,13 +177,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
177 177
178 protected 178 protected
179 179
180 - def create_url_to_edit_profile person  
181 - new_url = person.public_profile_url  
182 - new_url[:controller] = 'profile_editor'  
183 - new_url[:action] = 'edit'  
184 - new_url  
185 - end  
186 -  
187 def profile_required_list 180 def profile_required_list
188 fields = {} 181 fields = {}
189 fields[:person_fields] = %w(cell_phone 182 fields[:person_fields] = %w(cell_phone
@@ -279,11 +272,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin @@ -279,11 +272,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
279 manage_user_institutions(user, old_communities, new_communities) 272 manage_user_institutions(user, old_communities, new_communities)
280 end 273 end
281 274
282 - def show_sisp_field  
283 - current_person = User.find(context.session[:user]).person  
284 - context.environment.admins.include?(current_person)  
285 - end  
286 -  
287 def call_model_transaction(model,name) 275 def call_model_transaction(model,name)
288 send(name + '_transaction') if context.params.key?(model.to_sym) 276 send(name + '_transaction') if context.params.key?(model.to_sym)
289 end 277 end
@@ -357,17 +345,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin @@ -357,17 +345,6 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
357 } 345 }
358 end 346 end
359 347
360 - def call_percentage_profile_template(person)  
361 - if context.profile && context.profile.person? && !person.nil?  
362 - @person = person  
363 - @percentege = calc_percentage_registration(person)  
364 -  
365 - if @percentege >= 0 && @percentege <= 100  
366 - expanded_template('incomplete_registration.html.erb')  
367 - end  
368 - end  
369 - end  
370 -  
371 def update_user_institutions(user) 348 def update_user_institutions(user)
372 context.params[:user][:institution_ids].each do |institution_id| 349 context.params[:user][:institution_ids].each do |institution_id|
373 institution = Institution.find institution_id 350 institution = Institution.find institution_id
test/functional/software_communities_plugin_myprofile_controller_test.rb
@@ -45,32 +45,6 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC @@ -45,32 +45,6 @@ class SoftwareCommunitiesPluginMyprofileControllerTest &lt; ActionController::TestC
45 assert_equal @offer.person.id, @software.community.admins.last.id 45 assert_equal @offer.person.id, @software.community.admins.last.id
46 end 46 end
47 47
48 - should 'search new offers while creating a new software' do  
49 - offer_token = "An"  
50 - post :search_offerers, :profile => person.identifier,:q => offer_token  
51 - response = JSON.parse(@response.body)  
52 - response.sort!{|a, b| a["name"] <=> b["name"]}  
53 - assert_equal "Ana de Souza",response[0]["name"]  
54 - assert_equal "Angela Silva",response[1]["name"]  
55 - assert_equal "Angelo Roberto",response[2]["name"]  
56 - end  
57 -  
58 - should 'make search for Ang for offerer in software creation' do  
59 - offer_token = "Ang"  
60 - post :search_offerers, :profile => person.identifier,:q => offer_token  
61 - response = JSON.parse(@response.body)  
62 - response.sort!{|a, b| a["name"] <=> b["name"]}  
63 - assert_equal "Angela Silva",response[0]["name"]  
64 - assert_equal "Angelo Roberto",response[1]["name"]  
65 - end  
66 -  
67 - should 'not find any offerer for software creation' do  
68 - offer_token = "Jos"  
69 - post :search_offerers, :profile => person.identifier,:q => offer_token  
70 - response = JSON.parse(@response.body)  
71 - assert response.count == 0  
72 - end  
73 -  
74 should 'create a new software with all fields filled in' do 48 should 'create a new software with all fields filled in' do
75 fields = software_fields 49 fields = software_fields
76 @environment.add_admin(@person) 50 @environment.add_admin(@person)