Commit 382d1404ab1aa2d6c9fae51ea9694feb0844af7e
Committed by
Fabio Teixeira
1 parent
2f50cd62
Exists in
master
and in
5 other branches
incomplete_registration: Using partial to show percentage.
Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
2 changed files
with
14 additions
and
4 deletions
Show diff stats
lib/mpog_software_plugin.rb
... | ... | @@ -151,10 +151,17 @@ class MpogSoftwarePlugin < 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