diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb
index bf63bd6..3aae3f9 100644
--- a/lib/mpog_software_plugin.rb
+++ b/lib/mpog_software_plugin.rb
@@ -151,21 +151,19 @@ class MpogSoftwarePlugin < Noosfero::Plugin
end
- def incomplete_registration params
- return if params.nil? or params[:user].nil?
+ def body_middle
+ return if context.session[:user].nil? or context.session[:hide_incomplete_percentage] == true
- person = if params[:user].kind_of? User
- User.find(params[:user]).person
- else
- params[:user]
- end
+ person = Person.where(:user_id=>context.session[:user]).first
- @profile_edit_link = link_to _("Complete your registration"), "/myprofile/#{person.identifier}/profile_editor/edit"
- @profile_empty_fields = profile_required_empty_list person
- @percentege = calc_percentage_registration(person)
+ unless person.nil?
+ @profile_edit_link = link_to _("Complete your registration"), "/myprofile/#{person.identifier}/profile_editor/edit"
+ @profile_empty_fields = profile_required_empty_list person
+ @percentege = calc_percentage_registration(person)
- if @percentege >= 0 and @percentege <= 100 and context.session[:hide_incomplete_percentage] != true
- expanded_template('mpog_software_plugin_myprofile/_incomplete_registration.html.erb')
+ if @percentege >= 0 and @percentege <= 100
+ expanded_template('incomplete_registration.html.erb')
+ end
end
end
diff --git a/views/incomplete_registration.html.erb b/views/incomplete_registration.html.erb
new file mode 100644
index 0000000..1320475
--- /dev/null
+++ b/views/incomplete_registration.html.erb
@@ -0,0 +1,29 @@
+
+
+ <%= _("Incomplete registration percentage")+":#{@percentege}%" %>
+
+
+
+
<%= _("List with fields to be filled")+":" %>
+
+ <% @profile_empty_fields.each do |field|%>
+ -
+ <%= field %>
+
+ <% end %>
+
+
+
+
+
+
+
+ <%= @profile_edit_link %>
+ |
+
+ <%= link_to _("Hide this message"), "#", :class=>"hide-incomplete-percentage" %>
+ |
+
+
+
+
diff --git a/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb b/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb
deleted file mode 100644
index 1320475..0000000
--- a/views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- <%= _("Incomplete registration percentage")+":#{@percentege}%" %>
-
-
-
-
<%= _("List with fields to be filled")+":" %>
-
- <% @profile_empty_fields.each do |field|%>
- -
- <%= field %>
-
- <% end %>
-
-
-
-
-
-
-
- <%= @profile_edit_link %>
- |
-
- <%= link_to _("Hide this message"), "#", :class=>"hide-incomplete-percentage" %>
- |
-
-
-
-
--
libgit2 0.21.2