diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index bf80375..33b3cb9 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -229,12 +229,12 @@ class MpogSoftwarePlugin < Noosfero::Plugin def control_panel_buttons if context.profile.software? - return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } + return { :title => _("Software Info"), :icon => "edit-profile-group control-panel-software-link", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } elsif context.profile.person? return { :title => _("Create a new software"), :icon => "design-editor", :url => {:controller => "mpog_software_plugin_myprofile", :action => "new_software"} } return nil elsif context.profile.institution? - return { :title => _("Institution Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_institution"} } + return { :title => _("Institution Info"), :icon => "edit-profile-group control-panel-instituton-link", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_institution"} } end end diff --git a/public/mpog-institution-validations.js b/public/mpog-institution-validations.js index 3306ffb..3c7c4ad 100644 --- a/public/mpog-institution-validations.js +++ b/public/mpog-institution-validations.js @@ -184,7 +184,6 @@ } function show_hide_cnpj_city(country) { - console.log(country) var cnpj = jQuery("#institutions_cnpj").parent().parent(); var city = jQuery("#community_city").parent().parent(); var state = jQuery("#community_state").parent().parent(); diff --git a/public/mpog-software.js b/public/mpog-software.js index ef35eab..13722fc 100644 --- a/public/mpog-software.js +++ b/public/mpog-software.js @@ -10,15 +10,33 @@ jQuery(".operating-system-button-hide").hide(); } - function add_software_on_control_panel() { - if(jQuery(".control-panel").size() > 0 && jQuery(".control-panel-edit-profile-group:contains('Software')").size() > 0 ) { - jQuery(".control-panel")[0].innerHTML = jQuery(".control-panel-edit-profile-group:contains('Software')")[0].outerHTML + jQuery(".control-panel")[0].innerHTML - jQuery(".control-panel-edit-profile-group:contains('Software')")[1].remove(); + function add_software_on_control_panel(control_panel) { + var software_link = jQuery(".control-panel-software-link").remove(); + + if( software_link.size() > 0 ) { + control_panel.prepend(software_link); + } + } + + function add_institution_on_control_panel(control_panel) { + var institution_link = jQuery(".control-panel-instituton-link").remove(); + + if( institution_link.size() > 0 ) { + control_panel.prepend(institution_link); + } + } + + function add_itens_on_controla_panel() { + var control_panel = jQuery(".control-panel"); + + if( control_panel.size() > 0 ) { + add_software_on_control_panel(control_panel); + add_institution_on_control_panel(control_panel); } } jQuery(document).ready(function(){ - add_software_on_control_panel(); + add_itens_on_controla_panel(); hide_infos(); }); })(); \ No newline at end of file -- libgit2 0.21.2