Commit 382d1404ab1aa2d6c9fae51ea9694feb0844af7e

Authored by David Silva
Committed by Fabio Teixeira
1 parent 2f50cd62

incomplete_registration: Using partial to show percentage.

Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com>
Signed-off-by: Fabio Teixeira  <fabio1079@gmail.com>
lib/mpog_software_plugin.rb
... ... @@ -151,10 +151,17 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
151 151 end
152 152  
153 153 def incomplete_registration params
154   - person = User.find(params[:user]).person
155   - percentege = calc_percentage_registration(person)
156   - if percentege >= 0 and percentege <= 100
157   - return _("Registration "+percentege.to_s+"% incomplete ")
  154 + return if params.nil? or params[:user].nil?
  155 +
  156 + person = if params[:user].kind_of? User
  157 + User.find(params[:user]).person
  158 + else
  159 + params[:user]
  160 + end
  161 +
  162 + @percentege = calc_percentage_registration(person)
  163 + if @percentege >= 0 and @percentege <= 100
  164 + expanded_template('mpog_software_plugin_myprofile/_incomplete_registration.html.erb')
158 165 end
159 166 end
160 167  
... ...
views/mpog_software_plugin_myprofile/_incomplete_registration.html.erb 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +<div id='incomplete_registration'>
  2 + <%= 'Teste' %>
  3 +</div>
... ...