Commit 1e974dda9cddde256d5d2f53769c87c23dd816a0
Committed by
Arthur Esposte
1 parent
c09983e8
Exists in
master
and in
5 other branches
Add country, state, city in institution registration
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
3 changed files
with
13 additions
and
2 deletions
Show diff stats
public/mpog-institution-validations.js
@@ -48,11 +48,15 @@ | @@ -48,11 +48,15 @@ | ||
48 | 48 | ||
49 | function get_post_data() { | 49 | function get_post_data() { |
50 | return { | 50 | return { |
51 | - community : { name : jQuery("#community_name").val()}, | 51 | + community : { name : jQuery("#community_name").val(), |
52 | + country : jQuery("#community_country").val(), | ||
53 | + state : jQuery("#community_state").val(), | ||
54 | + city : jQuery("#community_city").val() | ||
55 | + }, | ||
52 | governmental : { | 56 | governmental : { |
53 | power : jQuery("#institutions_governmental_power").selected().val(), | 57 | power : jQuery("#institutions_governmental_power").selected().val(), |
54 | sphere : jQuery("#institutions_governmental_sphere").selected().val() | 58 | sphere : jQuery("#institutions_governmental_sphere").selected().val() |
55 | - } , | 59 | + }, |
56 | institution : { | 60 | institution : { |
57 | cnpj: jQuery("#institutions_cnpj").val(), | 61 | cnpj: jQuery("#institutions_cnpj").val(), |
58 | type: get_selected_institution_type(), | 62 | type: get_selected_institution_type(), |
views/mpog_software_plugin/create_institution.html.erb
@@ -24,6 +24,10 @@ | @@ -24,6 +24,10 @@ | ||
24 | <%= required f.text_field(:name) %> | 24 | <%= required f.text_field(:name) %> |
25 | <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> | 25 | <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> |
26 | 26 | ||
27 | + <%= required select_country(_('Country'), f, 'country', {:class => 'type-select', :id => "community_country"}) %> | ||
28 | + <%= required f.text_field(:state) %> | ||
29 | + <%= required f.text_field(:city) %> | ||
30 | + | ||
27 | <%= fields_for :institutions do |inst| %> | 31 | <%= fields_for :institutions do |inst| %> |
28 | 32 | ||
29 | <span class='required-field'> | 33 | <span class='required-field'> |
views/profile/_institution_tab.html.erb
@@ -6,6 +6,9 @@ | @@ -6,6 +6,9 @@ | ||
6 | <%= display_field(_('Type:'), profile.institution, :type, true) %> | 6 | <%= display_field(_('Type:'), profile.institution, :type, true) %> |
7 | <%= display_field(_('CNPJ:'), profile.institution, :cnpj, true) %> | 7 | <%= display_field(_('CNPJ:'), profile.institution, :cnpj, true) %> |
8 | <%= display_field(_('Last modification:'), profile.institution, :date_modification, true) %> | 8 | <%= display_field(_('Last modification:'), profile.institution, :date_modification, true) %> |
9 | + <%= display_field(_('Country:'), profile.institution.community, :country, true) %> | ||
10 | + <%= display_field(_('State:'), profile.institution.community, :state, true) %> | ||
11 | + <%= display_field(_('City:'), profile.institution.community, :city, true) %> | ||
9 | <% if profile.institution.type == "PrivateInstitution"%> | 12 | <% if profile.institution.type == "PrivateInstitution"%> |
10 | <%= display_field(_('Fantasy Name:'), profile.institution, :acronym, true) %> | 13 | <%= display_field(_('Fantasy Name:'), profile.institution, :acronym, true) %> |
11 | <% else %> | 14 | <% else %> |