Commit dce5c218a5c6f47111f340bffccceaa7efa9a5e0
Committed by
Thiago Ribeiro
1 parent
12664f27
Exists in
master
and in
51 other branches
Add modal to create institution in use report.
Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com> Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com> Signed-off-by: Marcos Ronaldo <marcos.rpj2@gmail.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
25 changed files
with
1261 additions
and
506 deletions
Show diff stats
src/noosfero-spb/gov_user/controllers/gov_user_plugin_controller.rb
@@ -117,7 +117,7 @@ class GovUserPluginController < ApplicationController | @@ -117,7 +117,7 @@ class GovUserPluginController < ApplicationController | ||
117 | @juridical_nature = get_juridical_natures() | 117 | @juridical_nature = get_juridical_natures() |
118 | 118 | ||
119 | state_list = get_state_list() | 119 | state_list = get_state_list() |
120 | - @state_options = state_list.zip(state_list).prepend([_('Select a state'), '-1']) | 120 | + @state_options = state_list.zip(state_list) |
121 | end | 121 | end |
122 | 122 | ||
123 | def get_model_by_params_field | 123 | def get_model_by_params_field |
src/noosfero-spb/gov_user/features/rating_institution_registration.feature
0 → 100644
@@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
1 | +Feature: Create institution on user report | ||
2 | + As a user | ||
3 | + I want to create a institution in use report of a software | ||
4 | + to add institution in report. | ||
5 | + | ||
6 | + Background: | ||
7 | + Given "GovUserPlugin" plugin is enabled | ||
8 | + And "SoftwareCommunitiesPlugin" plugin is enabled | ||
9 | + And "OrganizationRatings" plugin is enabled | ||
10 | + And I am logged in as mpog_admin | ||
11 | + And I go to /admin/plugins | ||
12 | + And I check "GovUserPlugin" | ||
13 | + And I check "SoftwareCommunitiesPlugin" | ||
14 | + And I check "Organization Ratings" | ||
15 | + And I press "Save changes" | ||
16 | + And the following softwares | ||
17 | + | name | public_software | finality | | ||
18 | + | Noosfero | true | some finality | | ||
19 | + | ||
20 | + @selenium | ||
21 | + Scenario: Test Additional JavaScript Fields | ||
22 | + Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | ||
23 | + And I should not see "Number of Beneficiaries" | ||
24 | + And I should not see "Saved resources" | ||
25 | + And I should not see "Organization name or Enterprise name" | ||
26 | + When I click on anything with selector "#comments-additional-information" | ||
27 | + Then I should see "Number of Beneficiaries" | ||
28 | + And I should see "Organization name or Enterprise name" | ||
29 | + And I should see "Saved resources" | ||
30 | + | ||
31 | + @selenium | ||
32 | + Scenario: Show new institution fields when clicked in add new institution | ||
33 | + Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | ||
34 | + And I click on anything with selector "#comments-additional-information" | ||
35 | + And I fill in "input_institution" with "None institution" | ||
36 | + And I sleep for 2 seconds | ||
37 | + When I follow "Add" | ||
38 | + Then I should see "New Institution" | ||
39 | + And I should see "Public Institution" | ||
40 | + And I should see "Private Institution" | ||
41 | + And I should see "Corporate Name" | ||
42 | + And I should see "Name" | ||
43 | + And I should see "State" | ||
44 | + And I should see "City" | ||
45 | + And I should see "Country" | ||
46 | + And I should see "CNPJ" | ||
47 | + And I should see "Acronym" | ||
48 | + And I choose "Public Institution" | ||
49 | + And I should see "Governmental Sphere:" | ||
50 | + And I should see "Governmental Power:" | ||
51 | + And I should see "Juridical Nature:" | ||
52 | + | ||
53 | + @selenium | ||
54 | + Scenario: Create new institution with name changed in the modal | ||
55 | + Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | ||
56 | + And I click on anything with selector "#comments-additional-information" | ||
57 | + And I fill in "input_institution" with "None institution" | ||
58 | + And I sleep for 2 seconds | ||
59 | + When I click on anything with selector "#create_institution_link" | ||
60 | + And I fill in "community_name" with "Noosfero Institution" | ||
61 | + And I select "United States" from "#community_country" | ||
62 | + And I follow "#save_institution_button" | ||
63 | + Then I should see "Noosfero Institution" | ||
64 | + | ||
65 | + @selenium | ||
66 | + Scenario: Check new institution name in the modal | ||
67 | + Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | ||
68 | + And I click on anything with selector "#comments-additional-information" | ||
69 | + And I fill in "input_institution" with "None institution" | ||
70 | + And I sleep for 2 seconds | ||
71 | + When I click on anything with selector "#create_institution_link" | ||
72 | + Then I should see "None Institution" within "community_name" | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + |
src/noosfero-spb/gov_user/features/steps_definitions/gov_user_steps.rb
@@ -1,90 +0,0 @@ | @@ -1,90 +0,0 @@ | ||
1 | -Given /^Institutions has initial default values on database$/ do | ||
2 | - GovernmentalPower.create(:name => "Executivo") | ||
3 | - GovernmentalPower.create(:name => "Legislativo") | ||
4 | - GovernmentalPower.create(:name => "Judiciario") | ||
5 | - | ||
6 | - GovernmentalSphere.create(:name => "Federal") | ||
7 | - | ||
8 | - JuridicalNature.create(:name => "Autarquia") | ||
9 | - JuridicalNature.create(:name => "Administracao Direta") | ||
10 | - JuridicalNature.create(:name => "Empresa Publica") | ||
11 | - JuridicalNature.create(:name => "Fundacao") | ||
12 | - JuridicalNature.create(:name => "Orgao Autonomo") | ||
13 | - JuridicalNature.create(:name => "Sociedade") | ||
14 | - JuridicalNature.create(:name => "Sociedade Civil") | ||
15 | - JuridicalNature.create(:name => "Sociedade de Economia Mista") | ||
16 | - | ||
17 | - national_region = NationalRegion.new | ||
18 | - national_region.name = "Distrito Federal" | ||
19 | - national_region.national_region_code = '35' | ||
20 | - national_region.national_region_type_id = NationalRegionType::STATE | ||
21 | - national_region.save | ||
22 | -end | ||
23 | - | ||
24 | -Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| | ||
25 | -# Wait the page javascript load | ||
26 | -sleep 1 | ||
27 | -# Basicaly it, search for the input field, type something, wait for ajax end select an item | ||
28 | -page.driver.browser.execute_script %Q{ | ||
29 | - var search_query = "#{input_field_selector}.ui-autocomplete-input"; | ||
30 | - var input = jQuery(search_query).first(); | ||
31 | - | ||
32 | - input.trigger('click'); | ||
33 | - input.val('#{typed}'); | ||
34 | - input.trigger('keydown'); | ||
35 | - | ||
36 | - window.setTimeout(function(){ | ||
37 | - search_query = ".ui-menu-item a:contains('#{should_select}')"; | ||
38 | - var typed = jQuery(search_query).first(); | ||
39 | - | ||
40 | - typed.trigger('mouseenter').trigger('click'); | ||
41 | - console.log(jQuery('#license_info_id')); | ||
42 | - }, 1000); | ||
43 | - } | ||
44 | - sleep 1 | ||
45 | -end | ||
46 | - | ||
47 | -Given /^the following public institutions?$/ do |table| | ||
48 | - # table is a Cucumber::Ast::Table | ||
49 | - table.hashes.each do |item| | ||
50 | - community = Community.new | ||
51 | - community.name = item[:name] | ||
52 | - community.country = item[:country] | ||
53 | - community.state = item[:state] | ||
54 | - community.city = item[:city] | ||
55 | - community.save! | ||
56 | - | ||
57 | - governmental_power = GovernmentalPower.where(:name => item[:governmental_power]).first | ||
58 | - governmental_sphere = GovernmentalSphere.where(:name => item[:governmental_sphere]).first | ||
59 | - | ||
60 | - juridical_nature = JuridicalNature.create(:name => item[:juridical_nature]) | ||
61 | - | ||
62 | - institution = PublicInstitution.new(:name => item[:name], :type => "PublicInstitution", :acronym => item[:acronym], :cnpj => item[:cnpj], :juridical_nature => juridical_nature, :governmental_power => governmental_power, :governmental_sphere => governmental_sphere) | ||
63 | - institution.community = community | ||
64 | - institution.corporate_name = item[:corporate_name] | ||
65 | - institution.save! | ||
66 | - end | ||
67 | -end | ||
68 | - | ||
69 | -Given /^I sleep for (\d+) seconds$/ do |time| | ||
70 | - sleep time.to_i | ||
71 | -end | ||
72 | - | ||
73 | -Given /^I am logged in as mpog_admin$/ do | ||
74 | - visit('/account/logout') | ||
75 | - | ||
76 | - user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com') | ||
77 | - person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin" | ||
78 | - user.person = person | ||
79 | - user.save! | ||
80 | - | ||
81 | - user.activate | ||
82 | - e = Environment.default | ||
83 | - e.add_admin(user.person) | ||
84 | - | ||
85 | - visit('/account/login') | ||
86 | - fill_in("Username", :with => user.login) | ||
87 | - fill_in("Password", :with => '123456') | ||
88 | - click_button("Log in") | ||
89 | -end | ||
90 | - |
src/noosfero-spb/gov_user/features/steps_definitions/gov_user_steps_backup.rb
0 → 100644
@@ -0,0 +1,93 @@ | @@ -0,0 +1,93 @@ | ||
1 | +Given /^Institutions has initial default values on database$/ do | ||
2 | + GovernmentalPower.create(:name => "Executivo") | ||
3 | + GovernmentalPower.create(:name => "Legislativo") | ||
4 | + GovernmentalPower.create(:name => "Judiciario") | ||
5 | + | ||
6 | + GovernmentalSphere.create(:name => "Federal") | ||
7 | + | ||
8 | + JuridicalNature.create(:name => "Autarquia") | ||
9 | + JuridicalNature.create(:name => "Administracao Direta") | ||
10 | + JuridicalNature.create(:name => "Empresa Publica") | ||
11 | + JuridicalNature.create(:name => "Fundacao") | ||
12 | + JuridicalNature.create(:name => "Orgao Autonomo") | ||
13 | + JuridicalNature.create(:name => "Sociedade") | ||
14 | + JuridicalNature.create(:name => "Sociedade Civil") | ||
15 | + JuridicalNature.create(:name => "Sociedade de Economia Mista") | ||
16 | + | ||
17 | + national_region = NationalRegion.new | ||
18 | + national_region.name = "Distrito Federal" | ||
19 | + national_region.national_region_code = '35' | ||
20 | + national_region.national_region_type_id = NationalRegionType::STATE | ||
21 | + national_region.save | ||
22 | +end | ||
23 | + | ||
24 | +Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| | ||
25 | +# Wait the page javascript load | ||
26 | +sleep 1 | ||
27 | +# Basicaly it, search for the input field, type something, wait for ajax end select an item | ||
28 | +page.driver.browser.execute_script %Q{ | ||
29 | + var search_query = "#{input_field_selector}.ui-autocomplete-input"; | ||
30 | + var input = jQuery(search_query).first(); | ||
31 | + | ||
32 | + input.trigger('click'); | ||
33 | + input.val('#{typed}'); | ||
34 | + input.trigger('keydown'); | ||
35 | + | ||
36 | + window.setTimeout(function(){ | ||
37 | + search_query = ".ui-menu-item a:contains('#{should_select}')"; | ||
38 | + var typed = jQuery(search_query).first(); | ||
39 | + | ||
40 | + typed.trigger('mouseenter').trigger('click'); | ||
41 | + console.log(jQuery('#license_info_id')); | ||
42 | + }, 1000); | ||
43 | + } | ||
44 | + sleep 1 | ||
45 | +end | ||
46 | + | ||
47 | +Given /^the following public institutions?$/ do |table| | ||
48 | + # table is a Cucumber::Ast::Table | ||
49 | + table.hashes.each do |item| | ||
50 | + community = Community.new | ||
51 | + community.name = item[:name] | ||
52 | + community.country = item[:country] | ||
53 | + community.state = item[:state] | ||
54 | + community.city = item[:city] | ||
55 | + community.save! | ||
56 | + | ||
57 | + governmental_power = GovernmentalPower.where(:name => item[:governmental_power]).first | ||
58 | + governmental_sphere = GovernmentalSphere.where(:name => item[:governmental_sphere]).first | ||
59 | + | ||
60 | + juridical_nature = JuridicalNature.create(:name => item[:juridical_nature]) | ||
61 | + | ||
62 | + institution = PublicInstitution.new(:name => item[:name], :type => "PublicInstitution", :acronym => item[:acronym], :cnpj => item[:cnpj], :juridical_nature => juridical_nature, :governmental_power => governmental_power, :governmental_sphere => governmental_sphere) | ||
63 | + institution.community = community | ||
64 | + institution.corporate_name = item[:corporate_name] | ||
65 | + institution.save! | ||
66 | + end | ||
67 | +end | ||
68 | + | ||
69 | +Given /^I sleep for (\d+) seconds$/ do |time| | ||
70 | + sleep time.to_i | ||
71 | +end | ||
72 | + | ||
73 | +Given /^I am logged in as mpog_admin$/ do | ||
74 | + visit('/account/logout') | ||
75 | + | ||
76 | + user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com') | ||
77 | + person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin" | ||
78 | + user.person = person | ||
79 | + user.save! | ||
80 | + | ||
81 | + user.activate | ||
82 | + e = Environment.default | ||
83 | + e.add_admin(user.person) | ||
84 | + | ||
85 | + visit('/account/login') | ||
86 | + fill_in("Username", :with => user.login) | ||
87 | + fill_in("Password", :with => '123456') | ||
88 | + click_button("Log in") | ||
89 | +end | ||
90 | + | ||
91 | +Given /^I click on anything with selector "([^"]*)"$/ do |selector| | ||
92 | + evaluate_script "jQuery('#{selector}').trigger('click') && true" | ||
93 | +end |
src/noosfero-spb/gov_user/features/steps_definitions/software_communities_steps.rb
0 → 120000
src/noosfero-spb/gov_user/lib/ext/organization_rating.rb
@@ -13,7 +13,8 @@ OrganizationRating.class_eval do | @@ -13,7 +13,8 @@ OrganizationRating.class_eval do | ||
13 | def verify_institution | 13 | def verify_institution |
14 | if self.institution != nil | 14 | if self.institution != nil |
15 | institution = Institution.find_by_id self.institution.id | 15 | institution = Institution.find_by_id self.institution.id |
16 | - self.errors.add :institution, _("not found") unless institution | 16 | + self.errors.add :institution, _("institution not found") unless institution |
17 | + return !!institution | ||
17 | end | 18 | end |
18 | end | 19 | end |
19 | 20 |
src/noosfero-spb/gov_user/lib/gov_user_plugin.rb
@@ -146,12 +146,14 @@ class GovUserPlugin < Noosfero::Plugin | @@ -146,12 +146,14 @@ class GovUserPlugin < Noosfero::Plugin | ||
146 | lib/noosfero-root.js | 146 | lib/noosfero-root.js |
147 | lib/select-element.js | 147 | lib/select-element.js |
148 | lib/select-field-choices.js | 148 | lib/select-field-choices.js |
149 | + lib/modal-observer.js | ||
149 | views/complete-registration.js | 150 | views/complete-registration.js |
150 | views/control-panel.js | 151 | views/control-panel.js |
151 | views/create-institution.js | 152 | views/create-institution.js |
152 | views/new-community.js | 153 | views/new-community.js |
153 | views/user-edit-profile.js | 154 | views/user-edit-profile.js |
154 | views/gov-user-comments-extra-fields.js | 155 | views/gov-user-comments-extra-fields.js |
156 | + views/institution-modal.js | ||
155 | initializer.js | 157 | initializer.js |
156 | app.js | 158 | app.js |
157 | ) | 159 | ) |
src/noosfero-spb/gov_user/lib/institution_modal_helper.rb
0 → 100644
@@ -0,0 +1,74 @@ | @@ -0,0 +1,74 @@ | ||
1 | +class InstitutionModalHelper | ||
2 | + extend( | ||
3 | + ActionView::Helpers::FormOptionsHelper, # content_tag | ||
4 | + ActionView::Helpers::FormTagHelper, # button_tag | ||
5 | + ActionView::Helpers::UrlHelper, # link_to | ||
6 | + ActionView::Context # content_tag do end | ||
7 | + ) | ||
8 | + | ||
9 | + def self.modal_button link_text=_("Create new institution"), display="block" | ||
10 | + # HTML Sample in: http://getbootstrap.com/javascript/#modals-examples | ||
11 | + content_tag :div, :id=>"institution_modal_container", :style=>"display: #{display}" do | ||
12 | + link = link_to( | ||
13 | + link_text, | ||
14 | + "javascript: void(0)", | ||
15 | + {:class=>"button with-text", :data=>{:toggle=>"modal", :target=>"#institution_modal"}, :id=>"create_institution_link"} | ||
16 | + ) | ||
17 | + | ||
18 | + link.concat modal | ||
19 | + end | ||
20 | + end | ||
21 | + | ||
22 | + private | ||
23 | + | ||
24 | + def self.modal | ||
25 | + options = { | ||
26 | + :id=>"institution_modal", | ||
27 | + :role=>"dialog", | ||
28 | + :class=>"modal fade" | ||
29 | + } | ||
30 | + | ||
31 | + content_tag :div, options do | ||
32 | + modal_dialog | ||
33 | + end | ||
34 | + end | ||
35 | + | ||
36 | + def self.modal_dialog | ||
37 | + content_tag :div, :class=>"modal-dialog", :role=>"document" do | ||
38 | + modal_content | ||
39 | + end | ||
40 | + end | ||
41 | + | ||
42 | + def self.modal_content | ||
43 | + content_tag :div, :class=>"modal-content" do | ||
44 | + #modal_header.concat(modal_body.concat(modal_footer)) | ||
45 | + modal_header.concat(modal_body) | ||
46 | + end | ||
47 | + end | ||
48 | + | ||
49 | + def self.modal_header | ||
50 | + content_tag :div, :class=>"modal-header" do | ||
51 | + button = button_tag :type=>"button", :data=>{:dismiss=>"modal"}, :class=>"close" do | ||
52 | + content_tag :span, "×" | ||
53 | + end | ||
54 | + | ||
55 | + h4 = content_tag :h4, _("New Institution"), :class=>"modal-title" | ||
56 | + | ||
57 | + button.concat h4 | ||
58 | + end | ||
59 | + end | ||
60 | + | ||
61 | + def self.modal_body | ||
62 | + content_tag :div, "", :id=>"institution_modal_body", :class=>"modal-body" | ||
63 | + end | ||
64 | + | ||
65 | + #def self.modal_footer | ||
66 | + # content_tag :div, {:class=>"modal-footer"} do | ||
67 | + # close = button_tag _("Close"), :type=>"button", :class=>"button with-text" | ||
68 | + # save = button_tag _("Save changes"), :type=>"button", :class=>"button with-text" | ||
69 | + # | ||
70 | + # close.concat save | ||
71 | + # end | ||
72 | + #end | ||
73 | +end | ||
74 | + |
src/noosfero-spb/gov_user/po/gov_user.pot
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | #, fuzzy | 6 | #, fuzzy |
7 | msgid "" | 7 | msgid "" |
8 | msgstr "" | 8 | msgstr "" |
9 | -"Project-Id-Version: 1.3.1+spb2\n" | ||
10 | -"POT-Creation-Date: 2015-10-16 19:14-0000\n" | 9 | +"Project-Id-Version: 1.3~rc1-3-gaf61824\n" |
10 | +"POT-Creation-Date: 2015-12-03 10:35-0200\n" | ||
11 | "PO-Revision-Date: 2015-09-01 20:59-0000\n" | 11 | "PO-Revision-Date: 2015-09-01 20:59-0000\n" |
12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | "Language-Team: LANGUAGE <LL@li.org>\n" | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -17,62 +17,37 @@ msgstr "" | @@ -17,62 +17,37 @@ msgstr "" | ||
17 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
19 | 19 | ||
20 | -#: plugins/gov_user/test/unit/gov_user_person_test.rb:50 | ||
21 | -#: plugins/gov_user/test/unit/gov_user_person_test.rb:56 | ||
22 | -msgid "Name Should begin with a capital letter and no special characters" | ||
23 | -msgstr "" | ||
24 | - | ||
25 | #: plugins/gov_user/controllers/gov_user_plugin_myprofile_controller.rb:28 | 20 | #: plugins/gov_user/controllers/gov_user_plugin_myprofile_controller.rb:28 |
26 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:168 | 21 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:181 |
27 | msgid "Could not find Governmental Power or Governmental Sphere" | 22 | msgid "Could not find Governmental Power or Governmental Sphere" |
28 | msgstr "" | 23 | msgstr "" |
29 | 24 | ||
30 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:18 | ||
31 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:43 | 25 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:137 |
32 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:80 | 26 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:80 |
33 | msgid "Select a Governmental Sphere" | 27 | msgid "Select a Governmental Sphere" |
34 | msgstr "" | 28 | msgstr "" |
35 | 29 | ||
36 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:19 | ||
37 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:44 | 30 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:142 |
38 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:87 | 31 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:87 |
39 | msgid "Select a Governmental Power" | 32 | msgid "Select a Governmental Power" |
40 | msgstr "" | 33 | msgstr "" |
41 | 34 | ||
42 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:20 | ||
43 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:45 | 35 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:147 |
44 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:93 | 36 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:93 |
45 | msgid "Select a Juridical Nature" | 37 | msgid "Select a Juridical Nature" |
46 | msgstr "" | 38 | msgstr "" |
47 | 39 | ||
48 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:21 | ||
49 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:46 | ||
50 | -msgid "Select a state" | ||
51 | -msgstr "" | ||
52 | - | ||
53 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:214 | 40 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:227 |
54 | msgid "Institution successful created!" | 41 | msgid "Institution successful created!" |
55 | msgstr "" | 42 | msgstr "" |
56 | 43 | ||
57 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:219 | 44 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:232 |
58 | msgid "Institution could not be created!" | 45 | msgid "Institution could not be created!" |
59 | msgstr "" | 46 | msgstr "" |
60 | 47 | ||
61 | -#: plugins/gov_user/lib/gov_user_plugin.rb:17 | ||
62 | -msgid "Add features related to Brazilian government." | ||
63 | -msgstr "" | ||
64 | - | ||
65 | -#: plugins/gov_user/lib/gov_user_plugin.rb:132 | ||
66 | -#: plugins/gov_user/lib/gov_user_plugin.rb:163 | ||
67 | -msgid "Create Institution" | ||
68 | -msgstr "" | ||
69 | - | ||
70 | -#: plugins/gov_user/lib/gov_user_plugin.rb:289 | ||
71 | -msgid "Institution Info" | ||
72 | -msgstr "" | ||
73 | - | ||
74 | -#: plugins/gov_user/lib/gov_user_plugin.rb:314 | ||
75 | -msgid "Institution" | 48 | +#: plugins/gov_user/test/unit/gov_user_person_test.rb:50 |
49 | +#: plugins/gov_user/test/unit/gov_user_person_test.rb:56 | ||
50 | +msgid "Name Should begin with a capital letter and no special characters" | ||
76 | msgstr "" | 51 | msgstr "" |
77 | 52 | ||
78 | #: plugins/gov_user/lib/institution.rb:47 | 53 | #: plugins/gov_user/lib/institution.rb:47 |
@@ -89,6 +64,14 @@ msgstr "" | @@ -89,6 +64,14 @@ msgstr "" | ||
89 | msgid "invalid format" | 64 | msgid "invalid format" |
90 | msgstr "" | 65 | msgstr "" |
91 | 66 | ||
67 | +#: plugins/gov_user/lib/ext/search_controller.rb:17 | ||
68 | +msgid "Institution Catalog" | ||
69 | +msgstr "" | ||
70 | + | ||
71 | +#: plugins/gov_user/lib/ext/organization_rating.rb:16 | ||
72 | +msgid "institution not found" | ||
73 | +msgstr "" | ||
74 | + | ||
92 | #: plugins/gov_user/lib/ext/user.rb:19 | 75 | #: plugins/gov_user/lib/ext/user.rb:19 |
93 | msgid "Email must be different from secondary email." | 76 | msgid "Email must be different from secondary email." |
94 | msgstr "" | 77 | msgstr "" |
@@ -101,12 +84,12 @@ msgstr "" | @@ -101,12 +84,12 @@ msgstr "" | ||
101 | msgid "Invalid secondary email format." | 84 | msgid "Invalid secondary email format." |
102 | msgstr "" | 85 | msgstr "" |
103 | 86 | ||
104 | -#: plugins/gov_user/lib/ext/search_controller.rb:17 | ||
105 | -msgid "Institution Catalog" | 87 | +#: plugins/gov_user/lib/institution_modal_helper.rb:9 |
88 | +msgid "Create new institution" | ||
106 | msgstr "" | 89 | msgstr "" |
107 | 90 | ||
108 | -#: plugins/gov_user/lib/ext/organization_rating.rb:16 | ||
109 | -msgid "not found" | 91 | +#: plugins/gov_user/lib/institution_modal_helper.rb:55 |
92 | +msgid "New Institution" | ||
110 | msgstr "" | 93 | msgstr "" |
111 | 94 | ||
112 | #: plugins/gov_user/lib/institutions_block.rb:4 | 95 | #: plugins/gov_user/lib/institutions_block.rb:4 |
@@ -129,6 +112,40 @@ msgstr "" | @@ -129,6 +112,40 @@ msgstr "" | ||
129 | msgid "institutions|View all" | 112 | msgid "institutions|View all" |
130 | msgstr "" | 113 | msgstr "" |
131 | 114 | ||
115 | +#: plugins/gov_user/lib/gov_user_plugin.rb:17 | ||
116 | +msgid "Add features related to Brazilian government." | ||
117 | +msgstr "" | ||
118 | + | ||
119 | +#: plugins/gov_user/lib/gov_user_plugin.rb:132 | ||
120 | +#: plugins/gov_user/lib/gov_user_plugin.rb:165 | ||
121 | +msgid "Create Institution" | ||
122 | +msgstr "" | ||
123 | + | ||
124 | +#: plugins/gov_user/lib/gov_user_plugin.rb:291 | ||
125 | +msgid "Institution Info" | ||
126 | +msgstr "" | ||
127 | + | ||
128 | +#: plugins/gov_user/lib/gov_user_plugin.rb:316 | ||
129 | +#: plugins/gov_user/views/organization_ratings_extra_fields_show_institution.html.erb:4 | ||
130 | +msgid "Institution" | ||
131 | +msgstr "" | ||
132 | + | ||
133 | +#: plugins/gov_user/views/search/institutions.html.erb:3 | ||
134 | +msgid "Type words about the %s you're looking for" | ||
135 | +msgstr "" | ||
136 | + | ||
137 | +#: plugins/gov_user/views/incomplete_registration.html.erb:3 | ||
138 | +msgid "Complete Profile" | ||
139 | +msgstr "" | ||
140 | + | ||
141 | +#: plugins/gov_user/views/incomplete_registration.html.erb:6 | ||
142 | +msgid "Complete your profile" | ||
143 | +msgstr "" | ||
144 | + | ||
145 | +#: plugins/gov_user/views/incomplete_registration.html.erb:7 | ||
146 | +msgid "Hide" | ||
147 | +msgstr "" | ||
148 | + | ||
132 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:1 | 149 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:1 |
133 | msgid "Edit Institution" | 150 | msgid "Edit Institution" |
134 | msgstr "" | 151 | msgstr "" |
@@ -143,100 +160,135 @@ msgid "" | @@ -143,100 +160,135 @@ msgid "" | ||
143 | msgstr "" | 160 | msgstr "" |
144 | 161 | ||
145 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:11 | 162 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:11 |
146 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:11 | 163 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:18 |
147 | msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" | 164 | msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" |
148 | msgstr "" | 165 | msgstr "" |
149 | 166 | ||
150 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:28 | 167 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:28 |
151 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:37 | 168 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:51 |
152 | msgid "Public Institution" | 169 | msgid "Public Institution" |
153 | msgstr "" | 170 | msgstr "" |
154 | 171 | ||
155 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:33 | 172 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:33 |
156 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:33 | 173 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:44 |
157 | msgid "Private Institution" | 174 | msgid "Private Institution" |
158 | msgstr "" | 175 | msgstr "" |
159 | 176 | ||
160 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:40 | 177 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:40 |
161 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:44 | 178 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:67 |
162 | msgid "Institution name already exists" | 179 | msgid "Institution name already exists" |
163 | msgstr "" | 180 | msgstr "" |
164 | 181 | ||
165 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:44 | 182 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:44 |
166 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:48 | 183 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:71 |
167 | msgid "Corporate Name" | 184 | msgid "Corporate Name" |
168 | msgstr "" | 185 | msgstr "" |
169 | 186 | ||
170 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:49 | 187 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:49 |
171 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:53 | 188 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:79 |
172 | msgid "Country" | 189 | msgid "Country" |
173 | msgstr "" | 190 | msgstr "" |
174 | 191 | ||
175 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:53 | 192 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:53 |
176 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:57 | 193 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:88 |
177 | msgid "State" | 194 | msgid "State" |
178 | msgstr "" | 195 | msgstr "" |
179 | 196 | ||
180 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:63 | 197 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:63 |
181 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:66 | 198 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:108 |
182 | msgid "CNPJ" | 199 | msgid "CNPJ" |
183 | msgstr "" | 200 | msgstr "" |
184 | 201 | ||
185 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:70 | 202 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:70 |
186 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:72 | 203 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:72 |
187 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:72 | ||
188 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:74 | 204 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:115 |
205 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:117 | ||
189 | msgid "Acronym" | 206 | msgid "Acronym" |
190 | msgstr "" | 207 | msgstr "" |
191 | 208 | ||
192 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:71 | 209 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:71 |
193 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:73 | 210 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:116 |
194 | msgid "Fantasy name" | 211 | msgid "Fantasy name" |
195 | msgstr "" | 212 | msgstr "" |
196 | 213 | ||
197 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:79 | 214 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:79 |
198 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:17 | 215 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:17 |
199 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:81 | 216 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:124 |
200 | msgid "Governmental Sphere:" | 217 | msgid "Governmental Sphere:" |
201 | msgstr "" | 218 | msgstr "" |
202 | 219 | ||
203 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:86 | 220 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:86 |
204 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:16 | 221 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:16 |
205 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:88 | 222 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:131 |
206 | msgid "Governmental Power:" | 223 | msgid "Governmental Power:" |
207 | msgstr "" | 224 | msgstr "" |
208 | 225 | ||
209 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:92 | 226 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:92 |
210 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:18 | 227 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:18 |
211 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:94 | 228 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:138 |
212 | msgid "Juridical Nature:" | 229 | msgid "Juridical Nature:" |
213 | msgstr "" | 230 | msgstr "" |
214 | 231 | ||
215 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:99 | 232 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:99 |
216 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:101 | ||
217 | msgid "SISP?" | 233 | msgid "SISP?" |
218 | msgstr "" | 234 | msgstr "" |
219 | 235 | ||
220 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:101 | 236 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:101 |
221 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 | 237 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 |
222 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:104 | 238 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:153 |
223 | msgid "Yes" | 239 | msgid "Yes" |
224 | msgstr "" | 240 | msgstr "" |
225 | 241 | ||
226 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:103 | 242 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:103 |
227 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:106 | 243 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:106 |
228 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 | 244 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 |
229 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:106 | ||
230 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:108 | 245 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:158 |
246 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:162 | ||
231 | msgid "No" | 247 | msgid "No" |
232 | msgstr "" | 248 | msgstr "" |
233 | 249 | ||
234 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:111 | 250 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:111 |
235 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:114 | ||
236 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:118 | 251 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:172 |
252 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:175 | ||
237 | msgid "Save" | 253 | msgid "Save" |
238 | msgstr "" | 254 | msgstr "" |
239 | 255 | ||
256 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:2 | ||
257 | +msgid "Organization name or Enterprise name" | ||
258 | +msgstr "" | ||
259 | + | ||
260 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:7 | ||
261 | +msgid "No organization or company found" | ||
262 | +msgstr "" | ||
263 | + | ||
264 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:8 | ||
265 | +msgid "Add" | ||
266 | +msgstr "" | ||
267 | + | ||
268 | +#: plugins/gov_user/views/person_editor_extras.html.erb:2 | ||
269 | +msgid "Secondary e-mail" | ||
270 | +msgstr "" | ||
271 | + | ||
272 | +#: plugins/gov_user/views/person_editor_extras.html.erb:21 | ||
273 | +msgid "No institution found" | ||
274 | +msgstr "" | ||
275 | + | ||
276 | +#: plugins/gov_user/views/person_editor_extras.html.erb:38 | ||
277 | +msgid "Should begin with a capital letter and no special characters" | ||
278 | +msgstr "" | ||
279 | + | ||
280 | +#: plugins/gov_user/views/person_editor_extras.html.erb:39 | ||
281 | +msgid "Email should have the following format: name@host.br" | ||
282 | +msgstr "" | ||
283 | + | ||
284 | +#: plugins/gov_user/views/person_editor_extras.html.erb:40 | ||
285 | +msgid "Site should have a valid format: http://name.hosts" | ||
286 | +msgstr "" | ||
287 | + | ||
288 | +#: plugins/gov_user/views/person_editor_extras.html.erb:41 | ||
289 | +msgid "If you work in a public agency use your government e-Mail" | ||
290 | +msgstr "" | ||
291 | + | ||
240 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:3 | 292 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:3 |
241 | msgid "Institution Information" | 293 | msgid "Institution Information" |
242 | msgstr "" | 294 | msgstr "" |
@@ -277,76 +329,35 @@ msgstr "" | @@ -277,76 +329,35 @@ msgstr "" | ||
277 | msgid "SISP:" | 329 | msgid "SISP:" |
278 | msgstr "" | 330 | msgstr "" |
279 | 331 | ||
280 | -#: plugins/gov_user/views/ratings_extra_field.html.erb:2 | ||
281 | -msgid "Organization name or Enterprise name" | ||
282 | -msgstr "" | ||
283 | - | ||
284 | -#: plugins/gov_user/views/ratings_extra_field.html.erb:6 | ||
285 | -#: plugins/gov_user/views/person_editor_extras.html.erb:21 | ||
286 | -msgid "No institution found" | ||
287 | -msgstr "" | ||
288 | - | ||
289 | -#: plugins/gov_user/views/person_editor_extras.html.erb:2 | ||
290 | -msgid "Secondary e-mail" | ||
291 | -msgstr "" | ||
292 | - | ||
293 | -#: plugins/gov_user/views/person_editor_extras.html.erb:22 | ||
294 | -msgid "Add new institution" | ||
295 | -msgstr "" | ||
296 | - | ||
297 | -#: plugins/gov_user/views/person_editor_extras.html.erb:23 | ||
298 | -msgid "Create new institution" | ||
299 | -msgstr "" | ||
300 | - | ||
301 | -#: plugins/gov_user/views/person_editor_extras.html.erb:39 | ||
302 | -msgid "Should begin with a capital letter and no special characters" | 332 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:11 |
333 | +msgid "The highlighted fields are mandatory" | ||
303 | msgstr "" | 334 | msgstr "" |
304 | 335 | ||
305 | -#: plugins/gov_user/views/person_editor_extras.html.erb:40 | ||
306 | -msgid "Email should have the following format: name@host.br" | 336 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:23 |
337 | +msgid "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | ||
307 | msgstr "" | 338 | msgstr "" |
308 | 339 | ||
309 | -#: plugins/gov_user/views/person_editor_extras.html.erb:41 | ||
310 | -msgid "Site should have a valid format: http://name.hosts" | 340 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:62 |
341 | +msgid "Name" | ||
311 | msgstr "" | 342 | msgstr "" |
312 | 343 | ||
313 | -#: plugins/gov_user/views/person_editor_extras.html.erb:42 | ||
314 | -msgid "If you work in a public agency use your government e-Mail" | 344 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:97 |
345 | +msgid "City" | ||
315 | msgstr "" | 346 | msgstr "" |
316 | 347 | ||
317 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:1 | ||
318 | -msgid "New Institution" | 348 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:145 |
349 | +msgid "SISP ?" | ||
319 | msgstr "" | 350 | msgstr "" |
320 | 351 | ||
321 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:16 | ||
322 | -msgid "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | ||
323 | -msgstr "" | ||
324 | - | ||
325 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:115 | ||
326 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:119 | 352 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:173 |
353 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:176 | ||
327 | msgid "Cancel" | 354 | msgid "Cancel" |
328 | msgstr "" | 355 | msgstr "" |
329 | 356 | ||
330 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:121 | 357 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:177 |
331 | msgid "Could not send the form data to the server" | 358 | msgid "Could not send the form data to the server" |
332 | msgstr "" | 359 | msgstr "" |
333 | 360 | ||
334 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:128 | 361 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:185 |
335 | msgid "Creating institution" | 362 | msgid "Creating institution" |
336 | msgstr "" | 363 | msgstr "" |
337 | - | ||
338 | -#: plugins/gov_user/views/search/institutions.html.erb:3 | ||
339 | -msgid "Type words about the %s you're looking for" | ||
340 | -msgstr "" | ||
341 | - | ||
342 | -#: plugins/gov_user/views/incomplete_registration.html.erb:3 | ||
343 | -msgid "Complete Profile" | ||
344 | -msgstr "" | ||
345 | - | ||
346 | -#: plugins/gov_user/views/incomplete_registration.html.erb:6 | ||
347 | -msgid "Complete your profile" | ||
348 | -msgstr "" | ||
349 | - | ||
350 | -#: plugins/gov_user/views/incomplete_registration.html.erb:7 | ||
351 | -msgid "Hide" | ||
352 | -msgstr "" |
src/noosfero-spb/gov_user/po/pt/gov_user.po
@@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
5 | # | 5 | # |
6 | msgid "" | 6 | msgid "" |
7 | msgstr "" | 7 | msgstr "" |
8 | -"Project-Id-Version: 1.3.1+spb2\n" | ||
9 | -"POT-Creation-Date: 2015-10-16 19:14-0000\n" | 8 | +"Project-Id-Version: 1.3~rc1-3-gaf61824\n" |
9 | +"POT-Creation-Date: 2015-12-03 10:35-0200\n" | ||
10 | "PO-Revision-Date: 2015-09-01 19:55-0000\n" | 10 | "PO-Revision-Date: 2015-09-01 19:55-0000\n" |
11 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 11 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
12 | "Language-Team: LANGUAGE <LL@li.org>\n" | 12 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -16,64 +16,38 @@ msgstr "" | @@ -16,64 +16,38 @@ msgstr "" | ||
16 | "Content-Transfer-Encoding: 8bit\n" | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | 17 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
18 | 18 | ||
19 | -#: plugins/gov_user/test/unit/gov_user_person_test.rb:50 | ||
20 | -#: plugins/gov_user/test/unit/gov_user_person_test.rb:56 | ||
21 | -msgid "Name Should begin with a capital letter and no special characters" | ||
22 | -msgstr "" | ||
23 | -"Nome deve iniciar com letrar maiúscula e não deve conter carateres especiais" | ||
24 | - | ||
25 | #: plugins/gov_user/controllers/gov_user_plugin_myprofile_controller.rb:28 | 19 | #: plugins/gov_user/controllers/gov_user_plugin_myprofile_controller.rb:28 |
26 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:168 | 20 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:181 |
27 | msgid "Could not find Governmental Power or Governmental Sphere" | 21 | msgid "Could not find Governmental Power or Governmental Sphere" |
28 | msgstr "Não foi possível encontrar o Poder ou Esfera Governamental" | 22 | msgstr "Não foi possível encontrar o Poder ou Esfera Governamental" |
29 | 23 | ||
30 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:18 | ||
31 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:43 | 24 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:137 |
32 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:80 | 25 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:80 |
33 | msgid "Select a Governmental Sphere" | 26 | msgid "Select a Governmental Sphere" |
34 | msgstr "Selecione uma Esfera Governamental" | 27 | msgstr "Selecione uma Esfera Governamental" |
35 | 28 | ||
36 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:19 | ||
37 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:44 | 29 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:142 |
38 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:87 | 30 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:87 |
39 | msgid "Select a Governmental Power" | 31 | msgid "Select a Governmental Power" |
40 | msgstr "Selecione um Poder Governamental" | 32 | msgstr "Selecione um Poder Governamental" |
41 | 33 | ||
42 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:20 | ||
43 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:45 | 34 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:147 |
44 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:93 | 35 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:93 |
45 | msgid "Select a Juridical Nature" | 36 | msgid "Select a Juridical Nature" |
46 | msgstr "Seleciona uma Natureza Jurídica" | 37 | msgstr "Seleciona uma Natureza Jurídica" |
47 | 38 | ||
48 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:21 | ||
49 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:46 | ||
50 | -msgid "Select a state" | ||
51 | -msgstr "Selecione um Estado" | ||
52 | - | ||
53 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:214 | 39 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:227 |
54 | msgid "Institution successful created!" | 40 | msgid "Institution successful created!" |
55 | msgstr "Instituição criada com sucesso!" | 41 | msgstr "Instituição criada com sucesso!" |
56 | 42 | ||
57 | -#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:219 | 43 | +#: plugins/gov_user/controllers/gov_user_plugin_controller.rb:232 |
58 | msgid "Institution could not be created!" | 44 | msgid "Institution could not be created!" |
59 | msgstr "Instituição não pode ser criada!" | 45 | msgstr "Instituição não pode ser criada!" |
60 | 46 | ||
61 | -#: plugins/gov_user/lib/gov_user_plugin.rb:17 | ||
62 | -msgid "Add features related to Brazilian government." | ||
63 | -msgstr "Adicionar funcionlidade relacionada com o governo brasileiro." | ||
64 | - | ||
65 | -#: plugins/gov_user/lib/gov_user_plugin.rb:132 | ||
66 | -#: plugins/gov_user/lib/gov_user_plugin.rb:163 | ||
67 | -msgid "Create Institution" | ||
68 | -msgstr "Criar Instituição" | ||
69 | - | ||
70 | -#: plugins/gov_user/lib/gov_user_plugin.rb:289 | ||
71 | -msgid "Institution Info" | ||
72 | -msgstr "Informações da Instituição" | ||
73 | - | ||
74 | -#: plugins/gov_user/lib/gov_user_plugin.rb:314 | ||
75 | -msgid "Institution" | ||
76 | -msgstr "Instituição" | 47 | +#: plugins/gov_user/test/unit/gov_user_person_test.rb:50 |
48 | +#: plugins/gov_user/test/unit/gov_user_person_test.rb:56 | ||
49 | +msgid "Name Should begin with a capital letter and no special characters" | ||
50 | +msgstr "Nome deve iniciar com letrar maiúscula e não deve conter carateres especiais" | ||
77 | 51 | ||
78 | #: plugins/gov_user/lib/institution.rb:47 | 52 | #: plugins/gov_user/lib/institution.rb:47 |
79 | msgid "invalid, only public and private institutions are allowed." | 53 | msgid "invalid, only public and private institutions are allowed." |
@@ -89,6 +63,14 @@ msgstr "não pode ficar em branco" | @@ -89,6 +63,14 @@ msgstr "não pode ficar em branco" | ||
89 | msgid "invalid format" | 63 | msgid "invalid format" |
90 | msgstr "formato inválido" | 64 | msgstr "formato inválido" |
91 | 65 | ||
66 | +#: plugins/gov_user/lib/ext/search_controller.rb:17 | ||
67 | +msgid "Institution Catalog" | ||
68 | +msgstr "Catálogo de Instituições" | ||
69 | + | ||
70 | +#: plugins/gov_user/lib/ext/organization_rating.rb:16 | ||
71 | +msgid "institution not found" | ||
72 | +msgstr "Nenhuma instituição encontrada" | ||
73 | + | ||
92 | #: plugins/gov_user/lib/ext/user.rb:19 | 74 | #: plugins/gov_user/lib/ext/user.rb:19 |
93 | msgid "Email must be different from secondary email." | 75 | msgid "Email must be different from secondary email." |
94 | msgstr "Email deve ser diferente do email secundário" | 76 | msgstr "Email deve ser diferente do email secundário" |
@@ -101,13 +83,13 @@ msgstr "Email ou email secundário já estão sendo utilizados." | @@ -101,13 +83,13 @@ msgstr "Email ou email secundário já estão sendo utilizados." | ||
101 | msgid "Invalid secondary email format." | 83 | msgid "Invalid secondary email format." |
102 | msgstr "Formato inválido do email sencundário" | 84 | msgstr "Formato inválido do email sencundário" |
103 | 85 | ||
104 | -#: plugins/gov_user/lib/ext/search_controller.rb:17 | ||
105 | -msgid "Institution Catalog" | ||
106 | -msgstr "Catálogo de Instituições" | 86 | +#: plugins/gov_user/lib/institution_modal_helper.rb:9 |
87 | +msgid "Create new institution" | ||
88 | +msgstr "Criar nova instituição" | ||
107 | 89 | ||
108 | -#: plugins/gov_user/lib/ext/organization_rating.rb:16 | ||
109 | -msgid "not found" | ||
110 | -msgstr "não encontrada" | 90 | +#: plugins/gov_user/lib/institution_modal_helper.rb:55 |
91 | +msgid "New Institution" | ||
92 | +msgstr "Nova Instituição" | ||
111 | 93 | ||
112 | #: plugins/gov_user/lib/institutions_block.rb:4 | 94 | #: plugins/gov_user/lib/institutions_block.rb:4 |
113 | #: plugins/gov_user/views/person_editor_extras.html.erb:11 | 95 | #: plugins/gov_user/views/person_editor_extras.html.erb:11 |
@@ -129,6 +111,40 @@ msgstr "Esse bloco mostra as instituições em que o usuário faz parte." | @@ -129,6 +111,40 @@ msgstr "Esse bloco mostra as instituições em que o usuário faz parte." | ||
129 | msgid "institutions|View all" | 111 | msgid "institutions|View all" |
130 | msgstr "instituições|Ver todas" | 112 | msgstr "instituições|Ver todas" |
131 | 113 | ||
114 | +#: plugins/gov_user/lib/gov_user_plugin.rb:17 | ||
115 | +msgid "Add features related to Brazilian government." | ||
116 | +msgstr "Adicionar funcionlidade relacionada com o governo brasileiro." | ||
117 | + | ||
118 | +#: plugins/gov_user/lib/gov_user_plugin.rb:132 | ||
119 | +#: plugins/gov_user/lib/gov_user_plugin.rb:165 | ||
120 | +msgid "Create Institution" | ||
121 | +msgstr "Criar Instituição" | ||
122 | + | ||
123 | +#: plugins/gov_user/lib/gov_user_plugin.rb:291 | ||
124 | +msgid "Institution Info" | ||
125 | +msgstr "Informações da Instituição" | ||
126 | + | ||
127 | +#: plugins/gov_user/lib/gov_user_plugin.rb:316 | ||
128 | +#: plugins/gov_user/views/organization_ratings_extra_fields_show_institution.html.erb:4 | ||
129 | +msgid "Institution" | ||
130 | +msgstr "Instituição" | ||
131 | + | ||
132 | +#: plugins/gov_user/views/search/institutions.html.erb:3 | ||
133 | +msgid "Type words about the %s you're looking for" | ||
134 | +msgstr "Escreve palavras sobre o %s que você está procurando" | ||
135 | + | ||
136 | +#: plugins/gov_user/views/incomplete_registration.html.erb:3 | ||
137 | +msgid "Complete Profile" | ||
138 | +msgstr "Complete o Perfil" | ||
139 | + | ||
140 | +#: plugins/gov_user/views/incomplete_registration.html.erb:6 | ||
141 | +msgid "Complete your profile" | ||
142 | +msgstr "Complete seu perfil" | ||
143 | + | ||
144 | +#: plugins/gov_user/views/incomplete_registration.html.erb:7 | ||
145 | +msgid "Hide" | ||
146 | +msgstr "Ocultar" | ||
147 | + | ||
132 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:1 | 148 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:1 |
133 | msgid "Edit Institution" | 149 | msgid "Edit Institution" |
134 | msgstr "Editar Instituição" | 150 | msgstr "Editar Instituição" |
@@ -147,101 +163,136 @@ msgstr "" | @@ -147,101 +163,136 @@ msgstr "" | ||
147 | "critérios." | 163 | "critérios." |
148 | 164 | ||
149 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:11 | 165 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:11 |
150 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:11 | 166 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:18 |
151 | msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" | 167 | msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" |
152 | msgstr "" | 168 | msgstr "" |
153 | "\"Não foi possível criar nova Instituição: #{flash[:errors].length} erros\"" | 169 | "\"Não foi possível criar nova Instituição: #{flash[:errors].length} erros\"" |
154 | 170 | ||
155 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:28 | 171 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:28 |
156 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:37 | 172 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:51 |
157 | msgid "Public Institution" | 173 | msgid "Public Institution" |
158 | msgstr "Instituição Pública" | 174 | msgstr "Instituição Pública" |
159 | 175 | ||
160 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:33 | 176 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:33 |
161 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:33 | 177 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:44 |
162 | msgid "Private Institution" | 178 | msgid "Private Institution" |
163 | msgstr "Instituição Privada" | 179 | msgstr "Instituição Privada" |
164 | 180 | ||
165 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:40 | 181 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:40 |
166 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:44 | 182 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:67 |
167 | msgid "Institution name already exists" | 183 | msgid "Institution name already exists" |
168 | msgstr "Nome de Instituição já existe" | 184 | msgstr "Nome de Instituição já existe" |
169 | 185 | ||
170 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:44 | 186 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:44 |
171 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:48 | 187 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:71 |
172 | msgid "Corporate Name" | 188 | msgid "Corporate Name" |
173 | -msgstr "Nome da Coorporação" | 189 | +msgstr "Razão social" |
174 | 190 | ||
175 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:49 | 191 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:49 |
176 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:53 | 192 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:79 |
177 | msgid "Country" | 193 | msgid "Country" |
178 | msgstr "País" | 194 | msgstr "País" |
179 | 195 | ||
180 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:53 | 196 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:53 |
181 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:57 | 197 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:88 |
182 | msgid "State" | 198 | msgid "State" |
183 | msgstr "Estado" | 199 | msgstr "Estado" |
184 | 200 | ||
185 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:63 | 201 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:63 |
186 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:66 | 202 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:108 |
187 | msgid "CNPJ" | 203 | msgid "CNPJ" |
188 | msgstr "CNPJ" | 204 | msgstr "CNPJ" |
189 | 205 | ||
190 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:70 | 206 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:70 |
191 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:72 | 207 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:72 |
192 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:72 | ||
193 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:74 | 208 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:115 |
209 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:117 | ||
194 | msgid "Acronym" | 210 | msgid "Acronym" |
195 | msgstr "Sigla" | 211 | msgstr "Sigla" |
196 | 212 | ||
197 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:71 | 213 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:71 |
198 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:73 | 214 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:116 |
199 | msgid "Fantasy name" | 215 | msgid "Fantasy name" |
200 | msgstr "Nome Fantasia" | 216 | msgstr "Nome Fantasia" |
201 | 217 | ||
202 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:79 | 218 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:79 |
203 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:17 | 219 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:17 |
204 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:81 | 220 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:124 |
205 | msgid "Governmental Sphere:" | 221 | msgid "Governmental Sphere:" |
206 | msgstr "Esfera Governamental:" | 222 | msgstr "Esfera Governamental:" |
207 | 223 | ||
208 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:86 | 224 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:86 |
209 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:16 | 225 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:16 |
210 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:88 | 226 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:131 |
211 | msgid "Governmental Power:" | 227 | msgid "Governmental Power:" |
212 | msgstr "Poder Governamental:" | 228 | msgstr "Poder Governamental:" |
213 | 229 | ||
214 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:92 | 230 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:92 |
215 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:18 | 231 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:18 |
216 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:94 | 232 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:138 |
217 | msgid "Juridical Nature:" | 233 | msgid "Juridical Nature:" |
218 | msgstr "Natureza Jurídica:" | 234 | msgstr "Natureza Jurídica:" |
219 | 235 | ||
220 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:99 | 236 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:99 |
221 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:101 | ||
222 | msgid "SISP?" | 237 | msgid "SISP?" |
223 | msgstr "SISP?" | 238 | msgstr "SISP?" |
224 | 239 | ||
225 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:101 | 240 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:101 |
226 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 | 241 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 |
227 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:104 | 242 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:153 |
228 | msgid "Yes" | 243 | msgid "Yes" |
229 | msgstr "Sim" | 244 | msgstr "Sim" |
230 | 245 | ||
231 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:103 | 246 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:103 |
232 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:106 | 247 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:106 |
233 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 | 248 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:19 |
234 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:106 | ||
235 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:108 | 249 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:158 |
250 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:162 | ||
236 | msgid "No" | 251 | msgid "No" |
237 | msgstr "Não" | 252 | msgstr "Não" |
238 | 253 | ||
239 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:111 | 254 | #: plugins/gov_user/views/gov_user_plugin_myprofile/edit_institution.html.erb:111 |
240 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:114 | ||
241 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:118 | 255 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:172 |
256 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:175 | ||
242 | msgid "Save" | 257 | msgid "Save" |
243 | msgstr "Salvar" | 258 | msgstr "Salvar" |
244 | 259 | ||
260 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:2 | ||
261 | +msgid "Organization name or Enterprise name" | ||
262 | +msgstr "Nome da organização ou empresa" | ||
263 | + | ||
264 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:7 | ||
265 | +msgid "No organization or company found" | ||
266 | +msgstr "Nenhuma organização ou companhia encontrados" | ||
267 | + | ||
268 | +#: plugins/gov_user/views/ratings_extra_field.html.erb:8 | ||
269 | +msgid "Add" | ||
270 | +msgstr "Adicionar" | ||
271 | + | ||
272 | +#: plugins/gov_user/views/person_editor_extras.html.erb:2 | ||
273 | +msgid "Secondary e-mail" | ||
274 | +msgstr "Email secundário" | ||
275 | + | ||
276 | +#: plugins/gov_user/views/person_editor_extras.html.erb:21 | ||
277 | +msgid "No institution found" | ||
278 | +msgstr "Nenhuma instituição encontrada" | ||
279 | + | ||
280 | +#: plugins/gov_user/views/person_editor_extras.html.erb:38 | ||
281 | +msgid "Should begin with a capital letter and no special characters" | ||
282 | +msgstr "Deve começar com letra maíscula e não conter caracteres especiais" | ||
283 | + | ||
284 | +#: plugins/gov_user/views/person_editor_extras.html.erb:39 | ||
285 | +msgid "Email should have the following format: name@host.br" | ||
286 | +msgstr "Email deve ter o seguinte formato: name@host.br" | ||
287 | + | ||
288 | +#: plugins/gov_user/views/person_editor_extras.html.erb:40 | ||
289 | +msgid "Site should have a valid format: http://name.hosts" | ||
290 | +msgstr "Site deve ter um formato válido: http://name.hosts" | ||
291 | + | ||
292 | +#: plugins/gov_user/views/person_editor_extras.html.erb:41 | ||
293 | +msgid "If you work in a public agency use your government e-Mail" | ||
294 | +msgstr "Se você trabalha em uma agência pública use seu email governamental" | ||
295 | + | ||
245 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:3 | 296 | #: plugins/gov_user/views/profile/_institution_tab.html.erb:3 |
246 | msgid "Institution Information" | 297 | msgid "Institution Information" |
247 | msgstr "Informação da Instituição" | 298 | msgstr "Informação da Instituição" |
@@ -282,82 +333,47 @@ msgstr "Sigla:" | @@ -282,82 +333,47 @@ msgstr "Sigla:" | ||
282 | msgid "SISP:" | 333 | msgid "SISP:" |
283 | msgstr "SISP:" | 334 | msgstr "SISP:" |
284 | 335 | ||
285 | -#: plugins/gov_user/views/ratings_extra_field.html.erb:2 | ||
286 | -msgid "Organization name or Enterprise name" | ||
287 | -msgstr "Nome da organização ou empresa" | ||
288 | - | ||
289 | -#: plugins/gov_user/views/ratings_extra_field.html.erb:6 | ||
290 | -#: plugins/gov_user/views/person_editor_extras.html.erb:21 | ||
291 | -msgid "No institution found" | ||
292 | -msgstr "Nenhuma instituição encontrada" | ||
293 | - | ||
294 | -#: plugins/gov_user/views/person_editor_extras.html.erb:2 | ||
295 | -msgid "Secondary e-mail" | ||
296 | -msgstr "Email secundário" | ||
297 | - | ||
298 | -#: plugins/gov_user/views/person_editor_extras.html.erb:22 | ||
299 | -msgid "Add new institution" | ||
300 | -msgstr "Adicionar nova instituição" | ||
301 | - | ||
302 | -#: plugins/gov_user/views/person_editor_extras.html.erb:23 | ||
303 | -msgid "Create new institution" | ||
304 | -msgstr "Criar nova instituição" | ||
305 | - | ||
306 | -#: plugins/gov_user/views/person_editor_extras.html.erb:39 | ||
307 | -msgid "Should begin with a capital letter and no special characters" | ||
308 | -msgstr "Deve começar com letra maíscula e não conter caracteres especiais" | ||
309 | - | ||
310 | -#: plugins/gov_user/views/person_editor_extras.html.erb:40 | ||
311 | -msgid "Email should have the following format: name@host.br" | ||
312 | -msgstr "Email deve ter o seguinte formato: name@host.br" | 336 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:11 |
337 | +msgid "The highlighted fields are mandatory" | ||
338 | +msgstr "Todos os campos com (*) são obrigatórios" | ||
313 | 339 | ||
314 | -#: plugins/gov_user/views/person_editor_extras.html.erb:41 | ||
315 | -msgid "Site should have a valid format: http://name.hosts" | ||
316 | -msgstr "Site deve ter um formato válido: http://name.hosts" | 340 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:23 |
341 | +msgid "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | ||
342 | +msgstr "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | ||
317 | 343 | ||
318 | -#: plugins/gov_user/views/person_editor_extras.html.erb:42 | ||
319 | -msgid "If you work in a public agency use your government e-Mail" | ||
320 | -msgstr "Se você trabalha em uma agência pública use seu email governamental" | 344 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:62 |
345 | +msgid "Name" | ||
346 | +msgstr "Nome" | ||
321 | 347 | ||
322 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:1 | ||
323 | -msgid "New Institution" | ||
324 | -msgstr "Nova Instituição" | 348 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:97 |
349 | +msgid "City" | ||
350 | +msgstr "Cidade" | ||
325 | 351 | ||
326 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:16 | ||
327 | -msgid "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | ||
328 | -msgstr "\"<b>#{key_name.capitalize}</b> #{value.join()}\"" | 352 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:145 |
353 | +msgid "SISP ?" | ||
354 | +msgstr "SISP ?" | ||
329 | 355 | ||
330 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:115 | ||
331 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:119 | 356 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:173 |
357 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:176 | ||
332 | msgid "Cancel" | 358 | msgid "Cancel" |
333 | msgstr "Cancelar" | 359 | msgstr "Cancelar" |
334 | 360 | ||
335 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:121 | 361 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:177 |
336 | msgid "Could not send the form data to the server" | 362 | msgid "Could not send the form data to the server" |
337 | msgstr "Não foi possível enviar os dados do formulário para o servidor" | 363 | msgstr "Não foi possível enviar os dados do formulário para o servidor" |
338 | 364 | ||
339 | -#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:128 | 365 | +#: plugins/gov_user/views/gov_user_plugin/_institution.html.erb:185 |
340 | msgid "Creating institution" | 366 | msgid "Creating institution" |
341 | msgstr "Criar instituição" | 367 | msgstr "Criar instituição" |
342 | 368 | ||
343 | -#: plugins/gov_user/views/search/institutions.html.erb:3 | ||
344 | -msgid "Type words about the %s you're looking for" | ||
345 | -msgstr "Escreve palavras sobre o %s que você está procurando" | 369 | +#~ msgid "Select a state" |
370 | +#~ msgstr "Selecione um Estado" | ||
346 | 371 | ||
347 | -#: plugins/gov_user/views/incomplete_registration.html.erb:3 | ||
348 | -msgid "Complete Profile" | ||
349 | -msgstr "Complete o Perfil" | ||
350 | - | ||
351 | -#: plugins/gov_user/views/incomplete_registration.html.erb:6 | ||
352 | -msgid "Complete your profile" | ||
353 | -msgstr "Complete seu perfil" | ||
354 | - | ||
355 | -#: plugins/gov_user/views/incomplete_registration.html.erb:7 | ||
356 | -msgid "Hide" | ||
357 | -msgstr "Ocultar" | 372 | +#~ msgid "not found" |
373 | +#~ msgstr "não encontrada" | ||
358 | 374 | ||
359 | -#~ msgid "All fields with (*) are mandatory" | ||
360 | -#~ msgstr "Todos os campos com (*) são obrigatórios" | 375 | +#~ msgid "Add new institution" |
376 | +#~ msgstr "Adicionar nova instituição" | ||
361 | 377 | ||
362 | #~ msgid "A plugin that does this and that." | 378 | #~ msgid "A plugin that does this and that." |
363 | #~ msgstr "Um plugin que faz isso e aquilo" | 379 | #~ msgstr "Um plugin que faz isso e aquilo" |
src/noosfero-spb/gov_user/public/initializer.js
@@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
1 | +/* globals modulejs */ | ||
2 | + | ||
3 | +// Works on: IE 11, Edge 12+, Firefox 40+, Chrome 43+, Opera 32+, Safari 32+ | ||
4 | +modulejs.define("ModalObserver", function() { | ||
5 | + "use strict"; | ||
6 | + | ||
7 | + function ModalObserver(target, callback) { | ||
8 | + this.action_callback = callback; | ||
9 | + this.observer = new MutationObserver(this.mutationVerifier.bind(this)); | ||
10 | + | ||
11 | + this.observer.observe(target, {attributes: true}); | ||
12 | + } | ||
13 | + | ||
14 | + | ||
15 | + ModalObserver.prototype.mutationVerifier = function(mutations) { | ||
16 | + var callback = this.action_callback; | ||
17 | + var observer = this.observer; | ||
18 | + | ||
19 | + mutations.forEach(function(mutation) { | ||
20 | + if (mutation.attributeName === "style" && | ||
21 | + mutation.target.style.display === "none") | ||
22 | + { | ||
23 | + callback(); | ||
24 | + // stop the observer, once its action is done | ||
25 | + observer.disconnect(); | ||
26 | + } | ||
27 | + }); | ||
28 | + }; | ||
29 | + | ||
30 | + | ||
31 | + return { | ||
32 | + init: function(target, callback) { | ||
33 | + new ModalObserver(target, callback); | ||
34 | + } | ||
35 | + }; | ||
36 | +}); |
src/noosfero-spb/gov_user/public/style.css
@@ -24,3 +24,12 @@ | @@ -24,3 +24,12 @@ | ||
24 | border-color: #FF0000; | 24 | border-color: #FF0000; |
25 | box-shadow: 0 0 10px #FF0000; | 25 | box-shadow: 0 0 10px #FF0000; |
26 | } | 26 | } |
27 | + | ||
28 | +#institution_empty_ajax_message { | ||
29 | + margin-top: 10px; | ||
30 | + margin-left: 0px !important; | ||
31 | +} | ||
32 | + | ||
33 | +#create_institution_link { | ||
34 | + margin-left: 8px; | ||
35 | +} |
src/noosfero-spb/gov_user/public/views/create-institution.js
@@ -4,8 +4,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -4,8 +4,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
4 | 'use strict'; | 4 | 'use strict'; |
5 | 5 | ||
6 | var AJAX_URL = { | 6 | var AJAX_URL = { |
7 | - create_institution_modal: | ||
8 | - NoosferoRoot.urlWithSubDirectory("/plugin/gov_user/create_institution"), | ||
9 | new_institution: | 7 | new_institution: |
10 | NoosferoRoot.urlWithSubDirectory("/plugin/gov_user/new_institution"), | 8 | NoosferoRoot.urlWithSubDirectory("/plugin/gov_user/new_institution"), |
11 | institution_already_exists: | 9 | institution_already_exists: |
@@ -16,30 +14,11 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -16,30 +14,11 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
16 | NoosferoRoot.urlWithSubDirectory("/account/search_cities") | 14 | NoosferoRoot.urlWithSubDirectory("/account/search_cities") |
17 | }; | 15 | }; |
18 | 16 | ||
19 | - | ||
20 | - function open_create_institution_modal(evt) { | ||
21 | - evt.preventDefault(); | ||
22 | - | ||
23 | - $.get(AJAX_URL.create_institution_modal, function(response){ | ||
24 | - $("#institution_dialog").html(response); | ||
25 | - | ||
26 | - set_form_count_custom_data(); | ||
27 | - set_events(); | ||
28 | - | ||
29 | - $("#institution_dialog").dialog({ | ||
30 | - modal: true, | ||
31 | - width: 500, | ||
32 | - height: 530, | ||
33 | - position: 'center', | ||
34 | - close: function() { | ||
35 | - $("#institution_dialog").html(""); | ||
36 | - $('#institution_empty_ajax_message').switchClass("show-field", "hide-field"); | ||
37 | - } | ||
38 | - }); | ||
39 | - }); | 17 | + function set_institution_field_name(name) { |
18 | + $("#input_institution").attr("value", name); | ||
19 | + $("#input_institution").autocomplete("search"); | ||
40 | } | 20 | } |
41 | 21 | ||
42 | - | ||
43 | function show_public_institutions_fields() { | 22 | function show_public_institutions_fields() { |
44 | $(".public-institutions-fields").show(); | 23 | $(".public-institutions-fields").show(); |
45 | } | 24 | } |
@@ -92,13 +71,28 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -92,13 +71,28 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
92 | var institution_name = response.institution_data.name; | 71 | var institution_name = response.institution_data.name; |
93 | var institution_id = response.institution_data.id; | 72 | var institution_id = response.institution_data.id; |
94 | 73 | ||
95 | - $("#institution_dialog").html("<div class='errorExplanation'><h2>"+response.message+"</h2></div>"); | ||
96 | - $("#create_institution_errors").switchClass("show-field", "hide-field"); | 74 | + // Tell the user it was created |
75 | + window.display_notice(response.message); | ||
76 | + | ||
77 | + set_institution_field_name($("#community_name").val()); | ||
78 | + //settup_created_institution(); | ||
79 | + | ||
80 | + // Close modal | ||
81 | + //$(".modal-header .close").trigger("click"); | ||
97 | 82 | ||
83 | + // Clear modal fields | ||
84 | + $("#institution_modal_body").html(window.sessionStorage.getItem("InstitutionModalBody")); | ||
85 | + | ||
86 | + // Reset modal events | ||
87 | + init_module(); | ||
88 | + | ||
89 | + | ||
90 | + // If the page has a user institution list, update it without repeating the institution | ||
98 | $(".institution_container").append(get_clone_institution_data(institution_id)); | 91 | $(".institution_container").append(get_clone_institution_data(institution_id)); |
99 | add_selected_institution_to_list(institution_id, institution_name); | 92 | add_selected_institution_to_list(institution_id, institution_name); |
100 | - | ||
101 | $(".remove-institution").click(remove_institution); | 93 | $(".remove-institution").click(remove_institution); |
94 | + //$('#institution_dialog').dialog('close'); | ||
95 | + $('#institution_modal').modal('toggle'); | ||
102 | } else { | 96 | } else { |
103 | var errors = create_error_list(response); | 97 | var errors = create_error_list(response); |
104 | $("#create_institution_errors").switchClass("hide-field", "show-field").html("<h2>"+response.message+"</h2>"+errors); | 98 | $("#create_institution_errors").switchClass("hide-field", "show-field").html("<h2>"+response.message+"</h2>"+errors); |
@@ -172,7 +166,7 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -172,7 +166,7 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
172 | 166 | ||
173 | function cancel_institution(evt){ | 167 | function cancel_institution(evt){ |
174 | evt.preventDefault(); | 168 | evt.preventDefault(); |
175 | - $('#institution_dialog').dialog('close'); | 169 | + $('#institution_modal').modal('toggle'); |
176 | } | 170 | } |
177 | 171 | ||
178 | 172 | ||
@@ -196,6 +190,16 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -196,6 +190,16 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
196 | return user_institutions; | 190 | return user_institutions; |
197 | } | 191 | } |
198 | 192 | ||
193 | + function toggle_extra_fields_style_status(status) { | ||
194 | + if(status) { | ||
195 | + $('.extra-fields-container').css({ marginTop: "55px" }); | ||
196 | + $('.button-bar').css({ marginTop: "55px" }); | ||
197 | + } else { | ||
198 | + $('.extra-fields-container').css({ marginTop: "0px" }); | ||
199 | + $('.button-bar').css({ marginTop: "20px" }); | ||
200 | + } | ||
201 | + } | ||
202 | + | ||
199 | 203 | ||
200 | function institution_autocomplete() { | 204 | function institution_autocomplete() { |
201 | $("#input_institution").autocomplete({ | 205 | $("#input_institution").autocomplete({ |
@@ -209,8 +213,8 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -209,8 +213,8 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
209 | 213 | ||
210 | if( result.length === 0 ) { | 214 | if( result.length === 0 ) { |
211 | $('#institution_empty_ajax_message').switchClass("hide-field", "show-field"); | 215 | $('#institution_empty_ajax_message').switchClass("hide-field", "show-field"); |
212 | - } else { | ||
213 | - $('#institution_empty_ajax_message').switchClass("show-field", "hide-field"); | 216 | + toggle_extra_fields_style_status(true); |
217 | + $("#institution_modal").css({display: "none"}); | ||
214 | } | 218 | } |
215 | }, | 219 | }, |
216 | error: function(ajax, stat, errorThrown) { | 220 | error: function(ajax, stat, errorThrown) { |
@@ -222,17 +226,13 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -222,17 +226,13 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
222 | minLength: 2, | 226 | minLength: 2, |
223 | 227 | ||
224 | select : function (event, selected) { | 228 | select : function (event, selected) { |
229 | + $('#institution_empty_ajax_message').switchClass("show-field", "hide-field"); | ||
230 | + //$("#create_institution_link").remove(); | ||
231 | + toggle_extra_fields_style_status(false); | ||
225 | $("#institution_selected").val(selected.item.id).attr("data-name", selected.item.label); | 232 | $("#institution_selected").val(selected.item.id).attr("data-name", selected.item.label); |
226 | - | ||
227 | - // +("") -> 0; +("1") -> 1... | ||
228 | - if (+($("#institution_selected").val()) !== 0) { | ||
229 | - add_new_institution(); | ||
230 | - } | ||
231 | } | 233 | } |
232 | }); | 234 | }); |
233 | } | 235 | } |
234 | - | ||
235 | - | ||
236 | function add_selected_institution_to_list(id, name) { | 236 | function add_selected_institution_to_list(id, name) { |
237 | var selected_institution = "<li data-institution='"+id+"'>"+name; | 237 | var selected_institution = "<li data-institution='"+id+"'>"+name; |
238 | selected_institution += "<a href='#' class='button without-text icon-remove remove-institution'></a></li>"; | 238 | selected_institution += "<a href='#' class='button without-text icon-remove remove-institution'></a></li>"; |
@@ -240,28 +240,27 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -240,28 +240,27 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
240 | $(".institutions_added").append(selected_institution); | 240 | $(".institutions_added").append(selected_institution); |
241 | } | 241 | } |
242 | 242 | ||
243 | - | ||
244 | - function add_new_institution() { | 243 | + function add_new_institution(evt) { |
244 | + evt.preventDefault(); | ||
245 | var selected = $("#institution_selected"); | 245 | var selected = $("#institution_selected"); |
246 | - var already_added_to_list = is_institution_already_added_to_list(selected.val()); | 246 | + var institution_already_added = $(".institutions_added li[data-institution='"+selected.val()+"']").length; |
247 | 247 | ||
248 | - if(selected.val().length > 0 && !already_added_to_list) { | 248 | + if(selected.val().length > 0 && institution_already_added === 0) { |
249 | //field that send the institutions to the server | 249 | //field that send the institutions to the server |
250 | $(".institution_container").append(get_clone_institution_data(selected.val())); | 250 | $(".institution_container").append(get_clone_institution_data(selected.val())); |
251 | 251 | ||
252 | // Visualy add the selected institution to the list | 252 | // Visualy add the selected institution to the list |
253 | add_selected_institution_to_list(selected.val(), selected.attr("data-name")); | 253 | add_selected_institution_to_list(selected.val(), selected.attr("data-name")); |
254 | 254 | ||
255 | + // clean the institution flag | ||
256 | + selected.val("").attr("data-name", ""); | ||
257 | + $("#input_institution").val(""); | ||
258 | + | ||
255 | $(".remove-institution").click(remove_institution); | 259 | $(".remove-institution").click(remove_institution); |
256 | } | 260 | } |
257 | } | 261 | } |
258 | 262 | ||
259 | 263 | ||
260 | - function is_institution_already_added_to_list(institution_id) { | ||
261 | - return $(".institutions_added li[data-institution='"+institution_id+"']").length !== 0; | ||
262 | - } | ||
263 | - | ||
264 | - | ||
265 | function remove_institution(evt) { | 264 | function remove_institution(evt) { |
266 | evt.preventDefault(); | 265 | evt.preventDefault(); |
267 | var code = $(this).parent().attr("data-institution"); | 266 | var code = $(this).parent().attr("data-institution"); |
@@ -279,15 +278,19 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -279,15 +278,19 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
279 | 278 | ||
280 | 279 | ||
281 | function show_hide_cnpj_city(country) { | 280 | function show_hide_cnpj_city(country) { |
282 | - var cnpj = $("#institutions_cnpj").parent().parent(); | ||
283 | - var city = $("#community_city").parent().parent(); | ||
284 | - var state = $("#community_state").parent().parent(); | 281 | + var cnpj = $("#institutions_cnpj").parent(); |
282 | + var city = $("#community_city").parent(); | ||
283 | + var state = $("#community_state").parent(); | ||
285 | var inst_type = $("input[name='institutions[type]']:checked").val(); | 284 | var inst_type = $("input[name='institutions[type]']:checked").val(); |
285 | + | ||
286 | institution_type_actions(inst_type); | 286 | institution_type_actions(inst_type); |
287 | 287 | ||
288 | - if( country === "-1" ) $("#community_country").val("BR"); | 288 | + if ( country === "-1" ) { |
289 | + $("#community_country").val("BR"); | ||
290 | + country = "BR"; | ||
291 | + } | ||
289 | 292 | ||
290 | - if( country !== "BR" ) { | 293 | + if ( country !== "BR" ) { |
291 | cnpj.hide(); | 294 | cnpj.hide(); |
292 | city.hide(); | 295 | city.hide(); |
293 | state.hide(); | 296 | state.hide(); |
@@ -364,18 +367,24 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -364,18 +367,24 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
364 | } | 367 | } |
365 | } | 368 | } |
366 | 369 | ||
367 | - function set_events() { | ||
368 | - $("#create_institution_link").click(open_create_institution_modal); | ||
369 | 370 | ||
371 | + function set_institution_name_into_modal() { | ||
372 | + $("#community_name").val($("#input_institution").val()); | ||
373 | + } | ||
374 | + | ||
375 | + | ||
376 | + function set_events() { | ||
370 | $("input[name='institutions[type]']").click(function(){ | 377 | $("input[name='institutions[type]']").click(function(){ |
371 | institution_type_actions(this.value); | 378 | institution_type_actions(this.value); |
372 | - }); | 379 | + }).trigger("click"); |
373 | 380 | ||
374 | $('#save_institution_button').click(save_institution); | 381 | $('#save_institution_button').click(save_institution); |
375 | $('#cancel_institution_button').click(cancel_institution); | 382 | $('#cancel_institution_button').click(cancel_institution); |
376 | 383 | ||
377 | $("#community_name").keyup(institution_already_exists); | 384 | $("#community_name").keyup(institution_already_exists); |
378 | 385 | ||
386 | + $("#add_new_institution").click(add_new_institution); | ||
387 | + | ||
379 | $(".remove-institution").click(remove_institution); | 388 | $(".remove-institution").click(remove_institution); |
380 | 389 | ||
381 | $("#community_country").change(function(){ | 390 | $("#community_country").change(function(){ |
@@ -390,19 +399,22 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | @@ -390,19 +399,22 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] | ||
390 | $('#community_country').change(function(){ | 399 | $('#community_country').change(function(){ |
391 | autoCompleteCity(); | 400 | autoCompleteCity(); |
392 | }); | 401 | }); |
402 | + | ||
403 | + $("#create_institution_link").click(set_institution_name_into_modal); | ||
393 | } | 404 | } |
394 | 405 | ||
395 | 406 | ||
407 | + function init_module() { | ||
408 | + set_form_count_custom_data(); | ||
409 | + set_events(); | ||
410 | + } | ||
411 | + | ||
396 | return { | 412 | return { |
397 | isCurrentPage: function() { | 413 | isCurrentPage: function() { |
398 | return $("#institution_form").length === 1; | 414 | return $("#institution_form").length === 1; |
399 | }, | 415 | }, |
400 | 416 | ||
401 | - | ||
402 | - init: function() { | ||
403 | - set_form_count_custom_data(); | ||
404 | - set_events(); | ||
405 | - }, | 417 | + init: init_module, |
406 | 418 | ||
407 | institution_autocomplete: function(){ | 419 | institution_autocomplete: function(){ |
408 | institution_autocomplete(); | 420 | institution_autocomplete(); |
src/noosfero-spb/gov_user/public/views/institution-modal.js
0 → 100644
@@ -0,0 +1,54 @@ | @@ -0,0 +1,54 @@ | ||
1 | +/* globals modulejs */ | ||
2 | + | ||
3 | +modulejs.define('InstitutionModal', | ||
4 | + ['jquery', 'NoosferoRoot', 'CreateInstitution', 'ModalObserver'], | ||
5 | + function($, NoosferoRoot, CreateInstitution, ModalObserver) | ||
6 | +{ | ||
7 | + 'use strict'; | ||
8 | + | ||
9 | + var AJAX_URL = { | ||
10 | + create_institution_modal: | ||
11 | + NoosferoRoot.urlWithSubDirectory("/plugin/gov_user/create_institution"), | ||
12 | + }; | ||
13 | + | ||
14 | + // When the modal is closed, put the community name into the autocomplete | ||
15 | + function observer_action() { | ||
16 | + var community_name = $("#community_name").val(); | ||
17 | + $("#input_institution").attr("value", community_name).autocomplete("search"); | ||
18 | + | ||
19 | + // Clear error messages | ||
20 | + $("#create_institution_errors").html(""); | ||
21 | + } | ||
22 | + | ||
23 | + // Observe when modal is closed | ||
24 | + function observe_modal() { | ||
25 | + var institution_modal = document.querySelector("#institution_modal"); | ||
26 | + ModalObserver.init(institution_modal, observer_action); | ||
27 | + } | ||
28 | + | ||
29 | + | ||
30 | + function prepare_institution_modal() { | ||
31 | + $.get(AJAX_URL.create_institution_modal, function(response){ | ||
32 | + window.sessionStorage.setItem("InstitutionModalBody", response); | ||
33 | + $("#institution_modal_body").html(response); | ||
34 | + | ||
35 | + // Set all events on modal | ||
36 | + CreateInstitution.init(); | ||
37 | + }); | ||
38 | + | ||
39 | + $("#create_institution_link").click(observe_modal); | ||
40 | + } | ||
41 | + | ||
42 | + | ||
43 | + return { | ||
44 | + isCurrentPage: function() { | ||
45 | + return $("#institution_modal_container").length === 1; | ||
46 | + }, | ||
47 | + | ||
48 | + | ||
49 | + init: function() { | ||
50 | + prepare_institution_modal(); | ||
51 | + }, | ||
52 | + }; | ||
53 | +}); | ||
54 | + |
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
1 | -<h1><%= _('New Institution') %></h1> | 1 | +<div class="form-description"> |
2 | + <div class="spb-row no-margin-top"> | ||
3 | + <% if environment.enabled?('admin_must_approve_new_communities') %> | ||
4 | + <div class='spb-col spb-col-12 explanation'> | ||
5 | + <%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%> | ||
6 | + </div> | ||
7 | + <% end %> | ||
8 | + </div> | ||
2 | 9 | ||
3 | -<% if environment.enabled?('admin_must_approve_new_communities') %> | ||
4 | - <div class='explanation'> | ||
5 | - <%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%> | 10 | + <div class="spb-row spb-col spb-col-12 required-field"> |
11 | + <%= _("The highlighted fields are mandatory") %> | ||
6 | </div> | 12 | </div> |
7 | -<%end %> | ||
8 | - | ||
9 | -<% unless flash[:errors].nil? %> | ||
10 | -<div class="errorExplanation" id="errorExplanation"> | ||
11 | - <h2> <%= _("Can`t create new Institution: #{flash[:errors].length} errors") %> </h2> | ||
12 | - <ul> | ||
13 | - <% flash[:errors].each do |key, value| %> | ||
14 | - <% key_name = key.to_s.gsub("_", " ") %> | ||
15 | - <% if value.length > 0 %> | ||
16 | - <li> <%= _("<b>#{key_name.capitalize}</b> #{value.join()}") %> </li> | 13 | +</div> |
14 | + | ||
15 | +<div class="spb-row spb-col spb-col-12"> | ||
16 | + <% unless flash[:errors].nil? %> | ||
17 | + <div class="errorExplanation" id="errorExplanation"> | ||
18 | + <h2> <%= _("Can`t create new Institution: #{flash[:errors].length} errors") %> </h2> | ||
19 | + <ul> | ||
20 | + <% flash[:errors].each do |key, value| %> | ||
21 | + <% key_name = key.to_s.gsub("_", " ") %> | ||
22 | + <% if value.length > 0 %> | ||
23 | + <li> <%= _("<b>#{key_name.capitalize}</b> #{value.join()}") %> </li> | ||
24 | + <% end %> | ||
17 | <% end %> | 25 | <% end %> |
26 | + </ul> | ||
27 | + </div> | ||
18 | <% end %> | 28 | <% end %> |
19 | - </ul> | ||
20 | </div> | 29 | </div> |
21 | -<% end %> | ||
22 | 30 | ||
23 | -<div id = 'create_institution_errors' class='errorExplanation hide-field'></div> | ||
24 | - | ||
25 | -<div> | ||
26 | - <%= labelled_form_for :community, :url => {:action=>"new_institution"}, :html => { :multipart => true, :id=>"institution_form" } do |f| %> | ||
27 | - <%= required_fields_message %> | ||
28 | - <%= hidden_field_tag "edit_institution_page", false %> | ||
29 | - <%= fields_for :institutions do |inst| %> | ||
30 | - <span class=''> | ||
31 | - <div class='formfield type-radio'> | ||
32 | - <label> | ||
33 | - <%= _("Private Institution") %> | ||
34 | - <%= radio_button_tag("institutions[type]" ,"PrivateInstitution", true)%> | ||
35 | - </label> | ||
36 | - | ||
37 | - <label> <%= _("Public Institution") %> | ||
38 | - <%= radio_button_tag("institutions[type]", "PublicInstitution") %> | ||
39 | - </label> | ||
40 | - </div> | ||
41 | - </span> | 31 | +<div class="spb-row"> |
32 | + <div id='create_institution_errors' class='spb-col spb-col-12 errorExplanation hide-field'></div> | ||
33 | +</div> | ||
42 | 34 | ||
43 | - <%= required f.text_field(:name, :class => flash[:error_community_name], :value => params[:community][:name]) %> | ||
44 | - <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> | ||
45 | 35 | ||
46 | - <span class='optional-field'> | ||
47 | - <div class="formfield type-text"> | ||
48 | - <%= inst.label "corporate_name", _("Corporate Name"), :class=>"formlabel" %> | ||
49 | - <%= inst.text_field(:corporate_name, :value => params[:institutions][:corporate_name], :size => 55) %> | ||
50 | - </div> | ||
51 | - </span> | 36 | +<%= form_for :community, :url => {:action=>"new_institution"}, :html => { :multipart => true, :id=>"institution_form" } do |f| %> |
52 | 37 | ||
53 | - <%= required select_country(_('Country'), 'community', 'country', {:class => "type-select #{flash[:error_community_country]}", :id => "community_country"}) %> | 38 | + <%= hidden_field_tag "edit_institution_page", false %> |
39 | + <%= fields_for :institutions do |inst| %> | ||
40 | + <div class="spb-row no-margin-top"> | ||
41 | + <div class='spb-col spb-col-3'> | ||
42 | + <label class="formlabel"> | ||
43 | + <%= radio_button_tag("institutions[type]" ,"PrivateInstitution", true)%> | ||
44 | + <%= _("Private Institution") %> | ||
45 | + </label> | ||
46 | + </div> | ||
54 | 47 | ||
55 | - <span class='required-field'> | ||
56 | - <div class="formfield"> | ||
57 | - <label for="community_state" class="formlabel"><%= _("State") %></label> | ||
58 | - <%= f.select(:state, @state_options, {:selected => params[:community][:state]}, {:class => flash[:error_community_state]}) %> | ||
59 | - </div> | ||
60 | - </span> | 48 | + <div class="spb-col spb-col-3"> |
49 | + <label class="formlabel"> | ||
50 | + <%= radio_button_tag("institutions[type]", "PublicInstitution") %> | ||
51 | + <%= _("Public Institution") %> | ||
52 | + </label> | ||
53 | + </div> | ||
61 | 54 | ||
62 | - <%= required f.text_field(:city, :class => flash[:error_community_city], :value => params[:community][:city]) %> | 55 | + <div class="spb-col spb-col-3"></div> |
56 | + <div class="spb-col spb-col-3"></div> | ||
57 | + </div> | ||
63 | 58 | ||
59 | + <div class="spb-row"> | ||
60 | + <div class="spb-col spb-col-5"> | ||
61 | + <label for="community_name" class="formlabel"> | ||
62 | + <%= _("Corporate Name") %><!-- razão social --> | ||
63 | + <span class="required-field">(*)</span> | ||
64 | + </label> | ||
64 | 65 | ||
65 | - <div class="formfield type-text"> | 66 | + <%= f.text_field(:name, :class => flash[:error_community_name], :value => params[:community][:name]) %> |
67 | + <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> | ||
68 | + </div> | ||
69 | + | ||
70 | + <div class="spb-col spb-col-6"> | ||
71 | + <%= inst.label "corporate_name", _("Fantasy name"), :class=>"formlabel" %><!-- Nome fantasia --> | ||
72 | + <%= inst.text_field(:corporate_name, :value => params[:institutions][:corporate_name], :size => 55) %> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + | ||
76 | + <div class="spb-row"> | ||
77 | + <div class="spb-col spb-col-5"> | ||
78 | + <label for="community_country" class="formlabel"> | ||
79 | + <%= _("Country") %> | ||
80 | + <span class="required-field">(*)</span> | ||
81 | + </label> | ||
82 | + | ||
83 | + <%= select("community", "country", [[_('Select a country'), nil]] + country_helper.countries, {:class => "type-select #{flash[:error_community_country]}"}) %> | ||
84 | + </div> | ||
85 | + | ||
86 | + <div class="spb-col spb-col-2"> | ||
87 | + <label for="community_state" class="formlabel"> | ||
88 | + <%= _("State") %> | ||
89 | + <span class="required-field">(*)</span> | ||
90 | + </label> | ||
91 | + | ||
92 | + <%= f.select(:state, @state_options, {:selected => params[:community][:state]}, {:class => flash[:error_community_state]}) %> | ||
93 | + </div> | ||
94 | + | ||
95 | + <div class="spb-col spb-col-5"> | ||
96 | + <label class="formlabel" for="community_city"> | ||
97 | + <%= _("City") %> | ||
98 | + <span class="required-field">(*)</span> | ||
99 | + </label> | ||
100 | + | ||
101 | + <%= f.text_field(:city, :class => flash[:error_community_city], :value => params[:community][:city]) %> | ||
102 | + </div> | ||
103 | + </div> | ||
104 | + | ||
105 | + | ||
106 | + <div class="spb-row"> | ||
107 | + <div class="spb-col spb-col-12"> | ||
66 | <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %> | 108 | <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %> |
67 | - <%= required inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => params[:institutions][:cnpj]) %> | 109 | + <%= inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => params[:institutions][:cnpj]) %> |
110 | + </div> | ||
111 | + </div> | ||
112 | + | ||
113 | + <div class="spb-row"> | ||
114 | + <div class="spb-col spb-col-12"> | ||
115 | + <%= hidden_field_tag "acronym_translate", _("Acronym") %> | ||
116 | + <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | ||
117 | + <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | ||
118 | + <%= inst.text_field(:acronym, :value => params[:institutions][:acronym]) %> | ||
68 | </div> | 119 | </div> |
120 | + </div> | ||
69 | 121 | ||
70 | - <span class='optional-field'> | ||
71 | - <div class="formfield type-text"> | ||
72 | - <%= hidden_field_tag "acronym_translate", _("Acronym") %> | ||
73 | - <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> | ||
74 | - <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | ||
75 | - <%= inst.text_field(:acronym, :value => params[:institutions][:acronym]) %> | ||
76 | - </div> | ||
77 | - </span> | 122 | + <div class="spb-row public-institutions-fields"> |
123 | + <div class="spb-col spb-col-6"> | ||
124 | + <label class="formlabel" for="institutions_governmental_sphere_id"> | ||
125 | + <%= _("Governmental Sphere") %> | ||
126 | + <span class="required-field">(*)</span> | ||
127 | + </label> | ||
78 | 128 | ||
79 | - <span class='required-field public-institutions-fields'> | ||
80 | - <div class="formfield type-text"> | ||
81 | - <%= inst.label("governmental_sphere_id" ,_("Governmental Sphere:"), :class=>"formlabel") %> | ||
82 | - <%= inst.select(:governmental_sphere, @governmental_sphere, :selected=>params[:institutions][:governmental_sphere], :class => flash[:error_institution_governmental_sphere])%> | ||
83 | - </div> | ||
84 | - </span> | 129 | + <%= inst.select(:governmental_sphere, @governmental_sphere, :selected=>params[:institutions][:governmental_sphere], :class => flash[:error_institution_governmental_sphere])%> |
130 | + </div> | ||
131 | + </div> | ||
85 | 132 | ||
86 | - <span class='required-field public-institutions-fields'> | ||
87 | - <div class="formfield type-text"> | ||
88 | - <%= inst.label("governmental_power_id" ,_("Governmental Power:"), :class=>"formlabel") %> | ||
89 | - <%= inst.select(:governmental_power, @governmental_power, :selected=>params[:institutions][:governmental_sphere], :class => flash[:error_institution_governmental_power])%> | ||
90 | - </div> | ||
91 | - </span> | ||
92 | - <span class='required-field public-institutions-fields'> | ||
93 | - <div class="formfield type-text"> | ||
94 | - <%= inst.label("juridical_nature_id" ,_("Juridical Nature:"), :class=>"formlabel") %> | ||
95 | - <%= inst.select(:juridical_nature, @juridical_nature, :selected=>params[:institutions][:juridical_nature], :class => flash[:error_institution_juridical_nature])%> | ||
96 | - </div> | ||
97 | - </span> | 133 | + <div class="spb-row public-institutions-fields"> |
134 | + <div class="spb-col spb-col-6"> | ||
135 | + <label class="formlabel" for="institutions_governmental_power_id"> | ||
136 | + <%= _("Governmental Power") %> | ||
137 | + <span class="required-field">(*)</span> | ||
138 | + </label> | ||
139 | + | ||
140 | + <%= inst.select(:governmental_power, @governmental_power, :selected=>params[:institutions][:governmental_sphere], :class => flash[:error_institution_governmental_power])%> | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + | ||
144 | + <div class="spb-row public-institutions-fields"> | ||
145 | + <div class="spb-col spb-col-6"> | ||
146 | + <label class="formlabel" for="institutions_juridical_nature_id"> | ||
147 | + <%= _("Juridical Nature") %> | ||
148 | + <span class="required-field">(*)</span> | ||
149 | + </label> | ||
150 | + | ||
151 | + <%= inst.select(:juridical_nature, @juridical_nature, :selected=>params[:institutions][:juridical_nature], :class => flash[:error_institution_juridical_nature])%> | ||
152 | + </div> | ||
153 | + </div> | ||
154 | + | ||
155 | + <div class="spb-row public-institutions-fields"> | ||
156 | + <div class="spb-col spb-col-12"> | ||
157 | + <%= _("SISP ?") %> | ||
158 | + </div> | ||
98 | 159 | ||
99 | - <span class='required-field public-institutions-fields'> | ||
100 | - <div class="formfield type-text"> | ||
101 | - <%= _("SISP?") %> | 160 | + <div class="spc-col spb-col-12 sisp-fields"> |
161 | + <div class="spb-col spb-col-3"> | ||
102 | <% if @show_sisp_field %> | 162 | <% if @show_sisp_field %> |
163 | + <div class="spb-col spb-col-5"> | ||
103 | <%= inst.radio_button(:sisp, true, :class => "#{flash[:error_institution_sisp]}" ) %> | 164 | <%= inst.radio_button(:sisp, true, :class => "#{flash[:error_institution_sisp]}" ) %> |
104 | <%= inst.label :sisp ,_("Yes"), :value => true %> | 165 | <%= inst.label :sisp ,_("Yes"), :value => true %> |
166 | + </div> | ||
167 | + | ||
168 | + <div class="spb-col spb-col-6"> | ||
105 | <%= inst.radio_button(:sisp, false, :checked=>"checked", :class => "#{flash[:error_institution_sisp]}") %> | 169 | <%= inst.radio_button(:sisp, false, :checked=>"checked", :class => "#{flash[:error_institution_sisp]}") %> |
106 | <%= inst.label :sisp ,_("No"), :value => false %> | 170 | <%= inst.label :sisp ,_("No"), :value => false %> |
171 | + </div> | ||
107 | <% else %> | 172 | <% else %> |
108 | - <%= inst.label("sisp", _("No")) %> | 173 | + <div class="spb-col spb-col-6"> |
174 | + <%= inst.label("sisp", _("No")) %> | ||
175 | + </div> | ||
109 | <% end %> | 176 | <% end %> |
110 | - </div> | ||
111 | - </span> | ||
112 | - | ||
113 | - <% if @url_token == "create_institution_admin" %> | ||
114 | - <%= submit_button :save, _('Save') %> | ||
115 | - <%= button(:cancel, _("Cancel"), {:controller => "admin_panel", :action => 'index'}) %> | ||
116 | - <%else%> | ||
117 | - <div> | ||
118 | - <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %> | ||
119 | - <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel') %> | ||
120 | </div> | 177 | </div> |
121 | - <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %> | ||
122 | - <%end%> | ||
123 | - | ||
124 | - <% end %> | 178 | + </div> |
179 | + </div> | ||
180 | + | ||
181 | + <div class="spb-row modal-form-actions"> | ||
182 | + <div class="spb-col spb-col-6"> | ||
183 | + <% if @url_token == "create_institution_admin" %> | ||
184 | + <%= submit_button :save, _('Save') %> | ||
185 | + <%= button(:cancel, _("Cancel"), {:controller => "admin_panel", :action => 'index'}) %> | ||
186 | + <% else %> | ||
187 | + <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %> | ||
188 | + <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel') %> | ||
189 | + <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %> | ||
190 | + <% end %> | ||
191 | + </div> | ||
192 | + </div> | ||
125 | 193 | ||
126 | <% end %> | 194 | <% end %> |
195 | +<% end %> | ||
127 | </div> | 196 | </div> |
128 | <%= hidden_field_tag :loading_message, _("Creating institution") %> | 197 | <%= hidden_field_tag :loading_message, _("Creating institution") %> |
src/noosfero-spb/gov_user/views/person_editor_extras.html.erb
@@ -19,8 +19,8 @@ | @@ -19,8 +19,8 @@ | ||
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %> | 21 | <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %> |
22 | - <%= link_to(_("Create new institution"), "#", :id=>"create_institution_link", :class=>'button with-text icon-add') %> | ||
23 | - <%= content_tag(:div, "", :id=>"institution_dialog") %> | 22 | + |
23 | + <%= InstitutionModalHelper.modal_button %> | ||
24 | 24 | ||
25 | <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %> | 25 | <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %> |
26 | <%= hidden_field_tag("institution_selected", "") %> | 26 | <%= hidden_field_tag("institution_selected", "") %> |
src/noosfero-spb/gov_user/views/ratings_extra_field.html.erb
@@ -3,8 +3,11 @@ | @@ -3,8 +3,11 @@ | ||
3 | <span class="star-tooltip" title="Órgão ou Empresa que você representa e utiliza o software"></span> | 3 | <span class="star-tooltip" title="Órgão ou Empresa que você representa e utiliza o software"></span> |
4 | <input type="text" id="input_institution"> | 4 | <input type="text" id="input_institution"> |
5 | 5 | ||
6 | - <%= content_tag(:div, _("No institution found"), | ||
7 | - :id=>"institution_empty_ajax_message", | ||
8 | - :class=>"errorExplanation hide-field") %> | 6 | + <div id="institution_empty_ajax_message" class="errorExplanation hide-field rating-create-institution-container"> |
7 | + <span class="institution-not-found"><%= _("No organization or company found") %></span> | ||
8 | + <%= InstitutionModalHelper.modal_button(_("Add"), "none") %> | ||
9 | + </div> | ||
10 | + | ||
9 | <%= hidden_field_tag "organization_rating[institution_id]", "", id: "institution_selected" %> | 11 | <%= hidden_field_tag "organization_rating[institution_id]", "", id: "institution_selected" %> |
10 | </div> | 12 | </div> |
13 | + |
@@ -0,0 +1,257 @@ | @@ -0,0 +1,257 @@ | ||
1 | +/* Bootstrap modal default css */ | ||
2 | +.modal { | ||
3 | + position: fixed; | ||
4 | + top: 0px; | ||
5 | + right: 0px; | ||
6 | + bottom: 0px; | ||
7 | + left: 0px; | ||
8 | + z-index: 1050; | ||
9 | + display: none; | ||
10 | + overflow: hidden; | ||
11 | + outline: 0px none; | ||
12 | + background-color: rgba(0, 0, 0, 0.5); | ||
13 | + height: 100%; | ||
14 | +} | ||
15 | + | ||
16 | +.modal-open .modal { | ||
17 | + overflow-x: hidden; | ||
18 | + overflow-y: auto; | ||
19 | +} | ||
20 | + | ||
21 | +.fade { | ||
22 | + opacity: 0; | ||
23 | + transition: opacity 0.15s linear 0s; | ||
24 | +} | ||
25 | + | ||
26 | +.fade.in { | ||
27 | + opacity: 1; | ||
28 | +} | ||
29 | + | ||
30 | +.modal-dialog { | ||
31 | + width: 45%; | ||
32 | + margin: 15px auto; | ||
33 | + position: relative; | ||
34 | +} | ||
35 | + | ||
36 | +.modal.in .modal-dialog { | ||
37 | + transform: translate(0px, 0px); | ||
38 | +} | ||
39 | + | ||
40 | +.modal.fade .modal-dialog { | ||
41 | + transition: transform 0.3s ease-out 0s; | ||
42 | +} | ||
43 | + | ||
44 | +.modal-content { | ||
45 | + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.5); | ||
46 | +} | ||
47 | + | ||
48 | +.modal-content { | ||
49 | + position: relative; | ||
50 | + background-color: #FFF; | ||
51 | + background-clip: padding-box; | ||
52 | + border: 1px solid rgba(0, 0, 0, 0.2); | ||
53 | + border-radius: 6px; | ||
54 | + outline: 0px none; | ||
55 | + box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.5); | ||
56 | +} | ||
57 | + | ||
58 | +.modal-header { | ||
59 | + min-height: 16.43px; | ||
60 | + padding: 15px; | ||
61 | + border-bottom: 1px solid #E5E5E5; | ||
62 | +} | ||
63 | + | ||
64 | +.modal-header .close { | ||
65 | + margin-top: -2px; | ||
66 | +} | ||
67 | + | ||
68 | +.modal-header button.close { | ||
69 | + padding: 0px; | ||
70 | + cursor: pointer; | ||
71 | + background: transparent none repeat scroll 0px 0px; | ||
72 | + border: 0px none; | ||
73 | +} | ||
74 | + | ||
75 | +.modal-header .close { | ||
76 | + float: right; | ||
77 | + font-size: 21px; | ||
78 | + font-weight: 700; | ||
79 | + line-height: 1; | ||
80 | + color: #000; | ||
81 | + text-shadow: 0px 1px 0px #FFF; | ||
82 | + opacity: 0.2; | ||
83 | +} | ||
84 | + | ||
85 | +.modal-title { | ||
86 | + margin: 0px !important; | ||
87 | + line-height: 1.42857 !important; | ||
88 | +} | ||
89 | + | ||
90 | +.modal-body { | ||
91 | + position: relative; | ||
92 | + padding: 15px; | ||
93 | +} | ||
94 | + | ||
95 | +.modal-footer { | ||
96 | + padding: 15px; | ||
97 | + text-align: right; | ||
98 | + border-top: 1px solid #E5E5E5; | ||
99 | +} | ||
100 | + | ||
101 | + | ||
102 | +/* Bootstrap modal override */ | ||
103 | +.modal-title { | ||
104 | + font-family: 'open_sansregular', Arial, Helvetica, sans-serif; | ||
105 | +} | ||
106 | + | ||
107 | +.modal-header h4 { | ||
108 | + color: #333 !important; | ||
109 | + font-size: 17px !important; | ||
110 | +} | ||
111 | + | ||
112 | +.modal-body { | ||
113 | + overflow: hidden; | ||
114 | +} | ||
115 | + | ||
116 | +/* Bootstrap modal form fields */ | ||
117 | +.modal, | ||
118 | +.modal input, | ||
119 | +.modal select, | ||
120 | +.modal .formlabel { | ||
121 | + font-family: 'open_sansregular', Arial, Helvetica, sans-serif; | ||
122 | + color: #333; | ||
123 | + font-style: normal; | ||
124 | +} | ||
125 | + | ||
126 | +.modal label { | ||
127 | + margin-left: 4px; | ||
128 | +} | ||
129 | + | ||
130 | +.modal .sisp-fields label { | ||
131 | + margin-left: 0px; | ||
132 | +} | ||
133 | + | ||
134 | +.modal h2 { | ||
135 | + margin-top: 0px !important; | ||
136 | +} | ||
137 | + | ||
138 | +.modal .form-description { | ||
139 | + border-bottom: 1px solid #E5E5E5; | ||
140 | + padding-bottom: 15px; | ||
141 | + overflow: hidden; | ||
142 | +} | ||
143 | + | ||
144 | +.modal .formfieldline { | ||
145 | + padding: 0px; | ||
146 | + margin: 0px; | ||
147 | +} | ||
148 | + | ||
149 | +.modal input[type="text"], | ||
150 | +.modal select { | ||
151 | + padding: 10px; | ||
152 | + border-radius: 5px; | ||
153 | + border: solid 1px #ccc; | ||
154 | + background-color: #fff; | ||
155 | +} | ||
156 | + | ||
157 | +.modal input[type="radio"] { | ||
158 | + vertical-align: middle; | ||
159 | +} | ||
160 | + | ||
161 | +.modal .explanation { | ||
162 | + color: #3F60C6; | ||
163 | + font-size: 12px; | ||
164 | +} | ||
165 | + | ||
166 | +.modal .required-field, .modal .errorExplanation { | ||
167 | + color: #EA1C00; | ||
168 | + font-size:12px; | ||
169 | +} | ||
170 | + | ||
171 | +.modal .spb-row { | ||
172 | + margin-top: 15px; | ||
173 | +} | ||
174 | + | ||
175 | +.no-margin-top { | ||
176 | + margin-top: 0px !important; | ||
177 | +} | ||
178 | + | ||
179 | +.modal .modal-margin-right { | ||
180 | + margin-right: 4%; | ||
181 | +} | ||
182 | + | ||
183 | +.modal .modal-margin-left { | ||
184 | + margin-left: 4%; | ||
185 | +} | ||
186 | + | ||
187 | +.modal #community_name { | ||
188 | + width: 200px; | ||
189 | +} | ||
190 | + | ||
191 | +.modal #institutions_corporate_name { | ||
192 | + width: 285px; | ||
193 | +} | ||
194 | + | ||
195 | +.modal #community_country { | ||
196 | + width: 220px; | ||
197 | +} | ||
198 | + | ||
199 | +.modal #community_state { | ||
200 | + width: 80px; | ||
201 | +} | ||
202 | + | ||
203 | +.modal #community_city { | ||
204 | + width: 190px; | ||
205 | + margin-top: 2px; | ||
206 | +} | ||
207 | + | ||
208 | +.modal #institutions_cnpj, | ||
209 | +.modal #institutions_acronym { | ||
210 | + width: 530px; | ||
211 | +} | ||
212 | + | ||
213 | +.modal a.button.with-text.icon-add, | ||
214 | +.modal a.button.with-text.icon-cancel { | ||
215 | + line-height: 25px !important; | ||
216 | + padding: 5px 15px !important; | ||
217 | + font-size: 12px !important; | ||
218 | +} | ||
219 | + | ||
220 | +.modal a.button.with-text.icon-add { | ||
221 | + background-color: #3E67B1 !important; | ||
222 | + color: #fff !important; | ||
223 | +} | ||
224 | + | ||
225 | +.modal .public-institutions-fields { | ||
226 | + display: none; | ||
227 | +} | ||
228 | + | ||
229 | +.modal .modal-form-actions { | ||
230 | + margin-top: 20px; | ||
231 | +} | ||
232 | + | ||
233 | +/* New rating page */ | ||
234 | +.rating-create-institution-container { | ||
235 | + overflow: hidden; | ||
236 | +} | ||
237 | + | ||
238 | +.rating-create-institution-container > .institution-not-found { | ||
239 | + line-height: 30px; | ||
240 | +} | ||
241 | + | ||
242 | +.rating-create-institution-container .institution-not-found { | ||
243 | + position: relative; | ||
244 | + float: left; | ||
245 | +} | ||
246 | + | ||
247 | +.rating-create-institution-container #institution_modal_container { | ||
248 | + position: relative; | ||
249 | + float: left; | ||
250 | +} | ||
251 | + | ||
252 | +.rating-create-institution-container #create_institution_link { | ||
253 | + background-color: #3E67B1 !important; | ||
254 | + color: #FFF !important; | ||
255 | + text-transform: none !important; | ||
256 | +} | ||
257 | + |
@@ -0,0 +1,76 @@ | @@ -0,0 +1,76 @@ | ||
1 | +.spb-row, | ||
2 | +.spb-col { | ||
3 | + box-sizing: border-box; | ||
4 | +} | ||
5 | + | ||
6 | +.spb-row:before, | ||
7 | +.spb-row:after { | ||
8 | + content: ""; | ||
9 | + display: table; | ||
10 | +} | ||
11 | + | ||
12 | +.spb-row:after { | ||
13 | + clear: both; | ||
14 | +} | ||
15 | + | ||
16 | +.spb-col { | ||
17 | + position: relative; | ||
18 | + float: left; | ||
19 | +} | ||
20 | + | ||
21 | +.spb-col { | ||
22 | + margin-right: 1.6%; | ||
23 | +} | ||
24 | +.spb-col:last-child { | ||
25 | + margin-right: 0%; | ||
26 | +} | ||
27 | + | ||
28 | + | ||
29 | +.spb-col-1 { | ||
30 | + width: 6.86666666667%; | ||
31 | +} | ||
32 | + | ||
33 | +.spb-col-2 { | ||
34 | + width: 15.3333333333%; | ||
35 | +} | ||
36 | + | ||
37 | +.spb-col-3 { | ||
38 | + width: 23.8%; | ||
39 | +} | ||
40 | + | ||
41 | +.spb-col-4 { | ||
42 | + width: 32.2666666667%; | ||
43 | +} | ||
44 | + | ||
45 | +.spb-col-5 { | ||
46 | + width: 40.7333333333%; | ||
47 | +} | ||
48 | + | ||
49 | +.spb-col-6 { | ||
50 | + width: 49.2%; | ||
51 | +} | ||
52 | + | ||
53 | +.spb-col-7 { | ||
54 | + width: 57.6666666667%; | ||
55 | +} | ||
56 | + | ||
57 | +.spb-col-8 { | ||
58 | + width: 66.1333333333%; | ||
59 | +} | ||
60 | + | ||
61 | +.spb-col-9 { | ||
62 | + width: 74.6%; | ||
63 | +} | ||
64 | + | ||
65 | +.spb-col-10 { | ||
66 | + width: 83.0666666667%; | ||
67 | +} | ||
68 | + | ||
69 | +.spb-col-11 { | ||
70 | + width: 91.5333333333%; | ||
71 | +} | ||
72 | + | ||
73 | +.spb-col-12 { | ||
74 | + width: 100%; | ||
75 | +} | ||
76 | + |
src/noosfero-spb/noosfero-spb-theme/css/use-report.css
@@ -239,7 +239,7 @@ | @@ -239,7 +239,7 @@ | ||
239 | 239 | ||
240 | #content .star-rate-form .star-comment-container .comments-software-extra-fields { | 240 | #content .star-rate-form .star-comment-container .comments-software-extra-fields { |
241 | height: 0; | 241 | height: 0; |
242 | - overflow: hidden; | 242 | + overflow: initial; |
243 | } | 243 | } |
244 | 244 | ||
245 | #content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments { | 245 | #content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments { |
@@ -248,11 +248,11 @@ | @@ -248,11 +248,11 @@ | ||
248 | height: 50px; | 248 | height: 50px; |
249 | } | 249 | } |
250 | 250 | ||
251 | -#content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments label { | 251 | +#content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments > label { |
252 | font-size: 12px; | 252 | font-size: 12px; |
253 | } | 253 | } |
254 | 254 | ||
255 | -#content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments input { | 255 | +#content .star-rate-form .star-comment-container .comments-software-extra-fields #input_institution_comments > input { |
256 | display: block; | 256 | display: block; |
257 | height: 19px; | 257 | height: 19px; |
258 | width: 335px; | 258 | width: 335px; |
src/noosfero-spb/noosfero-spb-theme/style.css
@@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
9 | 9 | ||
10 | /*** SPB Theme section styles ***/ | 10 | /*** SPB Theme section styles ***/ |
11 | @import url(css/overwriting-base-theme.css); | 11 | @import url(css/overwriting-base-theme.css); |
12 | +@import url(css/spb-grid.css); | ||
12 | @import url(css/header.css); | 13 | @import url(css/header.css); |
13 | @import url(css/footer.css); | 14 | @import url(css/footer.css); |
14 | @import url(css/left-bar.css); | 15 | @import url(css/left-bar.css); |
@@ -26,6 +27,7 @@ | @@ -26,6 +27,7 @@ | ||
26 | @import url(css/tooltip.css); | 27 | @import url(css/tooltip.css); |
27 | @import url(css/popover.css); | 28 | @import url(css/popover.css); |
28 | @import url(css/notifications.css); | 29 | @import url(css/notifications.css); |
30 | +@import url(css/modal.css); | ||
29 | 31 | ||
30 | @font-face{ | 32 | @font-face{ |
31 | font-weight: normal; | 33 | font-weight: normal; |
src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb
@@ -18,6 +18,28 @@ Given /^SoftwareInfo has initial default values on database$/ do | @@ -18,6 +18,28 @@ Given /^SoftwareInfo has initial default values on database$/ do | ||
18 | OperatingSystemName.create(:name=>"CentOS") | 18 | OperatingSystemName.create(:name=>"CentOS") |
19 | end | 19 | end |
20 | 20 | ||
21 | +Given /^Institutions has initial default values on database$/ do | ||
22 | + GovernmentalPower.create(:name => "Executivo") | ||
23 | + GovernmentalPower.create(:name => "Legislativo") | ||
24 | + GovernmentalPower.create(:name => "Judiciario") | ||
25 | + | ||
26 | + GovernmentalSphere.create(:name => "Federal") | ||
27 | + | ||
28 | + JuridicalNature.create(:name => "Autarquia") | ||
29 | + JuridicalNature.create(:name => "Administracao Direta") | ||
30 | + JuridicalNature.create(:name => "Empresa Publica") | ||
31 | + JuridicalNature.create(:name => "Fundacao") | ||
32 | + JuridicalNature.create(:name => "Orgao Autonomo") | ||
33 | + JuridicalNature.create(:name => "Sociedade") | ||
34 | + JuridicalNature.create(:name => "Sociedade Civil") | ||
35 | + JuridicalNature.create(:name => "Sociedade de Economia Mista") | ||
36 | + | ||
37 | + national_region = NationalRegion.new | ||
38 | + national_region.name = "Distrito Federal" | ||
39 | + national_region.national_region_code = '35' | ||
40 | + national_region.national_region_type_id = NationalRegionType::STATE | ||
41 | + national_region.save | ||
42 | +end | ||
21 | 43 | ||
22 | Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| | 44 | Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| |
23 | # Wait the page javascript load | 45 | # Wait the page javascript load |
@@ -42,6 +64,27 @@ Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*) | @@ -42,6 +64,27 @@ Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*) | ||
42 | sleep 1 | 64 | sleep 1 |
43 | end | 65 | end |
44 | 66 | ||
67 | +Given /^the following public institutions?$/ do |table| | ||
68 | + # table is a Cucumber::Ast::Table | ||
69 | + table.hashes.each do |item| | ||
70 | + community = Community.new | ||
71 | + community.name = item[:name] | ||
72 | + community.country = item[:country] | ||
73 | + community.state = item[:state] | ||
74 | + community.city = item[:city] | ||
75 | + community.save! | ||
76 | + | ||
77 | + governmental_power = GovernmentalPower.where(:name => item[:governmental_power]).first | ||
78 | + governmental_sphere = GovernmentalSphere.where(:name => item[:governmental_sphere]).first | ||
79 | + | ||
80 | + juridical_nature = JuridicalNature.create(:name => item[:juridical_nature]) | ||
81 | + | ||
82 | + institution = PublicInstitution.new(:name => item[:name], :type => "PublicInstitution", :acronym => item[:acronym], :cnpj => item[:cnpj], :juridical_nature => juridical_nature, :governmental_power => governmental_power, :governmental_sphere => governmental_sphere) | ||
83 | + institution.community = community | ||
84 | + institution.corporate_name = item[:corporate_name] | ||
85 | + institution.save! | ||
86 | + end | ||
87 | +end | ||
45 | 88 | ||
46 | Given /^the following software language$/ do |table| | 89 | Given /^the following software language$/ do |table| |
47 | table.hashes.each do |item| | 90 | table.hashes.each do |item| |
src/noosfero-spb/software_communities/public/style.css
src/noosfero-spb/software_communities/views/comments_extra_fields.html.erb
@@ -7,15 +7,18 @@ | @@ -7,15 +7,18 @@ | ||
7 | </div> | 7 | </div> |
8 | 8 | ||
9 | <div class="comments-software-extra-fields"> | 9 | <div class="comments-software-extra-fields"> |
10 | - <div class="comments-software-people-benefited"> | ||
11 | - <%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> | ||
12 | - <span class="star-tooltip" title="Quantidade de pessoas beneficiadas com a utilização do software"></span> | ||
13 | - <%= text_field_tag "organization_rating[people_benefited]", "" %> | ||
14 | - </div> | ||
15 | 10 | ||
16 | - <div class="comments-software-saved-values"> | ||
17 | - <%= label_tag "comments_saved_value", _("Saved resources")%> | ||
18 | - <span class="star-tooltip" title="Valores em “Real” economizados com a utilização do software"></span> | ||
19 | - <%= text_field_tag "organization_rating[saved_value]", "", :placeholder=>"R$"%> | 11 | + <div class="extra-fields-container"> |
12 | + <div class="comments-software-people-benefited"> | ||
13 | + <%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> | ||
14 | + <span class="star-tooltip" title="Estimativa do número de pessoas beneficiadas com a utilização do software"></span> | ||
15 | + <%= text_field_tag "organization_rating[people_benefited]", "" %> | ||
16 | + </div> | ||
17 | + | ||
18 | + <div class="comments-software-saved-values"> | ||
19 | + <%= label_tag "comments_saved_value", _("Saved resources")%> | ||
20 | + <span class="star-tooltip" title='Estimativa dos valores em "Real" economizados com a utilização do software'></span> | ||
21 | + <%= text_field_tag "organization_rating[saved_value]", "", :placeholder=>"R$"%> | ||
22 | + </div> | ||
20 | </div> | 23 | </div> |
21 | </div> | 24 | </div> |