From 34c2b8b60a5a5aec91d51956a63378ec677c091b Mon Sep 17 00:00:00 2001 From: Gabriela Navarro Date: Tue, 7 Apr 2015 11:38:21 -0300 Subject: [PATCH] Removing unused methods. --- controllers/software_communities_plugin_controller.rb | 12 ------------ controllers/software_communities_plugin_myprofile_controller.rb | 10 ---------- lib/software_communities_plugin.rb | 23 ----------------------- test/functional/software_communities_plugin_myprofile_controller_test.rb | 26 -------------------------- 4 files changed, 0 insertions(+), 71 deletions(-) diff --git a/controllers/software_communities_plugin_controller.rb b/controllers/software_communities_plugin_controller.rb index 38e1fbc..71150a1 100644 --- a/controllers/software_communities_plugin_controller.rb +++ b/controllers/software_communities_plugin_controller.rb @@ -77,18 +77,6 @@ class SoftwareCommunitiesPluginController < ApplicationController render :json => list.to_json end - def get_categories - redirect_to "/" if !request.xhr? || params[:query].blank? - - list = [] - - Category.where("name ILIKE ?", "%#{params[:query]}%").collect { |c| - list << {:label=>c.name, :id=>c.id} if c.name != "Software" - } - - render :json => list.to_json - end - def get_brazil_states redirect_to "/" unless request.xhr? diff --git a/controllers/software_communities_plugin_myprofile_controller.rb b/controllers/software_communities_plugin_myprofile_controller.rb index ea6a6af..e2ceab7 100644 --- a/controllers/software_communities_plugin_myprofile_controller.rb +++ b/controllers/software_communities_plugin_myprofile_controller.rb @@ -30,13 +30,6 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController update_new_software_errors end - def search_offerers - arg = params[:q].downcase - result = environment.people.find(:all, - :conditions => [ 'LOWER(name) LIKE ?', "%#{arg}%"]) - render :text => prepare_to_token_input(result).to_json - end - def edit_software update_software_atributes @@ -70,9 +63,6 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController !environment.admins.include?(current_user.person) end - def community_must_be_approved - end - private def add_software_erros diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb index 4a5e168..557e210 100644 --- a/lib/software_communities_plugin.rb +++ b/lib/software_communities_plugin.rb @@ -177,13 +177,6 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin protected - def create_url_to_edit_profile person - new_url = person.public_profile_url - new_url[:controller] = 'profile_editor' - new_url[:action] = 'edit' - new_url - end - def profile_required_list fields = {} fields[:person_fields] = %w(cell_phone @@ -279,11 +272,6 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin manage_user_institutions(user, old_communities, new_communities) end - def show_sisp_field - current_person = User.find(context.session[:user]).person - context.environment.admins.include?(current_person) - end - def call_model_transaction(model,name) send(name + '_transaction') if context.params.key?(model.to_sym) end @@ -357,17 +345,6 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin } end - def call_percentage_profile_template(person) - if context.profile && context.profile.person? && !person.nil? - @person = person - @percentege = calc_percentage_registration(person) - - if @percentege >= 0 && @percentege <= 100 - expanded_template('incomplete_registration.html.erb') - end - end - end - def update_user_institutions(user) context.params[:user][:institution_ids].each do |institution_id| institution = Institution.find institution_id diff --git a/test/functional/software_communities_plugin_myprofile_controller_test.rb b/test/functional/software_communities_plugin_myprofile_controller_test.rb index 43f33e9..a60e6d3 100644 --- a/test/functional/software_communities_plugin_myprofile_controller_test.rb +++ b/test/functional/software_communities_plugin_myprofile_controller_test.rb @@ -45,32 +45,6 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC assert_equal @offer.person.id, @software.community.admins.last.id end - should 'search new offers while creating a new software' do - offer_token = "An" - post :search_offerers, :profile => person.identifier,:q => offer_token - response = JSON.parse(@response.body) - response.sort!{|a, b| a["name"] <=> b["name"]} - assert_equal "Ana de Souza",response[0]["name"] - assert_equal "Angela Silva",response[1]["name"] - assert_equal "Angelo Roberto",response[2]["name"] - end - - should 'make search for Ang for offerer in software creation' do - offer_token = "Ang" - post :search_offerers, :profile => person.identifier,:q => offer_token - response = JSON.parse(@response.body) - response.sort!{|a, b| a["name"] <=> b["name"]} - assert_equal "Angela Silva",response[0]["name"] - assert_equal "Angelo Roberto",response[1]["name"] - end - - should 'not find any offerer for software creation' do - offer_token = "Jos" - post :search_offerers, :profile => person.identifier,:q => offer_token - response = JSON.parse(@response.body) - assert response.count == 0 - end - should 'create a new software with all fields filled in' do fields = software_fields @environment.add_admin(@person) -- libgit2 0.21.2