From 82305ca6babd1f3700c49ff6c1ff3cc3f78ab527 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Sat, 14 Jun 2014 00:21:36 -0300 Subject: [PATCH] stoa-plugin-tests: changes lambda to proc --- lib/noosfero/plugin.rb | 4 ++-- plugins/stoa/lib/stoa_plugin.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index a3608de..bc3cfd9 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -389,7 +389,7 @@ class Noosfero::Plugin end # -> Adds fields to the signup form - # returns = lambda block that creates html code + # returns = proc that creates html code def signup_extra_contents nil end @@ -464,7 +464,7 @@ class Noosfero::Plugin end # -> Adds fields to the login form - # returns = lambda block that creates html code + # returns = proc that creates html code def login_extra_contents nil end diff --git a/plugins/stoa/lib/stoa_plugin.rb b/plugins/stoa/lib/stoa_plugin.rb index d65bc93..9ebd919 100644 --- a/plugins/stoa/lib/stoa_plugin.rb +++ b/plugins/stoa/lib/stoa_plugin.rb @@ -15,7 +15,7 @@ class StoaPlugin < Noosfero::Plugin end def signup_extra_contents - lambda { + proc { content_tag(:div, labelled_form_field(_('USP number'), text_field(:profile_data, :usp_id, :id => 'usp_id_field')) + content_tag(:small, _('The usp id grants you special powers in the network. Don\'t forget to fill it with a valid number if you have one.'), :id => 'usp-id-balloon') + content_tag('p', _("Either this usp number is being used by another user or is not valid"), :id => 'usp-id-invalid') + @@ -43,7 +43,7 @@ class StoaPlugin < Noosfero::Plugin end def login_extra_contents - lambda { + proc { content_tag('div', labelled_form_field(_('USP number / Username'), text_field_tag('usp_id_login', '', :id => 'stoa_field_login')) + labelled_form_field(_('Password'), password_field_tag('password', '', :id => 'stoa_field_password')), :id => 'stoa-login-fields') } @@ -80,7 +80,7 @@ class StoaPlugin < Noosfero::Plugin end def profile_editor_controller_filters - block = lambda do + block = proc do if request.post? if !params[:profile_data][:usp_id].blank? && !StoaPlugin::UspUser.matches?(params[:profile_data][:usp_id], params[:confirmation_field], params[params[:confirmation_field]]) @profile_data = profile @@ -103,7 +103,7 @@ class StoaPlugin < Noosfero::Plugin def invite_controller_filters [{ :type => 'before_filter', :method_name => 'check_usp_id_existence', - :block => lambda {render_access_denied if !user || user.usp_id.blank?} }] + :block => proc {render_access_denied if !user || user.usp_id.blank?} }] end def control_panel_buttons -- libgit2 0.21.2