diff --git a/controllers/software_communities_plugin_controller.rb b/controllers/software_communities_plugin_controller.rb index 8667a85..b275a72 100644 --- a/controllers/software_communities_plugin_controller.rb +++ b/controllers/software_communities_plugin_controller.rb @@ -20,6 +20,27 @@ class SoftwareCommunitiesPluginController < ApplicationController render 'box_organizer/_download_list_template', :layout => false end + def get_field_data + condition = !request.xhr? || params[:query].nil? || params[:field].nil? + return render :json=>{} if condition + + model = get_model_by_params_field + + data = model.where("name ILIKE ?", "%#{params[:query]}%").select("id, name") + .collect { |db| + {:id=>db.id, :label=>db.name} + } + + other = [model.select("id, name").last].collect { |db| + {:id=>db.id, :label=>db.name} + } + + # Always has other in the list + data |= other + + render :json=> data + end + protected def get_model_by_params_field diff --git a/features/institution_registration.feature b/features/institution_registration.feature deleted file mode 100644 index 086b14e..0000000 --- a/features/institution_registration.feature +++ /dev/null @@ -1,32 +0,0 @@ -Feature: Institution Field - As a user - I want to sign up resgistring my institution - So others users can use it - - Background: - Given "SoftwareCommunitiesPlugin" plugin is enabled - And I am logged in as mpog_admin - And I go to /admin/plugins - And I check "SoftwareCommunitiesPlugin" - And I press "Save changes" - And Institutions has initial default values on database - And I am logged in as mpog_admin - - @selenium - Scenario: Show new institution fields when clicked in create new institution - Given I follow "Edit Profile" - When I follow "Create new institution" - And I should see "New Institution" - And I should see "Public Institution" - And I should see "Private Institution" - And I should see "Corporate Name" - And I should see "Name" - And I should see "State" - And I should see "City" - And I should see "Country" - And I should see "CNPJ" - And I should see "Acronym" - And I choose "Public Institution" - Then I should see "Governmental Sphere:" - And I should see "Governmental Power:" - And I should see "Juridical Nature:" \ No newline at end of file diff --git a/features/public_software_validation.feature b/features/public_software_validation.feature index 8cdc7a5..6f26b1d 100644 --- a/features/public_software_validation.feature +++ b/features/public_software_validation.feature @@ -47,6 +47,3 @@ Feature: edit adherent fields And I check "software[public_software]" And I uncheck "software[public_software]" Then I should not see "Adherent to e-ping ?" - - - diff --git a/features/step_definitions/software_communities_steps.rb b/features/step_definitions/software_communities_steps.rb index 12e1897..e87447b 100644 --- a/features/step_definitions/software_communities_steps.rb +++ b/features/step_definitions/software_communities_steps.rb @@ -18,28 +18,6 @@ Given /^SoftwareInfo has initial default values on database$/ do OperatingSystemName.create(:name=>"CentOS") end -Given /^Institutions has initial default values on database$/ do - GovernmentalPower.create(:name => "Executivo") - GovernmentalPower.create(:name => "Legislativo") - GovernmentalPower.create(:name => "Judiciario") - - GovernmentalSphere.create(:name => "Federal") - - JuridicalNature.create(:name => "Autarquia") - JuridicalNature.create(:name => "Administracao Direta") - JuridicalNature.create(:name => "Empresa Publica") - JuridicalNature.create(:name => "Fundacao") - JuridicalNature.create(:name => "Orgao Autonomo") - JuridicalNature.create(:name => "Sociedade") - JuridicalNature.create(:name => "Sociedade Civil") - JuridicalNature.create(:name => "Sociedade de Economia Mista") - - national_region = NationalRegion.new - national_region.name = "Distrito Federal" - national_region.national_region_code = '35' - national_region.national_region_type_id = NationalRegionType::STATE - national_region.save -end Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| # Wait the page javascript load @@ -64,27 +42,6 @@ Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*) sleep 1 end -Given /^the following public institutions?$/ do |table| - # table is a Cucumber::Ast::Table - table.hashes.each do |item| - community = Community.new - community.name = item[:name] - community.country = item[:country] - community.state = item[:state] - community.city = item[:city] - community.save! - - governmental_power = GovernmentalPower.where(:name => item[:governmental_power]).first - governmental_sphere = GovernmentalSphere.where(:name => item[:governmental_sphere]).first - - juridical_nature = JuridicalNature.create(:name => item[:juridical_nature]) - - 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) - institution.community = community - institution.corporate_name = item[:corporate_name] - institution.save! - end -end Given /^the following software language$/ do |table| table.hashes.each do |item| diff --git a/features/user_profile_edition.feature b/features/user_profile_edition.feature deleted file mode 100644 index 759e583..0000000 --- a/features/user_profile_edition.feature +++ /dev/null @@ -1,53 +0,0 @@ -Feature: Institution Field - As a user - I want to update my update my user data - So I can maintain my personal data updated - - Background: - Given "SoftwareCommunitiesPlugin" plugin is enabled - And I am logged in as mpog_admin - And I go to /admin/plugins - And I check "SoftwareCommunitiesPlugin" - And I press "Save changes" - And feature "skip_new_user_email_confirmation" is enabled on environment - And I go to /admin/features/manage_fields - And I check "person_fields_country_active" - And I check "person_fields_state_active" - And I check "person_fields_city_active" - And I press "Save changes" - And Institutions has initial default values on database - And the following public institutions - | name | acronym | country | state | city | cnpj | juridical_nature | governmental_power | governmental_sphere | corporate_name | - | Ministerio das Cidades | MC | BR | DF | Gama | 58.745.189/0001-21 | Autarquia | Executivo | Federal | Ministerio das Cidades | - | Governo do DF | GDF | BR | DF | Taguatinga | 12.645.166/0001-44 | Autarquia | Legislativo | Federal | Governo do DF | - | Ministerio do Planejamento | MP | BR | DF | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal | Ministerio do Planejamento | - And I am logged in as mpog_admin - - @selenium - Scenario: Add more then one instituion on profile editor - Given I follow "Edit Profile" - And I follow "Add new institution" - And I type in "Minis" in autocomplete list "#input_institution" and I choose "Ministerio do Planejamento" - And I follow "Add new institution" - And I type in "Gover" in autocomplete list "#input_institution" and I choose "Governo do DF" - And I follow "Add new institution" - Then I should see "Ministerio do Planejamento" within ".institutions_added" - And I should see "Governo do DF" within ".institutions_added" - - @selenium - Scenario: Verify if field 'city' is shown when Brazil is selected - Given I follow "Edit Profile" - Then I should see "City" - - @selenium - Scenario: Verify if field 'city' does not appear when Brazil is not selected as country - Given I follow "Edit Profile" - When I select "United States" from "profile_data_country" - Then I should not see "City" within ".type-text" - - @selenium - Scenario: Show message of institution not found - Given I follow "Edit Profile" - And I fill in "input_institution" with "Some Nonexistent Institution" - And I sleep for 1 seconds - Then I should see "No institution found" diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb index a2b3d35..0cbfa92 100644 --- a/lib/software_communities_plugin.rb +++ b/lib/software_communities_plugin.rb @@ -73,14 +73,12 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin vendor/jquery.js lib/noosfero-root.js lib/select-element.js - lib/select-field-choices + lib/select-field-choices.js lib/auto-complete.js lib/software-catalog-component.js views/control-panel.js views/edit-software.js views/new-software.js - views/user-edit-profile.js - views/create-institution.js views/search-software-catalog.js views/profile-tabs-software.js views/new-community.js diff --git a/public/initializer.js b/public/initializer.js index f4f8916..b882e32 100644 --- a/public/initializer.js +++ b/public/initializer.js @@ -5,8 +5,6 @@ 'ControlPanel', 'EditSoftware', 'NewSoftware', - 'UserEditProfile', - 'CreateInstitution', 'SearchSoftwareCatalog', 'SoftwareDownload', 'ProfileTabsSoftware', diff --git a/public/static/governmental_powers.txt b/public/static/governmental_powers.txt deleted file mode 100644 index 6fffa27..0000000 --- a/public/static/governmental_powers.txt +++ /dev/null @@ -1,4 +0,0 @@ -Executivo -Legislativo -Judiciario -Nao se aplica diff --git a/public/static/governmental_sphere.txt b/public/static/governmental_sphere.txt deleted file mode 100644 index ffaa31e..0000000 --- a/public/static/governmental_sphere.txt +++ /dev/null @@ -1,4 +0,0 @@ -Federal -Estadual -Distrital -Municipal \ No newline at end of file diff --git a/public/static/juridical_nature.txt b/public/static/juridical_nature.txt deleted file mode 100644 index 517bbd6..0000000 --- a/public/static/juridical_nature.txt +++ /dev/null @@ -1,8 +0,0 @@ -Administracao Direta -Autarquia -Empresa Publica -Fundacao -Orgao Autonomo -Sociedade -Sociedade Civil -Sociedade de Economia Mista diff --git a/public/views/control-panel.js b/public/views/control-panel.js index 52ac8d6..e7d6e29 100644 --- a/public/views/control-panel.js +++ b/public/views/control-panel.js @@ -9,22 +9,11 @@ modulejs.define('ControlPanel', ['jquery'], function($) { } } - - function add_institution_on_control_panel(control_panel) { - var institution_link = $(".control-panel-instituton-link").remove(); - - if( institution_link.size() > 0 ) { - control_panel.prepend(institution_link); - } - } - - function add_itens_on_controla_panel() { var control_panel = $(".control-panel"); if( control_panel.size() > 0 ) { add_software_on_control_panel(control_panel); - add_institution_on_control_panel(control_panel); } } diff --git a/public/views/create-institution.js b/public/views/create-institution.js deleted file mode 100644 index f909bc4..0000000 --- a/public/views/create-institution.js +++ /dev/null @@ -1,312 +0,0 @@ -modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'], function($, NoosferoRoot, SelectElement) { - 'use strict'; - - var AJAX_URL = { - create_institution_modal: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/create_institution"), - new_institution: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/new_institution"), - institution_already_exists: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/institution_already_exists"), - get_institutions: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_institutions") - }; - - - function open_create_institution_modal(evt) { - evt.preventDefault(); - - $.get(AJAX_URL.create_institution_modal, function(response){ - $("#institution_dialog").html(response); - - set_form_count_custom_data(); - set_events(); - - $("#institution_dialog").dialog({ - modal: true, - width: 500, - height: 530, - position: 'center', - close: function() { - $("#institution_dialog").html(""); - $('#institution_empty_ajax_message').switchClass("show-field", "hide-field"); - } - }); - }); - } - - - function show_public_institutions_fields() { - $(".public-institutions-fields").show(); - } - - - function show_private_institutions_fields() { - $(".public-institutions-fields").hide(); - - $("#institutions_governmental_power option").selected(0); - $("#institutions_governmental_sphere option").selected(0); - } - - - function get_comunity_post_data() { - return { - name : $("#community_name").val(), - country : $("#community_country").val(), - state : $("#community_state").val(), - city : $("#community_city").val() - } - } - - - function get_institution_post_data() { - return { - cnpj: $("#institutions_cnpj").val(), - type: $("input[name='institutions[type]']:checked").val(), - acronym : $("#institutions_acronym").val(), - governmental_power: $("#institutions_governmental_power").selected().val(), - governmental_sphere: $("#institutions_governmental_sphere").selected().val(), - juridical_nature: $("#institutions_juridical_nature").selected().val(), - corporate_name: $("#institutions_corporate_name").val() - } - } - - - function get_post_data() { - var post_data = {}; - - post_data.community = get_comunity_post_data(); - post_data.institutions = get_institution_post_data(); - - return post_data; - } - - - function success_ajax_response(response) { - close_loading(); - - if(response.success){ - var institution_name = response.institution_data.name; - var institution_id = response.institution_data.id; - - $("#institution_dialog").html("

