Commit 34c2b8b60a5a5aec91d51956a63378ec677c091b
Committed by
Arthur Esposte
1 parent
d96494d9
Exists in
master
and in
5 other branches
Removing unused methods.
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
4 changed files
with
0 additions
and
71 deletions
Show diff stats
controllers/software_communities_plugin_controller.rb
| @@ -77,18 +77,6 @@ class SoftwareCommunitiesPluginController < ApplicationController | @@ -77,18 +77,6 @@ class SoftwareCommunitiesPluginController < 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 < MyProfileController | @@ -30,13 +30,6 @@ class SoftwareCommunitiesPluginMyprofileController < 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 < MyProfileController | @@ -70,9 +63,6 @@ class SoftwareCommunitiesPluginMyprofileController < 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 < Noosfero::Plugin | @@ -177,13 +177,6 @@ class SoftwareCommunitiesPlugin < 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 < Noosfero::Plugin | @@ -279,11 +272,6 @@ class SoftwareCommunitiesPlugin < 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 < Noosfero::Plugin | @@ -357,17 +345,6 @@ class SoftwareCommunitiesPlugin < 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 < ActionController::TestC | @@ -45,32 +45,6 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < 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) |