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 | 48 | |
49 | 49 | function get_post_data() { |
50 | 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 | 56 | governmental : { |
53 | 57 | power : jQuery("#institutions_governmental_power").selected().val(), |
54 | 58 | sphere : jQuery("#institutions_governmental_sphere").selected().val() |
55 | - } , | |
59 | + }, | |
56 | 60 | institution : { |
57 | 61 | cnpj: jQuery("#institutions_cnpj").val(), |
58 | 62 | type: get_selected_institution_type(), | ... | ... |
views/mpog_software_plugin/create_institution.html.erb
... | ... | @@ -24,6 +24,10 @@ |
24 | 24 | <%= required f.text_field(:name) %> |
25 | 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 | 31 | <%= fields_for :institutions do |inst| %> |
28 | 32 | |
29 | 33 | <span class='required-field'> | ... | ... |
views/profile/_institution_tab.html.erb
... | ... | @@ -6,6 +6,9 @@ |
6 | 6 | <%= display_field(_('Type:'), profile.institution, :type, true) %> |
7 | 7 | <%= display_field(_('CNPJ:'), profile.institution, :cnpj, true) %> |
8 | 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 | 12 | <% if profile.institution.type == "PrivateInstitution"%> |
10 | 13 | <%= display_field(_('Fantasy Name:'), profile.institution, :acronym, true) %> |
11 | 14 | <% else %> | ... | ... |