From 0635131e0973c09cb28b11b18a7cf0de40f59851 Mon Sep 17 00:00:00 2001 From: Gust Date: Mon, 13 Oct 2014 14:29:01 -0300 Subject: [PATCH] Only show software button on software, fix edit --- lib/mpog_software_plugin.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index 2d0f0d7..9b10793 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -56,8 +56,6 @@ class MpogSoftwarePlugin < Noosfero::Plugin def profile_editor_extras if context.profile.person? expanded_template('person_editor_extras.html.erb') - elsif context.profile.respond_to? :software_info and !context.profile.software_info.nil? - expanded_template('software_editor_extras.html.erb') elsif context.profile.respond_to? :institution and !context.profile.institution.nil? @show_sisp_field = show_sisp_field expanded_template('institution_editor_extras.html.erb') @@ -198,7 +196,11 @@ class MpogSoftwarePlugin < Noosfero::Plugin end def control_panel_buttons - return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } + if context.profile.software? + return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } + else + return nil + end end def stylesheet? -- libgit2 0.21.2