Commit 0635131e0973c09cb28b11b18a7cf0de40f59851

Authored by Gust
Committed by Fabio Teixeira
1 parent c9cdb24a

Only show software button on software, fix edit

-Fix edit community page on software
-Only show software button on communities with software

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Gustavo Jaruga Cruz <darksshades@gmail.com>
Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
lib/mpog_software_plugin.rb
@@ -56,8 +56,6 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -56,8 +56,6 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
56 def profile_editor_extras 56 def profile_editor_extras
57 if context.profile.person? 57 if context.profile.person?
58 expanded_template('person_editor_extras.html.erb') 58 expanded_template('person_editor_extras.html.erb')
59 - elsif context.profile.respond_to? :software_info and !context.profile.software_info.nil?  
60 - expanded_template('software_editor_extras.html.erb')  
61 elsif context.profile.respond_to? :institution and !context.profile.institution.nil? 59 elsif context.profile.respond_to? :institution and !context.profile.institution.nil?
62 @show_sisp_field = show_sisp_field 60 @show_sisp_field = show_sisp_field
63 expanded_template('institution_editor_extras.html.erb') 61 expanded_template('institution_editor_extras.html.erb')
@@ -198,7 +196,11 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -198,7 +196,11 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
198 end 196 end
199 197
200 def control_panel_buttons 198 def control_panel_buttons
201 - return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } 199 + if context.profile.software?
  200 + return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} }
  201 + else
  202 + return nil
  203 + end
202 end 204 end
203 205
204 def stylesheet? 206 def stylesheet?