"+response.message+"

"); - $("#create_institution_errors").switchClass("show-field", "hide-field"); - - $(".institution_container").append(get_clone_institution_data(institution_id)); - add_selected_institution_to_list(institution_id, institution_name); - - $(".remove-institution").click(remove_institution); - } else { - var errors = ""; - - $("#create_institution_errors").switchClass("hide-field", "show-field").html("

"+response.message+"

"+errors); - } - } - - - function save_institution(evt) { - evt.preventDefault(); - - open_loading($("#loading_message").val()); - $.ajax({ - url: AJAX_URL.new_institution, - data : get_post_data(), - type: "POST", - success: success_ajax_response, - error: function() { - close_loading(); - var error_message = $("#institution_error_message").val(); - $("#create_institution_errors").switchClass("hide-field", "show-field").html("

"+error_message+"

"); - } - }); - } - - - function institution_already_exists(){ - if( this.value.length >= 3 ) { - $.get(AJAX_URL.institution_already_exists, {name:this.value}, function(response){ - if( response === true ) { - $("#already_exists_text").switchClass("hide-field", "show-field"); - } else { - $("#already_exists_text").switchClass("show-field", "hide-field"); - } - }); - } - } - - - function get_clone_institution_data(value) { - var user_institutions = $(".user_institutions").first().clone(); - user_institutions.val(value); - - return user_institutions; - } - - - function institution_autocomplete() { - $("#input_institution").autocomplete({ - source : function(request, response){ - $.ajax({ - type: "GET", - url: AJAX_URL.get_institutions, - data: {query: request.term}, - success: function(result){ - response(result); - - if( result.length === 0 ) { - $('#institution_empty_ajax_message').switchClass("hide-field", "show-field"); - } else { - $('#institution_empty_ajax_message').switchClass("show-field", "hide-field"); - } - }, - error: function(ajax, stat, errorThrown) { - console.log('Link not found : ' + errorThrown); - } - }); - }, - - minLength: 2, - - select : function (event, selected) { - $("#institution_selected").val(selected.item.id).attr("data-name", selected.item.label); - } - }); - } - - - function add_selected_institution_to_list(id, name) { - var selected_institution = "
  • "+name; - selected_institution += "
  • "; - - $(".institutions_added").append(selected_institution); - } - - - function add_new_institution(evt) { - evt.preventDefault(); - var selected = $("#institution_selected"); - var institution_already_added = $(".institutions_added li[data-institution='"+selected.val()+"']").length; - - if(selected.val().length > 0 && institution_already_added === 0) { - //field that send the institutions to the server - $(".institution_container").append(get_clone_institution_data(selected.val())); - - // Visualy add the selected institution to the list - add_selected_institution_to_list(selected.val(), selected.attr("data-name")); - - // clean the institution flag - selected.val("").attr("data-name", ""); - $("#input_institution").val(""); - - $(".remove-institution").click(remove_institution); - } - } - - - function remove_institution(evt) { - evt.preventDefault(); - var code = $(this).parent().attr("data-institution"); - - $(".user_institutions[value="+code+"]").remove(); - $(this).parent().remove(); - } - - - function add_mask_to_form_items() { - $(".intitution_cnpj_field").mask("99.999.999/9999-99"); - } - - - function show_hide_cnpj_city(country) { - var cnpj = $("#institutions_cnpj").parent().parent(); - var city = $("#community_city").parent().parent(); - var state = $("#community_state").parent().parent(); - - if( country === "-1" ) $("#community_country").val("BR"); - - if( country !== "BR" ) { - cnpj.hide(); - city.hide(); - state.hide(); - } else { - cnpj.show(); - city.show(); - state.show(); - } - } - - - function institution_type_actions(type) { - if( type === "PublicInstitution" ) { - show_public_institutions_fields(); - } else { - show_private_institutions_fields(); - } - } - - - function set_form_count_custom_data() { - var divisor_option = SelectElement.generateOption("-1", "--------------------------------"); - var default_option = SelectElement.generateOption("BR", "Brazil"); - - var inst_type = $("input[name='institutions[type]']:checked").val(); - var country = $("#community_country").val(); - - institution_type_actions(inst_type); - show_hide_cnpj_city(country); - - if( $('#community_country').find("option[value='']").length === 1 ) { - $('#community_country').find("option[value='']").remove(); - $('#community_country').prepend(divisor_option); - $('#community_country').prepend(default_option); - - if($("#edit_institution_page").val() === "false") { - $('#community_country').val("BR"); - show_hide_cnpj_city($('#community_country').val()); - } - } - } - - - function set_events() { - $("#create_institution_link").click(open_create_institution_modal); - - $("input[name='institutions[type]']").click(function(){ - institution_type_actions(this.value); - }); - - $('#save_institution_button').click(save_institution); - - $("#community_name").keyup(institution_already_exists); - - $("#add_new_institution").click(add_new_institution); - - $(".remove-institution").click(remove_institution); - - $("#community_country").change(function(){ - show_hide_cnpj_city(this.value); - }); - - add_mask_to_form_items(); - - institution_autocomplete(); - } - - - return { - isCurrentPage: function() { - return $("#institution_form").length === 1; - }, - - - init: function() { - set_form_count_custom_data(); - set_events(); - } - } -}); diff --git a/public/views/user-edit-profile.js b/public/views/user-edit-profile.js deleted file mode 100644 index 2bd7914..0000000 --- a/public/views/user-edit-profile.js +++ /dev/null @@ -1,216 +0,0 @@ -modulejs.define('UserEditProfile', ['jquery', 'SelectElement', 'SelectFieldChoices', 'CreateInstitution'], function($, SelectElement, SelectFieldChoices, CreateInstitution) { - 'use strict'; - - function set_form_count_custom_data() { - var divisor_option = SelectElement.generateOption("-1", "--------------------------------"); - var default_option = SelectElement.generateOption("BR", "Brazil"); - - $('#profile_data_country').find("option[value='']").remove(); - $('#profile_data_country').prepend(divisor_option); - $('#profile_data_country').prepend(default_option); - $('#profile_data_country').val("BR"); - } - - - function set_initial_form_custom_data(selectFieldChoices) { - set_form_count_custom_data(); - - $("#password-balloon").html($("#user_password_menssage").val()); - $("#profile_data_email").parent().append($("#email_public_message").remove()); - - if( $("#state_field").length !== 0 ) selectFieldChoices.replaceStateWithSelectElement(); - } - - - function show_state_if_country_is_brazil() { - var selectFieldChoices = new SelectFieldChoices("#state_field", "#city_field", "/plugin/software_communities/get_brazil_states"); - set_initial_form_custom_data(selectFieldChoices); - - $("#profile_data_country").change(function(){ - if( this.value === "-1" ) $(this).val("BR"); - - if( this.value === "BR" && selectFieldChoices.actualFieldIsInput() ) { - selectFieldChoices.replaceStateWithSelectElement(); - selectFieldChoices.showCity(); - } else if( this.value !== "BR" && !selectFieldChoices.actualFieldIsInput() ) { - selectFieldChoices.replaceStateWithInputElement(); - selectFieldChoices.hideCity(); - } - }); - } - - - function show_or_hide_phone_mask() { - if($("#profile_data_country").val() === "BR") { - if( (typeof $("#profile_data_cell_phone").data("rawMaskFn") === 'undefined') ) { - $("#profile_data_cell_phone").mask("(99) 9999?9-9999"); - $("#profile_data_comercial_phone").mask("(99) 9999?9-9999"); - $("#profile_data_contact_phone").mask("(99) 9999?9-9999"); - } - } else { - $("#profile_data_cell_phone").unmask(); - $("#profile_data_comercial_phone").unmask(); - $("#profile_data_contact_phone").unmask(); - } - } - - - function fix_phone_mask_format(id) { - $(id).blur(function() { - var last = $(this).val().substr( $(this).val().indexOf("-") + 1 ); - - if( last.length === 3 ) { - var move = $(this).val().substr( $(this).val().indexOf("-") - 1, 1 ); - var lastfour = move + last; - var first = $(this).val().substr( 0, 9 ); - - $(this).val( first + '-' + lastfour ); - } - }); - } - - - function show_plugin_error_message(field_selector, hidden_message_id ) { - var field = $(field_selector); - - field.removeClass("validated").addClass("invalid"); - - if(!$("." + hidden_message_id)[0]) { - var message = $("#" + hidden_message_id).val(); - field.parent().append("
    "+message+""); - } else { - $("." + hidden_message_id).show(); - } - } - - - function hide_plugin_error_message(field_selector, hidden_message_id) { - $(field_selector).removeClass("invalid").addClass("validated"); - $("." + hidden_message_id).hide(); - } - - - function add_blur_fields(field_selector, hidden_message_id, validation_function, allow_blank) { - $(field_selector).blur(function(){ - $(this).attr("class", ""); - - if( validation_function(this.value, !!allow_blank) ) { - show_plugin_error_message(field_selector, hidden_message_id); - } else { - hide_plugin_error_message(field_selector, hidden_message_id); - } - }); - } - - - function invalid_email_validation(value, allow_blank) { - if( allow_blank && value.trim().length === 0 ) { - return false; - } - - var correct_format_regex = new RegExp(/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/); - - return !correct_format_regex.test(value); - } - - - function invalid_site_validation(value) { - var correct_format_regex = new RegExp(/(^|)(http[s]{0,1})\:\/\/(\w+[.])\w+/g); - - return !correct_format_regex.test(value); - } - - - function get_privacy_selector_parent_div(field_id, actual) { - if( actual === undefined ) actual = $(field_id); - - if( actual.is("form") || actual.length === 0 ) return null; // Not allow recursion over form - - if( actual.hasClass("field-with-privacy-selector") ) { - return actual; - } else { - return get_privacy_selector_parent_div(field_id, actual.parent()); - } - } - - - function try_to_remove(list, field) { - try { - list.push(field.remove()); - } catch(e) { - console.log("Cound not remove field"); - } - } - - - function get_edit_fields_in_insertion_order() { - var containers = []; - - try_to_remove(containers, get_privacy_selector_parent_div("#city_field")); - try_to_remove(containers, get_privacy_selector_parent_div("#state_field")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_country")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_birth_date")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_organization_website")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_personal_website")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_comercial_phone")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_contact_phone")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_cell_phone")); - try_to_remove(containers, $("#select_institution")); - try_to_remove(containers, $("#user_secondary_email").parent().parent()); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_email")); - try_to_remove(containers, get_privacy_selector_parent_div("#profile_data_name")); - try_to_remove(containers, $(".pseudoformlabel").parent().parent()); - try_to_remove(containers, $("h2")[0]); - - return containers; - } - - - function change_edit_fields_order() { - var form = $("#profile-data"); - - if( form.length !== 0 ) { - var containers = get_edit_fields_in_insertion_order(); - - containers.forEach(function(container){ - form.prepend(container); - }); - } - } - - - function set_fields_validations() { - $("#profile_data_country").blur(show_or_hide_phone_mask); - - $("#profile_data_birth_date").mask("99/99/9999"); - - fix_phone_mask_format("#profile_data_cell_phone"); - fix_phone_mask_format("#profile_data_comercial_phone"); - fix_phone_mask_format("#profile_data_contact_phone"); - - add_blur_fields("#profile_data_email", "email_error", invalid_email_validation); - add_blur_fields("#user_secondary_email", "email_error", invalid_email_validation, true); - add_blur_fields("#profile_data_personal_website", "site_error", invalid_site_validation); - add_blur_fields("#profile_data_organization_website", "site_error", invalid_site_validation); - } - - - return { - isCurrentPage: function() { - return $('#profile_data_email').length === 1; - }, - - - init: function() { - change_edit_fields_order(); // To change the fields order, it MUST be the first function executed - - show_state_if_country_is_brazil(); - - show_or_hide_phone_mask(); - - set_fields_validations(); - - CreateInstitution.init(); - } - } -}); diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 815a6e7..b677a1d 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/institution_test_helper' require( File.dirname(__FILE__) + '/../../../../app/controllers/my_profile/profile_editor_controller' diff --git a/test/functional/software_communities_plugin_controller_test.rb b/test/functional/software_communities_plugin_controller_test.rb index 7322666..0f6f7ee 100644 --- a/test/functional/software_communities_plugin_controller_test.rb +++ b/test/functional/software_communities_plugin_controller_test.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/institution_test_helper' require File.dirname(__FILE__) + '/../../controllers/software_communities_plugin_controller' class SoftwareCommunitiesPluginController; def rescue_action(e) raise e end; end diff --git a/test/helpers/institution_test_helper.rb b/test/helpers/institution_test_helper.rb deleted file mode 100644 index 1f4df2f..0000000 --- a/test/helpers/institution_test_helper.rb +++ /dev/null @@ -1,59 +0,0 @@ -module InstitutionTestHelper - - def self.generate_form_fields name, country, state, city, cnpj, type - fields = { - :community => { - :name => name, - :country => country, - :state => state, - :city => city - }, - :institutions => { - :cnpj=> cnpj, - :type => type, - :acronym => "", - :governmental_power => "", - :governmental_sphere => "", - :juridical_nature => "", - :corporate_name => "coporate default" - } - } - fields - end - - def self.create_public_institution name, acronym, country, state, city, juridical_nature, gov_p, gov_s, cnpj - institution = PublicInstitution.new - institution.community = institution_community(name, country, state, city) - institution.name = name - institution.juridical_nature = juridical_nature - institution.acronym = acronym - institution.governmental_power = gov_p - institution.governmental_sphere = gov_s - institution.cnpj = cnpj - institution.corporate_name = "corporate default" - institution.save - institution - end - - def self.create_private_institution name, acronym, country, state, city, cnpj - institution = PrivateInstitution.new - institution.community = institution_community(name, country, state, city) - institution.name = name - institution.acronym = acronym - institution.cnpj = cnpj - institution.corporate_name = "corporate default" - institution.save - - institution - end - - def self.institution_community name, country, state, city - institution_community = Community::new - institution_community.name = name - institution_community.country = country - institution_community.state = state - institution_community.city = city - institution_community.save - institution_community - end -end \ No newline at end of file diff --git a/test/helpers/plugin_test_helper.rb b/test/helpers/plugin_test_helper.rb index 14d409a..ab1cfe5 100644 --- a/test/helpers/plugin_test_helper.rb +++ b/test/helpers/plugin_test_helper.rb @@ -1,11 +1,5 @@ -require File.dirname(__FILE__) + '/../helpers/institution_test_helper' - module PluginTestHelper - def create_public_institution *params - InstitutionTestHelper.create_public_institution *params - end - def create_community name community = fast_create(Community) community.name = name @@ -25,27 +19,6 @@ module PluginTestHelper software_info end - def create_private_institution name, acronym, country, state, city, cnpj - InstitutionTestHelper.create_private_institution( - name, - acronym, - country, - state, - city, - cnpj - ) - end - - def create_community_institution name, country, state, city - community = fast_create(Community) - community.name = name - community.country = country - community.state = state - community.city = city - community.save - community - end - def create_person name, email, password, password_confirmation, state, city user = create_user( name.to_slug, diff --git a/test/unit/communities_block_test.rb b/test/unit/communities_block_test.rb index 5c542d4..653140b 100644 --- a/test/unit/communities_block_test.rb +++ b/test/unit/communities_block_test.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/institution_test_helper' require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' class CommunitiesBlockTest < ActiveSupport::TestCase @@ -7,13 +6,6 @@ class CommunitiesBlockTest < ActiveSupport::TestCase def setup @person = create_person("My Name", "user@email.com", "123456", "123456", "Any State", "Some City") - @gov_power = GovernmentalPower.create(:name=>"Some Gov Power") - @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") - @juridical_nature = JuridicalNature.create(:name => "Autarquia") - - @institution = InstitutionTestHelper.create_public_institution("Ministerio Publico da Uniao", "MPU", "BR", "DF", "Gama", @juridical_nature, @gov_power, @gov_sphere, "12.345.678/9012-45") - @institution.community.add_member(@person) - @software_info = create_software_info("Novo Software") @software_info.community.add_member(@person) @@ -26,12 +18,8 @@ class CommunitiesBlockTest < ActiveSupport::TestCase end def teardown - GovernmentalPower.destroy_all - GovernmentalSphere.destroy_all - JuridicalNature.destroy_all CommunitiesBlock.destroy_all @person = nil - @institution = nil @community = nil @software_info = nil end diff --git a/test/unit/governmental_power_test.rb b/test/unit/governmental_power_test.rb deleted file mode 100644 index 5f777e6..0000000 --- a/test/unit/governmental_power_test.rb +++ /dev/null @@ -1,33 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/institution_test_helper' - -class GovernmentalPowerTest < ActiveSupport::TestCase - - def setup - @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") - @juridical_nature = JuridicalNature.create(:name => "Autarquia") - end - - def teardown - Institution.destroy_all - end - - should "get public institutions" do - inst_name = "Ministerio Publico da Uniao" - inst_cnpj = "12.345.678/9012-45" - gov_power = GovernmentalPower.create(:name=>"Some gov power") - InstitutionTestHelper.create_public_institution( - inst_name, - "MPU", - "BR", - "DF", - "Gama", - @juridical_nature, - gov_power, - @gov_sphere, - inst_cnpj - ) - - assert_equal gov_power.public_institutions.count, PublicInstitution.count - end -end \ No newline at end of file diff --git a/test/unit/institution_test.rb b/test/unit/institution_test.rb deleted file mode 100644 index cda237c..0000000 --- a/test/unit/institution_test.rb +++ /dev/null @@ -1,62 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class InstitutionTest < ActiveSupport::TestCase - include PluginTestHelper - def setup - @gov_power = GovernmentalPower.create(:name=>"Some Gov Power") - @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") - @juridical_nature = JuridicalNature.create(:name => "Autarquia") - - @institution = create_public_institution( - "Ministerio Publico da Uniao", - "MPU", - "BR", - "DF", - "Gama", - @juridical_nature, - @gov_power, - @gov_sphere, - "11.222.333/4444-55" - ) - end - - def teardown - GovernmentalPower.destroy_all - GovernmentalSphere.destroy_all - JuridicalNature.destroy_all - @institution = nil - end - should "not save institutions without name" do - @institution.name = nil - assert !@institution.save - assert @institution.errors.full_messages.include? "Name can't be blank" - end - - should "not save if institution has invalid type" do - invalid_msg = "Type invalid, only public and private institutions are allowed." - @institution.type = "Other type" - assert !@institution.save, 'Invalid type' - assert @institution.errors.full_messages.include? invalid_msg - end - - should "not save without country" do - @institution.community.country = nil - assert !@institution.save, "Country can't be blank" - assert @institution.errors.full_messages.include? "Country can't be blank" - end - - should "not save without state" do - @institution.community.state = nil - - assert !@institution.save, "State can't be blank" - assert @institution.errors.full_messages.include? "State can't be blank" - end - - should "not save without city" do - @institution.community.city = nil - - assert !@institution.save, "City can't be blank" - assert @institution.errors.full_messages.include? "City can't be blank" - end -end diff --git a/test/unit/institutions_block_test.rb b/test/unit/institutions_block_test.rb deleted file mode 100644 index e0af039..0000000 --- a/test/unit/institutions_block_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class InstitutionsBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from Block' do - assert_kind_of Block, InstitutionsBlock.new - end - - should 'declare its default title' do - InstitutionsBlock.any_instance.stubs(:profile_count).returns(0) - assert_not_equal Block.new.default_title, InstitutionsBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, InstitutionsBlock.description - end - - should 'give empty footer on unsupported owner type' do - block = InstitutionsBlock.new - block.expects(:owner).returns(1) - assert_equal '', block.footer - end - - should 'list institutions' do - user = create_person("Jose_Augusto", - "jose_augusto@email.com", - "aaaaaaa", - "aaaaaaa", - "DF", - "Gama" - ) - - institution = create_private_institution( - "inst name", - "IN", - "country", - "state", - "city", - "00.111.222/3333-44" - ) - institution.community.add_member(user) - - block = InstitutionsBlock.new - block.expects(:owner).at_least_once.returns(user) - - assert_equivalent [institution.community], block.profiles - end - -end diff --git a/test/unit/juridical_nature_test.rb b/test/unit/juridical_nature_test.rb deleted file mode 100644 index 80d34c6..0000000 --- a/test/unit/juridical_nature_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class JuridicalNatureTest < ActiveSupport::TestCase - - include PluginTestHelper - - def setup - @govPower = GovernmentalPower.create(:name=>"Some Gov Power") - @govSphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") - end - - def teardown - Institution.destroy_all - end - - should "get public institutions" do - juridical_nature = JuridicalNature.create(:name => "Autarquia") - create_public_institution("Ministerio Publico da Uniao", "MPU", "BR", "DF", "Gama", juridical_nature, @govPower, @govSphere, "22.333.444/5555-66") - create_public_institution("Tribunal Regional da Uniao", "TRU", "BR", "DF", "Brasilia", juridical_nature, @govPower, @govSphere, "22.333.444/5555-77") - assert juridical_nature.public_institutions.count == PublicInstitution.count - end -end diff --git a/test/unit/private_institution_test.rb b/test/unit/private_institution_test.rb deleted file mode 100644 index e0fad37..0000000 --- a/test/unit/private_institution_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class PrivateInstitutionTest < ActiveSupport::TestCase - include PluginTestHelper - def setup - @institution = create_private_institution( - "Simple Private Institution", - "SPI", - "BR", - "DF", - "Gama", - "00.000.000/0001-00" - ) - end - - def teardown - @institution = nil - Institution.destroy_all - end - - should "not save without a cnpj" do - @institution.cnpj = nil - - assert !@institution.save - assert @institution.errors.full_messages.include? "Cnpj can't be blank" - end - - should "not save with a repeated cnpj" do - msg = "Cnpj has already been taken" - assert @institution.save - sec_institution = create_private_institution( - "Another Private Institution", - "API", - "BR", - "DF", - "Gama", - "00.000.000/0001-00" - ) - - assert sec_institution.errors.full_messages.include? msg - end - - should "save without fantasy name" do - @institution.acronym = nil - @institution.community.save - - assert @institution.save - end -end diff --git a/test/unit/public_institution_test.rb b/test/unit/public_institution_test.rb deleted file mode 100644 index 1976d0f..0000000 --- a/test/unit/public_institution_test.rb +++ /dev/null @@ -1,68 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class PublicInstitutionTest < ActiveSupport::TestCase - include PluginTestHelper - def setup - @gov_power = GovernmentalPower.create(:name=>"Some Gov Power") - @gov_sphere = GovernmentalSphere.create(:name=>"Some Gov Sphere") - @juridical_nature = JuridicalNature.create(:name => "Autarquia") - - @institution = create_public_institution( - "Ministerio Publico da Uniao", - "MPU", - "BR", - "DF", - "Gama", - @juridical_nature, - @gov_power, - @gov_sphere, - "11.222.333/4444-55" - ) - end - - def teardown - GovernmentalPower.destroy_all - GovernmentalSphere.destroy_all - JuridicalNature.destroy_all - Institution.destroy_all - @gov_power = nil - @gov_sphere = nil - @juridical_nature = nil - @institution = nil - end - - should "not save without a cnpj" do - @institution.cnpj = nil - assert !@institution.save - end - - should "save institution without an acronym" do - @institution.acronym = nil - assert @institution.save - end - - should "Not save institution without a governmental_power" do - invalid_msg = "Governmental power can't be blank" - @institution.governmental_power = nil - - assert !@institution.save - assert @institution.errors.full_messages.include? invalid_msg - end - - should "Not save institution without a governmental_sphere" do - invalid_msg = "Governmental sphere can't be blank" - @institution.governmental_sphere = nil - - assert !@institution.save - assert @institution.errors.full_messages.include? invalid_msg - end - - should "not save institution without juridical nature" do - invalid_msg = "Juridical nature can't be blank" - @institution.juridical_nature = nil - - assert !@institution.save - assert @institution.errors.full_messages.include? invalid_msg - end -end diff --git a/test/unit/software_communities_person_test.rb b/test/unit/software_communities_person_test.rb index e945dda..3db9473 100644 --- a/test/unit/software_communities_person_test.rb +++ b/test/unit/software_communities_person_test.rb @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' -class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase +class GovUserPluginPersonTest < ActiveSupport::TestCase include PluginTestHelper def setup @@ -11,50 +11,19 @@ class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase @user = fast_create(User) @person = create_person( - "My Name", - "user@email.com", - "123456", - "123456", - "Any State", - "Some City" - ) + "My Name", + "user@email.com", + "123456", + "123456", + "Any State", + "Some City" + ) end def teardown @plugin = nil end - should 'be a noosfero plugin' do - assert_kind_of Noosfero::Plugin, @plugin - end - - should 'save person with a valid full name' do - p = Person::new :name=>"S1mpl3 0f N4m3", :identifier=>"simple-name" - p.user = fast_create(:user) - - assert_equal true, p.save - end - - should 'save person with a valid full name with accents' do - name = 'Jônatàs dâ Sîlvã Jösé' - identifier = "jonatas-jose-da-silva" - p = Person::new :name=>name, :identifier=>identifier - p.user = fast_create(:user) - - assert_equal true, p.save - end - - should 'not save person whose name has not capital letter' do - p = Person::new :name=>"simple name" - assert !p.save, _("Name Should begin with a capital letter and no special characters") - end - - should 'not save person whose name has special characters' do - p = Person::new :name=>"Simple N@me" - - assert !p.save , _("Name Should begin with a capital letter and no special characters") - end - should 'get a list of softwares of a person' do software1 = create_software_info "noosfero" software2 = create_software_info "colab" diff --git a/views/person_editor_extras.html.erb b/views/person_editor_extras.html.erb deleted file mode 100644 index 8b7f7ec..0000000 --- a/views/person_editor_extras.html.erb +++ /dev/null @@ -1,33 +0,0 @@ -
    - <%= label_tag "user[institution_ids]", _('Institutions'), :class=>"formlabel" %> - -
    - <%= text_field_tag(:institution, "", :id=>"input_institution") %> - - <% context.profile.user.institutions.each do |institution| %> - <%= hidden_field_tag("user[institution_ids][]", institution.id, :class => 'user_institutions') %> - <% end %> -
    - - <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %> - <%= link_to(_("Add new institution"), "#", :class=>'button with-text icon-add', :id => 'add_new_institution') %> - <%= link_to(_("Create new institution"), "#", :id=>"create_institution_link", :class=>'button with-text icon-add') %> - <%= content_tag(:div, "", :id=>"institution_dialog") %> - - <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %> - <%= hidden_field_tag("institution_selected", "") %> - - -
    - -<%= hidden_field_tag("full_name_error", _("Should begin with a capital letter and no special characters")) %> -<%= hidden_field_tag("email_error", _("Email should have the following format: name@host.br")) %> -<%= hidden_field_tag("site_error", _("Site should have a valid format: http://name.hosts")) %> -
    <%= _("If you work in a public agency use your government e-Mail") %>
    diff --git a/views/profile/_institution_tab.html.erb b/views/profile/_institution_tab.html.erb deleted file mode 100644 index 6c2f7fb..0000000 --- a/views/profile/_institution_tab.html.erb +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - <%= display_mpog_field(_('Type:'), profile.institution, :type, true) %> - <%= display_mpog_field(_('CNPJ:'), profile.institution, :cnpj, true) %> - <%= display_mpog_field(_('Last modification:'), profile.institution, :date_modification, true) %> - <%= display_mpog_field(_('Country:'), profile.institution.community, :country, true) %> - <%= display_mpog_field(_('State:'), profile.institution.community, :state, true) %> - <%= display_mpog_field(_('City:'), profile.institution.community, :city, true) %> - <% if profile.institution.type == "PrivateInstitution"%> - <%= display_mpog_field(_('Fantasy Name:'), profile.institution, :acronym, true) %> - <% else %> - <%= display_mpog_field(_('Acronym:'), profile.institution, :acronym, true) %> - <%= display_mpog_field(_('Governmental Power:'), profile.institution.governmental_power, :name, true) %> - <%= display_mpog_field(_('Governmental Sphere:'), profile.institution.governmental_sphere, :name, true) %> - <%= display_mpog_field(_('Juridical Nature:'), profile.institution.juridical_nature, :name, true) %> - <%= content_tag('tr', content_tag('td', _("SISP:")) + content_tag('td', profile.institution.sisp ? _("Yes") : _("No"))) %> - <% end %> -
    <%= _('Institution Information')%>
    diff --git a/views/profile/_profile_tab.html.erb b/views/profile/_profile_tab.html.erb deleted file mode 100644 index 4fc67b0..0000000 --- a/views/profile/_profile_tab.html.erb +++ /dev/null @@ -1,3 +0,0 @@ - - <%= display_mpog_profile_information %> -
    diff --git a/views/search/institutions.html.erb b/views/search/institutions.html.erb deleted file mode 100644 index 1b33ed2..0000000 --- a/views/search/institutions.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<%= search_page_title( @titles[@asset], @category ) %> - -<%= render :partial => 'search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> - -<%= display_results(@searches, @asset) %> -<% if params[:display] != 'map' %> - <%= pagination_links @searches[@asset][:results] %> -<% end %> - -
    - -<% if @asset == :product %> - <%= javascript_tag do %> - jQuery('.search-product-price-details').altBeautify(); - <% end %> -<% end %> diff --git a/views/software_communities_plugin_myprofile/edit_institution.html.erb b/views/software_communities_plugin_myprofile/edit_institution.html.erb deleted file mode 100644 index db95e3a..0000000 --- a/views/software_communities_plugin_myprofile/edit_institution.html.erb +++ /dev/null @@ -1,119 +0,0 @@ -

    <%= _('Edit Institution') %>

    - -<% if environment.enabled?('admin_must_approve_new_communities') %> -
    - <%= _("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 }%> -
    -<%end %> - -<% unless flash[:errors].nil? %> -
    -

    <%= _("Can`t create new Institution: #{flash[:errors].length} errors") %>

    - -
    -<% end %> - -
    - -
    -
    - <%= _("All fields with (*) are mandatory") %> -
    -
    - <%= labelled_form_for :community,:html => { :multipart => true, :id=>"institution_form" } do |f| %> - <%= hidden_field_tag "edit_institution_page", true %> - <%= fields_for :institutions do |inst| %> - -
    - - - -
    -
    - - <%= required f.text_field(:name, :value => @institution.community.name) %> - <%= content_tag :span, _("Institution name already exists"), :id=>"already_exists_text", :class=>"errorExplanation hide-field" %> - - -
    - <%= inst.label "corporate_name", _("Corporate Name"), :class=>"formlabel" %> - <%= required inst.text_field(:corporate_name, :value => @institution.corporate_name) %> -
    -
    - - <%= required select_country(_('Country'), 'community', 'country', {:class => 'type-select', :id => "community_country"}, :selected => @institution.community.country) %> - - -
    - - <%= f.select(:state, @state_list.collect {|state| [state.name, state.name]}, :selected => @institution.community.state) %> -
    -
    - - <%= required f.text_field(:city, :value => @institution.community.city) %> - - - -
    - <%= inst.label("cnpj" ,_("CNPJ"), :class=>"formlabel") %> - <%= required inst.text_field(:cnpj, :placeholder=>"99.999.999/9999-99", :class=>"intitution_cnpj_field", :value => @institution.cnpj) %> -
    -
    - - -
    - <%= hidden_field_tag "acronym_translate", _("Acronym") %> - <%= hidden_field_tag "fantasy_name_translate", _("Fantasy name") %> - <%= inst.label("acronym" ,_("Acronym"), :class=>"formlabel") %> - <%= inst.text_field(:acronym, :value => @institution.acronym) %> -
    -
    - - -
    - <%= inst.label("governmental_sphere_id" ,_("Governmental Sphere:"), :class=>"formlabel") %> - <%= inst.select(:governmental_sphere, [[_("Select a Governmental Sphere"), 0]]|GovernmentalSphere.all.map {|s| [s.name, s.id]}, {:selected=>@institution.governmental_power_id})%> -
    -
    - - -
    - <%= inst.label("governmental_power_id" ,_("Governmental Power:"), :class=>"formlabel") %> - <%= inst.select(:governmental_power, [[_("Select a Governmental Power"), 0]]|GovernmentalPower.all.map {|g| [g.name, g.id]}, {:selected=> @institution.governmental_sphere_id})%> -
    -
    - -
    - <%= inst.label("juridical_nature_id" ,_("Juridical Nature:"), :class=>"formlabel") %> - <%= inst.select(:juridical_nature, [[_("Select a Juridical Nature"), 0]]|JuridicalNature.all.map {|j| [j.name, j.id]}, {:selected=> @institution.juridical_nature_id})%> -
    -
    - - -
    - <%= _("SISP?") %> - <% if @show_sisp_field %> - <%= inst.label("sisp" ,_("Yes")) %> - <%= inst.radio_button(:sisp, true, :checked=>(@institution.sisp ? true : false)) %> - <%= inst.label("sisp" ,_("No")) %> - <%= inst.radio_button(:sisp, false, :checked=>(@institution.sisp ? false : true)) %> - <% else %> - <%= inst.label("sisp", _("No")) %> - <% end %> -
    -
    -
    - - <%= submit_button :save, _('Save') %> - <% end %> -<% end %> - -- libgit2 0.21.2