Commit 93215ecf11d35f9229d073444cf554cd7f8ea282

Authored by Fabio Teixeira
1 parent f7f325c5

add_user_to_institution_community: When user is registered, he is already added …

…as a member to the institution community

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Signed-off-by: Parley Martins <parley@outlook.com>
lib/mpog_software_plugin.rb
... ... @@ -169,6 +169,14 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
169 169 [{:title => _('Manage Software'), :url => {:controller => 'mpog_software_plugin', :action => 'archive_software'}}]
170 170 end
171 171  
  172 +
  173 + def custom_user_registration_attributes user
  174 + if user.institution
  175 + community = user.institution.community
  176 + community.add_member user.person
  177 + end
  178 + end
  179 +
172 180 protected
173 181  
174 182 def calc_percentage_registration person
... ...
views/mpog_software_plugin/create_institution.html.erb
... ... @@ -29,7 +29,7 @@
29 29 <span class='required-field'>
30 30 <div class="formfield type-text">
31 31 <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %>
32   - <%= required inst.text_field(:cnpj) %>
  32 + <%= required inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99") %>
33 33 </div>
34 34 </span>
35 35  
... ...