Commit 08f0247c6feafd8f75ef5e22e89ca9058047c992

Authored by Thiago Ribeiro
1 parent 0f984e23

CNPJ should be mandatory

(cherry picked from commit 0906bb6dab44aada8bada2ab1e15bd200e306ba4)
src/noosfero-spb/gov_user/lib/institution.rb
... ... @@ -23,6 +23,7 @@ class Institution < ActiveRecord::Base
23 23 :corporate_name, :siorg_code, :community
24 24  
25 25 validates :name, :presence=>true, :uniqueness=>true
  26 + validates :cnpj, :presence=>true, :uniqueness=>true
26 27  
27 28 before_save :verify_institution_type
28 29  
... ...
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
... ... @@ -105,7 +105,10 @@
105 105  
106 106 <div class="spb-row">
107 107 <div class="spb-col spb-col-12">
108   - <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %>
  108 + <label class="formlabel" for="institutions_cnpj">
  109 + <%= _("CNPJ") %>
  110 + <span class="required-field">(*)</span>
  111 + </label>
109 112 <%= inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => params[:institutions][:cnpj]) %>
110 113 </div>
111 114 </div>
... ... @@ -151,7 +154,7 @@
151 154 <%= inst.select(:juridical_nature, @juridical_nature, :selected=>params[:institutions][:juridical_nature], :class => flash[:error_institution_juridical_nature])%>
152 155 </div>
153 156 </div>
154   -
  157 +
155 158 <div class="spb-row public-institutions-fields">
156 159 <div class="spb-col spb-col-12">
157 160 <%= _("SISP ?") %>
... ...