Commit 0906bb6dab44aada8bada2ab1e15bd200e306ba4
1 parent
c9b158c7
Exists in
master
and in
49 other branches
CNPJ should be mandatory
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
src/noosfero-spb/gov_user/lib/institution.rb
@@ -23,6 +23,7 @@ class Institution < ActiveRecord::Base | @@ -23,6 +23,7 @@ class Institution < ActiveRecord::Base | ||
23 | :corporate_name, :siorg_code, :community | 23 | :corporate_name, :siorg_code, :community |
24 | 24 | ||
25 | validates :name, :presence=>true, :uniqueness=>true | 25 | validates :name, :presence=>true, :uniqueness=>true |
26 | + validates :cnpj, :presence=>true, :uniqueness=>true | ||
26 | 27 | ||
27 | before_save :verify_institution_type | 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,7 +105,10 @@ | ||
105 | 105 | ||
106 | <div class="spb-row"> | 106 | <div class="spb-row"> |
107 | <div class="spb-col spb-col-12"> | 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 | <%= inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => params[:institutions][:cnpj]) %> | 112 | <%= inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => params[:institutions][:cnpj]) %> |
110 | </div> | 113 | </div> |
111 | </div> | 114 | </div> |
@@ -151,7 +154,7 @@ | @@ -151,7 +154,7 @@ | ||
151 | <%= inst.select(:juridical_nature, @juridical_nature, :selected=>params[:institutions][:juridical_nature], :class => flash[:error_institution_juridical_nature])%> | 154 | <%= inst.select(:juridical_nature, @juridical_nature, :selected=>params[:institutions][:juridical_nature], :class => flash[:error_institution_juridical_nature])%> |
152 | </div> | 155 | </div> |
153 | </div> | 156 | </div> |
154 | - | 157 | + |
155 | <div class="spb-row public-institutions-fields"> | 158 | <div class="spb-row public-institutions-fields"> |
156 | <div class="spb-col spb-col-12"> | 159 | <div class="spb-col spb-col-12"> |
157 | <%= _("SISP ?") %> | 160 | <%= _("SISP ?") %> |