Commit 60f220f46b2b2c7bde95b18dbe35302051008c16
1 parent
af8e08a4
Exists in
master
and in
28 other branches
[stoa] Signup form extra content hotspot
Showing
3 changed files
with
29 additions
and
0 deletions
Show diff stats
app/views/account/_signup_form.rhtml
... | ... | @@ -73,6 +73,8 @@ |
73 | 73 | <%= render :partial => 'profile_editor/person_form', :locals => {:f => f} %> |
74 | 74 | <% end %> |
75 | 75 | |
76 | + <%= @plugins.map(:signup_extra_contents).collect { |content| instance_eval(&content) }.join("") %> | |
77 | + | |
76 | 78 | <% unless @terms_of_use.blank? %> |
77 | 79 | <div id='terms-of-use-box' class='formfieldline'> |
78 | 80 | <%= labelled_check_box(_('I accept the %s') % link_to(_('terms of use'), {:controller => 'home', :action => 'terms'}, :target => '_blank'), 'user[terms_accepted]') %> | ... | ... |
lib/noosfero/plugin.rb
test/functional/account_controller_test.rb
... | ... | @@ -737,6 +737,27 @@ class AccountControllerTest < ActionController::TestCase |
737 | 737 | end |
738 | 738 | end |
739 | 739 | |
740 | + should 'add extra content on signup forms from plugins' do | |
741 | + class Plugin1 < Noosfero::Plugin | |
742 | + def signup_extra_contents | |
743 | + lambda {"<strong>Plugin1 text</strong>"} | |
744 | + end | |
745 | + end | |
746 | + class Plugin2 < Noosfero::Plugin | |
747 | + def signup_extra_contents | |
748 | + lambda {"<strong>Plugin2 text</strong>"} | |
749 | + end | |
750 | + end | |
751 | + | |
752 | + Environment.default.enable_plugin(Plugin1.name) | |
753 | + Environment.default.enable_plugin(Plugin2.name) | |
754 | + | |
755 | + get :signup | |
756 | + | |
757 | + assert_tag :tag => 'strong', :content => 'Plugin1 text' | |
758 | + assert_tag :tag => 'strong', :content => 'Plugin2 text' | |
759 | + end | |
760 | + | |
740 | 761 | protected |
741 | 762 | def new_user(options = {}, extra_options ={}) |
742 | 763 | data = {:profile_data => person_data} | ... | ... |