diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index 4f68808..bab19c7 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -151,10 +151,17 @@ class MpogSoftwarePlugin < Noosfero::Plugin end def incomplete_registration params - person = User.find(params[:user]).person - percentege = calc_percentage_registration(person) - if percentege >= 0 and percentege <= 100 - return _("Registration "+percentege.to_s+"% incomplete ") + return if params.nil? or params[:user].nil? + + person = if params[:user].kind_of? User + User.find(params[:user]).person + else + params[:user] + end + + @percentege = calc_percentage_registration(person) + if @percentege >= 0 and @percentege <= 100 + expanded_template('mpog_software_plugin_myprofile/_incomplete_registration.html.erb') end end diff --git a/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb b/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb new file mode 100644 index 0000000..1cbe1cc --- /dev/null +++ b/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb @@ -0,0 +1,3 @@ +