From 4e38f46bd9018d9c50869f21cb18b24220a17f11 Mon Sep 17 00:00:00 2001 From: Daniela Feitosa Date: Tue, 13 Oct 2015 11:52:24 -0300 Subject: [PATCH] move to src/software_communities/ --- .gitignore | 6 ------ README.md | 94 ---------------------------------------------------------------------------------------------- Rakefile | 11 ----------- controllers/software_communities_plugin_controller.rb | 54 ------------------------------------------------------ controllers/software_communities_plugin_myprofile_controller.rb | 194 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- controllers/software_communities_plugin_profile_controller.rb | 49 ------------------------------------------------- db/migrate/20140523132016_create_controlled_vocabulary_table.rb | 35 ----------------------------------- db/migrate/20140528193902_create_license_infos_table.rb | 15 --------------- db/migrate/20140528193905_create_software_infos_table.rb | 23 ----------------------- db/migrate/20140528193927_create_libraries_table.rb | 14 -------------- db/migrate/20140528193956_create_programming_languages_table.rb | 13 ------------- db/migrate/20140528194044_create_database_descriptions_table.rb | 14 -------------- db/migrate/20140528194129_create_software_databases_table.rb | 14 -------------- db/migrate/20140528211914_create_software_languages_table.rb | 14 -------------- db/migrate/20140710185444_create_operating_system_table.rb | 13 ------------- db/migrate/20140711144012_remove_name_from_software_info.rb | 9 --------- db/migrate/20140714133901_create_operating_name_table.rb | 14 -------------- db/migrate/20140714135007_change_operating_systems_table.rb | 16 ---------------- db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb | 9 --------- db/migrate/20141007140419_add_finality_field_to_software_table.rb | 9 --------- db/migrate/20141013193939_add_repository_link_to_software.rb | 9 --------- db/migrate/20141103180655_add_public_software_field_validation.rb | 9 --------- db/migrate/20141105173616_add_first_edit_to_software.rb | 9 --------- db/migrate/20141216183111_remove_operating_system_from_software_database.rb | 9 --------- db/migrate/20141216183459_remove_operating_system_from_software_language.rb | 9 --------- db/migrate/20150209170529_add_settings_field_to_software_info.rb | 9 --------- db/migrate/20150210182519_rename_cc_license.rb | 13 ------------- db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb | 11 ----------- features/deactivate_user.feature | 45 --------------------------------------------- features/public_software_validation.feature | 49 ------------------------------------------------- features/software_block.feature | 48 ------------------------------------------------ features/software_catalog.feature | 82 ---------------------------------------------------------------------------------- features/software_registration.feature | 87 --------------------------------------------------------------------------------------- features/step_definitions/software_communities_steps.rb | 202 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- lib/categories_and_tags_block.rb | 29 ----------------------------- lib/categories_software_block.rb | 35 ----------------------------------- lib/create_software.rb | 113 ----------------------------------------------------------------------------------------------------------------- lib/database_description.rb | 15 --------------- lib/database_helper.rb | 86 -------------------------------------------------------------------------------------- lib/download.rb | 51 --------------------------------------------------- lib/download_block.rb | 36 ------------------------------------ lib/dynamic_table_helper.rb | 153 --------------------------------------------------------------------------------------------------------------------------------------------------------- lib/ext/category.rb | 35 ----------------------------------- lib/ext/communities_block.rb | 45 --------------------------------------------- lib/ext/community.rb | 66 ------------------------------------------------------------------ lib/ext/organization_rating.rb | 5 ----- lib/ext/person.rb | 24 ------------------------ lib/ext/profile_controller.rb | 64 ---------------------------------------------------------------- lib/ext/profile_editor_controller.rb | 28 ---------------------------- lib/ext/profile_helper.rb | 26 -------------------------- lib/ext/search_controller.rb | 169 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- lib/ext/search_helper.rb | 33 --------------------------------- lib/library.rb | 10 ---------- lib/library_helper.rb | 62 -------------------------------------------------------------- lib/license_helper.rb | 5 ----- lib/license_info.rb | 8 -------- lib/operating_system.rb | 14 -------------- lib/operating_system_helper.rb | 71 ----------------------------------------------------------------------- lib/operating_system_name.rb | 10 ---------- lib/programming_language.rb | 15 --------------- lib/repository_block.rb | 29 ----------------------------- lib/search_catalog_block.rb | 29 ----------------------------- lib/software_communities_plugin.rb | 164 -------------------------------------------------------------------------------------------------------------------------------------------------------------------- lib/software_database.rb | 20 -------------------- lib/software_helper.rb | 44 -------------------------------------------- lib/software_highlights_block.rb | 20 -------------------- lib/software_info.rb | 261 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- lib/software_information_block.rb | 37 ------------------------------------- lib/software_language.rb | 14 -------------- lib/software_language_helper.rb | 85 ------------------------------------------------------------------------------------- lib/software_tab_data_block.rb | 48 ------------------------------------------------ lib/softwares_block.rb | 105 --------------------------------------------------------------------------------------------------------- lib/statistic_block.rb | 52 ---------------------------------------------------- lib/tasks/create_categories.rake | 20 -------------------- lib/tasks/create_licenses.rake | 42 ------------------------------------------ lib/tasks/create_sample_softwares.rake | 71 ----------------------------------------------------------------------- lib/tasks/export.rake | 133 ------------------------------------------------------------------------------------------------------------------------------------- lib/tasks/main_data.rake | 18 ------------------ lib/tasks/templates.rake | 42 ------------------------------------------ lib/wiki_block.rb | 30 ------------------------------ po/pt/software_communities.po | 1361 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- po/software_communities.pot | 1044 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ public/app.js | 11 ----------- public/blocks/software-download.js | 51 --------------------------------------------------- public/initializer.js | 35 ----------------------------------- public/lib/auto-complete.js | 64 ---------------------------------------------------------------- public/lib/noosfero-root.js | 13 ------------- public/lib/select-element.js | 35 ----------------------------------- public/lib/select-field-choices.js | 81 --------------------------------------------------------------------------------- public/lib/software-catalog-component.js | 38 -------------------------------------- public/static/databases.txt | 101 ----------------------------------------------------------------------------------------------------- public/static/languages.txt | 101 ----------------------------------------------------------------------------------------------------- public/static/licences.txt | 212 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- public/static/operating_systems.txt | 9 --------- public/style.css | 112 ---------------------------------------------------------------------------------------------------------------- public/vendor/jquery.js | 3 --- public/vendor/jquery.maskedinput.min.js | 7 ------- public/vendor/modulejs-1.5.0.min.js | 2 -- public/views/comments-software-extra-fields.js | 30 ------------------------------ public/views/control-panel.js | 31 ------------------------------- public/views/edit-software.js | 111 --------------------------------------------------------------------------------------------------------------- public/views/new-community.js | 28 ---------------------------- public/views/new-software.js | 69 --------------------------------------------------------------------- public/views/profile-tabs-software.js | 86 -------------------------------------------------------------------------------------- public/views/search-software-catalog.js | 172 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- script/schedule_institution_update.sh | 4 ---- src/software_communities/.gitignore | 6 ++++++ src/software_communities/README.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/Rakefile | 11 +++++++++++ src/software_communities/controllers/software_communities_plugin_controller.rb | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/controllers/software_communities_plugin_myprofile_controller.rb | 194 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/controllers/software_communities_plugin_profile_controller.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/db/migrate/20140523132016_create_controlled_vocabulary_table.rb | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/db/migrate/20140528193902_create_license_infos_table.rb | 15 +++++++++++++++ src/software_communities/db/migrate/20140528193905_create_software_infos_table.rb | 23 +++++++++++++++++++++++ src/software_communities/db/migrate/20140528193927_create_libraries_table.rb | 14 ++++++++++++++ src/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb | 13 +++++++++++++ src/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb | 14 ++++++++++++++ src/software_communities/db/migrate/20140528194129_create_software_databases_table.rb | 14 ++++++++++++++ src/software_communities/db/migrate/20140528211914_create_software_languages_table.rb | 14 ++++++++++++++ src/software_communities/db/migrate/20140710185444_create_operating_system_table.rb | 13 +++++++++++++ src/software_communities/db/migrate/20140711144012_remove_name_from_software_info.rb | 9 +++++++++ src/software_communities/db/migrate/20140714133901_create_operating_name_table.rb | 14 ++++++++++++++ src/software_communities/db/migrate/20140714135007_change_operating_systems_table.rb | 16 ++++++++++++++++ src/software_communities/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb | 9 +++++++++ src/software_communities/db/migrate/20141007140419_add_finality_field_to_software_table.rb | 9 +++++++++ src/software_communities/db/migrate/20141013193939_add_repository_link_to_software.rb | 9 +++++++++ src/software_communities/db/migrate/20141103180655_add_public_software_field_validation.rb | 9 +++++++++ src/software_communities/db/migrate/20141105173616_add_first_edit_to_software.rb | 9 +++++++++ src/software_communities/db/migrate/20141216183111_remove_operating_system_from_software_database.rb | 9 +++++++++ src/software_communities/db/migrate/20141216183459_remove_operating_system_from_software_language.rb | 9 +++++++++ src/software_communities/db/migrate/20150209170529_add_settings_field_to_software_info.rb | 9 +++++++++ src/software_communities/db/migrate/20150210182519_rename_cc_license.rb | 13 +++++++++++++ src/software_communities/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb | 11 +++++++++++ src/software_communities/features/deactivate_user.feature | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/features/public_software_validation.feature | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/features/software_block.feature | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/features/software_catalog.feature | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/features/software_registration.feature | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/features/step_definitions/software_communities_steps.rb | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/categories_and_tags_block.rb | 29 +++++++++++++++++++++++++++++ src/software_communities/lib/categories_software_block.rb | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/lib/create_software.rb | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/database_description.rb | 15 +++++++++++++++ src/software_communities/lib/database_helper.rb | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/download.rb | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/download_block.rb | 36 ++++++++++++++++++++++++++++++++++++ src/software_communities/lib/dynamic_table_helper.rb | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/category.rb | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/communities_block.rb | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/community.rb | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/organization_rating.rb | 5 +++++ src/software_communities/lib/ext/person.rb | 24 ++++++++++++++++++++++++ src/software_communities/lib/ext/profile_controller.rb | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/profile_editor_controller.rb | 28 ++++++++++++++++++++++++++++ src/software_communities/lib/ext/profile_helper.rb | 26 ++++++++++++++++++++++++++ src/software_communities/lib/ext/search_controller.rb | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/ext/search_helper.rb | 33 +++++++++++++++++++++++++++++++++ src/software_communities/lib/library.rb | 10 ++++++++++ src/software_communities/lib/library_helper.rb | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/license_helper.rb | 5 +++++ src/software_communities/lib/license_info.rb | 8 ++++++++ src/software_communities/lib/operating_system.rb | 14 ++++++++++++++ src/software_communities/lib/operating_system_helper.rb | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/operating_system_name.rb | 10 ++++++++++ src/software_communities/lib/programming_language.rb | 15 +++++++++++++++ src/software_communities/lib/repository_block.rb | 29 +++++++++++++++++++++++++++++ src/software_communities/lib/search_catalog_block.rb | 29 +++++++++++++++++++++++++++++ src/software_communities/lib/software_communities_plugin.rb | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/software_database.rb | 20 ++++++++++++++++++++ src/software_communities/lib/software_helper.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/software_highlights_block.rb | 20 ++++++++++++++++++++ src/software_communities/lib/software_info.rb | 261 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/software_information_block.rb | 37 +++++++++++++++++++++++++++++++++++++ src/software_communities/lib/software_language.rb | 14 ++++++++++++++ src/software_communities/lib/software_language_helper.rb | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/software_tab_data_block.rb | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/softwares_block.rb | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/statistic_block.rb | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/tasks/create_categories.rake | 20 ++++++++++++++++++++ src/software_communities/lib/tasks/create_licenses.rake | 42 ++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/tasks/create_sample_softwares.rake | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/tasks/export.rake | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/tasks/main_data.rake | 18 ++++++++++++++++++ src/software_communities/lib/tasks/templates.rake | 42 ++++++++++++++++++++++++++++++++++++++++++ src/software_communities/lib/wiki_block.rb | 30 ++++++++++++++++++++++++++++++ src/software_communities/po/pt/software_communities.po | 1361 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/po/software_communities.pot | 1044 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/app.js | 11 +++++++++++ src/software_communities/public/blocks/software-download.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/initializer.js | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/public/lib/auto-complete.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/lib/noosfero-root.js | 13 +++++++++++++ src/software_communities/public/lib/select-element.js | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/public/lib/select-field-choices.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/lib/software-catalog-component.js | 38 ++++++++++++++++++++++++++++++++++++++ src/software_communities/public/static/databases.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/static/languages.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/static/licences.txt | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/static/operating_systems.txt | 9 +++++++++ src/software_communities/public/style.css | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/vendor/jquery.js | 3 +++ src/software_communities/public/vendor/jquery.maskedinput.min.js | 7 +++++++ src/software_communities/public/vendor/modulejs-1.5.0.min.js | 2 ++ src/software_communities/public/views/comments-software-extra-fields.js | 30 ++++++++++++++++++++++++++++++ src/software_communities/public/views/control-panel.js | 31 +++++++++++++++++++++++++++++++ src/software_communities/public/views/edit-software.js | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/views/new-community.js | 28 ++++++++++++++++++++++++++++ src/software_communities/public/views/new-software.js | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/views/profile-tabs-software.js | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/public/views/search-software-catalog.js | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/script/schedule_institution_update.sh | 4 ++++ src/software_communities/test/functional/profile_controller_test.rb | 40 ++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/functional/profile_editor_controller_test.rb | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/functional/search_controller_test.rb | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/functional/software_communities_plugin_controller_test.rb | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/helpers/plugin_test_helper.rb | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/helpers/software_test_helper.rb | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/categories_and_tags_block_test.rb | 19 +++++++++++++++++++ src/software_communities/test/unit/categories_software_block_test.rb | 19 +++++++++++++++++++ src/software_communities/test/unit/communities_block_test.rb | 31 +++++++++++++++++++++++++++++++ src/software_communities/test/unit/database_helper_test.rb | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/database_validation_test.rb | 37 +++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/download_block_test.rb | 34 ++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/download_test.rb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/library_helper_test.rb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/library_validation_test.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/operating_system_helper_test.rb | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/operating_system_validation_test.rb | 34 ++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/repository_block_test.rb | 19 +++++++++++++++++++ src/software_communities/test/unit/search_catalog_block_test.rb | 19 +++++++++++++++++++ src/software_communities/test/unit/search_helper_test.rb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_communities_person_test.rb | 39 +++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_database_test.rb | 35 +++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_helper_test.rb | 20 ++++++++++++++++++++ src/software_communities/test/unit/software_info_test.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_info_validation_test.rb | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_language_helper_test.rb | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_language_validation.rb | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_license_info_test.rb | 29 +++++++++++++++++++++++++++++ src/software_communities/test/unit/software_registration_test.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/software_tab_data_block_test.rb | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/test/unit/softwares_block_test.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/_main_software_editor_extras.html.erb | 32 ++++++++++++++++++++++++++++++++ src/software_communities/views/blocks/_software_tab_blog.html.erb | 17 +++++++++++++++++ src/software_communities/views/blocks/categories_and_tags.html.erb | 19 +++++++++++++++++++ src/software_communities/views/blocks/categories_software.html.erb | 22 ++++++++++++++++++++++ src/software_communities/views/blocks/download.html.erb | 25 +++++++++++++++++++++++++ src/software_communities/views/blocks/main_area_softwares.html.erb | 27 +++++++++++++++++++++++++++ src/software_communities/views/blocks/repository.html.erb | 5 +++++ src/software_communities/views/blocks/search_catalog.html.erb | 11 +++++++++++ src/software_communities/views/blocks/software_highlights.html.erb | 20 ++++++++++++++++++++ src/software_communities/views/blocks/software_information.html.erb | 36 ++++++++++++++++++++++++++++++++++++ src/software_communities/views/blocks/software_statistics.html.erb | 36 ++++++++++++++++++++++++++++++++++++ src/software_communities/views/blocks/software_tab_data.html.erb | 13 +++++++++++++ src/software_communities/views/blocks/wiki.html.erb | 6 ++++++ src/software_communities/views/box_organizer/_download_block.html.erb | 17 +++++++++++++++++ src/software_communities/views/box_organizer/_download_list.html.erb | 10 ++++++++++ src/software_communities/views/box_organizer/_download_list_template.html.erb | 10 ++++++++++ src/software_communities/views/box_organizer/_software_tab_data_block.html.erb | 15 +++++++++++++++ src/software_communities/views/box_organizer/_softwares_block.html.erb | 4 ++++ src/software_communities/views/box_organizer/_statistic_block.html.erb | 10 ++++++++++ src/software_communities/views/box_organizer/_wiki_block.html.erb | 10 ++++++++++ src/software_communities/views/comments_extra_fields.html.erb | 21 +++++++++++++++++++++ src/software_communities/views/environment_design | 1 + src/software_communities/views/organization_ratings_extra_fields_show_data.html.erb | 10 ++++++++++ src/software_communities/views/profile/_profile_members_list.html.erb | 14 ++++++++++++++ src/software_communities/views/profile/_software_tab.html.erb | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/profile/index.html.erb | 26 ++++++++++++++++++++++++++ src/software_communities/views/profile/members.html.erb | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/profile_design | 1 + src/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb | 9 +++++++++ src/software_communities/views/profile_editor/_software_community.html.erb | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/profile_editor/edit_software_community.html.erb | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/search/_catalog_filter.html.erb | 20 ++++++++++++++++++++ src/software_communities/views/search/_catalog_result_list.html.erb | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/search/_full_community.html.erb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/search/_software_search_form.html.erb | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/search/software_infos.html.erb | 21 +++++++++++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb | 12 ++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb | 12 ++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb | 12 ++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb | 14 ++++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb | 12 ++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb | 22 ++++++++++++++++++++++ src/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/software_communities/views/software_editor_extras.rhtml | 35 +++++++++++++++++++++++++++++++++++ test/functional/profile_controller_test.rb | 40 ---------------------------------------- test/functional/profile_editor_controller_test.rb | 70 ---------------------------------------------------------------------- test/functional/search_controller_test.rb | 304 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test/functional/software_communities_plugin_controller_test.rb | 116 -------------------------------------------------------------------------------------------------------------------- test/functional/software_communities_plugin_myprofile_controller_test.rb | 154 ---------------------------------------------------------------------------------------------------------------------------------------------------------- test/functional/software_communities_plugin_profile_controller_test.rb | 67 ------------------------------------------------------------------- test/helpers/plugin_test_helper.rb | 64 ---------------------------------------------------------------- test/helpers/software_test_helper.rb | 193 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- test/unit/categories_and_tags_block_test.rb | 19 ------------------- test/unit/categories_software_block_test.rb | 19 ------------------- test/unit/communities_block_test.rb | 31 ------------------------------- test/unit/database_helper_test.rb | 58 ---------------------------------------------------------- test/unit/database_validation_test.rb | 37 ------------------------------------- test/unit/download_block_test.rb | 34 ---------------------------------- test/unit/download_test.rb | 53 ----------------------------------------------------- test/unit/library_helper_test.rb | 53 ----------------------------------------------------- test/unit/library_validation_test.rb | 49 ------------------------------------------------- test/unit/operating_system_helper_test.rb | 64 ---------------------------------------------------------------- test/unit/operating_system_validation_test.rb | 34 ---------------------------------- test/unit/repository_block_test.rb | 19 ------------------- test/unit/search_catalog_block_test.rb | 19 ------------------- test/unit/search_helper_test.rb | 53 ----------------------------------------------------- test/unit/software_communities_person_test.rb | 39 --------------------------------------- test/unit/software_database_test.rb | 35 ----------------------------------- test/unit/software_helper_test.rb | 20 -------------------- test/unit/software_info_test.rb | 44 -------------------------------------------- test/unit/software_info_validation_test.rb | 121 ------------------------------------------------------------------------------------------------------------------------- test/unit/software_language_helper_test.rb | 60 ------------------------------------------------------------ test/unit/software_language_validation.rb | 69 --------------------------------------------------------------------- test/unit/software_license_info_test.rb | 29 ----------------------------- test/unit/software_registration_test.rb | 42 ------------------------------------------ test/unit/software_tab_data_block_test.rb | 66 ------------------------------------------------------------------ test/unit/softwares_block_test.rb | 43 ------------------------------------------- views/_main_software_editor_extras.html.erb | 32 -------------------------------- views/blocks/_software_tab_blog.html.erb | 17 ----------------- views/blocks/categories_and_tags.html.erb | 19 ------------------- views/blocks/categories_software.html.erb | 22 ---------------------- views/blocks/download.html.erb | 25 ------------------------- views/blocks/main_area_softwares.html.erb | 27 --------------------------- views/blocks/repository.html.erb | 5 ----- views/blocks/search_catalog.html.erb | 11 ----------- views/blocks/software_highlights.html.erb | 20 -------------------- views/blocks/software_information.html.erb | 36 ------------------------------------ views/blocks/software_statistics.html.erb | 36 ------------------------------------ views/blocks/software_tab_data.html.erb | 13 ------------- views/blocks/wiki.html.erb | 6 ------ views/box_organizer/_download_block.html.erb | 17 ----------------- views/box_organizer/_download_list.html.erb | 10 ---------- views/box_organizer/_download_list_template.html.erb | 10 ---------- views/box_organizer/_software_tab_data_block.html.erb | 15 --------------- views/box_organizer/_softwares_block.html.erb | 4 ---- views/box_organizer/_statistic_block.html.erb | 10 ---------- views/box_organizer/_wiki_block.html.erb | 10 ---------- views/comments_extra_fields.html.erb | 21 --------------------- views/environment_design | 1 - views/organization_ratings_extra_fields_show_data.html.erb | 10 ---------- views/profile/_profile_members_list.html.erb | 14 -------------- views/profile/_software_tab.html.erb | 138 ------------------------------------------------------------------------------------------------------------------------------------------ views/profile/index.html.erb | 26 -------------------------- views/profile/members.html.erb | 58 ---------------------------------------------------------- views/profile_design | 1 - views/profile_editor/_first_edit_software_community_extras.html.erb | 9 --------- views/profile_editor/_software_community.html.erb | 70 ---------------------------------------------------------------------- views/profile_editor/edit_software_community.html.erb | 90 ------------------------------------------------------------------------------------------ views/search/_catalog_filter.html.erb | 20 -------------------- views/search/_catalog_result_list.html.erb | 51 --------------------------------------------------- views/search/_full_community.html.erb | 53 ----------------------------------------------------- views/search/_software_search_form.html.erb | 67 ------------------------------------------------------------------- views/search/software_infos.html.erb | 21 --------------------- views/software_communities_plugin_myprofile/_database_fields.html.erb | 12 ------------ views/software_communities_plugin_myprofile/_language_fields.html.erb | 12 ------------ views/software_communities_plugin_myprofile/_library_fields.html.erb | 12 ------------ views/software_communities_plugin_myprofile/_license_info_fields.html.erb | 14 -------------- views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb | 47 ----------------------------------------------- views/software_communities_plugin_myprofile/_operating_system_fields.html.erb | 12 ------------ views/software_communities_plugin_myprofile/_public_software_info.html.erb | 102 ------------------------------------------------------------------------------------------------------ views/software_communities_plugin_myprofile/edit_software.html.erb | 22 ---------------------- views/software_communities_plugin_myprofile/new_software.html.erb | 103 ------------------------------------------------------------------------------------------------------- views/software_editor_extras.rhtml | 35 ----------------------------------- 370 files changed, 10978 insertions(+), 10978 deletions(-) delete mode 100644 .gitignore delete mode 100644 README.md delete mode 100644 Rakefile delete mode 100644 controllers/software_communities_plugin_controller.rb delete mode 100644 controllers/software_communities_plugin_myprofile_controller.rb delete mode 100644 controllers/software_communities_plugin_profile_controller.rb delete mode 100644 db/migrate/20140523132016_create_controlled_vocabulary_table.rb delete mode 100644 db/migrate/20140528193902_create_license_infos_table.rb delete mode 100644 db/migrate/20140528193905_create_software_infos_table.rb delete mode 100644 db/migrate/20140528193927_create_libraries_table.rb delete mode 100644 db/migrate/20140528193956_create_programming_languages_table.rb delete mode 100644 db/migrate/20140528194044_create_database_descriptions_table.rb delete mode 100644 db/migrate/20140528194129_create_software_databases_table.rb delete mode 100644 db/migrate/20140528211914_create_software_languages_table.rb delete mode 100644 db/migrate/20140710185444_create_operating_system_table.rb delete mode 100644 db/migrate/20140711144012_remove_name_from_software_info.rb delete mode 100644 db/migrate/20140714133901_create_operating_name_table.rb delete mode 100644 db/migrate/20140714135007_change_operating_systems_table.rb delete mode 100644 db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb delete mode 100644 db/migrate/20141007140419_add_finality_field_to_software_table.rb delete mode 100644 db/migrate/20141013193939_add_repository_link_to_software.rb delete mode 100644 db/migrate/20141103180655_add_public_software_field_validation.rb delete mode 100644 db/migrate/20141105173616_add_first_edit_to_software.rb delete mode 100644 db/migrate/20141216183111_remove_operating_system_from_software_database.rb delete mode 100644 db/migrate/20141216183459_remove_operating_system_from_software_language.rb delete mode 100644 db/migrate/20150209170529_add_settings_field_to_software_info.rb delete mode 100644 db/migrate/20150210182519_rename_cc_license.rb delete mode 100644 db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb delete mode 100644 features/deactivate_user.feature delete mode 100644 features/public_software_validation.feature delete mode 100644 features/software_block.feature delete mode 100644 features/software_catalog.feature delete mode 100644 features/software_registration.feature delete mode 100644 features/step_definitions/software_communities_steps.rb delete mode 100644 lib/categories_and_tags_block.rb delete mode 100644 lib/categories_software_block.rb delete mode 100644 lib/create_software.rb delete mode 100644 lib/database_description.rb delete mode 100644 lib/database_helper.rb delete mode 100644 lib/download.rb delete mode 100644 lib/download_block.rb delete mode 100644 lib/dynamic_table_helper.rb delete mode 100644 lib/ext/category.rb delete mode 100644 lib/ext/communities_block.rb delete mode 100644 lib/ext/community.rb delete mode 100644 lib/ext/organization_rating.rb delete mode 100644 lib/ext/person.rb delete mode 100644 lib/ext/profile_controller.rb delete mode 100644 lib/ext/profile_editor_controller.rb delete mode 100644 lib/ext/profile_helper.rb delete mode 100644 lib/ext/search_controller.rb delete mode 100644 lib/ext/search_helper.rb delete mode 100644 lib/library.rb delete mode 100644 lib/library_helper.rb delete mode 100644 lib/license_helper.rb delete mode 100644 lib/license_info.rb delete mode 100644 lib/operating_system.rb delete mode 100644 lib/operating_system_helper.rb delete mode 100644 lib/operating_system_name.rb delete mode 100644 lib/programming_language.rb delete mode 100644 lib/repository_block.rb delete mode 100644 lib/search_catalog_block.rb delete mode 100644 lib/software_communities_plugin.rb delete mode 100644 lib/software_database.rb delete mode 100644 lib/software_helper.rb delete mode 100644 lib/software_highlights_block.rb delete mode 100644 lib/software_info.rb delete mode 100644 lib/software_information_block.rb delete mode 100644 lib/software_language.rb delete mode 100644 lib/software_language_helper.rb delete mode 100644 lib/software_tab_data_block.rb delete mode 100644 lib/softwares_block.rb delete mode 100644 lib/statistic_block.rb delete mode 100644 lib/tasks/create_categories.rake delete mode 100644 lib/tasks/create_licenses.rake delete mode 100644 lib/tasks/create_sample_softwares.rake delete mode 100644 lib/tasks/export.rake delete mode 100644 lib/tasks/main_data.rake delete mode 100644 lib/tasks/templates.rake delete mode 100644 lib/wiki_block.rb delete mode 100644 po/pt/software_communities.po delete mode 100644 po/software_communities.pot delete mode 100644 public/app.js delete mode 100644 public/blocks/software-download.js delete mode 100644 public/initializer.js delete mode 100644 public/lib/auto-complete.js delete mode 100644 public/lib/noosfero-root.js delete mode 100644 public/lib/select-element.js delete mode 100644 public/lib/select-field-choices.js delete mode 100644 public/lib/software-catalog-component.js delete mode 100644 public/static/databases.txt delete mode 100644 public/static/languages.txt delete mode 100644 public/static/licences.txt delete mode 100644 public/static/operating_systems.txt delete mode 100644 public/style.css delete mode 100644 public/vendor/jquery.js delete mode 100644 public/vendor/jquery.maskedinput.min.js delete mode 100644 public/vendor/modulejs-1.5.0.min.js delete mode 100644 public/views/comments-software-extra-fields.js delete mode 100644 public/views/control-panel.js delete mode 100644 public/views/edit-software.js delete mode 100644 public/views/new-community.js delete mode 100644 public/views/new-software.js delete mode 100644 public/views/profile-tabs-software.js delete mode 100644 public/views/search-software-catalog.js delete mode 100755 script/schedule_institution_update.sh create mode 100644 src/software_communities/.gitignore create mode 100644 src/software_communities/README.md create mode 100644 src/software_communities/Rakefile create mode 100644 src/software_communities/controllers/software_communities_plugin_controller.rb create mode 100644 src/software_communities/controllers/software_communities_plugin_myprofile_controller.rb create mode 100644 src/software_communities/controllers/software_communities_plugin_profile_controller.rb create mode 100644 src/software_communities/db/migrate/20140523132016_create_controlled_vocabulary_table.rb create mode 100644 src/software_communities/db/migrate/20140528193902_create_license_infos_table.rb create mode 100644 src/software_communities/db/migrate/20140528193905_create_software_infos_table.rb create mode 100644 src/software_communities/db/migrate/20140528193927_create_libraries_table.rb create mode 100644 src/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb create mode 100644 src/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb create mode 100644 src/software_communities/db/migrate/20140528194129_create_software_databases_table.rb create mode 100644 src/software_communities/db/migrate/20140528211914_create_software_languages_table.rb create mode 100644 src/software_communities/db/migrate/20140710185444_create_operating_system_table.rb create mode 100644 src/software_communities/db/migrate/20140711144012_remove_name_from_software_info.rb create mode 100644 src/software_communities/db/migrate/20140714133901_create_operating_name_table.rb create mode 100644 src/software_communities/db/migrate/20140714135007_change_operating_systems_table.rb create mode 100644 src/software_communities/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb create mode 100644 src/software_communities/db/migrate/20141007140419_add_finality_field_to_software_table.rb create mode 100644 src/software_communities/db/migrate/20141013193939_add_repository_link_to_software.rb create mode 100644 src/software_communities/db/migrate/20141103180655_add_public_software_field_validation.rb create mode 100644 src/software_communities/db/migrate/20141105173616_add_first_edit_to_software.rb create mode 100644 src/software_communities/db/migrate/20141216183111_remove_operating_system_from_software_database.rb create mode 100644 src/software_communities/db/migrate/20141216183459_remove_operating_system_from_software_language.rb create mode 100644 src/software_communities/db/migrate/20150209170529_add_settings_field_to_software_info.rb create mode 100644 src/software_communities/db/migrate/20150210182519_rename_cc_license.rb create mode 100644 src/software_communities/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb create mode 100644 src/software_communities/features/deactivate_user.feature create mode 100644 src/software_communities/features/public_software_validation.feature create mode 100644 src/software_communities/features/software_block.feature create mode 100644 src/software_communities/features/software_catalog.feature create mode 100644 src/software_communities/features/software_registration.feature create mode 100644 src/software_communities/features/step_definitions/software_communities_steps.rb create mode 100644 src/software_communities/lib/categories_and_tags_block.rb create mode 100644 src/software_communities/lib/categories_software_block.rb create mode 100644 src/software_communities/lib/create_software.rb create mode 100644 src/software_communities/lib/database_description.rb create mode 100644 src/software_communities/lib/database_helper.rb create mode 100644 src/software_communities/lib/download.rb create mode 100644 src/software_communities/lib/download_block.rb create mode 100644 src/software_communities/lib/dynamic_table_helper.rb create mode 100644 src/software_communities/lib/ext/category.rb create mode 100644 src/software_communities/lib/ext/communities_block.rb create mode 100644 src/software_communities/lib/ext/community.rb create mode 100644 src/software_communities/lib/ext/organization_rating.rb create mode 100644 src/software_communities/lib/ext/person.rb create mode 100644 src/software_communities/lib/ext/profile_controller.rb create mode 100644 src/software_communities/lib/ext/profile_editor_controller.rb create mode 100644 src/software_communities/lib/ext/profile_helper.rb create mode 100644 src/software_communities/lib/ext/search_controller.rb create mode 100644 src/software_communities/lib/ext/search_helper.rb create mode 100644 src/software_communities/lib/library.rb create mode 100644 src/software_communities/lib/library_helper.rb create mode 100644 src/software_communities/lib/license_helper.rb create mode 100644 src/software_communities/lib/license_info.rb create mode 100644 src/software_communities/lib/operating_system.rb create mode 100644 src/software_communities/lib/operating_system_helper.rb create mode 100644 src/software_communities/lib/operating_system_name.rb create mode 100644 src/software_communities/lib/programming_language.rb create mode 100644 src/software_communities/lib/repository_block.rb create mode 100644 src/software_communities/lib/search_catalog_block.rb create mode 100644 src/software_communities/lib/software_communities_plugin.rb create mode 100644 src/software_communities/lib/software_database.rb create mode 100644 src/software_communities/lib/software_helper.rb create mode 100644 src/software_communities/lib/software_highlights_block.rb create mode 100644 src/software_communities/lib/software_info.rb create mode 100644 src/software_communities/lib/software_information_block.rb create mode 100644 src/software_communities/lib/software_language.rb create mode 100644 src/software_communities/lib/software_language_helper.rb create mode 100644 src/software_communities/lib/software_tab_data_block.rb create mode 100644 src/software_communities/lib/softwares_block.rb create mode 100644 src/software_communities/lib/statistic_block.rb create mode 100644 src/software_communities/lib/tasks/create_categories.rake create mode 100644 src/software_communities/lib/tasks/create_licenses.rake create mode 100644 src/software_communities/lib/tasks/create_sample_softwares.rake create mode 100644 src/software_communities/lib/tasks/export.rake create mode 100644 src/software_communities/lib/tasks/main_data.rake create mode 100644 src/software_communities/lib/tasks/templates.rake create mode 100644 src/software_communities/lib/wiki_block.rb create mode 100644 src/software_communities/po/pt/software_communities.po create mode 100644 src/software_communities/po/software_communities.pot create mode 100644 src/software_communities/public/app.js create mode 100644 src/software_communities/public/blocks/software-download.js create mode 100644 src/software_communities/public/initializer.js create mode 100644 src/software_communities/public/lib/auto-complete.js create mode 100644 src/software_communities/public/lib/noosfero-root.js create mode 100644 src/software_communities/public/lib/select-element.js create mode 100644 src/software_communities/public/lib/select-field-choices.js create mode 100644 src/software_communities/public/lib/software-catalog-component.js create mode 100644 src/software_communities/public/static/databases.txt create mode 100644 src/software_communities/public/static/languages.txt create mode 100644 src/software_communities/public/static/licences.txt create mode 100644 src/software_communities/public/static/operating_systems.txt create mode 100644 src/software_communities/public/style.css create mode 100644 src/software_communities/public/vendor/jquery.js create mode 100644 src/software_communities/public/vendor/jquery.maskedinput.min.js create mode 100644 src/software_communities/public/vendor/modulejs-1.5.0.min.js create mode 100644 src/software_communities/public/views/comments-software-extra-fields.js create mode 100644 src/software_communities/public/views/control-panel.js create mode 100644 src/software_communities/public/views/edit-software.js create mode 100644 src/software_communities/public/views/new-community.js create mode 100644 src/software_communities/public/views/new-software.js create mode 100644 src/software_communities/public/views/profile-tabs-software.js create mode 100644 src/software_communities/public/views/search-software-catalog.js create mode 100755 src/software_communities/script/schedule_institution_update.sh create mode 100644 src/software_communities/test/functional/profile_controller_test.rb create mode 100644 src/software_communities/test/functional/profile_editor_controller_test.rb create mode 100644 src/software_communities/test/functional/search_controller_test.rb create mode 100644 src/software_communities/test/functional/software_communities_plugin_controller_test.rb create mode 100644 src/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb create mode 100644 src/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb create mode 100644 src/software_communities/test/helpers/plugin_test_helper.rb create mode 100644 src/software_communities/test/helpers/software_test_helper.rb create mode 100644 src/software_communities/test/unit/categories_and_tags_block_test.rb create mode 100644 src/software_communities/test/unit/categories_software_block_test.rb create mode 100644 src/software_communities/test/unit/communities_block_test.rb create mode 100644 src/software_communities/test/unit/database_helper_test.rb create mode 100644 src/software_communities/test/unit/database_validation_test.rb create mode 100644 src/software_communities/test/unit/download_block_test.rb create mode 100644 src/software_communities/test/unit/download_test.rb create mode 100644 src/software_communities/test/unit/library_helper_test.rb create mode 100644 src/software_communities/test/unit/library_validation_test.rb create mode 100644 src/software_communities/test/unit/operating_system_helper_test.rb create mode 100644 src/software_communities/test/unit/operating_system_validation_test.rb create mode 100644 src/software_communities/test/unit/repository_block_test.rb create mode 100644 src/software_communities/test/unit/search_catalog_block_test.rb create mode 100644 src/software_communities/test/unit/search_helper_test.rb create mode 100644 src/software_communities/test/unit/software_communities_person_test.rb create mode 100644 src/software_communities/test/unit/software_database_test.rb create mode 100644 src/software_communities/test/unit/software_helper_test.rb create mode 100644 src/software_communities/test/unit/software_info_test.rb create mode 100644 src/software_communities/test/unit/software_info_validation_test.rb create mode 100644 src/software_communities/test/unit/software_language_helper_test.rb create mode 100644 src/software_communities/test/unit/software_language_validation.rb create mode 100644 src/software_communities/test/unit/software_license_info_test.rb create mode 100644 src/software_communities/test/unit/software_registration_test.rb create mode 100644 src/software_communities/test/unit/software_tab_data_block_test.rb create mode 100644 src/software_communities/test/unit/softwares_block_test.rb create mode 100644 src/software_communities/views/_main_software_editor_extras.html.erb create mode 100644 src/software_communities/views/blocks/_software_tab_blog.html.erb create mode 100644 src/software_communities/views/blocks/categories_and_tags.html.erb create mode 100644 src/software_communities/views/blocks/categories_software.html.erb create mode 100644 src/software_communities/views/blocks/download.html.erb create mode 100644 src/software_communities/views/blocks/main_area_softwares.html.erb create mode 100644 src/software_communities/views/blocks/repository.html.erb create mode 100644 src/software_communities/views/blocks/search_catalog.html.erb create mode 100644 src/software_communities/views/blocks/software_highlights.html.erb create mode 100644 src/software_communities/views/blocks/software_information.html.erb create mode 100644 src/software_communities/views/blocks/software_statistics.html.erb create mode 100644 src/software_communities/views/blocks/software_tab_data.html.erb create mode 100644 src/software_communities/views/blocks/wiki.html.erb create mode 100644 src/software_communities/views/box_organizer/_download_block.html.erb create mode 100644 src/software_communities/views/box_organizer/_download_list.html.erb create mode 100644 src/software_communities/views/box_organizer/_download_list_template.html.erb create mode 100644 src/software_communities/views/box_organizer/_software_tab_data_block.html.erb create mode 100644 src/software_communities/views/box_organizer/_softwares_block.html.erb create mode 100644 src/software_communities/views/box_organizer/_statistic_block.html.erb create mode 100644 src/software_communities/views/box_organizer/_wiki_block.html.erb create mode 100644 src/software_communities/views/comments_extra_fields.html.erb create mode 120000 src/software_communities/views/environment_design create mode 100644 src/software_communities/views/organization_ratings_extra_fields_show_data.html.erb create mode 100644 src/software_communities/views/profile/_profile_members_list.html.erb create mode 100644 src/software_communities/views/profile/_software_tab.html.erb create mode 100644 src/software_communities/views/profile/index.html.erb create mode 100644 src/software_communities/views/profile/members.html.erb create mode 120000 src/software_communities/views/profile_design create mode 100644 src/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb create mode 100644 src/software_communities/views/profile_editor/_software_community.html.erb create mode 100644 src/software_communities/views/profile_editor/edit_software_community.html.erb create mode 100644 src/software_communities/views/search/_catalog_filter.html.erb create mode 100644 src/software_communities/views/search/_catalog_result_list.html.erb create mode 100644 src/software_communities/views/search/_full_community.html.erb create mode 100644 src/software_communities/views/search/_software_search_form.html.erb create mode 100644 src/software_communities/views/search/software_infos.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb create mode 100644 src/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb create mode 100644 src/software_communities/views/software_editor_extras.rhtml delete mode 100644 test/functional/profile_controller_test.rb delete mode 100644 test/functional/profile_editor_controller_test.rb delete mode 100644 test/functional/search_controller_test.rb delete mode 100644 test/functional/software_communities_plugin_controller_test.rb delete mode 100644 test/functional/software_communities_plugin_myprofile_controller_test.rb delete mode 100644 test/functional/software_communities_plugin_profile_controller_test.rb delete mode 100644 test/helpers/plugin_test_helper.rb delete mode 100644 test/helpers/software_test_helper.rb delete mode 100644 test/unit/categories_and_tags_block_test.rb delete mode 100644 test/unit/categories_software_block_test.rb delete mode 100644 test/unit/communities_block_test.rb delete mode 100644 test/unit/database_helper_test.rb delete mode 100644 test/unit/database_validation_test.rb delete mode 100644 test/unit/download_block_test.rb delete mode 100644 test/unit/download_test.rb delete mode 100644 test/unit/library_helper_test.rb delete mode 100644 test/unit/library_validation_test.rb delete mode 100644 test/unit/operating_system_helper_test.rb delete mode 100644 test/unit/operating_system_validation_test.rb delete mode 100644 test/unit/repository_block_test.rb delete mode 100644 test/unit/search_catalog_block_test.rb delete mode 100644 test/unit/search_helper_test.rb delete mode 100644 test/unit/software_communities_person_test.rb delete mode 100644 test/unit/software_database_test.rb delete mode 100644 test/unit/software_helper_test.rb delete mode 100644 test/unit/software_info_test.rb delete mode 100644 test/unit/software_info_validation_test.rb delete mode 100644 test/unit/software_language_helper_test.rb delete mode 100644 test/unit/software_language_validation.rb delete mode 100644 test/unit/software_license_info_test.rb delete mode 100644 test/unit/software_registration_test.rb delete mode 100644 test/unit/software_tab_data_block_test.rb delete mode 100644 test/unit/softwares_block_test.rb delete mode 100644 views/_main_software_editor_extras.html.erb delete mode 100644 views/blocks/_software_tab_blog.html.erb delete mode 100644 views/blocks/categories_and_tags.html.erb delete mode 100644 views/blocks/categories_software.html.erb delete mode 100644 views/blocks/download.html.erb delete mode 100644 views/blocks/main_area_softwares.html.erb delete mode 100644 views/blocks/repository.html.erb delete mode 100644 views/blocks/search_catalog.html.erb delete mode 100644 views/blocks/software_highlights.html.erb delete mode 100644 views/blocks/software_information.html.erb delete mode 100644 views/blocks/software_statistics.html.erb delete mode 100644 views/blocks/software_tab_data.html.erb delete mode 100644 views/blocks/wiki.html.erb delete mode 100644 views/box_organizer/_download_block.html.erb delete mode 100644 views/box_organizer/_download_list.html.erb delete mode 100644 views/box_organizer/_download_list_template.html.erb delete mode 100644 views/box_organizer/_software_tab_data_block.html.erb delete mode 100644 views/box_organizer/_softwares_block.html.erb delete mode 100644 views/box_organizer/_statistic_block.html.erb delete mode 100644 views/box_organizer/_wiki_block.html.erb delete mode 100644 views/comments_extra_fields.html.erb delete mode 120000 views/environment_design delete mode 100644 views/organization_ratings_extra_fields_show_data.html.erb delete mode 100644 views/profile/_profile_members_list.html.erb delete mode 100644 views/profile/_software_tab.html.erb delete mode 100644 views/profile/index.html.erb delete mode 100644 views/profile/members.html.erb delete mode 120000 views/profile_design delete mode 100644 views/profile_editor/_first_edit_software_community_extras.html.erb delete mode 100644 views/profile_editor/_software_community.html.erb delete mode 100644 views/profile_editor/edit_software_community.html.erb delete mode 100644 views/search/_catalog_filter.html.erb delete mode 100644 views/search/_catalog_result_list.html.erb delete mode 100644 views/search/_full_community.html.erb delete mode 100644 views/search/_software_search_form.html.erb delete mode 100644 views/search/software_infos.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_database_fields.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_language_fields.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_library_fields.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_license_info_fields.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_operating_system_fields.html.erb delete mode 100644 views/software_communities_plugin_myprofile/_public_software_info.html.erb delete mode 100644 views/software_communities_plugin_myprofile/edit_software.html.erb delete mode 100644 views/software_communities_plugin_myprofile/new_software.html.erb delete mode 100644 views/software_editor_extras.rhtml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0675847..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Backup files -*~ -*.swp -config/institutions_update -config/siorg.yml -locale diff --git a/README.md b/README.md deleted file mode 100644 index e9c287a..0000000 --- a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -[![Code Climate](https://codeclimate.com/github/fabio1079/noosfero-plugin/badges/gpa.svg)](https://codeclimate.com/github/fabio1079/noosfero-plugin) - -README - MPOG Software Público Plugin -================================ - -MPOG Software Público Plugin is a plugin that includes features to Novo Portal do Software Público Brasileiro (SPB). - -More information about SPB: https://www.participa.br/softwarepublico - -INSTALL -======= - -Enable Plugin -------------- - -Also, you need to enable MPOG Software Plugin on your Noosfero: - -cd -./script/noosfero-plugins enable software_communities - -Activate Plugin ---------------- - -As a Noosfero administrator user, go to administrator panel: - -- Execute the command to allow city and states to show up: - psql -U USERNAME -d NOOSFERO_DATABASE -a -f db/brazil_national_regions.sql -- Click on "Enable/disable plugins" option -- Click on "MPOG Software Plugin" check-box - -Schedule Institutions Update ----------------------------- - -./plugins/software_communities/script/schedule_institution_update.sh - - -Create Categories -------------------- - -To create the categories that a software can have run - -rake software:create_categories - -Create Licenses ------------------ - -This command populate the database with 71 licenses and it's links -rake software:create_licenses - -Translate Plugin ------------------- - -To translate the strings used in the plugin run - -ruby script/move-translations-to-plugins.rb -rake updatepo -rake noosfero:translations:compile - - -Running MPOG Software tests --------------------- -$ ruby plugins/software_communities/test/unit/name_of_file.rb -$ cucumber plugins/software_communities/features/ - -Get Involved -============ - -If you find any bug and/or want to collaborate, please send an e-mail to arthurmde@gmail.com - -LICENSE -======= - -Copyright (c) The Author developers. - -See Noosfero license. - - -AUTHORS -======= - -Alex Campelo (campelo.al1 at gmail.com) -Arthur de Moura Del Esposte (arthurmde at gmail.com) -Daniel Bucher (daniel.bucher88 at gmail.com) -David Carlos (ddavidcarlos1392 at gmail.com) -Fabio Teixeira (fabio1079 at gmail.com) -Gustavo Jaruga (darksshades at gmail.com) -Luciano Prestes (lucianopcbr at gmail.com) -Matheus Faria (matheus.sousa.faria at gmail.com) - - -ACKNOWLEDGMENTS -=============== - -The authors have been supported by MPOG and UnB diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 0de7903..0000000 --- a/Rakefile +++ /dev/null @@ -1,11 +0,0 @@ -task :default => :makemo - -task :makemo do - require 'gettext' - require 'gettext/tools' - GetText.create_mofiles( - verbose: true, - po_root: 'po', - mo_root: 'locale', - ) -end diff --git a/controllers/software_communities_plugin_controller.rb b/controllers/software_communities_plugin_controller.rb deleted file mode 100644 index d3bb2c5..0000000 --- a/controllers/software_communities_plugin_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -# apenas software -require 'csv' -class SoftwareCommunitiesPluginController < ApplicationController - - def get_license_data - return render :json=>{} if !request.xhr? || params[:query].nil? - - data = if params[:query].empty? - LicenseInfo.all - else - LicenseInfo.where("version ILIKE ?", "%#{params[:query]}%").select("id, version") - end - render :json=> data.collect { |license| - {:id=>license.id, :label=>license.version} - } - - end - - def get_block_template - 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 - case params[:field] - when "software_language" - return ProgrammingLanguage - else - return DatabaseDescription - end - end -end diff --git a/controllers/software_communities_plugin_myprofile_controller.rb b/controllers/software_communities_plugin_myprofile_controller.rb deleted file mode 100644 index 256539a..0000000 --- a/controllers/software_communities_plugin_myprofile_controller.rb +++ /dev/null @@ -1,194 +0,0 @@ -class SoftwareCommunitiesPluginMyprofileController < MyProfileController - append_view_path File.join(File.dirname(__FILE__) + '/../views') - - def index - end - - def new_software - set_software_as_template - - @community = Community.new(params[:community]) - @community.environment = environment - @software_info = SoftwareInfo.new(params[:software_info]) - - @license_info = if params[:license].blank? or params[:license][:license_infos_id].blank? - LicenseInfo.new - else - LicenseInfo.find(params[:license][:license_infos_id]) - end - - control_software_creation - update_new_software_errors - end - - def edit_software - update_software_atributes - - return unless request.post? - - @software_info = constroy_software - software_info_insert_models.call(@list_libraries, 'libraries') - software_info_insert_models.call(@list_languages, 'software_languages') - software_info_insert_models.call(@list_databases, 'software_databases') - software_info_insert_models.call(@list_operating_systems, 'operating_systems') - - begin - @software_info.save! - - @community = @software_info.community - @community.update_attributes!(params[:community]) - - if params[:commit] == _('Save and Configure Community') - redirect_to :controller => 'profile_editor', :action => 'edit' - else - redirect_to :controller => 'profile_editor', :action => 'index' - session[:notice] = _('Software updated successfully') - end - rescue ActiveRecord::RecordInvalid => invalid - update_new_software_errors - session[:notice] = _('Could not update software') - end - end - - def disabled_public_software_field - !environment.admins.include?(current_user.person) - end - - private - - def add_software_erros - @errors = [] - @errors |= @community.errors.full_messages if @community - @errors |= @software_info.errors.full_messages if @software_info - @errors |= @license_info.errors.full_messages if @license_info - end - - def control_software_creation - valid_models = request.post? && (@community.valid? && @software_info.valid? && @license_info.valid?) - if valid_models - send_software_to_moderation - else - add_software_erros - end - end - - def software_info_insert_models - proc { |list,model_attr| - @software_info.send(model_attr).destroy_all - list.collect!{|m| @software_info.send(model_attr) << m } unless list.nil? - } - end - - def constroy_software - @software_info = @profile.software_info - params[:software][:public_software] ||= false unless @software_info.public_software? - @license = LicenseInfo.find(params[:license][:license_infos_id]) - @software_info.license_info = @license - @software_info.update_attributes(params[:software]) - - another_license_version = nil - another_license_link = nil - if params[:license] - another_license_version = params[:license][:version] - another_license_link = params[:license][:link] - end - - @software_info.verify_license_info(another_license_version, another_license_link) - - create_list_model_helpers - - @software_info - end - - def create_list_model_helpers - @list_libraries = LibraryHelper.list_library(params[:library]) - @list_languages = SoftwareLanguageHelper.list_language(params[:language]) - @list_databases = DatabaseHelper.list_database(params[:database]) - @list_operating_systems = OperatingSystemHelper.list_operating_system(params[:operating_system]) - end - - def send_software_to_moderation - another_license_version = "" - another_license_link = "" - if params[:license] - another_license_version = params[:license][:version] - another_license_link = params[:license][:link] - end - @software_info = SoftwareInfo.create_after_moderation(user, - params[:software_info].merge({ - :environment => environment, - :name => params[:community][:name], - :identifier => params[:community][:identifier], - :image_builder => params[:community][:image_builder], - :license_info => @license_info, - :another_license_version => another_license_version, - :another_license_link => another_license_link })) - - add_admin_to_community - - if !environment.admins.include?(current_user.person) - session[:notice] = _('Your new software request will be evaluated by an'\ - 'administrator. You will be notified.') - redirect_to user.admin_url - else - redirect_to :controller => 'profile_editor', - :action => 'edit', - :profile => @community.identifier - end - end - - def update_software_atributes - @software_info = @profile.software_info - @list_libraries = @software_info.libraries - @list_databases = @software_info.software_databases - @list_languages = @software_info.software_languages - @list_operating_systems = @software_info.operating_systems - @disabled_public_software_field = disabled_public_software_field - - @license_version = @software_info.license_info.version - @license_id = @software_info.license_info.id - @another_license_version = "" - @another_license_link = "" - - license_another = LicenseInfo.find_by_version("Another") - if license_another && @software_info.license_info_id == license_another.id - @license_version = "Another" - @another_license_version = @software_info.license_info.version - @another_license_link = @software_info.license_info.link - end - end - - def set_software_as_template - software_template = Community['software'] - software_valid = !software_template.blank? && software_template.is_template && !params['community'].blank? - if software_valid - params['community']['template_id'] = software_template.id if software_valid - end - end - - def add_admin_to_community - unless params[:q].nil? - admins = params[:q].split(/,/).map{ |n| environment.people.find n.to_i } - admins.each do |admin| - @community.add_member(admin) - @community.add_admin(admin) - end - end - end - - def update_new_software_errors - if request.post? - @community.valid? if @community - @software_info.valid? if @software_info - @license_info.valid? if @license_info - add_software_erros - end - - - @error_community_name = @community.errors.include?(:name) ? "highlight-error" : "" if @community - @error_software_acronym = @software_info.errors.include?(:acronym) ? "highlight-error" : "" if @software_info - @error_software_domain = @community.errors.include?(:identifier) ? "highlight-error" : "" if @community - @error_software_finality = @software_info.errors.include?(:finality) ? "highlight-error" : "" if @software_info - @error_software_license = @license_info.errors.include?(:version) ? "highlight-error" : "" if @license_info - end -end diff --git a/controllers/software_communities_plugin_profile_controller.rb b/controllers/software_communities_plugin_profile_controller.rb deleted file mode 100644 index 9f80e73..0000000 --- a/controllers/software_communities_plugin_profile_controller.rb +++ /dev/null @@ -1,49 +0,0 @@ -class SoftwareCommunitiesPluginProfileController < ProfileController - append_view_path File.join(File.dirname(__FILE__) + '/../views') - - before_filter :validate_download_params, only: [:download_file] - - ERROR_MESSAGES = { - :not_found => _("Could not find the download file"), - :invalid_params => _("Invalid download params") - } - - def download_file - download_block = DownloadBlock.find_by_id params[:block] - index = params[:download_index].to_i - - if download_block and (index < download_block.downloads.size) - download = Download.new(download_block.downloads[index]) - - download.total_downloads += 1 - download_block.downloads[index] = download.to_hash - download_block.save - - redirect_to download.link - else - session[:notice] = ERROR_MESSAGES[:not_found] - render_not_found - end - end - - private - - def validate_download_params - valid_block = (!params[:block].nil?) and (params[:block].to_i > 0) - valid_index = params[:download_index].to_i >= 0 - - if !valid_block or !valid_index - session[:notice] = ERROR_MESSAGES[:invalid_params] - safe_redirect_back - end - end - - def safe_redirect_back - begin - redirect_to :back - rescue ActionController::RedirectBackError - # There is no :back if it is a copied url - render_not_found - end - end -end diff --git a/db/migrate/20140523132016_create_controlled_vocabulary_table.rb b/db/migrate/20140523132016_create_controlled_vocabulary_table.rb deleted file mode 100644 index 8b5ec6e..0000000 --- a/db/migrate/20140523132016_create_controlled_vocabulary_table.rb +++ /dev/null @@ -1,35 +0,0 @@ -class CreateControlledVocabularyTable < ActiveRecord::Migration - def up - create_table :controlled_vocabulary do |t| - t.references :software_info - t.boolean :administration - t.boolean :agriculture - t.boolean :business_and_services - t.boolean :communication - t.boolean :culture - t.boolean :national_defense - t.boolean :economy_and_finances - t.boolean :education - t.boolean :energy - t.boolean :sports - t.boolean :habitation - t.boolean :industry - t.boolean :environment - t.boolean :research_and_development - t.boolean :social_security - t.boolean :social_protection - t.boolean :international_relations - t.boolean :sanitation - t.boolean :health - t.boolean :security_public_order - t.boolean :work - t.boolean :transportation - t.boolean :urbanism - - end - end - - def down - drop_table :controlled_vocabulary - end -end diff --git a/db/migrate/20140528193902_create_license_infos_table.rb b/db/migrate/20140528193902_create_license_infos_table.rb deleted file mode 100644 index 0024f7d..0000000 --- a/db/migrate/20140528193902_create_license_infos_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateLicenseInfosTable < ActiveRecord::Migration - def self.up - create_table :license_infos do |t| - t.string :version - t.string :link - end - - link = "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" - LicenseInfo.create(:version => "CC-GPL-V2", :link => link) - end - - def self.down - drop_table :license_infos - end -end diff --git a/db/migrate/20140528193905_create_software_infos_table.rb b/db/migrate/20140528193905_create_software_infos_table.rb deleted file mode 100644 index 5d7944a..0000000 --- a/db/migrate/20140528193905_create_software_infos_table.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CreateSoftwareInfosTable < ActiveRecord::Migration - def self.up - create_table :software_infos do |t| - t.references :license_info - t.references :community - t.boolean :e_mag, :default => false - t.boolean :icp_brasil,:default => false - t.boolean :intern, :default => false - t.boolean :e_ping, :default => false - t.boolean :e_arq, :default => false - t.string :name, :default => ' ' - t.string :operating_platform - t.string :demonstration_url - t.string :acronym - t.text :objectives - t.text :features - end - end - - def self.down - drop_table :software_infos - end -end diff --git a/db/migrate/20140528193927_create_libraries_table.rb b/db/migrate/20140528193927_create_libraries_table.rb deleted file mode 100644 index 3200454..0000000 --- a/db/migrate/20140528193927_create_libraries_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateLibrariesTable < ActiveRecord::Migration - def self.up - create_table :libraries do |t| - t.string :name - t.string :version - t.string :license - t.references :software_info - end - end - - def self.down - drop_table :libraries - end -end diff --git a/db/migrate/20140528193956_create_programming_languages_table.rb b/db/migrate/20140528193956_create_programming_languages_table.rb deleted file mode 100644 index 2c939eb..0000000 --- a/db/migrate/20140528193956_create_programming_languages_table.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateProgrammingLanguagesTable < ActiveRecord::Migration - def self.up - create_table :programming_languages do |t| - t.string :name - end - - SoftwareHelper.create_list_with_file("plugins/software_communities/public/static/languages.txt", ProgrammingLanguage) - end - - def self.down - drop_table :programming_languages - end -end diff --git a/db/migrate/20140528194044_create_database_descriptions_table.rb b/db/migrate/20140528194044_create_database_descriptions_table.rb deleted file mode 100644 index af2dda7..0000000 --- a/db/migrate/20140528194044_create_database_descriptions_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateDatabaseDescriptionsTable < ActiveRecord::Migration - def self.up - create_table :database_descriptions do |t| - t.string :name - end - - path_to_file = "plugins/software_communities/public/static/databases.txt" - SoftwareHelper.create_list_with_file(path_to_file, DatabaseDescription) - end - - def self.down - drop_table :database_descriptions - end -end diff --git a/db/migrate/20140528194129_create_software_databases_table.rb b/db/migrate/20140528194129_create_software_databases_table.rb deleted file mode 100644 index a70c4b7..0000000 --- a/db/migrate/20140528194129_create_software_databases_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateSoftwareDatabasesTable < ActiveRecord::Migration - def self.up - create_table :software_databases do |t| - t.string :version - t.string :operating_system - t.references :database_description - t.references :software_info - end - end - - def self.down - drop_table :software_databases - end -end diff --git a/db/migrate/20140528211914_create_software_languages_table.rb b/db/migrate/20140528211914_create_software_languages_table.rb deleted file mode 100644 index b08a37c..0000000 --- a/db/migrate/20140528211914_create_software_languages_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateSoftwareLanguagesTable < ActiveRecord::Migration - def self.up - create_table :software_languages do |t| - t.references :software_info - t.references :programming_language - t.string :version - t.string :operating_system - end - end - - def self.down - drop_table :software_languages - end -end diff --git a/db/migrate/20140710185444_create_operating_system_table.rb b/db/migrate/20140710185444_create_operating_system_table.rb deleted file mode 100644 index 1d5bcdc..0000000 --- a/db/migrate/20140710185444_create_operating_system_table.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateOperatingSystemTable < ActiveRecord::Migration - def up - create_table :operating_systems do |t| - t.string :name - t.string :version - t.references :software_info - end - end - - def down - drop_table :operating_systems - end -end diff --git a/db/migrate/20140711144012_remove_name_from_software_info.rb b/db/migrate/20140711144012_remove_name_from_software_info.rb deleted file mode 100644 index 4a72d82..0000000 --- a/db/migrate/20140711144012_remove_name_from_software_info.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveNameFromSoftwareInfo < ActiveRecord::Migration - def up - remove_column :software_infos, :name - end - - def down - add_column :software_infos, :name, :string - end -end diff --git a/db/migrate/20140714133901_create_operating_name_table.rb b/db/migrate/20140714133901_create_operating_name_table.rb deleted file mode 100644 index 610bcec..0000000 --- a/db/migrate/20140714133901_create_operating_name_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateOperatingNameTable < ActiveRecord::Migration - def up - create_table :operating_system_names do |t| - t.string :name - end - - path_to_file = "plugins/software_communities/public/static/operating_systems.txt" - SoftwareHelper.create_list_with_file(path_to_file, OperatingSystemName) - end - - def down - drop_table :operating_system_names - end -end diff --git a/db/migrate/20140714135007_change_operating_systems_table.rb b/db/migrate/20140714135007_change_operating_systems_table.rb deleted file mode 100644 index 313bb17..0000000 --- a/db/migrate/20140714135007_change_operating_systems_table.rb +++ /dev/null @@ -1,16 +0,0 @@ -class ChangeOperatingSystemsTable < ActiveRecord::Migration - def up - change_table :operating_systems do |t| - t.remove :name - t.references :operating_system_name - end - - end - - def down - change_table :operating_systems do |t| - t.string :name - t.remove :operating_system_name_id - end - end -end diff --git a/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb b/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb deleted file mode 100644 index 0d9a7b1..0000000 --- a/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RenameControlledVocabularyToSoftwareCategories < ActiveRecord::Migration - def up - rename_table :controlled_vocabulary, :software_categories - end - - def down - rename_table :software_categories, :controlled_vocabulary - end -end diff --git a/db/migrate/20141007140419_add_finality_field_to_software_table.rb b/db/migrate/20141007140419_add_finality_field_to_software_table.rb deleted file mode 100644 index 941ce26..0000000 --- a/db/migrate/20141007140419_add_finality_field_to_software_table.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddFinalityFieldToSoftwareTable < ActiveRecord::Migration - def up - add_column :software_infos, :finality, :string, :limit => 140 - end - - def down - remove_column :software_info, :finality - end -end diff --git a/db/migrate/20141013193939_add_repository_link_to_software.rb b/db/migrate/20141013193939_add_repository_link_to_software.rb deleted file mode 100644 index 61c557e..0000000 --- a/db/migrate/20141013193939_add_repository_link_to_software.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddRepositoryLinkToSoftware < ActiveRecord::Migration - def up - add_column :software_infos, :repository_link, :string - end - - def down - remove_column :software_infos, :repository_link - end -end diff --git a/db/migrate/20141103180655_add_public_software_field_validation.rb b/db/migrate/20141103180655_add_public_software_field_validation.rb deleted file mode 100644 index 563c2ee..0000000 --- a/db/migrate/20141103180655_add_public_software_field_validation.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddPublicSoftwareFieldValidation < ActiveRecord::Migration - def up - add_column :software_infos, :public_software, :boolean, :default => false - end - - def down - remove_column :software_infos, :public_software - end -end diff --git a/db/migrate/20141105173616_add_first_edit_to_software.rb b/db/migrate/20141105173616_add_first_edit_to_software.rb deleted file mode 100644 index a8b058e..0000000 --- a/db/migrate/20141105173616_add_first_edit_to_software.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddFirstEditToSoftware < ActiveRecord::Migration - def up - add_column :software_infos, :first_edit, :boolean, :default => true - end - - def down - remove_column :software_infos, :first_edit - end -end diff --git a/db/migrate/20141216183111_remove_operating_system_from_software_database.rb b/db/migrate/20141216183111_remove_operating_system_from_software_database.rb deleted file mode 100644 index 6dcdf7e..0000000 --- a/db/migrate/20141216183111_remove_operating_system_from_software_database.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveOperatingSystemFromSoftwareDatabase < ActiveRecord::Migration - def up - remove_column :software_databases, :operating_system - end - - def down - add_column :software_databases, :operating_system, :string - end -end diff --git a/db/migrate/20141216183459_remove_operating_system_from_software_language.rb b/db/migrate/20141216183459_remove_operating_system_from_software_language.rb deleted file mode 100644 index deb0f3f..0000000 --- a/db/migrate/20141216183459_remove_operating_system_from_software_language.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveOperatingSystemFromSoftwareLanguage < ActiveRecord::Migration - def up - remove_column :software_languages, :operating_system - end - - def down - add_column :software_languages, :operating_system, :string - end -end diff --git a/db/migrate/20150209170529_add_settings_field_to_software_info.rb b/db/migrate/20150209170529_add_settings_field_to_software_info.rb deleted file mode 100644 index c75c536..0000000 --- a/db/migrate/20150209170529_add_settings_field_to_software_info.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddSettingsFieldToSoftwareInfo < ActiveRecord::Migration - def up - add_column :software_infos, :settings, :text - end - - def down - remove_column :software_info, :settings - end -end diff --git a/db/migrate/20150210182519_rename_cc_license.rb b/db/migrate/20150210182519_rename_cc_license.rb deleted file mode 100644 index 9cc7fc8..0000000 --- a/db/migrate/20150210182519_rename_cc_license.rb +++ /dev/null @@ -1,13 +0,0 @@ -class RenameCcLicense < ActiveRecord::Migration - def up - license = LicenseInfo.find_by_version "CC-GPL-V2" - license.version = "Creative Commons GPL V2" - license.save! - end - - def down - license = LicenseInfo.find_by_version "Creative Commons GPL V2" - license.version = "CC-GPL-V2" - license.save! - end -end diff --git a/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb b/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb deleted file mode 100644 index d6c186c..0000000 --- a/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddPeopleBenefitedAndSavedValueToOrganizationRating < ActiveRecord::Migration - def up - add_column :organization_ratings, :people_benefited, :integer - add_column :organization_ratings, :saved_value, :decimal - end - - def down - remove_column :organization_ratings, :people_benefited - remove_column :organization_ratings, :saved_value - end -end diff --git a/features/deactivate_user.feature b/features/deactivate_user.feature deleted file mode 100644 index a6dccdc..0000000 --- a/features/deactivate_user.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: deactivate user - As a environment admin - I want to be able deactivate my account - So that user data remains persisted and allows the reactivation of the account - - 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 I go to /account/logout - And the following users - | login | name | email | - | joaosilva | Joao Silva | joaosilva@example.com | - And I am logged in as "joaosilva" - - - @selenium-fixme - Scenario: successfull deactivation - Given I go to joaosilva's control panel - And I follow "Edit Profile" - And I follow "Delete profile" - And I follow "Yes, I am sure" - Then I am not logged in - When I go to /profile/joaosilva - Then I should see "This profile is inaccessible." - - @selenium-fixme - Scenario: successfull reactivation of account - Given I go to joaosilva's control panel - And I follow "Edit Profile" - And I follow "Delete profile" - And I follow "Yes, I am sure" - And I go to the homepage - When I follow "Login" - And I follow "New user" - And I fill in the following within ".no-boxes": - | e-Mail | joaosilva@example.com | - | Full name | 123 | - And I follow "Reactive account" - And I fill in the following within ".no-boxes": - | Username or Email | joaosilva@example.com | - And I press "Send instructions" - Then I should see "An e-mail was just sent to your e-mail address" diff --git a/features/public_software_validation.feature b/features/public_software_validation.feature deleted file mode 100644 index 6f26b1d..0000000 --- a/features/public_software_validation.feature +++ /dev/null @@ -1,49 +0,0 @@ -Feature: edit adherent fields - As a user - I want to edit adherent fields - to mantain my public software up to date. - - Background: - Given "SoftwareCommunitiesPlugin" plugin is enabled - And the following users - | login | name | email | - | joaosilva | Joao Silva | joaosilva@example.com | - | mariasilva | Maria Silva | mariasilva@example.com | - And the following softwares - | name | public_software | finality | - | basic software | true | basic software finality | - And SoftwareInfo has initial default values on database - And I am logged in as mpog_admin - And I go to /admin/plugins - And I check "SoftwareCommunitiesPlugin" - Then I press "Save changes" - - Scenario: Disable public software checkbox to non admin users - Given I am logged in as "joaosilva" - And I go to /myprofile/basic-software/plugin/software_communities/edit_software - And I follow "Specifications" - Then I should see "Public software" within ".public_software_disabled" - - Scenario: Enable public software checkbox to admin users - Given I am logged in as mpog_admin - And I go to /myprofile/basic-software/plugin/software_communities/edit_software - And I follow "Specifications" - Then I should see "Public software" within ".public_software_enabled" - - @selenium - Scenario: Show adherent fields when checkbox are checked - Given I am logged in as mpog_admin - And I go to /myprofile/basic-software/plugin/software_communities/edit_software - And I follow "Specifications" - And I uncheck "software[public_software]" - And I check "software[public_software]" - Then I should see "Adherent to e-ping ?" - - @selenium - Scenario: Don't show adherent fields when checkbox are not checked - Given I am logged in as mpog_admin - And I go to /myprofile/basic-software/plugin/software_communities/edit_software - And I follow "Specifications" - 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/software_block.feature b/features/software_block.feature deleted file mode 100644 index 1f8cf8b..0000000 --- a/features/software_block.feature +++ /dev/null @@ -1,48 +0,0 @@ -Feature: edit adherent fields - As a user - I want to edit adherent fields - to mantain my public software up to date. - - 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 the following softwares - | name | public_software | finality | - | Public Software | true | some finality | - | Generic Software | false | some finality | - - Scenario: Add software block - Given I am logged in as mpog_admin - And I follow "Control panel" - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" - Then I should see "softwares" - - Scenario: Change software block to generic software block - Given I am logged in as mpog_admin - And I follow "Control panel" - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" - And I follow "Edit" within ".softwares-block" - And I select "Generic" from "block_software_type" - And I press "Save" - Then I should see "generic software" - - Scenario: Change software block to generic software block - Given I am logged in as mpog_admin - And I follow "Control panel" - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" - And I follow "Edit" within ".softwares-block" - And I select "Public" from "block_software_type" - And I press "Save" - Then I should see "public software" \ No newline at end of file diff --git a/features/software_catalog.feature b/features/software_catalog.feature deleted file mode 100644 index e0988cf..0000000 --- a/features/software_catalog.feature +++ /dev/null @@ -1,82 +0,0 @@ -Feature: Search software - As a user - I want to be able to search catalogued software - So that I find a software that fit my needs - 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 I go to /account/logout - And the following categories - | name | display_in_menu | - | Software | true | - And the following categories - | parent | name | display_in_menu | - | Software | Health | true | - | Software | Education | true | - And the following softwares - | name | public_software | categories | finality | - | Software One | true | Health | some finality | - | Software Two | true | Health, Education | some finality | - | Software Three | false | Education | some finality | - - - Scenario: Show all "public_software" softwares when open search page - Given I go to /search/software_infos - Then I should see "Software One" - Then I should see "Software Two" - - Scenario: Show all "public_software" softwares when search software - Given I go to /search/software_infos - And I fill in "search-input" with "Software" - Then I should see "Software One" - Then I should see "Software Two" - - @selenium - Scenario: Show software "One" when searching for "Software One" - Given I go to /search/software_infos - And I fill in "search-input" with "One" - And I keyup on selector "#search-input" - Then I should see "Software One" - Then I should not see "Software Two" - - @selenium - Scenario: Show software ordered by name when "Name A-Z" is selected - Given I go to /search/software_infos - And I select "Name A-Z" from "sort" - And I press "Filter" - Then I should see "Software One" before "Software Two" - - @selenium - Scenario: Show software in reverse order by name when "Name Z-A" is selected - Given I go to /search/software_infos - And I select "Name Z-A" from "sort" - And I sleep for 3 seconds - Then I should see "Software Two" before "Software One" - - @selenium - Scenario: Show only "Software Two" when searching for "Education" category - Given I go to /search/software_infos - And I click on anything with selector "#filter-option-catalog-software" - And I check "Education" - Then I should see "Software Two" - And I should not see "Software One" - - @selenium - Scenario: Show both Software "One" and "Two" when searching for "Health" category - Given I go to /search/software_infos - And I click on anything with selector "#filter-option-catalog-software" - And I check "Health" - Then I should see "Software One" - And I should see "Software Two" - - @selenium - Scenario: Show not "public_software" when "Include in results" is checked - Given I go to /search/software_infos - And I click on anything with selector "#filter-option-catalog-software" - And I check "include_non_public" - Then I should see "Software One" - And I should see "Software Two" - And I should see "Software Three" diff --git a/features/software_registration.feature b/features/software_registration.feature deleted file mode 100644 index 86c7d7a..0000000 --- a/features/software_registration.feature +++ /dev/null @@ -1,87 +0,0 @@ -Feature: edit public software information - As a user - I want to add public software information to a software - So that I can have software communities on my network - - Background: - Given "SoftwareCommunitiesPlugin" plugin is enabled - And SoftwareInfo has initial default values on database - And I am logged in as mpog_admin - And I go to /admin/plugins - And I check "SoftwareCommunitiesPlugin" - And I press "Save changes" - And I go to /myprofile/mpog-admin - And the following softwares - | name | public_software | finality | - | basic software | true | basic software finality | - - @selenium - Scenario: Show SoftwareLangue fields when click in New Language - Given I go to /myprofile/basic-software/plugin/software_communities/edit_software - When I follow "Specifications" - And I follow "New language" - And I should see "3" of this selector ".software-language-table" - And I follow "Delete" - Then I should see "2" of this selector ".software-language-table" - #3 because one is always hidden - - @selenium - Scenario: Show databasefields when click in New database - Given I go to /myprofile/basic-software/plugin/software_communities/edit_software - When I follow "Specifications" - And I follow "New Database" - And I should see "3" of this selector ".database-table" - And I follow "Delete" - Then I should see "2" of this selector ".database-table" - #3 because one is always hidden - - @selenium - Scenario: Software database name should be an autocomplete - Given I go to /myprofile/basic-software/plugin/software_communities/edit_software - When I follow "Specifications" - And I follow "New Database" - And I type in "my" in autocomplete list ".database_autocomplete" and I choose "MySQL" - Then selector ".database_autocomplete" should have any "MySQL" - - @selenium - Scenario: Software database name should be an autocomplete - Given I go to /myprofile/basic-software/plugin/software_communities/edit_software - When I follow "Specifications" - And I follow "New language" - And I type in "py" in autocomplete list ".language_autocomplete" and I choose "Python" - Then selector ".database_autocomplete" should have any "Python" - - @selenium - Scenario: Create software with all dynamic table fields filled - Given I go to /myprofile/basic-software/plugin/software_communities/edit_software - When I follow "Specifications" - And I follow "New language" - And I type in "py" in autocomplete list ".language_autocomplete" and I choose "Python" - And I fill in "language__version" with "1.2.3" - And I follow "New Database" - And I type in "my" in autocomplete list ".database_autocomplete" and I choose "MySQL" - And I fill in "database__version" with "4.5.6" - Then I press "Save" - And I follow "Software Info" - And I follow "Specifications" - And selector ".language_autocomplete" should have any "Python" - And selector "#language__version" should have any "1.2.3" - And selector ".database_autocomplete" should have any "MySQL" - And selector "#database__version" should have any "4.5.6" - - @selenium - Scenario: Show license link when a license is selected - Given I am on mpog-admin's control panel - And I follow "Create a new software" - And I fill in "community_name_id" with "another software" - And I fill in "community-identifier" with "another-software" - And I fill in "software_info_finality" with "another software finality" - And I type in "gp" in autocomplete list "#license_info_version" and I choose "GPL-2" - And I should see "Read license" within "#version_link" - And I press "Create" - And I should see "Configure Software Community" - And I press "Save" - And I should see "Control Panel" - And I follow "Software Info" - And I type in "gp" in autocomplete list "#license_info_version" and I choose "GPL-3" - Then I should see "Read license" within "#version_link" diff --git a/features/step_definitions/software_communities_steps.rb b/features/step_definitions/software_communities_steps.rb deleted file mode 100644 index e87447b..0000000 --- a/features/step_definitions/software_communities_steps.rb +++ /dev/null @@ -1,202 +0,0 @@ -Given /^SoftwareInfo has initial default values on database$/ do - LicenseInfo.create(:version=>"None", :link=>"") - LicenseInfo.create(:version=>"GPL-2", :link =>"www.gpl2.com") - LicenseInfo.create(:version=>"GPL-3", :link =>"www.gpl3.com") - - ProgrammingLanguage.create(:name=>"C") - ProgrammingLanguage.create(:name=>"C++") - ProgrammingLanguage.create(:name=>"Ruby") - ProgrammingLanguage.create(:name=>"Python") - - DatabaseDescription.create(:name => "Oracle") - DatabaseDescription.create(:name => "MySQL") - DatabaseDescription.create(:name => "Apache") - DatabaseDescription.create(:name => "PostgreSQL") - - OperatingSystemName.create(:name=>"Debian") - OperatingSystemName.create(:name=>"Fedora") - OperatingSystemName.create(:name=>"CentOS") -end - - -Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| - # Wait the page javascript load - sleep 1 - # Basicaly it, search for the input field, type something, wait for ajax end select an item - page.driver.browser.execute_script %Q{ - var search_query = "#{input_field_selector}.ui-autocomplete-input"; - var input = jQuery(search_query).first(); - - input.trigger('click'); - input.val('#{typed}'); - input.trigger('keydown'); - - window.setTimeout(function(){ - search_query = ".ui-menu-item a:contains('#{should_select}')"; - var typed = jQuery(search_query).first(); - - typed.trigger('mouseenter').trigger('click'); - console.log(jQuery('#license_info_id')); - }, 1000); - } - sleep 1 -end - - -Given /^the following software language$/ do |table| - table.hashes.each do |item| - programming_language = ProgrammingLanguage.where(:name=>item[:programing_language]).first - software_language = SoftwareLanguage::new - - software_language.programming_language = programming_language - software_language.version = item[:version] - software_language.operating_system = item[:operating_system] - - software_language.save! - end -end - -Given /^the following software databases$/ do |table| - table.hashes.each do |item| - database_description = DatabaseDescription.where(:name=>item[:database_name]).first - software_database = SoftwareDatabase::new - - software_database.database_description = database_description - software_database.version = item[:version] - software_database.operating_system = item[:operating_system] - - software_database.save! - end -end - - -Given /^the following operating systems$/ do |table| - table.hashes.each do |item| - operating_system_name = OperatingSystemName.where(:name=>item[:operating_system_name]).first - operating_system = OperatingSystem::new - - operating_system.operating_system_name = operating_system_name - operating_system.version = item[:version] - - operating_system.save! - end -end - -Given /^the following softwares$/ do |table| - table.hashes.each do |item| - software_info = SoftwareInfo.new - software_info.community = Community.create(:name=>item[:name]) - - software_info.finality = item[:finality] if item[:finality] - software_info.acronym = item[:acronym] if item[:acronym] - software_info.finality = item[:finality] if item[:finality] - software_info.finality ||= "something" - software_info.operating_platform = item[:operating_platform] if item[:operating_platform] - software_info.objectives = item[:objectives] if item[:objectives] - software_info.features = item[:features] if item[:features] - software_info.public_software = item[:public_software] == "true" if item[:public_software] - software_info.license_info = LicenseInfo.create :version=>"GPL - 1.0" - - if item[:software_language] - programming_language = ProgrammingLanguage.where(:name=>item[:software_language]).first - software_language = SoftwareLanguage.where(:programming_language_id=>programming_language).first - software_info.software_languages << software_language - end - - if item[:software_database] - database_description = DatabaseDescription.where(:name=>item[:software_database]).first - software_database = SoftwareDatabase.where(:database_description_id=>database_description).first - software_info.software_databases << software_database - end - - if item[:operating_system] - operating_system_name = OperatingSystemName.where(:name => item[:operating_system]).first - operating_system = OperatingSystem.where(:operating_system_name_id => operating_system_name).first - software_info.operating_systems << operating_system - end - - if item[:categories] - categories = item[:categories].split(",") - categories.map! {|category| category.strip} - - categories.each do |category_name| - category = Category.find_by_name category_name - software_info.community.categories << category - end - end - - software_info.save! - end -end - -# Dynamic table steps -Given /^I fill in first "([^"]*)" class with "([^"]*)"$/ do |selector, value| - evaluate_script "jQuery('#{selector}').first().attr('value', '#{value}') && true" -end - -Given /^I fill in last "([^"]*)" class with "([^"]*)"$/ do |selector, value| - evaluate_script "jQuery('#{selector}').last().attr('value', '#{value}') && true" -end - -Given /^I click on the first button with class "([^"]*)"$/ do |selector| - evaluate_script "jQuery('#{selector}').first().trigger('click') && true" -end - -Given /^I click on the last button with class "([^"]*)"$/ do |selector| - evaluate_script "jQuery('#{selector}').last().trigger('click') && true" -end - -Given /^the user "([^"]*)" has "([^"]*)" as secondary e\-mail$/ do |login, email| - User[login].update_attributes(:secondary_email => email) -end - -Given /^I click on anything with selector "([^"]*)"$/ do |selector| - evaluate_script "jQuery('#{selector}').trigger('click') && true" -end - -Given /^I should see "([^"]*)" of this selector "([^"]*)"$/ do |quantity, selector| - evaluate_script "jQuery('#{selector}').length == '#{quantity}'" -end - -Given /^selector "([^"]*)" should have any "([^"]*)"$/ do |selector, text| - evaluate_script "jQuery('#{selector}').html().indexOf('#{text}') != -1" -end - -Given /^I click on table number "([^"]*)" selector "([^"]*)" and select the value "([^"]*)"$/ do |number, selector, value| - evaluate_script "jQuery('#{selector}:nth-child(#{number}) select option:contains(\"#{value}\")').selected() && true" -end - -Given /^I fill with "([^"]*)" in field with name "([^"]*)" of table number "([^"]*)" with class "([^"]*)"$/ do |value, name, number, selector| - evaluate_script "jQuery('#{selector}:nth-child(#{number}) input[name=\"#{name}\"]').val('#{value}') && true" -end - -Given /^I sleep for (\d+) seconds$/ do |time| - sleep time.to_i -end - -Given /^I am logged in as mpog_admin$/ do - visit('/account/logout') - - user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com') - person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin" - user.person = person - user.save! - - user.activate - e = Environment.default - e.add_admin(user.person) - - visit('/account/login') - fill_in("Username", :with => user.login) - fill_in("Password", :with => '123456') - click_button("Log in") -end - -Given /^I should see "([^"]*)" before "([^"]*)"$/ do |before, after| - assert page.body.index("#{before}") < page.body.index("#{after}") -end - -Given /^I keyup on selector "([^"]*)"$/ do |selector| - selector_founded = evaluate_script("jQuery('#{selector}').trigger('keyup').length != 0") - selector_founded.should be_true -end diff --git a/lib/categories_and_tags_block.rb b/lib/categories_and_tags_block.rb deleted file mode 100644 index e50f9c4..0000000 --- a/lib/categories_and_tags_block.rb +++ /dev/null @@ -1,29 +0,0 @@ -class CategoriesAndTagsBlock < Block - - attr_accessible :show_name - - settings_items :show_name, :type => :boolean, :default => false - - def self.description - _('Categories and Tags') - end - - def help - _('This block displays the categories and tags of a software.') - end - - def content(args={}) - block = self - s = show_name - lambda do |object| - render( - :file => 'blocks/categories_and_tags', - :locals => { :block => block, :show_name => s } - ) - end - end - - def cacheable? - false - end -end diff --git a/lib/categories_software_block.rb b/lib/categories_software_block.rb deleted file mode 100644 index 97e1fda..0000000 --- a/lib/categories_software_block.rb +++ /dev/null @@ -1,35 +0,0 @@ -class CategoriesSoftwareBlock < Block - - attr_accessible :show_name - - settings_items :show_name, :type => :boolean, :default => false - - def self.description - _('Categories Softwares') - end - - def help - _('This block displays the categories and the amount of softwares for - each category.') - end - - def content(args={}) - block = self - s = show_name - - software_category = Category.find_by_name("Software") - categories = [] - categories = software_category.children.sort if software_category - - lambda do |object| - render( - :file => 'blocks/categories_software', - :locals => { :block => block, :show_name => s, :categories => categories } - ) - end - end - - def cacheable? - false - end -end diff --git a/lib/create_software.rb b/lib/create_software.rb deleted file mode 100644 index 7b8b914..0000000 --- a/lib/create_software.rb +++ /dev/null @@ -1,113 +0,0 @@ -class CreateSoftware < Task - include Rails.application.routes.url_helpers - - validates_presence_of :requestor_id, :target_id - validates_presence_of :name - - attr_accessible :name, :finality, :repository_link, :requestor, :environment, - :reject_explanation, :license_info - - alias :environment :target - alias :environment= :target= - - DATA_FIELDS = ['name', 'finality', 'license_info', 'repository_link'] - DATA_FIELDS.each do |field| - settings_items field.to_sym - end - - def perform - software_template = Community["software"] - if (!software_template.blank? && software_template.is_template) - template_id = software_template.id - end - - community = Community.create!(:name => self.name, - :template_id => template_id) - - community.environment = self.environment - community.add_admin(self.requestor) - - software = SoftwareInfo.create!(:finality => self.finality, - :repository_link => self.repository_link, :community_id => community.id, - :license_info => self.license_info) - end - - def title - _("New software") - end - - def subject - name - end - - def information - message = _('%{requestor} wants to create software %{subject} with') - if finality.blank? - { :message => message + _(' no finality.') } - else - { :message => message + _(' this finality:

%{finality}

'), - :variables => {:finality => finality} } - end - end - - def reject_details - true - end - - # tells if this request was rejected - def rejected? - self.status == Task::Status::CANCELLED - end - - # tells if this request was appoved - def approved? - self.status == Task::Status::FINISHED - end - - def target_notification_description - _('%{requestor} wants to create software %{subject}') % - {:requestor => requestor.name, :subject => subject} - end - - def target_notification_message - _("User \"%{user}\" just requested to create software %{software}. - You have to approve or reject it through the \"Pending Validations\" - section in your control panel.\n") % - { :user => self.requestor.name, :software => self.name } - end - - def task_created_message - _("Your request for registering software %{software} at %{environment} was - just sent. Environment administrator will receive it and will approve or - reject your request according to his methods and criteria. - - You will be notified as soon as environment administrator has a position - about your request.") % - { :software => self.name, :environment => self.target } - end - - def task_cancelled_message - _("Your request for registering software %{software} at %{environment} was - not approved by the environment administrator. The following explanation - was given: \n\n%{explanation}") % - { :software => self.name, - :environment => self.environment, - :explanation => self.reject_explanation } - end - - def task_finished_message - _('Your request for registering the software "%{software}" was approved. - You can access %{url} and finish the registration of your software.') % - { :software => self.name, :url => mount_url } - end - - private - - def mount_url - identifier = Community.where(:name => self.name).first.identifier - # The use of url_for doesn't allow the /social within the Public Software - # portal. That's why the url is mounted so 'hard coded' - url = "#{environment.top_url}/myprofile/#{identifier}/profile_editor/edit_software_community" - end - -end diff --git a/lib/database_description.rb b/lib/database_description.rb deleted file mode 100644 index ff1e641..0000000 --- a/lib/database_description.rb +++ /dev/null @@ -1,15 +0,0 @@ -class DatabaseDescription < ActiveRecord::Base - - SEARCHABLE_SOFTWARE_FIELDS = { - :name => 1 - } - - attr_accessible :name - - has_many :software_databases - has_many :software_infos, :through => :software_databases - - validates_presence_of :name - validates_uniqueness_of :name - -end diff --git a/lib/database_helper.rb b/lib/database_helper.rb deleted file mode 100644 index af7f5e2..0000000 --- a/lib/database_helper.rb +++ /dev/null @@ -1,86 +0,0 @@ -class DatabaseHelper < DynamicTableHelper - MODEL_NAME ="database" - FIELD_NAME = "database_description_id" - - def self.valid_database? database - return false if SoftwareHelper.all_table_is_empty?(database) - - database_description_id_list = DatabaseDescription.select(:id). - collect {|dd| dd.id} - - return database_description_id_list.include?( - database[:database_description_id].to_i - ) - end - - def self.list_database new_databases - return [] if new_databases.nil? or new_databases.length == 0 - list_databases = [] - - new_databases.each do |new_database| - if valid_database? new_database - database = SoftwareDatabase.new - - database.database_description_id = - new_database[:database_description_id] - - database.version = new_database[:version] - list_databases << database - end - end - - list_databases - end - - def self.valid_list_database? list_databases - return false if list_databases.nil? or list_databases.length == 0 - - list_databases.each do |database| - return false unless database.valid? - end - - true - end - - def self.database_as_tables(list_databases, disabled=false) - model_list = list_databases - model_list ||= [{:database_description_id => "", :version => ""}] - - models_as_tables model_list, "database_html_structure", disabled - end - - def self.database_html_structure(database_data, disabled) - database_id = database_data[:database_description_id] - database_name = if database_data[:database_description_id].blank? - "" - else - DatabaseDescription.find( - database_data[:database_description_id], - :select=>"name" - ).name - end - - data = { - model_name: MODEL_NAME, - field_name: FIELD_NAME, - name: { - value: database_name, - id: database_id, - hidden: true, - autocomplete: true, - select_field: false - }, - version: { - value: database_data[:version], - hidden: true, - delete: true - } - } - DATA[:license].delete(:value) - table_html_structure(data, disabled) - end - - def self.add_dynamic_table - database_as_tables(nil).first.call - end -end \ No newline at end of file diff --git a/lib/download.rb b/lib/download.rb deleted file mode 100644 index 0b63fed..0000000 --- a/lib/download.rb +++ /dev/null @@ -1,51 +0,0 @@ -#FIX ME: Turn this into a proper model(next release) -class Download - def initialize data - @name = data[:name] - @link = data[:link] - @software_description = data[:software_description] - @minimum_requirements = data[:minimum_requirements] - @size = data[:size] - - @total_downloads = if data[:total_downloads] - data[:total_downloads] - else - 0 - end - end - - def self.validate_download_list download_list - download_list.select! do |download| - not download[:name].blank? - end - - download_list.map do |download| - Download.new(download).to_hash - end - end - - def to_hash - { - :name => @name, - :link => @link, - :software_description => @software_description, - :minimum_requirements => @minimum_requirements, - :size => @size, - :total_downloads => @total_downloads - } - end - - def total_downloads= value - if value.is_a? Integer - @total_downloads = value - end - end - - def total_downloads - @total_downloads - end - - def link - @link - end -end diff --git a/lib/download_block.rb b/lib/download_block.rb deleted file mode 100644 index 58048b7..0000000 --- a/lib/download_block.rb +++ /dev/null @@ -1,36 +0,0 @@ -class DownloadBlock < Block - - attr_accessible :show_name, :downloads - - settings_items :show_name, :type => :boolean, :default => false - settings_items :downloads, :type => Array, :default => [] - - validate :download_values - - def download_values - self.downloads = Download.validate_download_list(self.downloads) - end - - def self.description - _('Download Stable Version') - end - - def help - _('This block displays the stable version of a software.') - end - - def content(args={}) - block = self - s = show_name - lambda do |object| - render( - :file => 'blocks/download', - :locals => { :block => block, :show_name => s } - ) - end - end - - def cacheable? - false - end -end diff --git a/lib/dynamic_table_helper.rb b/lib/dynamic_table_helper.rb deleted file mode 100644 index 1c9265e..0000000 --- a/lib/dynamic_table_helper.rb +++ /dev/null @@ -1,153 +0,0 @@ -class DynamicTableHelper - extend( - ActionView::Helpers::TagHelper, - ActionView::Helpers::FormTagHelper, - ActionView::Helpers::FormOptionsHelper, - ActionView::Helpers::UrlHelper, - ApplicationHelper - ) - - COLLUMN_NAME = { - name: "name", - version: "version", - license: "license" - } - - LABEL_TEXT = { - :name => _("Name"), - :version => _("Version"), - :license => _("License") - } - - DATA = { - name: { - label: LABEL_TEXT[:name], - name: COLLUMN_NAME[:name] - }, - version: { - label: LABEL_TEXT[:version], - name: COLLUMN_NAME[:version] - } , - license: { - label: LABEL_TEXT[:license], - name: COLLUMN_NAME[:license], - delete: true - } - } - @@disabled = false - - def self.table_html_structure data={}, disabled=false - @@disabled = disabled - Proc::new do - content_tag :table , generate_table_lines(data), :class => "dynamic-table" - end - end - - def self.generate_table_lines data={} - @@model = data[:model_name] - @@field_name = data[:field_name] - @@hidden_label = data[:name][:value] - @@hidden_id = data[:name][:id] - - row_data = prepare_row_data data - - table_line_data = [ - self.table_line(row_data[:name]), - self.table_line(row_data[:version]) - ] - - if row_data[:license].has_key?(:value) - table_line_data << self.table_line(row_data[:license]) - end - - table_line_data.join() - end - - def self.table_line row_data={} - unless row_data.blank? - content_tag :tr, [ - self.label_collumn(row_data[:label]), - self.value_collumn( - row_data[:value], - row_data[:name], - row_data[:autocomplete], - row_data[:select_field], - row_data[:options] - ), - self.hidden_collumn(row_data[:delete], row_data[:hidden]) - ].join() - end - end - - def self.label_collumn label="" - content_tag :td, label_tag(label) - end - - def self.value_collumn value="", name="", autocomplete=false, select_field=false, options=[] - html_options = - if autocomplete - { - :class => "#{@@model}_autocomplete", - :placeholder => _("Autocomplete field, type something") - } - else - {} - end - - html_options[:disabled] = @@disabled - - content = if select_field - select_tag("#{@@model}[][#{@@field_name}]", options, html_options) - elsif autocomplete - text_field_tag("#{@@model}_autocomplete", value, html_options) - else - text_field_tag("#{@@model}[][#{name}]", value, html_options) - end - - content_tag :td, content - end - - def self.hidden_collumn delete=false, hidden_data=false - value = - if @@disabled - nil - elsif delete - button_without_text( - :delete, _('Delete'), "#" , :class=>"delete-dynamic-table" - ) - elsif hidden_data - hidden_field_tag( - "#{@@model}[][#{@@field_name}]", - @@hidden_id, - :class => "#{@@field_name}", - :data => {:label => @@hidden_label } #check how to get the name of an object of the current model - ) - else - nil - end - - content_tag(:td, value, :align => 'right') - end - - def self.prepare_row_data data - row_data = { - name: DATA[:name], - version: DATA[:version], - license: DATA[:license] - } - - row_data[:name].merge! data[:name] - row_data[:version].merge! data[:version] - row_data[:license].merge! data[:license] if data.has_key? :license - - row_data - end - - def self.models_as_tables models, callback, disabled=false - lambdas_list = [] - - models.map do |model| - send(callback, model, disabled) - end - end -end \ No newline at end of file diff --git a/lib/ext/category.rb b/lib/ext/category.rb deleted file mode 100644 index 0c3008c..0000000 --- a/lib/ext/category.rb +++ /dev/null @@ -1,35 +0,0 @@ -require_dependency 'category' - -class Category - SOFTWARE_CATEGORIES = [ - _('Agriculture, Fisheries and Extraction'), - _('Science, Information and Communication'), - _('Economy and Finances'), - _('Public Administration'), - _('Habitation, Sanitation and Urbanism'), - _('Individual, Family and Society'), - _('Health'), - _('Social Welfare and Development'), - _('Defense and Security'), - _('Education'), - _('Government and Politics'), - _('Justice and Legislation'), - _('International Relationships'), - _('Transportation and Transit') - ] - - scope :software_categories, lambda { - software_category = Category.find_by_name("Software") - if software_category.nil? - [] - else - software_category.children - end - } - - def software_infos - software_list = self.communities - software_list.collect { |x| software_list.delete(x) unless x.software? } - software_list - end -end diff --git a/lib/ext/communities_block.rb b/lib/ext/communities_block.rb deleted file mode 100644 index 4a5fcaa..0000000 --- a/lib/ext/communities_block.rb +++ /dev/null @@ -1,45 +0,0 @@ -require_dependency 'communities_block' - -class CommunitiesBlock - - def profile_list - result = get_visible_profiles - result.slice(0..get_limit-1) - end - - def profile_count - profile_list.count - end - - private - - def get_visible_profiles - visible_profiles = profiles.visible.includes( - [:image,:domains,:preferred_domain,:environment] - ) - - delete_communities = [] - valid_communities_string = Community.get_valid_communities_string - Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} - - visible_profiles = visible_profiles.where(["profiles.id NOT IN (?)", delete_communities]) unless delete_communities.empty? - - if !prioritize_profiles_with_image - return visible_profiles.all( - :limit => get_limit, - :order => 'profiles.updated_at DESC' - ).sort_by {rand} - elsif profiles.visible.with_image.count >= get_limit - return visible_profiles.with_image.all( - :limit => get_limit * 5, - :order => 'profiles.updated_at DESC' - ).sort_by {rand} - else - visible_profiles = visible_profiles.with_image.sort_by {rand} + - visible_profiles.without_image.all( - :limit => get_limit * 5, :order => 'profiles.updated_at DESC' - ).sort_by {rand} - return visible_profiles - end - end -end diff --git a/lib/ext/community.rb b/lib/ext/community.rb deleted file mode 100644 index 6f8602f..0000000 --- a/lib/ext/community.rb +++ /dev/null @@ -1,66 +0,0 @@ -require_dependency 'community' - -class Community - - SEARCHABLE_SOFTWARE_FIELDS = { - :name => 1, - :identifier => 2, - :nickname => 3 - } - - attr_accessible :visible - - has_one :software_info, :dependent=>:destroy - - settings_items :hits, :type => :integer, :default => 0 - - def self.create_after_moderation(requestor, attributes = {}) - community = Community.new(attributes) - - if community.environment.enabled?('admin_must_approve_new_communities') && - !community.environment.admins.include?(requestor) - - cc = CreateCommunity.create(attributes.merge(:requestor => requestor)) - else - community = Community.create(attributes) - community.add_admin(requestor) - end - community - end - - def self.get_valid_communities_string - remove_of_communities_methods = Community.instance_methods.select{|m| m =~ /remove_of_community_search/} - valid_communities_string = "!(" - remove_of_communities_methods.each do |method| - valid_communities_string += "community.send('#{method}') || " - end - valid_communities_string = valid_communities_string[0..-5] - valid_communities_string += ")" - - valid_communities_string - end - - def software? - return !software_info.nil? - end - - def deactivate - self.visible = false - self.save! - end - - def activate - self.visible = true - self.save! - end - - def remove_of_community_search_software? - return software? - end - - def hit - self.hits += 1 - self.save! - end - -end diff --git a/lib/ext/organization_rating.rb b/lib/ext/organization_rating.rb deleted file mode 100644 index cedb7ca..0000000 --- a/lib/ext/organization_rating.rb +++ /dev/null @@ -1,5 +0,0 @@ -require_dependency "organization_rating" - -class OrganizationRating - attr_accessible :people_benefited, :saved_value -end diff --git a/lib/ext/person.rb b/lib/ext/person.rb deleted file mode 100644 index 2ccb9a2..0000000 --- a/lib/ext/person.rb +++ /dev/null @@ -1,24 +0,0 @@ -# encoding: utf-8 - -require_dependency 'person' - -class Person - - delegate :login, :to => :user, :prefix => true - - def software? - false - end - - def softwares - softwares = [] - self.communities.each do |community| - if community.software? - softwares << community - end - end - - softwares - end - -end diff --git a/lib/ext/profile_controller.rb b/lib/ext/profile_controller.rb deleted file mode 100644 index e0619f6..0000000 --- a/lib/ext/profile_controller.rb +++ /dev/null @@ -1,64 +0,0 @@ -require_dependency 'profile_controller' - -class ProfileController - - before_filter :hit_view_page - - def communities - type = [] - params[:type].downcase! unless params[:type].nil? - - if params[:type] == "software" - type = profile.softwares - elsif params[:type] == "institution" - type = profile.institutions - else - profile.communities.select do |community| - type << community unless community.software? || community.institution? - end - end - - if is_cache_expired?(profile.communities_cache_key(params)) - @communities = type.paginate(:per_page => per_page, :page => params[:npage], :total_entries => type.count) - end - end - - def members - if is_cache_expired?(profile.members_cache_key(params)) - sort = (params[:sort] == 'desc') ? params[:sort] : 'asc' - @profile_admins = profile.admins.includes(relations_to_include).order("name #{sort}").paginate(:per_page => members_per_page, :page => params[:npage]) - @profile_members = profile.members.order("name #{sort}").paginate(:per_page => members_per_page, :page => params[:npage]) - @profile_members_url = url_for(:controller => 'profile', :action => 'members') - end - end - - def user_is_a_bot? - user_agent= request.env["HTTP_USER_AGENT"] - user_agent.blank? || - user_agent.match(/bot/) || - user_agent.match(/spider/) || - user_agent.match(/crawler/) || - user_agent.match(/\(.*https?:\/\/.*\)/) - end - - def already_visited?(element) - user_id = if user.nil? then -1 else current_user.id end - user_id = "#{user_id}_#{element.id}_#{element.class}" - - if cookies.signed[:visited] == user_id - return true - else - cookies.permanent.signed[:visited] = user_id - return false - end - end - - def hit_view_page - if profile - community = profile - community.hit unless user_is_a_bot? || - already_visited?(community) || - community.class != Community - end - end -end diff --git a/lib/ext/profile_editor_controller.rb b/lib/ext/profile_editor_controller.rb deleted file mode 100644 index 3645f1f..0000000 --- a/lib/ext/profile_editor_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_dependency 'profile_editor_controller' - -class ProfileEditorController - - before_filter :redirect_to_edit_software_community, :only => [:edit] - - def edit_software_community - @profile_data = profile - @possible_domains = profile.possible_domains - @first_edit = profile.software_info.first_edit? - - if @first_edit - profile.software_info.first_edit = false - profile.software_info.save! - end - - edit if request.post? - end - - protected - - def redirect_to_edit_software_community - if profile.class == Community && profile.software? - redirect_to :action => 'edit_software_community' - end - end - -end diff --git a/lib/ext/profile_helper.rb b/lib/ext/profile_helper.rb deleted file mode 100644 index 7268d4b..0000000 --- a/lib/ext/profile_helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_dependency 'profile_helper' - -module ProfileHelper - PERSON_CATEGORIES[:mpog_profile_information] = [:secondary_email, - :institutions] - - def display_mpog_field(title, profile, field, force = false) - unless force || profile.may_display_field_to?(field, user) - return '' - end - value = profile.send(field) - if !value.blank? - if block_given? - value = yield(value) - end - content_tag( - 'tr', - content_tag('td', title, :class => 'field-name') + - content_tag('td', value) - ) - else - '' - end - end - -end diff --git a/lib/ext/search_controller.rb b/lib/ext/search_controller.rb deleted file mode 100644 index e96cd63..0000000 --- a/lib/ext/search_controller.rb +++ /dev/null @@ -1,169 +0,0 @@ -require_dependency 'search_controller' - -class SearchController - - def communities - delete_communities = [] - valid_communities_string = Community.get_valid_communities_string - Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} - - @scope = visible_profiles(Community) - @scope = @scope.where(["id NOT IN (?)", delete_communities]) unless delete_communities.empty? - - full_text_search - end - - def software_infos - prepare_software_search_page - results = filter_software_infos_list - @software_count = results.count - results = results.paginate(:per_page => @per_page, :page => params[:page]) - @searches[@asset] = {:results => results} - @search = results - - render :layout=>false if request.xhr? - end - - protected - - def filter_communities_list - unfiltered_list = visible_profiles(Community) - - unless params[:query].nil? - unfiltered_list = unfiltered_list.select do |com| - com.name.downcase =~ /#{params[:query].downcase}/ - end - end - - communities_list = [] - unfiltered_list.each do |profile| - if profile.class == Community && !profile.is_template? && yield(profile) - communities_list << profile - end - end - - communities_list - end - - def filter_software_infos_list - filtered_software_list = get_filtered_software_list - filtered_community_list = get_communities_list(filtered_software_list) - sort_communities_list filtered_community_list - end - - def get_filter_category_ids - category_ids = [] - unless params[:selected_categories_id].blank? - category_ids = params[:selected_categories_id] - end - category_ids.map(&:to_i) - end - - def get_filtered_software_list - params[:query] ||= "" - visible_communities = visible_profiles(Community) - - filtered_software_list = SoftwareInfo.search_by_query(params[:query]) - - if params[:only_softwares] - params[:only_softwares].collect!{ |software_name| software_name.to_slug } - filtered_software_list = SoftwareInfo.all.select{ |s| params[:only_softwares].include?(s.identifier) } - @public_software_selected = false - end - - filtered_software_list.select!{ |software| visible_communities.include?(software.community) } - category_ids = get_filter_category_ids - - unless category_ids.empty? - filtered_software_list.select! do |software| - if software.nil? || software.community.nil? - false - else - result_ids = (software.community.category_ids & category_ids).sort - result_ids == category_ids.sort - end - end - end - - filtered_software_list - end - - def get_communities_list software_list - filtered_community_list = [] - software_list.each do |software| - if !@public_software_selected || software.public_software? - filtered_community_list << software.community unless software.community.nil? - end - end - filtered_community_list - end - - def sort_communities_list communities_list - communities_list.sort! {|a, b| a.name.downcase <=> b.name.downcase} - - if params[:sort] && params[:sort] == "desc" - communities_list.reverse! - elsif params[:sort] && params[:sort] == "relevance" - communities_list = sort_by_relevance(communities_list, params[:query]){ |community| [community.software_info.finality, community.name] } - end - communities_list - end - - def prepare_software_search_page - prepare_software_infos_params - prepare_software_infos_message - prepare_software_infos_category_groups - prepare_software_infos_category_enable - end - - def prepare_software_infos_params - @titles[:software_infos] = _("Result Search") - @selected_categories_id = params[:selected_categories_id] - @selected_categories_id ||= [] - @selected_categories_id = @selected_categories_id.map(&:to_i) - @all_selected = params[:software_type] == "all" - @public_software_selected = !@all_selected - @per_page = prepare_per_page - end - - def prepare_per_page - return 15 if params[:software_display].nil? - - if params[:software_display] == "all" - SoftwareInfo.count - else - params[:software_display].to_i - end - end - - def prepare_software_infos_message - @message_selected_options = "" - - @selected_categories = [] - unless @selected_categories_id.empty? - @message_selected_options = _("Selected options: ") - - @selected_categories = Category.find(@selected_categories_id) - @message_selected_options += @selected_categories.collect { |category| - "#{category.name}; " - }.join() - end - end - - def prepare_software_infos_category_groups - @categories = Category.software_categories.sort{|a, b| a.name <=> b.name} - end - - def prepare_software_infos_category_enable - @enabled_check_box = Hash.new - categories = Category.software_categories - - categories.each do |category| - if category.software_infos.count > 0 - @enabled_check_box[category] = :enabled - else - @enabled_check_box[category] = :disabled - end - end - end -end diff --git a/lib/ext/search_helper.rb b/lib/ext/search_helper.rb deleted file mode 100644 index 025a3b8..0000000 --- a/lib/ext/search_helper.rb +++ /dev/null @@ -1,33 +0,0 @@ -require_dependency 'search_helper' - -module SearchHelper - - COMMON_PROFILE_LIST_BLOCK ||= [] - COMMON_PROFILE_LIST_BLOCK << :software_infos - - def sort_by_relevance list, text - text_splited = text.split - - element_relevance = {} - - list.each do |element| - relevance = 1 - relevance_list = yield(element) - - text_splited.each do |t| - relevance_list.count.times do |i| - relevance = -1 * i if relevance_list[i].downcase.include?(t.downcase) - end - end - - element_relevance[element] = relevance - end - - list.sort! do |a, b| - element_relevance[a] <=> element_relevance[b] - end - - list - end - -end diff --git a/lib/library.rb b/lib/library.rb deleted file mode 100644 index d4b2b56..0000000 --- a/lib/library.rb +++ /dev/null @@ -1,10 +0,0 @@ -class Library < ActiveRecord::Base - attr_accessible :name, :version, :license, :software_info_id - - validates :name, :version, :license, - presence: { message: _("can't be blank") }, - length: { - maximum: 20, - too_long: _("Too long (maximum is 20 characters)") - } -end diff --git a/lib/library_helper.rb b/lib/library_helper.rb deleted file mode 100644 index dfb0953..0000000 --- a/lib/library_helper.rb +++ /dev/null @@ -1,62 +0,0 @@ -class LibraryHelper < DynamicTableHelper - MODEL_NAME = "library" - - def self.list_library new_libraries - return [] if new_libraries.nil? or new_libraries.length == 0 - list_libraries = [] - - new_libraries.each do |new_library| - unless SoftwareHelper.all_table_is_empty? new_library - library = Library.new - library.name = new_library[:name] - library.version = new_library[:version] - library.license = new_library[:license] - list_libraries << library - end - end - - list_libraries - end - - def self.valid_list_library? list_libraries - return true if list_libraries.nil? or list_libraries.length == 0 - - list_libraries.each do |library| - return false unless library.valid? - end - - true - end - - def self.libraries_as_tables list_libraries, disabled=false - model_list = list_libraries - model_list ||= [{:name=>"", :version=>"", :license=>""}] - - models_as_tables model_list, "library_html_structure", disabled - end - - def self.library_html_structure library_data, disabled - data = { - model_name: MODEL_NAME, - name: { - value: library_data[:name], - hidden: false, - autocomplete: false, - select_field: false - }, - version: { - value: library_data[:version], - delete: false - }, - license: { - value: library_data[:license] - } - } - - table_html_structure(data, disabled) - end - - def self.add_dynamic_table - libraries_as_tables(nil).first.call - end -end \ No newline at end of file diff --git a/lib/license_helper.rb b/lib/license_helper.rb deleted file mode 100644 index af390cb..0000000 --- a/lib/license_helper.rb +++ /dev/null @@ -1,5 +0,0 @@ -module LicenseHelper - def self.getListLicenses - LicenseInfo.all - end -end \ No newline at end of file diff --git a/lib/license_info.rb b/lib/license_info.rb deleted file mode 100644 index 6f9bfe7..0000000 --- a/lib/license_info.rb +++ /dev/null @@ -1,8 +0,0 @@ -class LicenseInfo < ActiveRecord::Base - attr_accessible :version, :link - - validates_presence_of :version - - has_many :software_info - -end diff --git a/lib/operating_system.rb b/lib/operating_system.rb deleted file mode 100644 index b2763e9..0000000 --- a/lib/operating_system.rb +++ /dev/null @@ -1,14 +0,0 @@ -class OperatingSystem < ActiveRecord::Base - attr_accessible :version - - belongs_to :software_info - belongs_to :operating_system_name - - validates :operating_system_name, presence: true - validates :version, - presence: true, - length: { - maximum: 20, - too_long: _('too long (maximum is 20 characters)') - } -end diff --git a/lib/operating_system_helper.rb b/lib/operating_system_helper.rb deleted file mode 100644 index d5bd9a9..0000000 --- a/lib/operating_system_helper.rb +++ /dev/null @@ -1,71 +0,0 @@ -class OperatingSystemHelper < DynamicTableHelper - MODEL_NAME = "operating_system" - FIELD_NAME = "operating_system_name_id" - - def self.list_operating_system new_operating_systems - return [] if new_operating_systems.nil? or new_operating_systems.length == 0 - list_operating_system = [] - - new_operating_systems.each do |new_operating_system| - unless SoftwareHelper.all_table_is_empty?( - new_operating_system, - ["operating_system_name_id"] - ) - - operating_system = OperatingSystem.new - operating_system.operating_system_name = OperatingSystemName.find( - new_operating_system[:operating_system_name_id] - ) - - operating_system.version = new_operating_system[:version] - list_operating_system << operating_system - end - end - list_operating_system - end - - def self.valid_list_operating_system? list_operating_system - return !(list_operating_system.nil? || list_operating_system.length == 0) - - list_operating_system.each do |operating_system| - return false unless operating_system.valid? - end - true - end - - def self.operating_system_as_tables(list_operating_system, disabled=false) - model_list = list_operating_system - model_list ||= [{:operating_system_name_id => "", :version => ""}] - - models_as_tables model_list, "operating_system_html_structure", disabled - end - - def self.operating_system_html_structure (operating_system_data, disabled) - select_options = options_for_select( - OperatingSystemName.all.collect {|osn| [osn.name, osn.id]}, - operating_system_data[:operating_system_name_id] - ) - - data = { - model_name: MODEL_NAME, - field_name: FIELD_NAME, - name: { - hidden: false, - autocomplete: false, - select_field: true, - options: select_options - }, - version: { - value: operating_system_data[:version], - hidden: true, - delete: true - } - } - DATA[:license].delete(:value) - table_html_structure(data, disabled) - end - - def self.add_dynamic_table - operating_system_as_tables(nil).first.call - end -end diff --git a/lib/operating_system_name.rb b/lib/operating_system_name.rb deleted file mode 100644 index cc59602..0000000 --- a/lib/operating_system_name.rb +++ /dev/null @@ -1,10 +0,0 @@ -class OperatingSystemName < ActiveRecord::Base - attr_accessible :name - - validates_presence_of :name - validates_uniqueness_of :name - - has_many :operating_systems - has_many :software_infos, :through => :operating_systems - -end diff --git a/lib/programming_language.rb b/lib/programming_language.rb deleted file mode 100644 index 193225c..0000000 --- a/lib/programming_language.rb +++ /dev/null @@ -1,15 +0,0 @@ -class ProgrammingLanguage < ActiveRecord::Base - - SEARCHABLE_SOFTWARE_FIELDS = { - :name => 1 - } - - attr_accessible :name - - validates_presence_of :name - validates_uniqueness_of :name - - has_many :software_languages - has_many :software_infos, :through => :software_languages - -end diff --git a/lib/repository_block.rb b/lib/repository_block.rb deleted file mode 100644 index 483da7a..0000000 --- a/lib/repository_block.rb +++ /dev/null @@ -1,29 +0,0 @@ -class RepositoryBlock < Block - - attr_accessible :show_name - - settings_items :show_name, :type => :boolean, :default => false - - def self.description - _('Repository Link') - end - - def help - _('This block displays the repository link of a software.') - end - - def content(args={}) - block = self - s = show_name - lambda do |object| - render( - :file => 'blocks/repository', - :locals => { :block => block, :show_name => s } - ) - end - end - - def cacheable? - false - end -end diff --git a/lib/search_catalog_block.rb b/lib/search_catalog_block.rb deleted file mode 100644 index 4f7b517..0000000 --- a/lib/search_catalog_block.rb +++ /dev/null @@ -1,29 +0,0 @@ -class SearchCatalogBlock < Block - - attr_accessible :show_name - - settings_items :show_name, :type => :boolean, :default => false - - def self.description - _('Search Softwares catalog') - end - - def help - _('This block displays the search categories field ') - end - - def content(args={}) - block = self - s = show_name - lambda do |object| - render( - :file => 'blocks/search_catalog', - :locals => { :block => block, :show_name => s } - ) - end - end - - def cacheable? - false - end -end diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb deleted file mode 100644 index d11c176..0000000 --- a/lib/software_communities_plugin.rb +++ /dev/null @@ -1,164 +0,0 @@ -class SoftwareCommunitiesPlugin < Noosfero::Plugin - include ActionView::Helpers::TagHelper - include ActionView::Helpers::FormTagHelper - include ActionView::Helpers::FormOptionsHelper - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::AssetTagHelper - include FormsHelper - include ActionView::Helpers - include ActionDispatch::Routing - include Rails.application.routes.url_helpers - - def self.plugin_name - 'SoftwareCommunitiesPlugin' - end - - def self.plugin_description - _('Add Public Software and MPOG features.') - end - - def profile_tabs - if context.profile.community? - return profile_tabs_software if context.profile.software? - end - end - - def control_panel_buttons - if context.profile.software? - return software_info_button - elsif context.profile.person? - return create_new_software_button - end - end - - def self.extra_blocks - { - SoftwaresBlock => { :type => [Environment, Person] }, - SoftwareInformationBlock => { :type => [Community] }, - DownloadBlock => { :type => [Community] }, - RepositoryBlock => { :type => [Community] }, - CategoriesAndTagsBlock => { :type => [Community] }, - CategoriesSoftwareBlock => { :type => [Environment] }, - SearchCatalogBlock => { :type => [Environment] }, - SoftwareHighlightsBlock => { :type => [Environment] }, - SoftwareTabDataBlock => {:type => [Community], :position => 1}, - WikiBlock => {:type => [Community]}, - StatisticBlock => { :type => [Community] } - } - end - - def stylesheet? - true - end - - def js_files - %w( - vendor/jquery.maskedinput.min.js - vendor/modulejs-1.5.0.min.js - vendor/jquery.js - lib/noosfero-root.js - lib/select-element.js - 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/search-software-catalog.js - views/profile-tabs-software.js - views/new-community.js - views/comments-software-extra-fields.js - blocks/software-download.js - initializer.js - app.js - ) - end - - module Hotspots - def display_organization_average_rating organization - nil - end - end - - def organization_ratings_plugin_comments_extra_fields - if context.profile.software? - Proc::new { render :file => 'comments_extra_fields' } - end - end - - def organization_ratings_plugin_star_message - Proc::new do _("Rate this software") end - end - - def organization_ratings_title - title = _('Use reports') - Proc::new do "

#{title}

" end - end - - def organization_ratings_plugin_extra_fields_show_data user_rating - Proc::new { - if logged_in? - is_admin = environment.admins.include?(current_user.person) - is_admin ||= user_rating.organization.admins.include?(current_user.person) - - if is_admin and profile.software? - - render :file => 'organization_ratings_extra_fields_show_data', - :locals => {:user_rating => user_rating} - end - end - } - end - - # FIXME - if in error log apears has_permission?, try to use this method - def has_permission?(person, permission, target) - person.has_permission_without_plugins?(permission, target) - end - - protected - - def software_info_transaction - SoftwareInfo.transaction do - context.profile. - software_info. - update_attributes!(context.params[:software_info]) - end - end - - def license_transaction - license = LicenseInfo.find(context.params[:version]) - context.profile.software_info.license_info = license - context.profile.software_info.save! - end - - private - - def software_info_button - { - :title => _('Software Info'), - :icon => 'edit-profile-group control-panel-software-link', - :url => { - :controller => 'software_communities_plugin_myprofile', - :action => 'edit_software' - } - } - end - - def create_new_software_button - { - :title => _('Create a new software'), - :icon => 'design-editor', - :url => { - :controller => 'software_communities_plugin_myprofile', - :action => 'new_software' - } - } - end - - def profile_tabs_software - { :title => _('Software'), - :id => 'software-fields', - :content => Proc::new do render :partial => 'profile/software_tab' end, - :start => true } - end -end diff --git a/lib/software_database.rb b/lib/software_database.rb deleted file mode 100644 index 6c7911f..0000000 --- a/lib/software_database.rb +++ /dev/null @@ -1,20 +0,0 @@ -class SoftwareDatabase < ActiveRecord::Base - attr_accessible :version - - belongs_to :software_info - belongs_to :database_description - - validates_presence_of :database_description_id, :version - - validates_length_of( - :version, - :maximum => 20, - :too_long => _("Software database is too long (maximum is 20 characters)") - ) - - validates( - :database_description_id, - :numericality => {:greater_than_or_equal_to => 1} - ) - -end diff --git a/lib/software_helper.rb b/lib/software_helper.rb deleted file mode 100644 index a406c64..0000000 --- a/lib/software_helper.rb +++ /dev/null @@ -1,44 +0,0 @@ -module SoftwareHelper - def self.select_options programming_languages, selected = 0 - value = "" - - programming_languages.each do |language| - selected = selected == language.id ? 'selected' : '' - value += "" - end - - value - end - - def self.create_list_with_file file_name, model - list_file = File.open file_name, "r" - - list_file.each_line do |line| - model.create(:name=>line.strip) - end - - list_file.close - end - - def self.all_table_is_empty? table, ignored_fields=[] - filled_fields = [] - - table.each do |key, value| - unless ignored_fields.include? key - filled_fields << if value.empty? - false - else - true - end - end - end - - if filled_fields.include? true - false - else - true - end - end -end diff --git a/lib/software_highlights_block.rb b/lib/software_highlights_block.rb deleted file mode 100644 index a8b2a1c..0000000 --- a/lib/software_highlights_block.rb +++ /dev/null @@ -1,20 +0,0 @@ -class SoftwareHighlightsBlock < HighlightsBlock - - def self.description - _('Software Highlights Block') - end - - def help - _('This block displays the softwares icon into a highlight') - end - - def content(args={}) - softwares = self.settings[:images].collect {|h| h[:address].split('/').last} - block = self - proc do - render :file => 'blocks/software_highlights', :locals => { :block => block, :softwares => softwares} - end - end - - -end diff --git a/lib/software_info.rb b/lib/software_info.rb deleted file mode 100644 index ffe5364..0000000 --- a/lib/software_info.rb +++ /dev/null @@ -1,261 +0,0 @@ -class SoftwareInfo < ActiveRecord::Base - acts_as_having_settings :field => :settings - - SEARCHABLE_SOFTWARE_FIELDS = { - :acronym => 1, - :finality => 2, - } - - SEARCHABLE_SOFTWARE_CLASSES = [ - SoftwareInfo, - Community, - ProgrammingLanguage, - DatabaseDescription - ] - - scope :search_by_query, lambda { |query = ""| - filtered_query = query.gsub(/[\|\(\)\\\/\s\[\]'"*%&!:]/,' ').split.map{|w| w += ":*"}.join('|') - search_fields = SoftwareInfo.pg_search_plugin_fields - - if query.empty? - SoftwareInfo.joins(:community).where("profiles.visible = ?", true) - else - searchable_software_objects = SoftwareInfo.transform_list_in_methods_list(SEARCHABLE_SOFTWARE_CLASSES) - includes(searchable_software_objects).where("to_tsvector('simple', #{search_fields}) @@ to_tsquery('#{filtered_query}')").where("profiles.visible = ?", true) - end - } - - def self.transform_list_in_methods_list list - methods_list = [] - - list.each do |element| - if SoftwareInfo.instance_methods.include?(element.to_s.underscore.to_sym) - methods_list << element.to_s.underscore.to_sym - elsif SoftwareInfo.instance_methods.include?(element.to_s.underscore.pluralize.to_sym) - methods_list << element.to_s.underscore.pluralize.to_sym - end - end - - methods_list - end - - def self.pg_search_plugin_fields - SEARCHABLE_SOFTWARE_CLASSES.collect { |one_class| - self.get_searchable_fields(one_class) - }.join(" || ' ' || ") - end - - def self.get_searchable_fields one_class - searchable_fields = one_class::SEARCHABLE_SOFTWARE_FIELDS.keys.map(&:to_s).sort.map {|f| "coalesce(#{one_class.table_name}.#{f}, '')"}.join(" || ' ' || ") - searchable_fields - end - - SEARCH_FILTERS = { - :order => %w[], - :display => %w[full] - } - - def self.default_search_display - 'full' - end - - attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, - :operating_platform - - attr_accessible :demonstration_url, :acronym, :objectives, :features, - :license_info - - attr_accessible :community_id, :finality, :repository_link, :public_software, - :first_edit - - has_many :libraries, :dependent => :destroy - has_many :software_databases - has_many :database_descriptions, :through => :software_databases - has_many :software_languages - has_many :operating_systems - has_many :programming_languages, :through => :software_languages - has_many :operating_system_names, :through => :operating_systems - - belongs_to :community, :dependent => :destroy - belongs_to :license_info - - has_one :software_categories - - validates_length_of :finality, :maximum => 120 - validates_length_of :objectives, :maximum => 4000 - validates_length_of :features, :maximum => 4000 - validates_presence_of :finality - - validate :validate_acronym - - settings_items :another_license_version, :another_license_link - - # used on find_by_contents - scope :like_search, lambda{ |name| - joins(:community).where( - "name ILIKE ? OR acronym ILIKE ? OR finality ILIKE ?", - "%#{name}%", "%#{name}%", "%#{name}%" - ) - } - - scope :search, lambda { |name="", database_description_id = "", - programming_language_id = "", operating_system_name_id = "", - license_info_id = "", e_ping = "", e_mag = "", internacionalizable = "", - icp_brasil = "", e_arq = "", software_categories = "" | - - like_sql = "" - values = [] - - unless name.blank? - like_sql << "name ILIKE ? OR identifier ILIKE ? AND " - values << "%#{name}%" << "%#{name}%" - end - - like_sql = like_sql[0..like_sql.length-5] - - { - :joins => [:community], - :conditions=>[like_sql, *values] - } - } - - def license_info - license = LicenseInfo.find_by_id self.license_info_id - license_another = LicenseInfo.find_by_version("Another") - - if license_another && license.id == license_another.id - LicenseInfo.new( - :version => self.another_license_version, - :link => self.another_license_link - ) - else - license - end - end - - def another_license(version, link) - license_another = LicenseInfo.find_by_version("Another") - - if license_another - self.another_license_version = version - self.another_license_link = link - self.license_info = license_another - self.save! - end - end - - def validate_name_lenght - if self.community.name.size > 100 - self.errors.add( - :base, - _("Name is too long (maximum is %{count} characters)") - ) - false - end - true - end - - # if create_after_moderation receive a model object, would be possible to reuse core method - def self.create_after_moderation(requestor, attributes = {}) - environment = attributes.delete(:environment) - name = attributes.delete(:name) - identifier = attributes.delete(:identifier) - image_builder = attributes.delete(:image_builder) - license_info = attributes.delete(:license_info) - another_license_version = attributes.delete(:another_license_version) - another_license_link = attributes.delete(:another_license_link) - - software_info = SoftwareInfo.new(attributes) - if !environment.admins.include? requestor - CreateSoftware.create!( - attributes.merge( - :requestor => requestor, - :environment => environment, - :name => name, - :license_info => license_info - ) - ) - else - software_template = Community["software"] - - community_hash = {:name => name} - community_hash[:identifier] = identifier - community_hash[:image_builder] = image_builder if image_builder - - community = Community.new(community_hash) - community.environment = environment - - if (!software_template.blank? && software_template.is_template) - community.template_id = software_template.id - end - - software_info.license_info = license_info - software_info.save - community.software_info = software_info - community.save! - community.add_admin(requestor) - end - - software_info.verify_license_info(another_license_version, another_license_link) - software_info.save! - software_info - end - - def verify_license_info another_license_version, another_license_link - license_another = LicenseInfo.find_by_version("Another") - - if license_another && self.license_info_id == license_another.id - version = another_license_version - link = another_license_link - - self.another_license(version, link) - end - end - - - def validate_acronym - self.acronym = "" if self.acronym.nil? - if self.acronym.length > 10 && self.errors.messages[:acronym].nil? - self.errors.add(:acronym, _("can't have more than 10 characteres")) - false - elsif self.acronym.match(/\s+/) - self.errors.add(:acronym, _("can't have whitespaces")) - false - end - true - end - - def valid_operating_systems - if self.operating_systems.empty? - self.errors.add(:operating_system, _(": at least one must be filled")) - end - end - - def valid_software_info - if self.software_languages.empty? - self.errors.add(:software_languages, _(": at least one must be filled")) - end - end - - def valid_databases - if self.software_databases.empty? - self.errors.add(:software_databases, _(": at least one must be filled")) - end - end - - def visible? - self.community.visible? - end - - def name - self.community.name - end - - def short_name - self.community.short_name - end - - def identifier - self.community.identifier - end -end diff --git a/lib/software_information_block.rb b/lib/software_information_block.rb deleted file mode 100644 index a398c96..0000000 --- a/lib/software_information_block.rb +++ /dev/null @@ -1,37 +0,0 @@ -class SoftwareInformationBlock < Block - - attr_accessible :show_name - - settings_items :show_name, :type => :boolean, :default => false - - def self.description - _('Basic Software Information') - end - - def help - _('This block displays the basic information of a software profile.') - end - - def content(args={}) - block = self - s = show_name - - lambda do |object| - render( - :file => 'blocks/software_information', - :locals => { :block => block, :show_name => s} - ) - end - end - - def cacheable? - false - end - - private - - def owner_has_ratings? - ratings = CommunityRating.where(community_id: block.owner.id) - !ratings.empty? - end -end diff --git a/lib/software_language.rb b/lib/software_language.rb deleted file mode 100644 index 29f23c4..0000000 --- a/lib/software_language.rb +++ /dev/null @@ -1,14 +0,0 @@ -class SoftwareLanguage < ActiveRecord::Base - attr_accessible :version - - belongs_to :software_info - belongs_to :programming_language - - validates_length_of( - :version, - :maximum => 20, - :too_long => _("Software language is too long (maximum is 20 characters)") - ) - - validates_presence_of :version,:programming_language -end diff --git a/lib/software_language_helper.rb b/lib/software_language_helper.rb deleted file mode 100644 index 296088d..0000000 --- a/lib/software_language_helper.rb +++ /dev/null @@ -1,85 +0,0 @@ -class SoftwareLanguageHelper < DynamicTableHelper - MODEL_NAME ="language" - FIELD_NAME = "programming_language_id" - - def self.valid_language? language - return false if SoftwareHelper.all_table_is_empty?(language) - - programming_language_id_list = ProgrammingLanguage. - select(:id). - collect { |dd| dd.id } - - return programming_language_id_list.include?( - language[:programming_language_id].to_i - ) - end - - def self.list_language new_languages - return [] if new_languages.nil? or new_languages.length == 0 - list_languages = [] - - new_languages.each do |new_language| - if valid_language? new_language - language = SoftwareLanguage.new - language.programming_language = - ProgrammingLanguage.find(new_language[:programming_language_id]) - language.version = new_language[:version] - list_languages << language - end - end - - list_languages - end - - def self.valid_list_language? list_languages - return false if list_languages.nil? or list_languages.length == 0 - - list_languages.each do |language| - return false unless language.valid? - end - - true - end - - def self.language_as_tables(list_languages, disabled=false) - model_list = list_languages - model_list ||= [{:programming_language_id => "", :version => ""}] - - models_as_tables model_list, "language_html_structure", disabled - end - - def self.language_html_structure(language_data, disabled) - language_id = language_data[:programming_language_id] - language_name = if language_data[:programming_language_id].blank? - "" - else - ProgrammingLanguage.find( - language_data[:programming_language_id], - :select=>"name" - ).name - end - - data = { - model_name: MODEL_NAME, - field_name: FIELD_NAME, - name: { - value: language_name, - id: language_id, - hidden: true, - autocomplete: true, - select_field: false - }, - version: { - value: language_data[:version], - hidden: true, - delete: true - } - } - DATA[:license].delete(:value) - table_html_structure(data, disabled) - end - - def self.add_dynamic_table - language_as_tables(nil).first.call - end -end diff --git a/lib/software_tab_data_block.rb b/lib/software_tab_data_block.rb deleted file mode 100644 index b32eeb5..0000000 --- a/lib/software_tab_data_block.rb +++ /dev/null @@ -1,48 +0,0 @@ -class SoftwareTabDataBlock < Block - attr_accessible :show_name, :displayed_blog - - settings_items :show_name, :type => :boolean, :default => false - settings_items :displayed_blog, :type => :integer, :default => 0 - - TOTAL_POSTS_DYSPLAYED = 5 - - def self.description - _('Software Tab Data') - end - - def help - _('This block is used by colab to insert data into Noosfero') - end - - def content(args={}) - block = self - - lambda do |object| - render( - :file => 'blocks/software_tab_data', - :locals => { - :block => block - } - ) - end - end - - def blogs - self.owner.blogs - end - - def actual_blog - # As :displayed_blog default value is 0, it falls to the first one - blogs.find_by_id(self.displayed_blog) || blogs.first - end - - def posts - blog = actual_blog - - if blog and (not blog.posts.empty?) - blog.posts.limit(TOTAL_POSTS_DYSPLAYED) - else - [] - end - end -end diff --git a/lib/softwares_block.rb b/lib/softwares_block.rb deleted file mode 100644 index 067345a..0000000 --- a/lib/softwares_block.rb +++ /dev/null @@ -1,105 +0,0 @@ -class SoftwaresBlock < CommunitiesBlock - - settings_items :software_type, :default => "All" - attr_accessible :accessor_id, :accessor_type, :role_id, - :resource_id, :resource_type, :software_type - - def self.description - _('Softwares') - end - - def default_title - if self.software_type == "Generic" - return n_('{#} generic software', '{#} generic softwares', profile_count) - elsif self.software_type == "Public" - return n_('{#} public software', '{#} public softwares', profile_count) - else - return n_('{#} software', '{#} softwares', profile_count) - end - end - - def help - _('This block displays the softwares in which the user is a member.') - end - - def footer - self.software_type ||= "All" - owner = self.owner - case owner - when Profile - lambda do |context| - link_to s_('softwares|View all'), :profile => owner.identifier, - :controller => 'profile', :action => 'communities', - :type => 'Software' - end - when Environment - lambda do |context| - link_to s_('softwares|View all'), :controller => 'search', - :action => 'software_infos' - end - else - '' - end - end - - def profile_count - profile_list.count - end - - def profiles - owner.communities - end - - def profile_list - profiles = get_visible_profiles - - software_profiles = profiles.select do |profile| - profile.class == Community && profile.software? - end - - block_softwares = if self.software_type == "Public" - software_profiles.select { |profile| profile.software_info.public_software? } - elsif self.software_type == "Generic" - software_profiles.select { |profile| !profile.software_info.public_software? } - else # All - software_profiles - end - - block_softwares.slice(0..get_limit-1) - end - - def content(arg={}) - if self.box.owner_type == "Environment" && self.box.position == 1 - block = self - - proc do - render :file => 'blocks/main_area_softwares', - :locals => {:profiles=> block.profile_list(), :block => block} - end - else - super(arg) - end - end - - protected - - def get_visible_profiles - profile_include_list = [:image, :domains, :preferred_domain, :environment] - visible_profiles = profiles.visible.includes(profile_include_list) - - if !prioritize_profiles_with_image - visible_profiles.all( :limit => get_limit, - :order => 'profiles.updated_at DESC' - ).sort_by{ rand } - elsif profiles.visible.with_image.count >= get_limit - visible_profiles.with_image.all( :limit => get_limit * 5, - :order => 'profiles.updated_at DESC' - ).sort_by{ rand } - else - visible_profiles.with_image.sort_by{ rand } + - visible_profiles.without_image.all( :limit => get_limit * 5, - :order => 'profiles.updated_at DESC' - ).sort_by{ rand } - end - end -end diff --git a/lib/statistic_block.rb b/lib/statistic_block.rb deleted file mode 100644 index fd45f4f..0000000 --- a/lib/statistic_block.rb +++ /dev/null @@ -1,52 +0,0 @@ -class StatisticBlock < Block - - settings_items :benefited_people, :type => :integer, :default => 0 - settings_items :saved_resources, :type => :float, :default => 0.0 - - attr_accessible :benefited_people, :saved_resources - - def self.description - _('Software Statistics') - end - - def help - _('This block displays software statistics.') - end - - def content(args={}) - download_blocks = get_profile_download_blocks(self.owner) - downloads = download_blocks.map do |download_block| - get_downloads_from_block(download_block) - end - - block = self - - lambda do |object| - render( - :file => 'blocks/software_statistics', - :locals => { - :block => block, - :total_downloads => downloads.sum - } - ) - end - end - - def cacheable? - false - end - - private - - def get_profile_download_blocks profile - DownloadBlock.joins(:box).where("boxes.owner_id = ?", profile.id) - end - - def get_downloads_from_block download_block - downloads = download_block.downloads.map do |download| - download[:total_downloads] unless download[:total_downloads].nil? - end - downloads.select! {|value| not value.nil? } - downloads.sum - end -end diff --git a/lib/tasks/create_categories.rake b/lib/tasks/create_categories.rake deleted file mode 100644 index 29a1cf9..0000000 --- a/lib/tasks/create_categories.rake +++ /dev/null @@ -1,20 +0,0 @@ -namespace :software do - desc "Create software categories" - task :create_categories => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") - print 'Creating categories: ' - software = Category.create(:name => _("Software"), :environment => env) - Category::SOFTWARE_CATEGORIES.each do |category_name| - unless Category.find_by_name(category_name) - print '.' - Category.create(:name => category_name, :environment => env, :parent => software) - else - print 'F' - end - end - puts '' - end - end - end -end diff --git a/lib/tasks/create_licenses.rake b/lib/tasks/create_licenses.rake deleted file mode 100644 index 3df7c30..0000000 --- a/lib/tasks/create_licenses.rake +++ /dev/null @@ -1,42 +0,0 @@ -namespace :software do - desc "Create software licences" - - task :create_licenses => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") - list_file = File.open "plugins/software_communities/public/static/licences.txt", "r" - - version_or_link = 'version' - can_save = true - licence = nil - - print 'Creating Licenses: ' - list_file.each_line do |line| - data = line.strip - - if data.length != 0 - if version_or_link == 'version' - can_save = LicenseInfo.find_by_version(data) ? false : true - licence = LicenseInfo::new :version => data - version_or_link = 'link' - elsif version_or_link == 'link' - licence.link = data - - if can_save - licence.save! - print '.' - else - print 'F' - end - - version_or_link = 'version' - end - end - end - puts '' - - list_file.close - end - end - end -end diff --git a/lib/tasks/create_sample_softwares.rake b/lib/tasks/create_sample_softwares.rake deleted file mode 100644 index 1cd00cf..0000000 --- a/lib/tasks/create_sample_softwares.rake +++ /dev/null @@ -1,71 +0,0 @@ -NUMBER_OF_SOFTWARES = 10 - -namespace :software do - desc "Create sample softwares" - task :create_sample_softwares => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") - print "Creating softwares: " - - NUMBER_OF_SOFTWARES.times do |i| - number = i < 10 ? "0#{i}" : "#{i}" - software_name = "Software #{number}" - create_software_info(software_name) - end - - create_software_info("Ubuntu") - create_software_info("Debian") - create_software_info("Windows XP") - create_software_info("Windows Vista") - create_software_info("Windows 7") - create_software_info("Windows 8") - create_software_info("Disk Operating System", "DOS") - create_software_info("Sublime") - create_software_info("Vi IMproved", "Vim") - create_software_info("Nano") - create_software_info("Gedit") - create_software_info("Firefox") - create_software_info("InkScape") - create_software_info("Eclipse") - create_software_info("LibreOffice") - create_software_info("Tetris") - create_software_info("Mario") - create_software_info("Pong") - create_software_info("Sonic") - create_software_info("Astah") - create_software_info("Pokemom Red") - create_software_info("Mass Effect") - create_software_info("Deus EX") - create_software_info("Dragon Age") - - puts "" - end - end - end -end - -def create_community(name) - community = Community.new - community.name = name - community.save - community -end - -def create_software_info(name, acronym = "", finality = "default") - community = create_community(name) - software_info = SoftwareInfo.new - software_info.community = community - software_info.public_software = true - software_info.acronym = acronym - software_info.finality = finality - software_info.license_info = LicenseInfo.first - - if software_info.community.valid? && software_info.valid? - print "." - software_info.save - software_info - else - print "F" - nil - end -end diff --git a/lib/tasks/export.rake b/lib/tasks/export.rake deleted file mode 100644 index 224ae25..0000000 --- a/lib/tasks/export.rake +++ /dev/null @@ -1,133 +0,0 @@ -require 'csv' - -namespace :export do - namespace :catalog do - desc "Export all softwares to CSV" - task :csv => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") - softwares_to_csv - categories_to_csv - software_categories_to_csv - - compress_files - end - end - end - end - - def softwares_to_csv - print "Exporting softwares to softwares.csv: " - - CSV.open('/tmp/softwares.csv', 'w') do |csv| - csv << [ - "id", - "community_id", - "identifier", - "name", - "finality", - "acronym", - "created_at", - "image_filename", - "home_page_name", - "home_page_slug", - "home_page_path", - "home_page_body", - "home_page_abstract", - "home_page_published_at" - ] - - SoftwareInfo.all.each do |software| - if software.community - begin - csv << [ - software.id, - software.community.id, - software.community.identifier, - software.community.name, - software.finality, - software.acronym, - software.community.created_at, - (software.community.image.nil? ? nil : software.community.image.filename), - (software.community.home_page.nil? ? nil : software.community.home_page.name), - (software.community.home_page.nil? ? nil : software.community.home_page.slug), - (software.community.home_page.nil? ? nil : software.community.home_page.path), - (software.community.home_page.nil? ? nil : software.community.home_page.body), - (software.community.home_page.nil? ? nil : software.community.home_page.abstract), - (software.community.home_page.nil? ? nil : software.community.home_page.published_at), - ] - - print '.' - rescue - print 'F' - end - end - end - end - - print "\n" - end - - def categories_to_csv - print "Exporting categories to categories.csv: " - - CSV.open('/tmp/categories.csv', 'w') do |csv| - csv << [ - "id", - "name", - "path", - ] - - Category.all.each do |category| - begin - csv << [ - category.id, - category.name, - category.path, - ] - - print '.' - rescue - print 'F' - end - end - end - - print "\n" - end - - def software_categories_to_csv - print "Exporting software and categories relation to software_categories.csv: " - CSV.open('/tmp/software_categories.csv', 'w') do |csv| - csv << [ - "software_id", - "category_id" - ] - - SoftwareInfo.all.each do |software| - if software.community - software.community.categories.each do |category| - begin - csv << [ - software.id, - category.id - ] - - print '.' - rescue - print 'F' - end - end - end - end - end - - print "\n" - end - - def compress_files - `cd /tmp/ && tar -zcvf software_catalog_csvs.tar.gz softwares.csv categories.csv software_categories.csv` - - `cd /tmp/ && rm softwares.csv categories.csv software_categories.csv` - end -end \ No newline at end of file diff --git a/lib/tasks/main_data.rake b/lib/tasks/main_data.rake deleted file mode 100644 index 793ec38..0000000 --- a/lib/tasks/main_data.rake +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/env ruby -# encoding: utf-8 - -namespace :main_data do - desc "Create the main community and its contents" - task :populate => :environment do - Rake::Task["templates:create:all"].invoke - Rake::Task["software:create_licenses"].invoke - Rake::Task["software:create_categories"].invoke - Rake::Task["software:create_sample_softwares"].invoke - end - - desc "Create the main community and its contents" - task :all => :environment do - Rake::Task["templates:destroy"].invoke - Rake::Task["main_data:populate"].invoke - end -end diff --git a/lib/tasks/templates.rake b/lib/tasks/templates.rake deleted file mode 100644 index 46ad264..0000000 --- a/lib/tasks/templates.rake +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/env ruby -# encoding: utf-8 - -namespace :templates do - namespace :create do - - desc "Create new templates of software, intitution, person and community" - task :all => :environment do - Rake::Task["templates:create:software"].invoke - end - - desc "Create new templates of software" - task :software => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") - software = Community["software"] - - if software.nil? - software = Community.create!(:name => "Software", :identifier => "software") - end - - software.layout_template = "default" - software.is_template = true - software.save! - - puts "Software Template successfully created!" - end - end - end - end - - desc "Destroy all templates created by this namespace" - task :destroy => :environment do - Environment.all.each do |env| - if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") - Community["software"].destroy unless Community["software"].nil? - puts "Software template destoyed with success!" - end - end - end - -end diff --git a/lib/wiki_block.rb b/lib/wiki_block.rb deleted file mode 100644 index 3d7da90..0000000 --- a/lib/wiki_block.rb +++ /dev/null @@ -1,30 +0,0 @@ -class WikiBlock < Block - - attr_accessible :show_name, :wiki_link - settings_items :show_name, :type => :boolean, :default => false - settings_items :wiki_link, :type => :string, :default => "" - - def self.description - _('Wiki Link') - end - - def help - _('This block displays a link to the software wiki.') - end - - def content(args={}) - block = self - s = show_name - - lambda do |object| - render( - :file => 'blocks/wiki', - :locals => { :block => block, :show_name => s } - ) - end - end - - def cacheable? - true - end -end diff --git a/po/pt/software_communities.po b/po/pt/software_communities.po deleted file mode 100644 index 037150c..0000000 --- a/po/pt/software_communities.po +++ /dev/null @@ -1,1361 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: 1.2.1+spb4-2-ged0502e\n" -"POT-Creation-Date: 2015-09-14 14:29-0300\n" -"PO-Revision-Date: 2014-11-12 13:05-0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: plugins/software_communities/lib/search_catalog_block.rb:8 -msgid "Search Softwares catalog" -msgstr "Busca do catálogo de software" - -#: plugins/software_communities/lib/search_catalog_block.rb:12 -msgid "This block displays the search categories field " -msgstr "Este bloco apresenta a busca do campo de categorias" - -#: plugins/software_communities/lib/ext/category.rb:5 -msgid "Agriculture, Fisheries and Extraction" -msgstr "Agricultura, Extrativismo e Pesca" - -#: plugins/software_communities/lib/ext/category.rb:6 -msgid "Science, Information and Communication" -msgstr "Ciência, Informação e Comunicação " - -#: plugins/software_communities/lib/ext/category.rb:7 -msgid "Economy and Finances" -msgstr "Economia e Finanças" - -#: plugins/software_communities/lib/ext/category.rb:8 -msgid "Public Administration" -msgstr "Gestão Pública" - -#: plugins/software_communities/lib/ext/category.rb:9 -msgid "Habitation, Sanitation and Urbanism" -msgstr "Habitação, Saneamento e Urbanismo" - -#: plugins/software_communities/lib/ext/category.rb:10 -msgid "Individual, Family and Society" -msgstr "Pessoa, Família e Sociedade " - -#: plugins/software_communities/lib/ext/category.rb:11 -msgid "Health" -msgstr "Saúde" - -#: plugins/software_communities/lib/ext/category.rb:12 -msgid "Social Welfare and Development" -msgstr "Bem-estar e Desenvolvimento Social" - -#: plugins/software_communities/lib/ext/category.rb:13 -msgid "Defense and Security" -msgstr "Defesa e Segurança" - -#: plugins/software_communities/lib/ext/category.rb:14 -msgid "Education" -msgstr "Educação" - -#: plugins/software_communities/lib/ext/category.rb:15 -msgid "Government and Politics" -msgstr "Governo e Política" - -#: plugins/software_communities/lib/ext/category.rb:16 -msgid "Justice and Legislation" -msgstr "Justiça e Legislação" - -#: plugins/software_communities/lib/ext/category.rb:17 -msgid "International Relationships" -msgstr "Relações Internacionais" - -#: plugins/software_communities/lib/ext/category.rb:18 -msgid "Transportation and Transit" -msgstr "Transporte e Trânsito" - -#: plugins/software_communities/lib/ext/search_controller.rb:118 -msgid "Result Search" -msgstr "Resultado da pesquisa" - -#: plugins/software_communities/lib/ext/search_controller.rb:142 -msgid "Selected options: " -msgstr "Opções selecionadas:" - -#: plugins/software_communities/lib/repository_block.rb:8 -msgid "Repository Link" -msgstr "Link para o Repositório" - -#: plugins/software_communities/lib/repository_block.rb:12 -msgid "This block displays the repository link of a software." -msgstr "Este bloco apresenta o link para o repositório do software." - -#: plugins/software_communities/lib/wiki_block.rb:8 -msgid "Wiki Link" -msgstr "Link da wiki" - -#: plugins/software_communities/lib/wiki_block.rb:12 -msgid "This block displays a link to the software wiki." -msgstr "Este bloco apresenta o link para a wiki do software." - -#: plugins/software_communities/lib/statistic_block.rb:9 -msgid "Software Statistics" -msgstr "Estastísticas de software" - -#: plugins/software_communities/lib/statistic_block.rb:13 -msgid "This block displays software statistics." -msgstr "Este bloco apresenta a estatística de software" - -#: plugins/software_communities/lib/library.rb:5 -msgid "can't be blank" -msgstr "não pode ficar em branco" - -#: plugins/software_communities/lib/library.rb:8 -msgid "Too long (maximum is 20 characters)" -msgstr "Muito grande(máximo é 20 caracteres" - -#: plugins/software_communities/lib/software_info.rb:151 -msgid "Name is too long (maximum is %{count} characters)" -msgstr "Nome é muito longo(máximo é %{count} caracteres)" - -#: plugins/software_communities/lib/software_info.rb:219 -msgid "can't have more than 10 characteres" -msgstr "não pode ter mais de 10 caracteres" - -#: plugins/software_communities/lib/software_info.rb:222 -msgid "can't have whitespaces" -msgstr "não pode ter espaços em branco" - -#: plugins/software_communities/lib/software_info.rb:230 -#: plugins/software_communities/lib/software_info.rb:236 -#: plugins/software_communities/lib/software_info.rb:242 -msgid ": at least one must be filled" -msgstr ": ao menos um deve ser preenchido" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:17 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:3 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:37 -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:3 -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:3 -msgid "Name" -msgstr "Nome" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:18 -msgid "Version" -msgstr "Versão" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:19 -#: plugins/software_communities/views/profile/_software_tab.html.erb:18 -msgid "License" -msgstr "Licença" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:91 -msgid "Autocomplete field, type something" -msgstr "Campo automático, digite algo" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:116 -#: plugins/software_communities/views/box_organizer/_download_list_template.html.erb:8 -#: plugins/software_communities/views/box_organizer/_download_list.html.erb:8 -msgid "Delete" -msgstr "Deletar" - -#: plugins/software_communities/lib/create_software.rb:36 -msgid "New software" -msgstr "Novo software" - -#: plugins/software_communities/lib/create_software.rb:44 -msgid "%{requestor} wants to create software %{subject} with" -msgstr "%{requestor} deseja criar o software %{subject} com" - -#: plugins/software_communities/lib/create_software.rb:46 -msgid " no finality." -msgstr " campo finalidade em branco." - -#: plugins/software_communities/lib/create_software.rb:48 -msgid " this finality:

%{finality}

" -msgstr " esta finalidade:

%{finality}

" - -#: plugins/software_communities/lib/create_software.rb:68 -msgid "%{requestor} wants to create software %{subject}" -msgstr "%{requestor} deseja criar o software %{subject}" - -#: plugins/software_communities/lib/create_software.rb:73 -msgid "" -"User \"%{user}\" just requested to create software %{software}.\n" -" You have to approve or reject it through the \"Pending Validations\"\n" -" section in your control panel.\n" -msgstr "" -"Usuário \"%{user}\" acabou de requisitar a criação do software %{software}.\n" -" Você deve aprovar ou rejeitar pela seção \"Tarefas pendentes\"\n" -" no seu painel de controle.\n" - -#: plugins/software_communities/lib/create_software.rb:80 -msgid "" -"Your request for registering software %{software} at %{environment} was\n" -" just sent. Environment administrator will receive it and will approve " -"or\n" -" reject your request according to his methods and criteria.\n" -"\n" -" You will be notified as soon as environment administrator has a " -"position\n" -" about your request." -msgstr "" -"O seu pedido para registrar o software %{software} no %{environment} foi\n" -" enviada. O administrador do ambiente irá recebe-la e aprovará ou rejeitará " -"seu pedido de acordo com seus métodos e critérios.\n" -"\n" -" Você será notificado assim que o administrador do ambiente tiver uma " -"resposta sobre o seu pedido." - -#: plugins/software_communities/lib/create_software.rb:90 -msgid "" -"Your request for registering software %{software} at %{environment} was\n" -" not approved by the environment administrator. The following " -"explanation\n" -" was given: \n" -"\n" -"%{explanation}" -msgstr "" -"Seu pedido para registro do software %{software} no %{environment} não " -"foi\n" -" aprovado pelo administrador do ambiente. A seguinte explicação\n" -" foi fornecida:\n" -"\n" -"%{explanation}" - -#: plugins/software_communities/lib/create_software.rb:99 -msgid "" -"Your request for registering the software \"%{software}\" was approved.\n" -" You can access %{url} and finish the registration of your software." -msgstr "" -"Seu pedido para registro do software %{software} foi aprovada.\n" -" Você pode acessar %{url} e finalizar o registro do seu software. " - -#: plugins/software_communities/lib/operating_system.rb:12 -msgid "too long (maximum is 20 characters)" -msgstr "muito longo(máximo é 20 caracteres)" - -#: plugins/software_communities/lib/software_highlights_block.rb:4 -msgid "Software Highlights Block" -msgstr "Bloco de software em destaque" - -#: plugins/software_communities/lib/software_highlights_block.rb:8 -msgid "This block displays the softwares icon into a highlight" -msgstr "Esse bloco apresenta o ícone do software em destaque" - -#: plugins/software_communities/lib/categories_software_block.rb:8 -msgid "Categories Softwares" -msgstr "Categorias de Softwares" - -#: plugins/software_communities/lib/categories_software_block.rb:12 -msgid "" -"This block displays the categories and the amount of softwares for\n" -" each category." -msgstr "" -"Este bloco apresenta as categorias e a quantidade de softwares para \n" -" cada categoria." - -#: plugins/software_communities/lib/softwares_block.rb:8 -msgid "Softwares" -msgstr "Softwares" - -#: plugins/software_communities/lib/softwares_block.rb:13 -msgid "{#} generic software" -msgid_plural "{#} generic softwares" -msgstr[0] "{#} software genérico" -msgstr[1] "{#} softwares genéricos" - -#: plugins/software_communities/lib/softwares_block.rb:15 -msgid "{#} public software" -msgid_plural "{#} public softwares" -msgstr[0] "{#} software público" -msgstr[1] "{#} software públicos" - -#: plugins/software_communities/lib/softwares_block.rb:17 -msgid "{#} software" -msgid_plural "{#} softwares" -msgstr[0] "{#} software" -msgstr[1] "{#} softwares" - -#: plugins/software_communities/lib/softwares_block.rb:22 -msgid "This block displays the softwares in which the user is a member." -msgstr "Este bloco apresenta os softwares em que o usuário é membro." - -#: plugins/software_communities/lib/softwares_block.rb:31 -#: plugins/software_communities/lib/softwares_block.rb:37 -msgid "softwares|View all" -msgstr "softwares|Veja todos" - -#: plugins/software_communities/lib/software_communities_plugin.rb:17 -msgid "Add Public Software and MPOG features." -msgstr "Adicionar Software Público e Funcionalidades." - -#: plugins/software_communities/lib/software_communities_plugin.rb:90 -msgid "Rate this software" -msgstr "Avalie esse software" - -#: plugins/software_communities/lib/software_communities_plugin.rb:94 -msgid "Use reports" -msgstr "Relatos de uso" - -#: plugins/software_communities/lib/software_communities_plugin.rb:138 -msgid "Software Info" -msgstr "Informação de Software" - -#: plugins/software_communities/lib/software_communities_plugin.rb:149 -msgid "Create a new software" -msgstr "Criar um novo software" - -#: plugins/software_communities/lib/software_communities_plugin.rb:159 -msgid "Software" -msgstr "Software" - -#: plugins/software_communities/lib/software_language.rb:10 -msgid "Software language is too long (maximum is 20 characters)" -msgstr "Linguagem do software está muito grande (máximo de 20 caracteres)" - -#: plugins/software_communities/lib/software_tab_data_block.rb:10 -msgid "Software Tab Data" -msgstr "Aba de dados do software" - -#: plugins/software_communities/lib/software_tab_data_block.rb:14 -msgid "This block is used by colab to insert data into Noosfero" -msgstr "Esse bloco é usado pelo Colab para inserir dados no noosfero" - -#: plugins/software_communities/lib/download_block.rb:15 -msgid "Download Stable Version" -msgstr "Baixar Versão Estável" - -#: plugins/software_communities/lib/download_block.rb:19 -msgid "This block displays the stable version of a software." -msgstr "Este block apresenta a versão estável do software." - -#: plugins/software_communities/lib/software_database.rb:12 -msgid "Software database is too long (maximum is 20 characters)" -msgstr "Banco de dados do software está muito grande(máximo é 20 caracteres)" - -#: plugins/software_communities/lib/software_information_block.rb:8 -msgid "Basic Software Information" -msgstr "Informação Básica do Software" - -#: plugins/software_communities/lib/software_information_block.rb:12 -msgid "This block displays the basic information of a software profile." -msgstr "Este bloco apresenta a informação básica de um perfil de software." - -#: plugins/software_communities/lib/categories_and_tags_block.rb:8 -msgid "Categories and Tags" -msgstr "Categorias e Marcadores" - -#: plugins/software_communities/lib/categories_and_tags_block.rb:12 -msgid "This block displays the categories and tags of a software." -msgstr "Este block apresenta as categorias e marcadores de um software." - -#: plugins/software_communities/test/unit/software_info_validation_test.rb:108 -msgid "Features is too long (maximum is 4000 characters)" -msgstr "Funcionalidades está muito grande(máximo é 4000 caracteres)" - -#: plugins/software_communities/test/unit/software_info_validation_test.rb:116 -msgid "Objectives is too long (maximum is 4000 characters)" -msgstr "Objetivo está muito grande (máximo é 4000 caracteres)" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:41 -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:19 -msgid "Save and Configure Community" -msgstr "Salvar e Configurar Comunidade" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:45 -msgid "Software updated successfully" -msgstr "Software atualizado com sucesso" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:49 -msgid "Could not update software" -msgstr "Não foi possível atualizar o software" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:130 -msgid "" -"Your new software request will be evaluated by anadministrator. You will be " -"notified." -msgstr "" -"Seu pedido para registro do software será avaliado por um administrador. " -"Você será notificado." - -#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:7 -msgid "Could not find the download file" -msgstr "Não foi possível encontrar o arquivo para download" - -#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:8 -msgid "Invalid download params" -msgstr "Parâmetros de Download inválidos" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:1 -msgid "General information" -msgstr "Informação geral" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:40 -msgid "Address" -msgstr "Endereço" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:46 -msgid "WARNING!" -msgstr "PERIGO!" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:47 -msgid "" -"You are about to change the address, and this will break external links to " -"the homepage or to content inside it. Do you really want to change?" -msgstr "" -"Você está prestes a mudar o endereço, e isso vai quebrar links externos para " -"a página inicial ou para o conteúdo dentro dela. Você realmente quer mudar?" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:49 -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 -#: plugins/software_communities/views/profile/_software_tab.html.erb:8 -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -msgid "Yes" -msgstr "Sim" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:50 -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 -#: plugins/software_communities/views/profile/_software_tab.html.erb:8 -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -msgid "No" -msgstr "Não" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:63 -msgid "Enable \"contact us\"" -msgstr "Habilitar \"entre em contato\"" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:68 -msgid "Products/Services catalog" -msgstr "Catálogo de Produtos/Serviços" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:69 -msgid "Number of products/services displayed per page on catalog" -msgstr "Número de produtos/serviços mostrado por página no catálogo" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:4 -msgid "Configure Software Community" -msgstr "Configurar Comunidade do Software" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:8 -msgid "Set the basic settings of the software associated community" -msgstr "Defina as configurações básicas da comunidade do software" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:18 -msgid "This profile is a template" -msgstr "Este perfil é um template" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:24 -msgid "Privacy options" -msgstr "Opções de privacidade" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:28 -msgid "Public — show my contents to all internet users" -msgstr "Público — mostrar meus conteúdos a todos os usuários na internet" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:31 -msgid "Private — show my contents only to friends" -msgstr "Privado — mostrar meus conteudos apenas aos amigos" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:35 -msgid "Public — show content of this group to all internet users" -msgstr "" -"Público — mostrar conteudos deste grupo a todos os usuários na internet" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:38 -msgid "Private — show content of this group only to members" -msgstr "Privado — mostrar meus conteudos deste grupo apenas aos membros" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:43 -msgid "Page to redirect after login" -msgstr "Página para redirecionar após o login" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:47 -msgid "Translations" -msgstr "Traduções" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:49 -msgid "" -"Automaticaly redirect the visitor to the article translated to his/her " -"language" -msgstr "" -"Redirecionar automaticamente o visitante para o artigo traduzido para sua " -"língua" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:53 -msgid "Suggestions" -msgstr "Sugestões" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:55 -msgid "Send me relationship suggestions by email" -msgstr "Envie-me sugestões de relacionamento por e-mail" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:65 -#: plugins/software_communities/views/search/_full_community.html.erb:27 -msgid "Software Categories" -msgstr "Categorias de Software" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:68 -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:18 -msgid "Save" -msgstr "Salvar" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:71 -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:20 -msgid "Back to control panel" -msgstr "Voltar para o painel de controle" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:77 -msgid "Delete software and community" -msgstr "Remover software e comunidade" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 -msgid "Deactivate software and community" -msgstr "Desativar software e comunidade" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 -msgid "Are you sure you want to deactivate this profile?" -msgstr "Tem certeza de que deseja desativar esse perfil?" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 -msgid "Activate software and community" -msgstr "Ativar software e comunidade" - -#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:3 -msgid "Step 1 - Software Creation" -msgstr "Passo 1 - Criação do Software" - -#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:7 -msgid "Step 2 - Community Settings" -msgstr "Passo 2 - Configuração da Comunidade" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:5 -msgid "Autocomplete field, type some license" -msgstr "Campo com auto completar, digite uma licença" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:8 -msgid "Read license" -msgstr "Ler licença" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:10 -#: plugins/software_communities/views/search/_software_search_form.html.erb:14 -msgid "Public Software" -msgstr "Software Público" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 -msgid "Public software" -msgstr "Software Público" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:12 -msgid "Adherent to e-PING ?" -msgstr "Aderente ao e-PING ?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:21 -msgid "Adherent to e-MAG ?" -msgstr "Aderente ao e-MAG ?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:30 -msgid "Adherent to ICP-Brasil ?" -msgstr "Aderente ao ICP-Brasil ?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:39 -msgid "Adherent to e-ARQ ?" -msgstr "Aderente ao e-ARQ ?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:48 -msgid "Internacionalizable ?" -msgstr "Internacionalizável ?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:59 -msgid "Operating Platform" -msgstr "Plataforma Operacional" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:64 -msgid "Features" -msgstr "Características" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:69 -msgid "Demonstration url" -msgstr "Url de demonstração" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:74 -#: plugins/software_communities/views/profile/_software_tab.html.erb:35 -msgid "Libraries" -msgstr "Bibliotecas" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:82 -msgid "Operating Systems" -msgstr "Sistemas Operacionais" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:90 -msgid "Programming languages" -msgstr "Linguagens de programação" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:97 -msgid "Databases" -msgstr "Banco de dados" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:1 -msgid "Edit Software" -msgstr "Editar Software" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:9 -msgid "Main Information" -msgstr "Informação" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:12 -msgid "Specifications" -msgstr "Especificações" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb:11 -msgid "New language" -msgstr "Nova linguagem" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb:11 -msgid "New Library" -msgstr "Nova Biblioteca" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb:11 -msgid "New Operating System" -msgstr "Novo Sistema Operacional" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb:11 -msgid "New Database" -msgstr "Novo Banco de Dados" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:8 -msgid "Short Name" -msgstr "Nome Curto" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:14 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:56 -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:10 -msgid "Finality" -msgstr "Finalidade" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:15 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:57 -msgid "What is the software for?" -msgstr "Para quê serve o software?" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:21 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:64 -msgid "Software Logo" -msgstr "Marca do Software" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 -msgid "Image:" -msgstr "Imagem:" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 -msgid "Max size: %s (.jpg, .gif, .png)" -msgstr "Tamanho máximo: %s (.jpg, .gif, .png)" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:33 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:76 -msgid "License Version: " -msgstr "Versão da Licença: " - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:45 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:89 -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:29 -msgid "Link to Repository: " -msgstr "Link para o Repositório" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:5 -msgid "Creating new software" -msgstr "Criando novo software" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:9 -msgid "" -"Enter the basic information about the software.
\n" -" You can add the details after you create it." -msgstr "" -"Entre com as informações básicas do software.
\n" -" Você pode adicionar os detalhes após sua criação." - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:16 -msgid "" -"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." -msgstr "" -"Note que a criação de comunidades nesse ambiente é restrita. Sua requisição " -"para criar essa nova comunidade será enviada aos administradores do " -"%{environment} para ser aprovada ou rejeitada de acordo com os seus métodos " -"e critérios" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 -msgid "\"Can`t create new software: #{@errors.length} errors\"" -msgstr "\"Não foi possível criar o software: #{@errors.length} errors\"" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 -msgid "Domain" -msgstr "Domínio" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:97 -msgid "Create" -msgstr "Criar" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:98 -msgid "Cancel" -msgstr "Cancelar" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:12 -msgid "see all (%d)" -msgstr "ver todos (%d)" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:34 -msgid "No software found. Try more general filters" -msgstr "Nenhum software encontrado. Tente outros filtros" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:36 -msgid "" -"No software found. Try more general filters or check the software category " -"individually" -msgstr "" -"Nenhum software encontrado. Tente outros filtros ou verifique a categoria do " -"software individualmente" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:41 -#: plugins/software_communities/views/search/_full_community.html.erb:35 -#: plugins/software_communities/views/search/_catalog_filter.html.erb:10 -#: plugins/software_communities/views/blocks/categories_software.html.erb:15 -msgid "\"#{category.name}\"" -msgstr "\"#{category.name}\"" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:3 -msgid "Search Public Software Catalog" -msgstr "Pesquisar Catálogo de Software Público" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:15 -msgid "" -"Projects that have passed by the Avalia SPB process according to the " -"requirements of IN 01/2011." -msgstr "" -"Projetos que passaram pelo processo Avalia SPB de acordo com os Requisitos " -"da IN 01/2011." - -#: plugins/software_communities/views/search/_software_search_form.html.erb:18 -msgid "All" -msgstr "Todos" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:19 -msgid "Projects included in the portal as cases provided by the IN 01/2011." -msgstr "Projetos incluidos no portal como os casos fornecidos pela IN 01/2011." - -#: plugins/software_communities/views/search/_software_search_form.html.erb:24 -msgid "" -"Type words about the software you're looking for (the search begins after 3 " -"characters)" -msgstr "" -"Digite palavras sobre o software que você está procurando (a busca começa " -"depois de 3 caracteres" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:27 -msgid "Filter" -msgstr "Filtro" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:52 -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:5 -msgid "Name A-Z" -msgstr "Nome A-Z" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:53 -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:6 -msgid "Name Z-A" -msgstr "Nome Z-A" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:54 -msgid "Relevance" -msgstr "Relevância" - -#: plugins/software_communities/views/search/software_infos.html.erb:6 -msgid "Type words about the %s you're looking for" -msgstr "Digite palavras sobre o %s que você está procurando" - -#: plugins/software_communities/views/search/_full_community.html.erb:46 -msgid "This software doesn't have categories" -msgstr "Este software nào contém categorias" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:4 -#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:2 -msgid "Categories" -msgstr "Categorias" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:16 -msgid "More options" -msgstr "Mais opções" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:18 -msgid "Clean up" -msgstr "Limpar" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:19 -msgid "Close" -msgstr "Fechar" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:3 -msgid "Additional informations" -msgstr "Informações adicionais" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:11 -msgid "Number of Beneficiaries" -msgstr "Número de beneficiados" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:17 -msgid "Saved resources" -msgstr "Recursos economizados" - -#: plugins/software_communities/views/box_organizer/_wiki_block.html.erb:3 -msgid "Wiki link" -msgstr "Link da wiki" - -#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:5 -msgid "Which blog should have its posts displayed: " -msgstr "Qual blog deve ter seus posts exibidos: " - -#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:13 -msgid "This community has no blogs" -msgstr "Essa comunidade não possui blogs" - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:5 -msgid "Benefited People" -msgstr "Pessoas Beneficiadas" - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:6 -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:8 -msgid "Portal suggested value: " -msgstr "Valor sugerido pelo portal: " - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:7 -msgid "Saved Resources" -msgstr "Recursos economizados" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:4 -msgid "Link" -msgstr "Link" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:5 -msgid "Platforms" -msgstr "Plataformas" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:6 -#: plugins/software_communities/views/blocks/download.html.erb:17 -msgid "Minimum Requirements" -msgstr "Requisitos Mínimos" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:7 -msgid "Size:" -msgstr "Tamanho:" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:16 -msgid "New link" -msgstr "Novo link" - -#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:2 -msgid "Limit of items" -msgstr "Limite de itens" - -#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:3 -msgid "Software Type:" -msgstr "Tipo de Software:" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:1 -#: plugins/software_communities/views/profile/_software_tab.html.erb:3 -msgid "Software Information" -msgstr "Informação de Software" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:15 -msgid "Licenses" -msgstr "Licenças" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:20 -msgid "License link" -msgstr "Link para a licença" - -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:2 -msgid "Sort by:" -msgstr "Ordenar por:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:6 -msgid "Name:" -msgstr "Nome:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 -msgid "Adherent to e_mag:" -msgstr "Aderente ao e_mag:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:8 -msgid "Adherent to icp_brasil:" -msgstr "Aderente ao icp_brasil:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -msgid "Adherent to e_ping:" -msgstr "Aderente ao e_ping" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -msgid "Adherent to e_arq:" -msgstr "Aderente ao e_arq" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -msgid "Internacionalizable:" -msgstr "Internacionalizável:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:12 -msgid "Operating Platform:" -msgstr "Plataforma Operacional:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:13 -msgid "Demonstration URL:" -msgstr "URL de Demonstração:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:14 -msgid "Short Name:" -msgstr "Nome Curto:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:15 -msgid "Objectives:" -msgstr "Objetivos:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:16 -msgid "Features:" -msgstr "Funcionalidades:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:19 -msgid "Version:" -msgstr "Versão:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:20 -msgid "Link:" -msgstr "Link:" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:25 -msgid "Show Libraries" -msgstr "Mostrar Bibliotecas" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:26 -msgid "Hide Libraries" -msgstr "Ocultar Bibliotecas" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:53 -msgid "Show Database" -msgstr "Mostrar Banco de Dados" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:54 -msgid "Hide Database" -msgstr "Ocultar Banco de Dados" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:63 -msgid "Software Databases" -msgstr "Bancos de Dados do Software" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:81 -msgid "Show Languages" -msgstr "Mostrar Linguagens" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:82 -msgid "Hide Languages" -msgstr "Ocultar Linguagens" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:91 -msgid "Software Languages" -msgstr "Linguagens do Software" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:109 -msgid "Show Operating Systems" -msgstr "Mostrar Sistema Operacional" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:110 -msgid "Hide Operating Systems" -msgstr "Ocultar Sistema Operacional" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:120 -msgid "Operating System" -msgstr "Sistema Operacional" - -#: plugins/software_communities/views/profile/members.html.erb:3 -#: plugins/software_communities/views/profile/members.html.erb:26 -msgid "Members" -msgstr "Membros" - -#: plugins/software_communities/views/profile/members.html.erb:4 -msgid "%s" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:43 -msgid "Administrators" -msgstr "Administradores" - -#: plugins/software_communities/views/profile/members.html.erb:57 -msgid "Go back" -msgstr "Voltar" - -#: plugins/software_communities/views/profile/members.html.erb:60 -msgid "Invite people to join" -msgstr "Convide pessoas para entrar" - -#: plugins/software_communities/views/profile/members.html.erb:63 -msgid "Send e-mail to members" -msgstr "Envie e-mail para os membros" - -#: plugins/software_communities/views/profile/index.html.erb:17 -msgid "Control Panel" -msgstr "Painel de Controle" - -#: plugins/software_communities/views/blocks/main_area_softwares.html.erb:23 -msgid "See More" -msgstr "Veja Mais" - -#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:5 -msgid "This community has no posts in its blog" -msgstr "Essa comunidade não possui posts nesse blog" - -#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:13 -msgid "Read more" -msgstr "Leia mais" - -#: plugins/software_communities/views/blocks/repository.html.erb:2 -#: plugins/software_communities/views/blocks/download.html.erb:2 -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:2 -#: plugins/software_communities/views/blocks/wiki.html.erb:2 -#: plugins/software_communities/views/blocks/software_information.html.erb:4 -msgid "This community needs a software to use this block" -msgstr "Essa comunidade precisa de um software para usar este block" - -#: plugins/software_communities/views/blocks/repository.html.erb:4 -msgid "Repository" -msgstr "Repositório" - -#: plugins/software_communities/views/blocks/download.html.erb:4 -msgid "\"Download #{block.owner.software_info.community.name}\"" -msgstr "\"Baixar #{block.owner.software_info.community.name}\"" - -#: plugins/software_communities/views/blocks/download.html.erb:9 -msgid "Download the software" -msgstr "Baixar o software" - -#: plugins/software_communities/views/blocks/download.html.erb:15 -msgid "\"#{download[:name]}\"" -msgstr "\"#{download[:name]}\"" - -#: plugins/software_communities/views/blocks/download.html.erb:16 -msgid "\"Platform:#{download[:software_description]}\"" -msgstr "\"Platform:#{download[:software_description]}\"" - -#: plugins/software_communities/views/blocks/download.html.erb:23 -msgid "\"License: #{block.owner.software_info.license_info.version}\"" -msgstr "\"License: #{block.owner.software_info.license_info.version}\"" - -#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:12 -msgid "Tags" -msgstr "Tags" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:5 -msgid " benefited people*" -msgstr " pessoas beneficiadas*" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:6 -msgid " saved resources*" -msgstr " recursos economizados*" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:10 -msgid "Data estimated by the software administrator." -msgstr "Dados estimados pelo administrador do software" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:4 -msgid "See more Software" -msgstr "Veja mais softwares" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:8 -msgid "Categories:" -msgstr "Categorias:" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:23 -#: plugins/software_communities/views/blocks/search_catalog.html.erb:9 -msgid "Access the complete catalog" -msgstr "Acessar o catálogo completo" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:6 -msgid "Discussions" -msgstr "Discussões" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:7 -msgid "Blog" -msgstr "" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:8 -msgid "Repository Feed" -msgstr "Feed do Repositório" - -#: plugins/software_communities/views/blocks/wiki.html.erb:4 -msgid "Wiki" -msgstr "" - -#: plugins/software_communities/views/blocks/software_highlights.html.erb:13 -msgid "See all" -msgstr "ver todos (%d)" - -#: plugins/software_communities/views/blocks/software_information.html.erb:16 -msgid "Control panel" -msgstr "Painel de Controle" - -#: plugins/software_communities/views/blocks/software_information.html.erb:24 -msgid "\"#{block.owner.software_info.acronym} - \"" -msgstr "\"#{block.owner.software_info.acronym} - \"" - -#: plugins/software_communities/views/blocks/software_information.html.erb:25 -msgid "\"#{block.owner.name}\"" -msgstr "\"#{block.owner.name}\"" - -#: plugins/software_communities/views/blocks/search_catalog.html.erb:2 -msgid "Catalog of Public Software" -msgstr "Catálogo de Software Público" - -#: plugins/software_communities/views/blocks/search_catalog.html.erb:5 -msgid "Search" -msgstr "Procurar" - -#~ msgid "Software Projects:" -#~ msgstr "Projetos de Software:" - -#~ msgid "Include in results" -#~ msgstr "Incluir em resultados" - -#~ msgid "" -#~ "Include software development projects that are not yet officially " -#~ "Brazilian Public Software." -#~ msgstr "" -#~ "Incluir projetos de desenvolvimento de software que não são ainda " -#~ "oficialmente Software Público Brasileiro" - -#~ msgid "Email must be different from secondary email." -#~ msgstr "Email deve ser diferente do email secundário." - -#~ msgid "E-mail or secondary e-mail already taken." -#~ msgstr "Email ou email secundário já foram escolhidos por outro usuário." - -#~ msgid "Invalid secondary email format." -#~ msgstr "Formato do email secundário inválido." - -#~ msgid "The governamental email must be the primary one." -#~ msgstr "O email governamental deve ser o email primário." - -#~ msgid "Institution is obligatory if user has a government email." -#~ msgstr "Instituição é obrigatório se usuário tem um email governamental." - -#~ msgid "Institution Catalog" -#~ msgstr "Catálogo de Instituição" - -#~ msgid "Create Institution" -#~ msgstr "Criar Instituição" - -#~ msgid "Institution Info" -#~ msgstr "Informação de Instituição" - -#~ msgid "Institution" -#~ msgstr "Instituição" - -#~ msgid "Institutions" -#~ msgstr "Instituições" - -#~ msgid "{#} institution" -#~ msgid_plural "{#} institutions" -#~ msgstr[0] "{#} instituição" -#~ msgstr[1] "{#} instituições" - -#~ msgid "This block displays the institutions in which the user is a member." -#~ msgstr "Este bloco apresenta as instituições em que o usuário é membro." - -#~ msgid "institutions|View all" -#~ msgstr "instituições|Veja todos" - -#~ msgid "invalid, only public and private institutions are allowed." -#~ msgstr "inválido, apenas instituições públicas e privadas são permitidas." - -#~ msgid "invalid format" -#~ msgstr "formato inválido" - -#~ msgid "Could not find Governmental Power or Governmental Sphere" -#~ msgstr "Não foi possível encontrar o poder ou esfera governamental" - -#~ msgid "Institution successful created!" -#~ msgstr "Instituição criada com sucesso!" - -#~ msgid "Institution could not be created!" -#~ msgstr "Instituição não pode ser criada!" - -#~ msgid "Name Should begin with a capital letter and no special characters" -#~ msgstr "" -#~ "Nome deve começar com letra maiúscula e não pode ter caracteres especiais" - -#~ msgid "Secondary e-mail" -#~ msgstr "Email secundário" - -#~ msgid "No institution found" -#~ msgstr "Nenhuma instituição encontrada" - -#~ msgid "Add new institution" -#~ msgstr "Adicionar nova instituiço" - -#~ msgid "Create new institution" -#~ msgstr "Criar nova instituição" - -#~ msgid "Should begin with a capital letter and no special characters" -#~ msgstr "Deve começar com letra maíuscula e sem caracteres especiais" - -#~ msgid "Email should have the following format: name@host.br" -#~ msgstr "Email deve ter o seguinte formato: name@host.br" - -#~ msgid "Site should have a valid format: http://name.hosts" -#~ msgstr "Site deve ter um formato válido: http://name.hosts" - -#~ msgid "If you work in a public agency use your government e-Mail" -#~ msgstr "Se você trabalha em um órgão público use seu e-Mail governamental" - -#~ msgid "New Institution" -#~ msgstr "Nova Instituição" - -#~ msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" -#~ msgstr "" -#~ "\"Não foi possível criar a Instituição: #{flash[:errors].length} errors\"" - -#~ msgid "All fields with (*) are mandatory" -#~ msgstr "Todos os campos com (*) são obrigatórios" - -#~ msgid "Public Institution" -#~ msgstr "Insituição Pública" - -#~ msgid "Private Institution" -#~ msgstr "Instituição Privada" - -#~ msgid "Institution name already exists" -#~ msgstr "Instituição com o nome informado já existe" - -#~ msgid "Country" -#~ msgstr "País" - -#~ msgid "State" -#~ msgstr "Estado" - -#~ msgid "CNPJ" -#~ msgstr "CNPJ" - -#~ msgid "Acronym" -#~ msgstr "Sigla" - -#~ msgid "Fantasy name" -#~ msgstr "Nome fantasia" - -#~ msgid "Governmental Sphere:" -#~ msgstr "Esfera Governamental:" - -#~ msgid "Select a Governmental Sphere" -#~ msgstr "Selecione a Esfera Governamental" - -#~ msgid "Governmental Power:" -#~ msgstr "Poder Governamental:" - -#~ msgid "Select a Governmental Power" -#~ msgstr "Selecione um Poder Governamental" - -#~ msgid "Juridical Nature:" -#~ msgstr "Natureza Jurídica" - -#~ msgid "Select a Juridical Nature" -#~ msgstr "Selecione uma Natureza Jurídica" - -#~ msgid "SISP?" -#~ msgstr "SISP?" - -#~ msgid "Could not send the form data to the server" -#~ msgstr "Não foi possível enviar os dados do formulário ao servidor" - -#~ msgid "Creating institution" -#~ msgstr "Criando instituição" - -#~ msgid "Institution Information" -#~ msgstr "Informações de Instituição" - -#~ msgid "Type:" -#~ msgstr "Tipo:" - -#~ msgid "CNPJ:" -#~ msgstr "CNPJ:" - -#~ msgid "Last modification:" -#~ msgstr "Última modificação:" - -#~ msgid "Country:" -#~ msgstr "País" - -#~ msgid "State:" -#~ msgstr "Estado" - -#~ msgid "City:" -#~ msgstr "Cidade" - -#~ msgid "Fantasy Name:" -#~ msgstr "Nome Fantasia:" - -#~ msgid "Acronym:" -#~ msgstr "Sigla:" - -#~ msgid "SISP:" -#~ msgstr "SISP:" - -#~ msgid "Edit Institution" -#~ msgstr "Editar Instituíção" - -#~ msgid "Link to Repository" -#~ msgstr "Link para o Repositório" - -#~ msgid "Select the categories of your interest" -#~ msgstr "Selecione as categorias de seu interesse" - -#~ msgid "Delete profile" -#~ msgstr "Deletar perfil" - -#~ msgid "Deactivate profile" -#~ msgstr "Desativar perfil" - -#~ msgid "Activate profile" -#~ msgstr "Ativar perfil" - -#~ msgid "Complete Profile" -#~ msgstr "Completar Perfil" - -#~ msgid "Complete your profile" -#~ msgstr "Complete seu perfil" - -#~ msgid "Hide" -#~ msgstr "Esconder" - -#~ msgid "Most downloaded" -#~ msgstr "Mais baixado" - -#~ msgid "Top rated" -#~ msgstr "Mais Populares" - -#~ msgid "Recently updated" -#~ msgstr "Atualizado Recentemente" - -#~ msgid "New in portal" -#~ msgstr "Novo no portal" diff --git a/po/software_communities.pot b/po/software_communities.pot deleted file mode 100644 index 5885eee..0000000 --- a/po/software_communities.pot +++ /dev/null @@ -1,1044 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: 1.2-143-g8dfded9\n" -"POT-Creation-Date: 2015-09-11 17:15-0000\n" -"PO-Revision-Date: 2015-09-11 17:15-0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: plugins/software_communities/test/unit/software_info_validation_test.rb:108 -msgid "Features is too long (maximum is 4000 characters)" -msgstr "" - -#: plugins/software_communities/test/unit/software_info_validation_test.rb:116 -msgid "Objectives is too long (maximum is 4000 characters)" -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:41 -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:19 -msgid "Save and Configure Community" -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:45 -msgid "Software updated successfully" -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:49 -msgid "Could not update software" -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:130 -msgid "Your new software request will be evaluated by anadministrator. You will be notified." -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:7 -msgid "Could not find the download file" -msgstr "" - -#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:8 -msgid "Invalid download params" -msgstr "" - -#: plugins/software_communities/lib/operating_system.rb:12 -msgid "too long (maximum is 20 characters)" -msgstr "" - -#: plugins/software_communities/lib/statistic_block.rb:9 -msgid "Software Statistics" -msgstr "" - -#: plugins/software_communities/lib/statistic_block.rb:13 -msgid "This block displays software statistics." -msgstr "" - -#: plugins/software_communities/lib/categories_and_tags_block.rb:8 -msgid "Categories and Tags" -msgstr "" - -#: plugins/software_communities/lib/categories_and_tags_block.rb:12 -msgid "This block displays the categories and tags of a software." -msgstr "" - -#: plugins/software_communities/lib/wiki_block.rb:8 -msgid "Wiki Link" -msgstr "" - -#: plugins/software_communities/lib/wiki_block.rb:12 -msgid "This block displays a link to the software wiki." -msgstr "" - -#: plugins/software_communities/lib/library.rb:5 -msgid "can't be blank" -msgstr "" - -#: plugins/software_communities/lib/library.rb:8 -msgid "Too long (maximum is 20 characters)" -msgstr "" - -#: plugins/software_communities/lib/search_catalog_block.rb:8 -msgid "Search Softwares catalog" -msgstr "" - -#: plugins/software_communities/lib/search_catalog_block.rb:12 -msgid "This block displays the search categories field " -msgstr "" - -#: plugins/software_communities/lib/software_database.rb:12 -msgid "Software database is too long (maximum is 20 characters)" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:5 -msgid "Agriculture, Fisheries and Extraction" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:6 -msgid "Science, Information and Communication" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:7 -msgid "Economy and Finances" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:8 -msgid "Public Administration" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:9 -msgid "Habitation, Sanitation and Urbanism" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:10 -msgid "Individual, Family and Society" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:11 -msgid "Health" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:12 -msgid "Social Welfare and Development" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:13 -msgid "Defense and Security" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:14 -msgid "Education" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:15 -msgid "Government and Politics" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:16 -msgid "Justice and Legislation" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:17 -msgid "International Relationships" -msgstr "" - -#: plugins/software_communities/lib/ext/category.rb:18 -msgid "Transportation and Transit" -msgstr "" - -#: plugins/software_communities/lib/ext/search_controller.rb:118 -msgid "Result Search" -msgstr "" - -#: plugins/software_communities/lib/ext/search_controller.rb:142 -msgid "Selected options: " -msgstr "" - -#: plugins/software_communities/lib/download_block.rb:15 -msgid "Download Stable Version" -msgstr "" - -#: plugins/software_communities/lib/download_block.rb:19 -msgid "This block displays the stable version of a software." -msgstr "" - -#: plugins/software_communities/lib/software_tab_data_block.rb:10 -msgid "Software Tab Data" -msgstr "" - -#: plugins/software_communities/lib/software_tab_data_block.rb:14 -msgid "This block is used by colab to insert data into Noosfero" -msgstr "" - -#: plugins/software_communities/lib/software_highlights_block.rb:4 -msgid "Software Highlights Block" -msgstr "" - -#: plugins/software_communities/lib/software_highlights_block.rb:8 -msgid "This block displays the softwares icon into a highlight" -msgstr "" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:17 -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:3 -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:3 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:37 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:3 -msgid "Name" -msgstr "" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:18 -msgid "Version" -msgstr "" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:19 -#: plugins/software_communities/views/profile/_software_tab.html.erb:18 -msgid "License" -msgstr "" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:91 -msgid "Autocomplete field, type something" -msgstr "" - -#: plugins/software_communities/lib/dynamic_table_helper.rb:116 -#: plugins/software_communities/views/box_organizer/_download_list_template.html.erb:8 -#: plugins/software_communities/views/box_organizer/_download_list.html.erb:8 -msgid "Delete" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:36 -msgid "New software" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:44 -msgid "%{requestor} wants to create software %{subject} with" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:46 -msgid " no finality." -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:48 -msgid " this finality:

%{finality}

" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:68 -msgid "%{requestor} wants to create software %{subject}" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:73 -msgid "User \"%{user}\" just requested to create software %{software}.\n You have to approve or reject it through the \"Pending Validations\"\n section in your control panel.\n" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:80 -msgid "Your request for registering software %{software} at %{environment} was\n just sent. Environment administrator will receive it and will approve or\n reject your request according to his methods and criteria.\n\n You will be notified as soon as environment administrator has a position\n about your request." -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:90 -msgid "Your request for registering software %{software} at %{environment} was\n not approved by the environment administrator. The following explanation\n was given: \n\n%{explanation}" -msgstr "" - -#: plugins/software_communities/lib/create_software.rb:99 -msgid "Your request for registering the software \"%{software}\" was approved.\n You can access %{url} and finish the registration of your software." -msgstr "" - -#: plugins/software_communities/lib/software_communities_plugin.rb:17 -msgid "Add Public Software and MPOG features." -msgstr "" - -#: plugins/software_communities/lib/software_communities_plugin.rb:90 -msgid "Rate this software" -msgstr "" - -#: plugins/software_communities/lib/software_communities_plugin.rb:136 -msgid "Software Info" -msgstr "" - -#: plugins/software_communities/lib/software_communities_plugin.rb:147 -msgid "Create a new software" -msgstr "" - -#: plugins/software_communities/lib/software_communities_plugin.rb:157 -msgid "Software" -msgstr "" - -#: plugins/software_communities/lib/repository_block.rb:8 -msgid "Repository Link" -msgstr "" - -#: plugins/software_communities/lib/repository_block.rb:12 -msgid "This block displays the repository link of a software." -msgstr "" - -#: plugins/software_communities/lib/software_info.rb:151 -msgid "Name is too long (maximum is %{count} characters)" -msgstr "" - -#: plugins/software_communities/lib/software_info.rb:219 -msgid "can't have more than 10 characteres" -msgstr "" - -#: plugins/software_communities/lib/software_info.rb:222 -msgid "can't have whitespaces" -msgstr "" - -#: plugins/software_communities/lib/software_info.rb:230 plugins/software_communities/lib/software_info.rb:236 -#: plugins/software_communities/lib/software_info.rb:242 -msgid ": at least one must be filled" -msgstr "" - -#: plugins/software_communities/lib/software_information_block.rb:8 -msgid "Basic Software Information" -msgstr "" - -#: plugins/software_communities/lib/software_information_block.rb:12 -msgid "This block displays the basic information of a software profile." -msgstr "" - -#: plugins/software_communities/lib/software_language.rb:10 -msgid "Software language is too long (maximum is 20 characters)" -msgstr "" - -#: plugins/software_communities/lib/categories_software_block.rb:8 -msgid "Categories Softwares" -msgstr "" - -#: plugins/software_communities/lib/categories_software_block.rb:12 -msgid "This block displays the categories and the amount of softwares for\n each category." -msgstr "" - -#: plugins/software_communities/lib/softwares_block.rb:8 -msgid "Softwares" -msgstr "" - -#: plugins/software_communities/lib/softwares_block.rb:13 -msgid "{#} generic software" -msgid_plural "{#} generic softwares" -msgstr[0] "" -msgstr[1] "" - -#: plugins/software_communities/lib/softwares_block.rb:15 -msgid "{#} public software" -msgid_plural "{#} public softwares" -msgstr[0] "" -msgstr[1] "" - -#: plugins/software_communities/lib/softwares_block.rb:17 -msgid "{#} software" -msgid_plural "{#} softwares" -msgstr[0] "" -msgstr[1] "" - -#: plugins/software_communities/lib/softwares_block.rb:22 -msgid "This block displays the softwares in which the user is a member." -msgstr "" - -#: plugins/software_communities/lib/softwares_block.rb:31 plugins/software_communities/lib/softwares_block.rb:37 -msgid "softwares|View all" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:3 plugins/software_communities/views/profile/members.html.erb:26 -msgid "Members" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:4 -msgid "%s" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:43 -msgid "Administrators" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:57 -msgid "Go back" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:60 -msgid "Invite people to join" -msgstr "" - -#: plugins/software_communities/views/profile/members.html.erb:63 -msgid "Send e-mail to members" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:3 -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:1 -msgid "Software Information" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:6 -msgid "Name:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 -msgid "Adherent to e_mag:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 plugins/software_communities/views/profile/_software_tab.html.erb:8 -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:49 -msgid "Yes" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:7 plugins/software_communities/views/profile/_software_tab.html.erb:8 -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:50 -msgid "No" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:8 -msgid "Adherent to icp_brasil:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:9 -msgid "Adherent to e_ping:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:10 -msgid "Adherent to e_arq:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:11 -msgid "Internacionalizable:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:12 -msgid "Operating Platform:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:13 -msgid "Demonstration URL:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:14 -msgid "Short Name:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:15 -msgid "Objectives:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:16 -msgid "Features:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:19 -msgid "Version:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:20 -msgid "Link:" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:25 -msgid "Show Libraries" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:26 -msgid "Hide Libraries" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:35 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:74 -msgid "Libraries" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:53 -msgid "Show Database" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:54 -msgid "Hide Database" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:63 -msgid "Software Databases" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:81 -msgid "Show Languages" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:82 -msgid "Hide Languages" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:91 -msgid "Software Languages" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:109 -msgid "Show Operating Systems" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:110 -msgid "Hide Operating Systems" -msgstr "" - -#: plugins/software_communities/views/profile/_software_tab.html.erb:120 -msgid "Operating System" -msgstr "" - -#: plugins/software_communities/views/profile/index.html.erb:17 -msgid "Control Panel" -msgstr "" - -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:2 -msgid "Sort by:" -msgstr "" - -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:5 -#: plugins/software_communities/views/search/_software_search_form.html.erb:52 -msgid "Name A-Z" -msgstr "" - -#: plugins/software_communities/views/profile/_profile_members_list.html.erb:6 -#: plugins/software_communities/views/search/_software_search_form.html.erb:53 -msgid "Name Z-A" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:5 -msgid "Which blog should have its posts displayed: " -msgstr "" - -#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:13 -msgid "This community has no blogs" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:2 -msgid "Limit of items" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:3 -msgid "Software Type:" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:5 -msgid "Benefited People" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:6 -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:8 -msgid "Portal suggested value: " -msgstr "" - -#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:7 -msgid "Saved Resources" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:4 -msgid "Link" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:5 -msgid "Platforms" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:6 plugins/software_communities/views/blocks/download.html.erb:17 -msgid "Minimum Requirements" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:7 -msgid "Size:" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_download_block.html.erb:16 -msgid "New link" -msgstr "" - -#: plugins/software_communities/views/box_organizer/_wiki_block.html.erb:3 -msgid "Wiki link" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:4 -#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:2 -msgid "Categories" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:10 -#: plugins/software_communities/views/search/_full_community.html.erb:35 -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:41 -#: plugins/software_communities/views/blocks/categories_software.html.erb:15 -msgid "\"#{category.name}\"" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:16 -msgid "More options" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:18 -msgid "Clean up" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_filter.html.erb:19 -msgid "Close" -msgstr "" - -#: plugins/software_communities/views/search/_full_community.html.erb:27 -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:65 -msgid "Software Categories" -msgstr "" - -#: plugins/software_communities/views/search/_full_community.html.erb:46 -msgid "This software doesn't have categories" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:12 -msgid "see all (%d)" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:34 -msgid "No software found. Try more general filters" -msgstr "" - -#: plugins/software_communities/views/search/_catalog_result_list.html.erb:36 -msgid "No software found. Try more general filters or check the software category individually" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:3 -msgid "Search Public Software Catalog" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:14 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:10 -msgid "Public Software" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:15 -msgid "Projects that have passed by the Avalia SPB process according to the requirements of IN 01/2011." -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:18 -msgid "All" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:19 -msgid "Projects included in the portal as cases provided by the IN 01/2011." -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:24 -msgid "Type words about the software you're looking for (the search begins after 3 characters)" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:27 -msgid "Filter" -msgstr "" - -#: plugins/software_communities/views/search/_software_search_form.html.erb:54 -msgid "Relevance" -msgstr "" - -#: plugins/software_communities/views/search/software_infos.html.erb:6 -msgid "Type words about the %s you're looking for" -msgstr "" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:10 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:56 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:14 -msgid "Finality" -msgstr "" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:15 -msgid "Licenses" -msgstr "" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:20 -msgid "License link" -msgstr "" - -#: plugins/software_communities/views/_main_software_editor_extras.html.erb:29 -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:89 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:45 -msgid "Link to Repository: " -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 -msgid "Public software" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:12 -msgid "Adherent to e-PING ?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:21 -msgid "Adherent to e-MAG ?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:30 -msgid "Adherent to ICP-Brasil ?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:39 -msgid "Adherent to e-ARQ ?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:48 -msgid "Internacionalizable ?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:59 -msgid "Operating Platform" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:64 -msgid "Features" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:69 -msgid "Demonstration url" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:82 -msgid "Operating Systems" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:90 -msgid "Programming languages" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:97 -msgid "Databases" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb:11 -msgid "New Database" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:5 -msgid "Autocomplete field, type some license" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:8 -msgid "Read license" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb:11 -msgid "New language" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb:11 -msgid "New Operating System" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:5 -msgid "Creating new software" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:9 -msgid "Enter the basic information about the software.
\n You can add the details after you create it." -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:16 -msgid "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." -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 -msgid "\"Can`t create new software: #{@errors.length} errors\"" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 -msgid "Domain" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:57 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:15 -msgid "What is the software for?" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:64 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:21 -msgid "Software Logo" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 -msgid "Image:" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 -msgid "Max size: %s (.jpg, .gif, .png)" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:76 -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:33 -msgid "License Version: " -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:97 -msgid "Create" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:98 -msgid "Cancel" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:8 -msgid "Short Name" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:1 -msgid "Edit Software" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:9 -msgid "Main Information" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:12 -msgid "Specifications" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:18 -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:68 -msgid "Save" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:20 -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:71 -msgid "Back to control panel" -msgstr "" - -#: plugins/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb:11 -msgid "New Library" -msgstr "" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:4 -msgid "See more Software" -msgstr "" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:8 -msgid "Categories:" -msgstr "" - -#: plugins/software_communities/views/blocks/categories_software.html.erb:23 plugins/software_communities/views/blocks/search_catalog.html.erb:9 -msgid "Access the complete catalog" -msgstr "" - -#: plugins/software_communities/views/blocks/wiki.html.erb:2 -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:2 plugins/software_communities/views/blocks/download.html.erb:2 -#: plugins/software_communities/views/blocks/software_information.html.erb:4 plugins/software_communities/views/blocks/repository.html.erb:2 -msgid "This community needs a software to use this block" -msgstr "" - -#: plugins/software_communities/views/blocks/wiki.html.erb:4 -msgid "Wiki" -msgstr "" - -#: plugins/software_communities/views/blocks/main_area_softwares.html.erb:23 -msgid "See More" -msgstr "" - -#: plugins/software_communities/views/blocks/search_catalog.html.erb:2 -msgid "Catalog of Public Software" -msgstr "" - -#: plugins/software_communities/views/blocks/search_catalog.html.erb:5 -msgid "Search" -msgstr "" - -#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:12 -msgid "Tags" -msgstr "" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:6 -msgid "Discussions" -msgstr "" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:7 -msgid "Blog" -msgstr "" - -#: plugins/software_communities/views/blocks/software_tab_data.html.erb:8 -msgid "Repository Feed" -msgstr "" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:5 -msgid " benefited people*" -msgstr "" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:6 -msgid " saved resources*" -msgstr "" - -#: plugins/software_communities/views/blocks/software_statistics.html.erb:10 -msgid "Data estimated by the software administrator." -msgstr "" - -#: plugins/software_communities/views/blocks/download.html.erb:4 -msgid "\"Download #{block.owner.software_info.community.name}\"" -msgstr "" - -#: plugins/software_communities/views/blocks/download.html.erb:9 -msgid "Download the software" -msgstr "" - -#: plugins/software_communities/views/blocks/download.html.erb:15 -msgid "\"#{download[:name]}\"" -msgstr "" - -#: plugins/software_communities/views/blocks/download.html.erb:16 -msgid "\"Platform:#{download[:software_description]}\"" -msgstr "" - -#: plugins/software_communities/views/blocks/download.html.erb:23 -msgid "\"License: #{block.owner.software_info.license_info.version}\"" -msgstr "" - -#: plugins/software_communities/views/blocks/software_highlights.html.erb:13 -msgid "See all" -msgstr "" - -#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:5 -msgid "This community has no posts in its blog" -msgstr "" - -#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:13 -msgid "Read more" -msgstr "" - -#: plugins/software_communities/views/blocks/software_information.html.erb:16 -msgid "Control panel" -msgstr "" - -#: plugins/software_communities/views/blocks/software_information.html.erb:24 -msgid "\"#{block.owner.software_info.acronym} - \"" -msgstr "" - -#: plugins/software_communities/views/blocks/software_information.html.erb:25 -msgid "\"#{block.owner.name}\"" -msgstr "" - -#: plugins/software_communities/views/blocks/repository.html.erb:4 -msgid "Repository" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:1 -msgid "General information" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:40 -msgid "Address" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:46 -msgid "WARNING!" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:47 -msgid "You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:63 -msgid "Enable \"contact us\"" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:68 -msgid "Products/Services catalog" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_software_community.html.erb:69 -msgid "Number of products/services displayed per page on catalog" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:4 -msgid "Configure Software Community" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:8 -msgid "Set the basic settings of the software associated community" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:18 -msgid "This profile is a template" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:24 -msgid "Privacy options" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:28 -msgid "Public — show my contents to all internet users" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:31 -msgid "Private — show my contents only to friends" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:35 -msgid "Public — show content of this group to all internet users" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:38 -msgid "Private — show content of this group only to members" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:43 -msgid "Page to redirect after login" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:47 -msgid "Translations" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:49 -msgid "Automaticaly redirect the visitor to the article translated to his/her language" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:53 -msgid "Suggestions" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:55 -msgid "Send me relationship suggestions by email" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:77 -msgid "Delete software and community" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 -msgid "Deactivate software and community" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 -msgid "Are you sure you want to deactivate this profile?" -msgstr "" - -#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 -msgid "Activate software and community" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:3 -msgid "Step 1 - Software Creation" -msgstr "" - -#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:7 -msgid "Step 2 - Community Settings" -msgstr "" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:3 -msgid "Additional informations" -msgstr "" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:11 -msgid "Number of Beneficiaries" -msgstr "" - -#: plugins/software_communities/views/comments_extra_fields.html.erb:17 -msgid "Saved resources" -msgstr "" diff --git a/public/app.js b/public/app.js deleted file mode 100644 index 7e98375..0000000 --- a/public/app.js +++ /dev/null @@ -1,11 +0,0 @@ -(function() { - 'use strict'; - - var $ = modulejs.require('jquery'); - var Initializer = modulejs.require('Initializer'); - - - $(document).ready(function() { - Initializer.init(); - }); -})(); diff --git a/public/blocks/software-download.js b/public/blocks/software-download.js deleted file mode 100644 index 94bda3f..0000000 --- a/public/blocks/software-download.js +++ /dev/null @@ -1,51 +0,0 @@ -modulejs.define('SoftwareDownload', ['jquery', 'NoosferoRoot'], function($, NoosferoRoot) { - 'use strict'; - - var AJAX_URL = { - get_download_template: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_block_template") - }; - - var $download_html_template; - - function getDownloadListTemplate() { - var block_template = sessionStorage.getItem('download_list_block_template'); - - if(block_template && block_template.length > 0) { - $download_html_template = block_template; - } else { - $.get(AJAX_URL.get_download_template, function(response) { - $download_html_template = response; - sessionStorage.setItem('download_list_block_template', response); - }); - } - } - - - function SoftwareDownload() { - getDownloadListTemplate(); - } - - - SoftwareDownload.prototype.addNewDonwload = function() { - var new_download = $($download_html_template); - $("#droppable-list-downloads").append(new_download); - } - - - SoftwareDownload.prototype.deleteDownload = function(element) { - var delete_download = $(element).parent().parent().parent().remove(); - } - - - return { - isCurrentPage: function() { - return $('.download-block').length !== 0; - }, - - - init: function() { - window.softwareDownload = new SoftwareDownload(); - } - } -}); diff --git a/public/initializer.js b/public/initializer.js deleted file mode 100644 index b0d3be6..0000000 --- a/public/initializer.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - 'use strict'; - - var dependencies = [ - 'ControlPanel', - 'EditSoftware', - 'NewSoftware', - 'SearchSoftwareCatalog', - 'SoftwareDownload', - 'ProfileTabsSoftware', - 'NewCommunity', - 'CommentsSoftwareExtraFields' - ]; - - - modulejs.define('Initializer', dependencies, function() { - var __dependencies = arguments; - - - function call_dependency(dependency) { - if( dependency.isCurrentPage() ) { - dependency.init(); - } - } - - - return { - init: function() { - for(var i=0, len = __dependencies.length; i < len; i++) { - call_dependency(__dependencies[i]); - } - } - }; - }); -})(); diff --git a/public/lib/auto-complete.js b/public/lib/auto-complete.js deleted file mode 100644 index f96c04b..0000000 --- a/public/lib/auto-complete.js +++ /dev/null @@ -1,64 +0,0 @@ -modulejs.define('AutoComplete', ['jquery'], function($) { - 'use strict'; - - - function get_hidden_description_field(autocomplete_field, klass) { - var field = $(autocomplete_field); - field = field.parent().parent().find(klass); - return field; - } - - - function verify_autocomplete(field, klass) { - var field = $(field); - var selected = get_hidden_description_field(field, klass); - var message_error = $(field).parent().find(".autocomplete_validation_message"); - - if( field.length === 0 || selected.val().length === 0 ) { - message_error.removeClass("hide-field"); - selected.val(""); - - message_error.show(); - } else { - field.val(selected.attr("data-label")); - message_error.hide(); - } - } - - - function enable_autocomplete(field_name, field_value_class, autocomplete_class, ajax_url, select_callback) { - $(autocomplete_class).autocomplete({ - source : function(request, response){ - $.ajax({ - type: "GET", - url: ajax_url, - data: {query: request.term, field: field_name}, - success: function(result){ - response(result); - } - }); - }, - - minLength: 0, - - select : function (event, selected) { - var description = get_hidden_description_field(this, field_value_class); - description.val(selected.item.id); - description.attr("data-label", selected.item.label); - - if( select_callback !== undefined ) { - select_callback(selected); - } - } - }).blur(function(){ - verify_autocomplete(this, field_value_class); - }).click(function(){ - $(this).autocomplete("search", ""); - }); - } - - - return { - enable: enable_autocomplete - } -}); \ No newline at end of file diff --git a/public/lib/noosfero-root.js b/public/lib/noosfero-root.js deleted file mode 100644 index cd3c8bf..0000000 --- a/public/lib/noosfero-root.js +++ /dev/null @@ -1,13 +0,0 @@ -modulejs.define('NoosferoRoot', function() { - 'use strict'; - - - function url_with_subdirectory(url) { - return noosfero_root() + url; - } - - - return { - urlWithSubDirectory: url_with_subdirectory - } -}); diff --git a/public/lib/select-element.js b/public/lib/select-element.js deleted file mode 100644 index 26880ae..0000000 --- a/public/lib/select-element.js +++ /dev/null @@ -1,35 +0,0 @@ -modulejs.define('SelectElement', function() { - 'use strict'; - - - function SelectElement(name, id) { - this.select = document.createElement("select"); - } - - - SelectElement.prototype.setAttr = function(attr, value) { - return this.select.setAttribute(attr, value); - }; - - - SelectElement.prototype.addOption = function(option) { - return this.select.add(option); - }; - - - SelectElement.prototype.getSelect = function() { - return this.select; - }; - - - SelectElement.generateOption = function(value, text) { - var option; - option = document.createElement("option"); - option.setAttribute("value", value); - option.text = text; - return option; - }; - - - return SelectElement; -}); diff --git a/public/lib/select-field-choices.js b/public/lib/select-field-choices.js deleted file mode 100644 index 095d4e1..0000000 --- a/public/lib/select-field-choices.js +++ /dev/null @@ -1,81 +0,0 @@ -modulejs.define('SelectFieldChoices', ['jquery', 'SelectElement'], function($, SelectElement) { - 'use strict'; - - - function SelectFieldChoices(state_id, city_id, state_url) { - this.state_id = state_id; - this.input_html = $(state_id).parent().html(); - this.old_value = $(state_id).val(); - this.city_parent_div = $(city_id).parent().parent().parent(); - this.state_url = state_url; - } - - - SelectFieldChoices.prototype.getCurrentStateElement = function() { - return $(this.state_id); - }; - - - SelectFieldChoices.prototype.replaceWith = function(html) { - var parent_div = this.getCurrentStateElement().parent(); - parent_div.html(html); - }; - - - SelectFieldChoices.prototype.generateSelect = function(state_list) { - var select_element, option; - - select_element = new SelectElement(); - select_element.setAttr("name", "profile_data[state]"); - select_element.setAttr("id", "state_field"); - select_element.setAttr("class", "type-select valid"); - - state_list.forEach(function(state) { - option = SelectElement.generateOption(state, state); - select_element.addOption(option); - }); - - return select_element.getSelect(); - }; - - - SelectFieldChoices.prototype.replaceStateWithSelectElement = function() { - var klass = this; - - $.get(this.state_url, function(response) { - var select_html; - - if (response.length > 0) { - select_html = klass.generateSelect(response); - klass.replaceWith(select_html); - - if (klass.old_value.length !== 0 && response.include(klass.old_value)) { - klass.getCurrentStateElement().val(klass.old_value); - } - } - }); - }; - - - SelectFieldChoices.prototype.replaceStateWithInputElement = function() { - this.replaceWith(this.input_html); - }; - - - SelectFieldChoices.prototype.hideCity = function() { - this.city_parent_div.addClass("mpog_hidden_field"); - }; - - - SelectFieldChoices.prototype.showCity = function() { - this.city_parent_div.removeClass("mpog_hidden_field"); - }; - - - SelectFieldChoices.prototype.actualFieldIsInput = function() { - return this.getCurrentStateElement().attr("type") === "text"; - }; - - - return SelectFieldChoices; -}); diff --git a/public/lib/software-catalog-component.js b/public/lib/software-catalog-component.js deleted file mode 100644 index c16e343..0000000 --- a/public/lib/software-catalog-component.js +++ /dev/null @@ -1,38 +0,0 @@ -modulejs.define('SoftwareCatalogComponent', ['jquery'], function($) { - 'use strict'; - - var dispatch_ajax_function; - - function clearCatalogCheckbox() { - $("#group-categories input:checked").each(function() { - $(this).prop('checked', false); - }); - - dispatch_ajax_function(true); - } - - - function selectCheckboxCategory(dispatch_ajax) { - dispatch_ajax_function(true); - } - - - function selectProjectSoftwareCheckbox() { - dispatch_ajax_function(true); - } - - - function set_events() { - $("#cleanup-filter-catalg").click(clearCatalogCheckbox); - $(".categories-catalog").click(selectCheckboxCategory); - $(".project-software").click(selectProjectSoftwareCheckbox); - } - - return { - init: function(dispatch_ajax) { - dispatch_ajax_function = dispatch_ajax; - set_events(); - }, - } -}); - diff --git a/public/static/databases.txt b/public/static/databases.txt deleted file mode 100644 index 69efefa..0000000 --- a/public/static/databases.txt +++ /dev/null @@ -1,101 +0,0 @@ -Accumulo -Adabas -Aerospike -AllegroGraph -Altibase -Berkeley DB -Caché -Cassandra -CloudSearch -Cloudant -Coherence -CouchDB -Couchbase -D3 -DB2 -DataEase -Datameer -Db4o -Derby -Drizzle -DynamoDB -Ehcache -Elasticsearch -Endeca -EnterpriseDB -FileMaker -Firebird -GemFire -Google BigQuery -Google Search Appliance -Greenplum -H2 -HBase -Hazelcast -Hive -HyperSQL -IDMS -IMS -Infinispan -Infobright -Informix -Ingres -Interbase -Jackrabbit -Jena -LevelDB -MariaDB -MarkLogic -MaxDB -MemSQL -Memcached -Microsoft Access -Microsoft Azure SQL Database -Microsoft SQL Server -Mnesia -MongoDB -MySQL -Neo4j -Netezza -NuoDB -ObjectStore -OpenEdge -Oracle -Oracle NoSQL -OrientDB -ParAccel -Percona Server -PostgreSQL -RavenDB -Red Brick -Redis -Redshift -RethinkDB -Riak -SAP HANA -SQL Anywhere -SQLite -Sedna -Sesame -SimpleDB -Solr -Sparksee -Sphinx -Splunk -Sybase ADS -Sybase ASE -Sybase IQ -Teradata -Teradata Aster -TimesTen -Titan -UniData -UniVerse -Versant Object Database -Vertica -Virtuoso -VoltDB -dBASE -jBASE -mSQL -Other \ No newline at end of file diff --git a/public/static/languages.txt b/public/static/languages.txt deleted file mode 100644 index a6ec626..0000000 --- a/public/static/languages.txt +++ /dev/null @@ -1,101 +0,0 @@ -ASP -ActionScript -Ada -Apex -AppleScript -Arduino -Assembly -AutoHotkey -AutoIt -Awk -BlitzBasic -C -C# -C++ -CSS -Clojure -CoffeeScript -ColdFusion -Common Lisp -Coq -Cuda -D -DCPU-16 ASM -DOT -Dart -Delphi -Eiffel -Elixir -Elm -Emacs Lisp -Erlang -F# -FORTRAN -Go -Gosu -Groovy -HaXe -Haskell -Haxe -IDL -Io -Java -JavaScript -Julia -Kotlin -Lasso -LiveScript -Logos -Lua -M -Matlab -Max -Nemerle -Nimrod -OCaml -Objective-C -Objective-C++ -Objective-J -OpenEdge ABL -PHP -Parrot -Pascal -Perl -PowerShell -Processing -Prolog -Puppet -Pure Data -PureScript -Python -R -Racket -Ruby -Rust -SQL -Scala -Scheme -Scilab -Shell -Slash -Smalltalk -Standard ML -SuperCollider -Swift -Tcl -TeX -TypeScript -UnrealScript -VHDL -Vala -Verilog -VimL -Visual Basic -XC -XML -XQuery -XSLT -Xtend -nesC -xBase -Other \ No newline at end of file diff --git a/public/static/licences.txt b/public/static/licences.txt deleted file mode 100644 index 14e83c2..0000000 --- a/public/static/licences.txt +++ /dev/null @@ -1,212 +0,0 @@ -Academic Free License 3.0 (AFL-3.0) -http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl - -Affero GNU Public License (AGPL-3.0) -http://www.gnu.org/licenses/agpl-3.0.html - -Adaptive Public License (APL-1.0) -http://opensource.org/licenses/APL-1.0 - -Apache License 2.0 (Apache-2.0) -http://www.apache.org/licenses/LICENSE-2.0 - -Apple Public Source License (APSL-2.0) -http://www.opensource.apple.com/license/apsl/ - -Artistic license 2.0 (Artistic-2.0) -http://opensource.org/licenses/Artistic-2.0 - -Attribution Assurance Licenses (AAL) -http://opensource.org/licenses/AAL - -BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) -http://opensource.org/licenses/BSD-3-Clause - -BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause) -http://opensource.org/licenses/BSD-2-Clause - -Boost Software License (BSL-1.0) -http://www.boost.org/users/license.html - -Computer Associates Trusted Open Source License 1.1 (CATOSL-1.1) -http://opensource.org/licenses/CATOSL-1.1 - -Common Development and Distribution License 1.0 (CDDL-1.0) -http://opensource.org/licenses/CDDL-1.0 - -Common Public Attribution License 1.0 (CPAL-1.0) -http://opensource.org/licenses/CPAL-1.0 - -CUA Office Public License Version 1.0 (CUA-OPL-1.0) -http://opensource.org/licenses/CUA-OPL-1.0 - -EU DataGrid Software License (EUDatagrid) -http://opensource.org/licenses/EUDatagrid - -Eclipse Public License 1.0 (EPL-1.0) -https://www.eclipse.org/legal/epl-v10.html - -Educational Community License, Version 2.0 (ECL-2.0) -http://opensource.org/licenses/ECL-2.0 - -Eiffel Forum License V2.0 (EFL-2.0) -http://opensource.org/licenses/EFL-2.0 - -Entessa Public License (Entessa) -http://opensource.org/licenses/entessa.php - -European Union Public License, Version 1.1 (EUPL-1.1) -http://ec.europa.eu/idabc/eupl.html - -Fair License (FAIR) -http://opensource.org/licenses/Fair - -Frameworx License (Frameworx-1.0) -http://opensource.org/licenses/Frameworx-1.0 - -GNU Affero General Public License v3 (AGPL-3.0) -http://www.gnu.org/licenses/agpl-3.0.html - -GNU General Public License version 2.0 (GPL-2.0) -http://www.gnu.org/licenses/gpl-2.0.html - -GNU General Public License version 3.0 (GPL-3.0) -http://www.gnu.org/copyleft/gpl.html - -GNU Library or "Lesser" General Public License version 2.1 (LGPL-2.1) -https://www.gnu.org/licenses/lgpl-2.1.html - -GNU Library or "Lesser" General Public License version 3.0 (LGPL-3.0) -https://www.gnu.org/licenses/lgpl.html - -Historical Permission Notice and Disclaimer (HPND) -http://opensource.org/licenses/HPND - -IBM Public License 1.0 (IPL-1.0) -http://opensource.org/licenses/IPL-1.0 - -IPA Font License (IPA) -http://opensource.org/licenses/IPA - -ISC License (ISC) -#No-link-found - -LaTeX Project Public License 1.3c (LPPL-1.3c) -http://latex-project.org/lppl/lppl-1-3c.html - -Lucent Public License Version 1.02 (LPL-1.02) -http://opensource.org/licenses/LPL-1.02 - -MirOS Licence (MirOS) -http://opensource.org/licenses/MirOS - -Microsoft Public License (Ms-PL) -http://opensource.org/licenses/MS-PL - -Microsoft Reciprocal License (Ms-RL) -http://opensource.org/licenses/MS-RL - -MIT license (MIT) -http://opensource.org/licenses/MIT - -Motosoto License (Motosoto) -http://opensource.org/licenses/Motosoto - -Mozilla Public License 2.0 (MPL-2.0) -https://www.mozilla.org/MPL/2.0/ - -Multics License (Multics) -http://opensource.org/licenses/Multics - -NASA Open Source Agreement 1.3 (NASA 1.3) -http://worldwind.arc.nasa.gov/worldwind-nosa-1.3.html - -NTP License (NTP) -http://opensource.org/licenses/NTP - -Naumen Public License (Naumen) -http://opensource.org/licenses/Naumen - -Nethack General Public License (NGPL) -http://www.nethack.org/common/license.html - -Nokia Open Source License (Nokia) -http://opensource.org/licenses/nokia.php - -Non-Profit Open Software License 3.0 (NPOSL-3.0) -http://opensource.org/licenses/NPOSL-3.0 - -OCLC Research Public License 2.0 (OCLC-2.0) -http://opensource.org/licenses/OCLC-2.0 - -Open Font License 1.1 (OFL 1.1) -http://opensource.org/licenses/OFL-1.1 - -Open Group Test Suite License (OGTSL) -http://opensource.org/licenses/OGTSL - -Open Software License 3.0 (OSL-3.0) -http://opensource.org/licenses/OSL-3.0 - -PHP License v3.0 (PHP-3.0) -http://php.net/license/3_0.txt - -PHP License v3.01 (PHP 4, PHP 5) -http://php.net/license/3_01.txt - -The PostgreSQL License (PostgreSQL) -http://www.postgresql.org/about/licence/ - -Python License (Python-2.0) -http://opensource.org/licenses/Python-2.0 - -CNRI Python license (CNRI-Python) -http://www.openfoundry.org/en/licenses/35-python-license-python - -Q Public License (QPL-1.0) -http://opensource.org/licenses/QPL-1.0 - -RealNetworks Public Source License V1.0 (RPSL-1.0) -http://opensource.org/licenses/RPSL-1.0 - -Reciprocal Public License 1.5 (RPL-1.5) -http://opensource.org/licenses/RPL-1.5 - -Ricoh Source Code Public License (RSCPL) -http://opensource.org/licenses/RSCPL - -Simple Public License 2.0 (SimPL-2.0) -http://opensource.org/licenses/Simple-2.0 - -Sleepycat License (Sleepycat) -http://opensource.org/licenses/Sleepycat - -Sun Public License 1.0 (SPL-1.0) -http://opensource.org/licenses/SPL-1.0 - -Sybase Open Watcom Public License 1.0 (Watcom-1.0) -http://www.openwatcom.org/index.php/Open_Watcom_Public_License - -University of Illinois/NCSA Open Source License (NCSA) -http://otm.illinois.edu/uiuc_openSource - -Vovida Software License v. 1.0 (VSL-1.0) -http://opensource.org/licenses/VSL-1.0 - -W3C License (W3C) -http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - -wxWindows Library License (WXwindows) -https://www.wxwidgets.org/about/licence/ - -X.Net License (Xnet) -http://opensource.org/licenses/xnet.php - -Zope Public License 2.0 (ZPL-2.0) -http://opensource.org/licenses/ZPL-2.0 - -zlib/libpng license (Zlib) -http://www.openfoundry.org/en/licenses/36-zliblibpng-license-zliblibpng - -Another -# \ No newline at end of file diff --git a/public/static/operating_systems.txt b/public/static/operating_systems.txt deleted file mode 100644 index 445ec6e..0000000 --- a/public/static/operating_systems.txt +++ /dev/null @@ -1,9 +0,0 @@ -Debian -Ubuntu -Windows -CentOS -RedHat -Mint -MacOS -Fedora -Arch \ No newline at end of file diff --git a/public/style.css b/public/style.css deleted file mode 100644 index 5d4c536..0000000 --- a/public/style.css +++ /dev/null @@ -1,112 +0,0 @@ -.mpog_hidden_field { - display: none; -} - -.dynamic-table { - border: solid 1px #000; - margin-top: 5px; - margin-bottom: 15px; -} -.dynamic-table td, .dynamic-table tr { - border: none; -} -.dynamic-table input { - width: 220px; -} - -#institution_dialog { - display: none; -} - -.errorExplanation { - color: red; - margin-left: 10px; -} - -.hide-field { - display: none !important; -} - -.show-field { - display: block !important; -} - -.formfieldline { - margin-top: 10px; -} -.formfieldline input[type="text"] { - width: 180px; -} - -#profile-data .invalid { - border-color: rgb(127, 0, 0); - box-shadow: 0px 0px 7px red; -} - -#profile-data .validated { - box-shadow: 0px 0px 7px green; - border-color: rgb(0, 80, 0); -} - -#software-name-field { - padding-bottom: 10px; -} - -#software-hostname { - padding: 0px 7px; - font-size: 18px; -} - -.mandatory::after { - color: red; - content: ' (*)'; -} - -.autocomplete_validation_message { - color: red; -} - -#content .softwares-block ul { - min-width: 196px; - width: 192px; - margin: 0px 0px 0px -3px; - padding: 0px; -} - -#content .box-1 .softwares-block ul { - width: auto; - display: block; -} - -#content .softwares-block .block-footer-content a { - background: url(../../../designs/themes/base/imgs/arrow-right-p.png) 100% 50% no-repeat; -} - -/*FIX-ME: necessary while there is -* not a defined theme style for the -* forms */ -.improve_input_size { - width: 315px !important; -} - -.software-block { - position: relative; - float: left; - overflow: hidden; -} - -.software-block-content, .software-block-finality { - width: 100%; - position: absolute; -} - -/*===== Communities rate hotspot extra fields =====*/ - -.comments-software-extra-fields div { - display: none; -} - -#content .star-rate-form .star-comment-container .comments-display-fields { - cursor: pointer; -} - diff --git a/public/vendor/jquery.js b/public/vendor/jquery.js deleted file mode 100644 index a3f4ebf..0000000 --- a/public/vendor/jquery.js +++ /dev/null @@ -1,3 +0,0 @@ -modulejs.define('jquery', function() { - return jQuery; -}); diff --git a/public/vendor/jquery.maskedinput.min.js b/public/vendor/jquery.maskedinput.min.js deleted file mode 100644 index 0d9ce6e..0000000 --- a/public/vendor/jquery.maskedinput.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - Masked Input plugin for jQuery - Copyright (c) 2007-2013 Josh Bush (digitalbush.com) - Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) - Version: 1.3.1 -*/ -(function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery); \ No newline at end of file diff --git a/public/vendor/modulejs-1.5.0.min.js b/public/vendor/modulejs-1.5.0.min.js deleted file mode 100644 index 9905b63..0000000 --- a/public/vendor/modulejs-1.5.0.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* modulejs 1.5.0 - http://larsjung.de/modulejs/ */ -!function(n){this.modulejs=n()}(function(){"use strict";function n(n){return function(r){return l.toString.call(r)==="[object "+n+"]"}}function r(n){return n===new Object(n)}function t(n,r){return l.hasOwnProperty.call(n,r)}function e(n,r,e){if(p&&n.forEach===p)n.forEach(r,e);else if(n.length===+n.length)for(var i=0,o=n.length;o>i;i+=1)r.call(e,n[i],i,n);else for(var u in n)t(n,u)&&r.call(e,n[u],u,n)}function i(n,r){for(var t=0,e=n.length;e>t;t+=1)if(n[t]===r)return!0;return!1}function o(n){var r={},i=[];return e(n,function(n){t(r,n)||(i.push(n),r[n]=1)}),i}function u(n,r,t){if(n){var e=new Error("[modulejs-"+r+"] "+t);throw e.code=r,e}}function c(n,r,a){if(u(!h(n),31,'id must be a string "'+n+'"'),!r&&t(b,n))return b[n];var f=y[n];u(!f,32,'id not defined "'+n+'"'),a=(a||[]).slice(0),a.push(n);var s=[];if(e(f.deps,function(n){u(i(a,n),33,"circular dependencies: "+a+" & "+n),r?(s=s.concat(c(n,r,a)),s.push(n)):s.push(c(n,r,a))}),r)return o(s);var d=f.fn.apply(void 0,s);return b[n]=d,d}function a(n,t,e){void 0===e&&(e=t,t=[]),u(!h(n),11,'id must be a string "'+n+'"'),u(y[n],12,'id already defined "'+n+'"'),u(!g(t),13,'dependencies for "'+n+'" must be an array "'+t+'"'),u(!r(e)&&!v(e),14,'arg for "'+n+'" must be object or function "'+e+'"'),y[n]={id:n,deps:t,fn:v(e)?e:function(){return e}}}function f(n){return c(n)}function s(){var n={};return e(y,function(r,e){n[e]={deps:r.deps.slice(0),reqs:c(e,!0),init:t(b,e)}}),e(y,function(r,t){var o=[];e(y,function(r,e){i(n[e].reqs,t)&&o.push(e)}),n[t].reqd=o}),n}function d(n){var r="\n";return e(s(),function(t,e){var i=n?t.reqd:t.reqs;r+=(t.init?"* ":" ")+e+" -> [ "+i.join(", ")+" ]\n"}),r}var l=Object.prototype,p=Array.prototype.forEach,h=n("String"),v=n("Function"),g=Array.isArray||n("Array"),y={},b={};return{define:a,require:f,state:s,log:d,_private:{isString:h,isFunction:v,isArray:g,isObject:r,has:t,each:e,contains:i,uniq:o,err:u,definitions:y,instances:b,resolve:c}}}); \ No newline at end of file diff --git a/public/views/comments-software-extra-fields.js b/public/views/comments-software-extra-fields.js deleted file mode 100644 index c270cd9..0000000 --- a/public/views/comments-software-extra-fields.js +++ /dev/null @@ -1,30 +0,0 @@ -modulejs.define('CommentsSoftwareExtraFields', ['jquery'], function($) { - 'use strict'; - - var DATA = { - information_display_state: "hidden" - } - - function set_show_additional_information() { - $(".comments-display-fields").on("click", function() { - if (DATA.information_display_state === "hidden") { - DATA.information_display_state = "show"; - $(".comments-software-extra-fields div").show(); - } else { - DATA.information_display_state = "hidden"; - $(".comments-software-extra-fields div").hide(); - } - }); - } - - return { - isCurrentPage: function() { - return $(".star-rate-form").length === 1; - }, - - - init: function() { - set_show_additional_information(); - } - } -}); diff --git a/public/views/control-panel.js b/public/views/control-panel.js deleted file mode 100644 index e7d6e29..0000000 --- a/public/views/control-panel.js +++ /dev/null @@ -1,31 +0,0 @@ -modulejs.define('ControlPanel', ['jquery'], function($) { - 'use strict'; - - function add_software_on_control_panel(control_panel) { - var software_link = $(".control-panel-software-link").remove(); - - if( software_link.size() > 0 ) { - control_panel.prepend(software_link); - } - } - - function add_itens_on_controla_panel() { - var control_panel = $(".control-panel"); - - if( control_panel.size() > 0 ) { - add_software_on_control_panel(control_panel); - } - } - - - return { - isCurrentPage: function() { - return $("#profile-editor-index").length === 1; - }, - - - init: function() { - add_itens_on_controla_panel(); - } - } -}); diff --git a/public/views/edit-software.js b/public/views/edit-software.js deleted file mode 100644 index 142077d..0000000 --- a/public/views/edit-software.js +++ /dev/null @@ -1,111 +0,0 @@ -modulejs.define('EditSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewSoftware'], function($, NoosferoRoot, AutoComplete, NewSoftware) { - 'use strict'; - - var AJAX_URL = { - get_field_data: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_field_data") - }; - - - function database_autocomplete() { - AutoComplete.enable("database", ".database_description_id", ".database_autocomplete", AJAX_URL.get_field_data); - } - - - function language_autocomplete() { - AutoComplete.enable("software_language", ".programming_language_id", ".language_autocomplete", AJAX_URL.get_field_data); - } - - - function delete_dynamic_table() { - var button = $(".delete-dynamic-table"); - - button.each(function(){ - var table = $(this).parent().parent().parent().parent(); - var color = table.css("background-color"); - - $(this).click(function(){ - table.remove(); - return false; - }).mouseover(function(){ - table.css("background-color", "#eee"); - }).mouseout(function(){ - table.css("background-color", color); - }); - }); - } - - - function has_more_than_one(table_class) { - return ($("."+table_class).length > 2); // One is always added by defaul and its hidden - } - - - function add_dynamic_table(element_id, content) { - $("#"+element_id).append(content); - } - - - function hide_show_public_software_fields() { - if ($("#software_public_software").is(":checked")) { - $(".public-software-fields").show(); - } else { - $(".public-software-fields").hide(); - } - } - - - function replace_software_creations_step() { - var software_creation_step = $("#software_creation_step").remove(); - - if( software_creation_step.size() > 0 ) { - $("#profile-data").parent().prepend(software_creation_step); - } - } - - - return { - isCurrentPage: function() { - return $("#especific-info").length === 1; - }, - - - init: function() { - var dynamic_tables = ["dynamic-databases", "dynamic-languages", "dynamic-libraries","dynamic-operating_systems"]; - - delete_dynamic_table(); - database_autocomplete(); - language_autocomplete(); - - $(".new-dynamic-table").click(function(){ - var link = $(this); - - dynamic_tables.forEach(function(value){ - if( link.hasClass(value) ) { - var table_id = value.split("-")[1]; - - var table_html = $("#table_structure_"+table_id).html(); - - add_dynamic_table(table_id, table_html); - } - }); - - delete_dynamic_table(); - database_autocomplete(); - language_autocomplete(); - - return false; - }); - - - - - hide_show_public_software_fields(); - $("#software_public_software").click(hide_show_public_software_fields); - - replace_software_creations_step(); - - NewSoftware.init(); - } - } -}); diff --git a/public/views/new-community.js b/public/views/new-community.js deleted file mode 100644 index b665e8f..0000000 --- a/public/views/new-community.js +++ /dev/null @@ -1,28 +0,0 @@ -modulejs.define("NewCommunity", ['jquery'], function($) { - - function replace_mandatory_message() { - $(".required-field").first() - .replaceWith(" Os campos em destaque são obrigatórios. "); - } - - function remove_image_builder_text() { - $("label:contains('Image builder')").hide(); - } - - function hide_organization_template_fields(){ - $('#template-options').hide(); - } - - return { - - isCurrentPage: function() { - return true; - }, - - init: function() { - replace_mandatory_message(); - remove_image_builder_text(); - hide_organization_template_fields(); - } - } -}) diff --git a/public/views/new-software.js b/public/views/new-software.js deleted file mode 100644 index 180ff70..0000000 --- a/public/views/new-software.js +++ /dev/null @@ -1,69 +0,0 @@ -modulejs.define('NewSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewCommunity'], function($, NoosferoRoot, AutoComplete, Community) { - 'use strict'; - - var AJAX_URL = { - get_license_data: - NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_license_data") - }; - - function replace_domain_and_repository_link(){ - var community_name = $("#community_name_id").val(); - var domain = 'https://'; - domain = domain.concat($("#software-hostname").text()); - - var slug_name = community_name.replace(/\s+/g, '-').toLowerCase(); - - var custom_domain = domain.concat(''); - custom_domain = custom_domain.concat('/'); - custom_domain = custom_domain.concat(slug_name); - - $("#community-identifier").val(slug_name); - $("#software-info-repository-link").val(custom_domain); - } - - function show_another_license_on_page_load() { - $("#license_info_id").trigger("change"); - } - - - function display_another_license_fields(selected) { - if( selected === "Another" ) { - $("#another_license").removeClass("hide-field"); - $("#version_link").addClass("hide-field"); - } else { - $("#another_license").addClass("hide-field"); - $("#version_link").removeClass("hide-field"); - } - } - - - function display_license_link_on_autocomplete(selected) { - var link = $("#version_" + selected.item.id).val(); - $("#version_link").attr("href", link); - - display_another_license_fields(selected.item.label); - } - - - function license_info_autocomplete() { - AutoComplete.enable( - "license_info", ".license_info_id", ".license_info_version", - AJAX_URL.get_license_data, display_license_link_on_autocomplete - ); - } - - - return { - isCurrentPage: function() { - return $('#new-software-page').length === 1; - }, - - - init: function() { - license_info_autocomplete(); - Community.init(); - - $("#community_name_id").blur(replace_domain_and_repository_link); - } - } -}); diff --git a/public/views/profile-tabs-software.js b/public/views/profile-tabs-software.js deleted file mode 100644 index 92ee237..0000000 --- a/public/views/profile-tabs-software.js +++ /dev/null @@ -1,86 +0,0 @@ -modulejs.define("ProfileTabsSoftware", ["jquery"], function($) { - "use strict"; - - function hide_infos(){ - $(".language-info").hide(); - $(".database-info").hide(); - $(".libraries-info").hide(); - $(".operating-system-info").hide(); - $(".language-button-hide").hide(); - $(".database-button-hide").hide(); - $(".libraries-button-hide").hide(); - $(".operating-system-button-hide").hide(); - } - - - function set_show_hide_dynamic_table_events() { - $(".language-button-hide").click(function(event){ - event.preventDefault(); - $(".language-info").hide(); - $(".language-button-show").show(); - $(".language-button-hide").hide(); - }); - - $(".language-button-show").click(function(event){ - event.preventDefault(); - $(".language-info").show(); - $(".language-button-show").hide(); - $(".language-button-hide").show(); - }); - - $(".operating-system-button-hide").click(function(event){ - event.preventDefault(); - $(".operating-system-info").hide(); - $(".operating-system-button-show").show(); - $(".operating-system-button-hide").hide(); - }); - - $(".operating-system-button-show").click(function(event){ - event.preventDefault(); - $(".operating-system-info").show(); - $(".operating-system-button-show").hide(); - $(".operating-system-button-hide").show(); - }); - - $(".database-button-hide").click(function(event){ - event.preventDefault(); - $(".database-info").hide(); - $(".database-button-show").show(); - $(".database-button-hide").hide(); - }); - - $(".database-button-show").click(function(event){ - event.preventDefault(); - $(".database-info").show(); - $(".database-button-show").hide(); - $(".database-button-hide").show(); - }); - - $(".libraries-button-hide").click(function(event){ - event.preventDefault(); - $(".libraries-info").hide(); - $(".libraries-button-show").show(); - $(".libraries-button-hide").hide(); - }); - - $(".libraries-button-show").click(function(event){ - event.preventDefault(); - $(".libraries-info").show(); - $(".libraries-button-show").hide(); - $(".libraries-button-hide").show(); - }); - } - - - return { - isCurrentPage: function() { - return $("#software-fields").length === 1; - }, - - - init: function() { - hide_infos(); - set_show_hide_dynamic_table_events(); - } - } -}); diff --git a/public/views/search-software-catalog.js b/public/views/search-software-catalog.js deleted file mode 100644 index 552b055..0000000 --- a/public/views/search-software-catalog.js +++ /dev/null @@ -1,172 +0,0 @@ -modulejs.define('SearchSoftwareCatalog', ['jquery', 'NoosferoRoot', 'SoftwareCatalogComponent'], function($, NoosferoRoot, SoftwareCatalogComponent) { - 'use strict'; - - var AJAX_URL = { - software_infos: - NoosferoRoot.urlWithSubDirectory("/search/software_infos") - }; - - - function dispatch_search_ajax(enable_load) { - var search_params = get_search_params(); - - if(enable_load) { - open_loading("Loading"); - } - - $.ajax({ - url: AJAX_URL.software_infos, - type: "GET", - data: search_params, - success: update_search_page_on_ajax, - error: function(){ - close_loading(); - } - }); - } - - - function get_search_params() { - var params = {}; - - params.query = $("#search-input").val(); - params.selected_categories_id = []; - - $(".categories-catalog:checked").each(function(index, element) { - params.selected_categories_id.push(element.value); - }); - - params.software_display = $("#software_display").val(); - params.sort = $("#sort").val(); - - if($("#all_radio_button").is(":checked")) { - params.software_type = $("#all_radio_button").val(); - } else { - params.software_type = $("#public_software_radio_button").val(); - } - - return params; - } - - - function get_result_div_core(message) { - $("#search-results-empty").html(message); - } - - - function catalog_message() { - var empty_result = $('#empty_result').val() === 'true'; - var user_selected_categories = $('.categories-catalog:checked').length !== 0; - - if(empty_result && !user_selected_categories) { - get_result_div_core($('#message-no-catalog-selected').val()); - } else if (empty_result && user_selected_categories) { - get_result_div_core($('#message-catalog-selected').val()); - } - } - - - function update_search_page_on_ajax(response) { - response = $(response); - - var search_list = $("#search-results"); - var selected_categories_field = $("#filter-categories-select-catalog"); - var pagination = $("#software-pagination"); - var software_count = $("#software-count"); - var individually_category = $("#individually-category"); - - var result_list = response.find("#search-results").html(); - var result_categories = response.find("#filter-categories-select-catalog").html(); - var result_pagination = response.find("#software-pagination").html(); - var result_software_count = response.find("#software-count").html(); - var result_individually_category = response.find("#individually-category").html(); - - search_list.html(result_list); - selected_categories_field.html(result_categories); - pagination.html(result_pagination); - software_count.html(result_software_count); - individually_category.html(result_individually_category); - - highlight_searched_terms(); - catalog_message(); - - hide_load_after_ajax(); - } - - - function hide_load_after_ajax() { - if ($("#overlay_loading_modal").is(":visible")) { - close_loading(); - setTimeout(hide_load_after_ajax, 1500); - } - } - - - function highlight_searched_terms() { - var searched_terms = $("#search-input").val(); - - if( searched_terms.length === 0 ) { - return undefined; - } - - var content_result = $(".search-content-result"); - var regex = new RegExp("("+searched_terms.replace(/\s/g, "|")+")", "gi"); - - content_result.each(function(i, e){ - var element = $(e); - - var new_text = element.text().replace(regex, function(text) { - return ""+text+""; - }); - - element.html(new_text); - }); - } - - - function update_page_by_ajax_on_select_change() { - dispatch_search_ajax(true); - } - - function update_page_by_text_filter() { - var text = this.value; - dispatch_search_ajax(false); - } - - - function search_input_keyup() { - var timer = null; - - $("#search-input").keyup(function() { - // Only start the search(with ajax) after 3 characters - if(this.value.length >= 3) { - timer = setTimeout(update_page_by_text_filter, 400); - } - }).keydown(function() { - clearTimeout(timer); - }); - } - - - function set_events() { - $("#software_display").change(update_page_by_ajax_on_select_change); - $("#sort").change(update_page_by_ajax_on_select_change); - - search_input_keyup(); - } - - - return { - isCurrentPage: function() { - return $('#software-search-container').length === 1; - }, - - - init: function() { - set_events(); - catalog_message(); - SoftwareCatalogComponent.init(dispatch_search_ajax); - } - } -}); - diff --git a/script/schedule_institution_update.sh b/script/schedule_institution_update.sh deleted file mode 100755 index a5d1281..0000000 --- a/script/schedule_institution_update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cp plugins/software_communities/config/institutions_update.example /etc/cron.d/institutions_update -echo "Created crontab file in /etc/cron.d/institution_update..." diff --git a/src/software_communities/.gitignore b/src/software_communities/.gitignore new file mode 100644 index 0000000..0675847 --- /dev/null +++ b/src/software_communities/.gitignore @@ -0,0 +1,6 @@ +# Backup files +*~ +*.swp +config/institutions_update +config/siorg.yml +locale diff --git a/src/software_communities/README.md b/src/software_communities/README.md new file mode 100644 index 0000000..e9c287a --- /dev/null +++ b/src/software_communities/README.md @@ -0,0 +1,94 @@ +[![Code Climate](https://codeclimate.com/github/fabio1079/noosfero-plugin/badges/gpa.svg)](https://codeclimate.com/github/fabio1079/noosfero-plugin) + +README - MPOG Software Público Plugin +================================ + +MPOG Software Público Plugin is a plugin that includes features to Novo Portal do Software Público Brasileiro (SPB). + +More information about SPB: https://www.participa.br/softwarepublico + +INSTALL +======= + +Enable Plugin +------------- + +Also, you need to enable MPOG Software Plugin on your Noosfero: + +cd +./script/noosfero-plugins enable software_communities + +Activate Plugin +--------------- + +As a Noosfero administrator user, go to administrator panel: + +- Execute the command to allow city and states to show up: + psql -U USERNAME -d NOOSFERO_DATABASE -a -f db/brazil_national_regions.sql +- Click on "Enable/disable plugins" option +- Click on "MPOG Software Plugin" check-box + +Schedule Institutions Update +---------------------------- + +./plugins/software_communities/script/schedule_institution_update.sh + + +Create Categories +------------------- + +To create the categories that a software can have run + +rake software:create_categories + +Create Licenses +----------------- + +This command populate the database with 71 licenses and it's links +rake software:create_licenses + +Translate Plugin +------------------ + +To translate the strings used in the plugin run + +ruby script/move-translations-to-plugins.rb +rake updatepo +rake noosfero:translations:compile + + +Running MPOG Software tests +-------------------- +$ ruby plugins/software_communities/test/unit/name_of_file.rb +$ cucumber plugins/software_communities/features/ + +Get Involved +============ + +If you find any bug and/or want to collaborate, please send an e-mail to arthurmde@gmail.com + +LICENSE +======= + +Copyright (c) The Author developers. + +See Noosfero license. + + +AUTHORS +======= + +Alex Campelo (campelo.al1 at gmail.com) +Arthur de Moura Del Esposte (arthurmde at gmail.com) +Daniel Bucher (daniel.bucher88 at gmail.com) +David Carlos (ddavidcarlos1392 at gmail.com) +Fabio Teixeira (fabio1079 at gmail.com) +Gustavo Jaruga (darksshades at gmail.com) +Luciano Prestes (lucianopcbr at gmail.com) +Matheus Faria (matheus.sousa.faria at gmail.com) + + +ACKNOWLEDGMENTS +=============== + +The authors have been supported by MPOG and UnB diff --git a/src/software_communities/Rakefile b/src/software_communities/Rakefile new file mode 100644 index 0000000..0de7903 --- /dev/null +++ b/src/software_communities/Rakefile @@ -0,0 +1,11 @@ +task :default => :makemo + +task :makemo do + require 'gettext' + require 'gettext/tools' + GetText.create_mofiles( + verbose: true, + po_root: 'po', + mo_root: 'locale', + ) +end diff --git a/src/software_communities/controllers/software_communities_plugin_controller.rb b/src/software_communities/controllers/software_communities_plugin_controller.rb new file mode 100644 index 0000000..d3bb2c5 --- /dev/null +++ b/src/software_communities/controllers/software_communities_plugin_controller.rb @@ -0,0 +1,54 @@ +# apenas software +require 'csv' +class SoftwareCommunitiesPluginController < ApplicationController + + def get_license_data + return render :json=>{} if !request.xhr? || params[:query].nil? + + data = if params[:query].empty? + LicenseInfo.all + else + LicenseInfo.where("version ILIKE ?", "%#{params[:query]}%").select("id, version") + end + render :json=> data.collect { |license| + {:id=>license.id, :label=>license.version} + } + + end + + def get_block_template + 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 + case params[:field] + when "software_language" + return ProgrammingLanguage + else + return DatabaseDescription + end + end +end diff --git a/src/software_communities/controllers/software_communities_plugin_myprofile_controller.rb b/src/software_communities/controllers/software_communities_plugin_myprofile_controller.rb new file mode 100644 index 0000000..256539a --- /dev/null +++ b/src/software_communities/controllers/software_communities_plugin_myprofile_controller.rb @@ -0,0 +1,194 @@ +class SoftwareCommunitiesPluginMyprofileController < MyProfileController + append_view_path File.join(File.dirname(__FILE__) + '/../views') + + def index + end + + def new_software + set_software_as_template + + @community = Community.new(params[:community]) + @community.environment = environment + @software_info = SoftwareInfo.new(params[:software_info]) + + @license_info = if params[:license].blank? or params[:license][:license_infos_id].blank? + LicenseInfo.new + else + LicenseInfo.find(params[:license][:license_infos_id]) + end + + control_software_creation + update_new_software_errors + end + + def edit_software + update_software_atributes + + return unless request.post? + + @software_info = constroy_software + software_info_insert_models.call(@list_libraries, 'libraries') + software_info_insert_models.call(@list_languages, 'software_languages') + software_info_insert_models.call(@list_databases, 'software_databases') + software_info_insert_models.call(@list_operating_systems, 'operating_systems') + + begin + @software_info.save! + + @community = @software_info.community + @community.update_attributes!(params[:community]) + + if params[:commit] == _('Save and Configure Community') + redirect_to :controller => 'profile_editor', :action => 'edit' + else + redirect_to :controller => 'profile_editor', :action => 'index' + session[:notice] = _('Software updated successfully') + end + rescue ActiveRecord::RecordInvalid => invalid + update_new_software_errors + session[:notice] = _('Could not update software') + end + end + + def disabled_public_software_field + !environment.admins.include?(current_user.person) + end + + private + + def add_software_erros + @errors = [] + @errors |= @community.errors.full_messages if @community + @errors |= @software_info.errors.full_messages if @software_info + @errors |= @license_info.errors.full_messages if @license_info + end + + def control_software_creation + valid_models = request.post? && (@community.valid? && @software_info.valid? && @license_info.valid?) + if valid_models + send_software_to_moderation + else + add_software_erros + end + end + + def software_info_insert_models + proc { |list,model_attr| + @software_info.send(model_attr).destroy_all + list.collect!{|m| @software_info.send(model_attr) << m } unless list.nil? + } + end + + def constroy_software + @software_info = @profile.software_info + params[:software][:public_software] ||= false unless @software_info.public_software? + @license = LicenseInfo.find(params[:license][:license_infos_id]) + @software_info.license_info = @license + @software_info.update_attributes(params[:software]) + + another_license_version = nil + another_license_link = nil + if params[:license] + another_license_version = params[:license][:version] + another_license_link = params[:license][:link] + end + + @software_info.verify_license_info(another_license_version, another_license_link) + + create_list_model_helpers + + @software_info + end + + def create_list_model_helpers + @list_libraries = LibraryHelper.list_library(params[:library]) + @list_languages = SoftwareLanguageHelper.list_language(params[:language]) + @list_databases = DatabaseHelper.list_database(params[:database]) + @list_operating_systems = OperatingSystemHelper.list_operating_system(params[:operating_system]) + end + + def send_software_to_moderation + another_license_version = "" + another_license_link = "" + if params[:license] + another_license_version = params[:license][:version] + another_license_link = params[:license][:link] + end + @software_info = SoftwareInfo.create_after_moderation(user, + params[:software_info].merge({ + :environment => environment, + :name => params[:community][:name], + :identifier => params[:community][:identifier], + :image_builder => params[:community][:image_builder], + :license_info => @license_info, + :another_license_version => another_license_version, + :another_license_link => another_license_link })) + + add_admin_to_community + + if !environment.admins.include?(current_user.person) + session[:notice] = _('Your new software request will be evaluated by an'\ + 'administrator. You will be notified.') + redirect_to user.admin_url + else + redirect_to :controller => 'profile_editor', + :action => 'edit', + :profile => @community.identifier + end + end + + def update_software_atributes + @software_info = @profile.software_info + @list_libraries = @software_info.libraries + @list_databases = @software_info.software_databases + @list_languages = @software_info.software_languages + @list_operating_systems = @software_info.operating_systems + @disabled_public_software_field = disabled_public_software_field + + @license_version = @software_info.license_info.version + @license_id = @software_info.license_info.id + @another_license_version = "" + @another_license_link = "" + + license_another = LicenseInfo.find_by_version("Another") + if license_another && @software_info.license_info_id == license_another.id + @license_version = "Another" + @another_license_version = @software_info.license_info.version + @another_license_link = @software_info.license_info.link + end + end + + def set_software_as_template + software_template = Community['software'] + software_valid = !software_template.blank? && software_template.is_template && !params['community'].blank? + if software_valid + params['community']['template_id'] = software_template.id if software_valid + end + end + + def add_admin_to_community + unless params[:q].nil? + admins = params[:q].split(/,/).map{ |n| environment.people.find n.to_i } + admins.each do |admin| + @community.add_member(admin) + @community.add_admin(admin) + end + end + end + + def update_new_software_errors + if request.post? + @community.valid? if @community + @software_info.valid? if @software_info + @license_info.valid? if @license_info + add_software_erros + end + + + @error_community_name = @community.errors.include?(:name) ? "highlight-error" : "" if @community + @error_software_acronym = @software_info.errors.include?(:acronym) ? "highlight-error" : "" if @software_info + @error_software_domain = @community.errors.include?(:identifier) ? "highlight-error" : "" if @community + @error_software_finality = @software_info.errors.include?(:finality) ? "highlight-error" : "" if @software_info + @error_software_license = @license_info.errors.include?(:version) ? "highlight-error" : "" if @license_info + end +end diff --git a/src/software_communities/controllers/software_communities_plugin_profile_controller.rb b/src/software_communities/controllers/software_communities_plugin_profile_controller.rb new file mode 100644 index 0000000..9f80e73 --- /dev/null +++ b/src/software_communities/controllers/software_communities_plugin_profile_controller.rb @@ -0,0 +1,49 @@ +class SoftwareCommunitiesPluginProfileController < ProfileController + append_view_path File.join(File.dirname(__FILE__) + '/../views') + + before_filter :validate_download_params, only: [:download_file] + + ERROR_MESSAGES = { + :not_found => _("Could not find the download file"), + :invalid_params => _("Invalid download params") + } + + def download_file + download_block = DownloadBlock.find_by_id params[:block] + index = params[:download_index].to_i + + if download_block and (index < download_block.downloads.size) + download = Download.new(download_block.downloads[index]) + + download.total_downloads += 1 + download_block.downloads[index] = download.to_hash + download_block.save + + redirect_to download.link + else + session[:notice] = ERROR_MESSAGES[:not_found] + render_not_found + end + end + + private + + def validate_download_params + valid_block = (!params[:block].nil?) and (params[:block].to_i > 0) + valid_index = params[:download_index].to_i >= 0 + + if !valid_block or !valid_index + session[:notice] = ERROR_MESSAGES[:invalid_params] + safe_redirect_back + end + end + + def safe_redirect_back + begin + redirect_to :back + rescue ActionController::RedirectBackError + # There is no :back if it is a copied url + render_not_found + end + end +end diff --git a/src/software_communities/db/migrate/20140523132016_create_controlled_vocabulary_table.rb b/src/software_communities/db/migrate/20140523132016_create_controlled_vocabulary_table.rb new file mode 100644 index 0000000..8b5ec6e --- /dev/null +++ b/src/software_communities/db/migrate/20140523132016_create_controlled_vocabulary_table.rb @@ -0,0 +1,35 @@ +class CreateControlledVocabularyTable < ActiveRecord::Migration + def up + create_table :controlled_vocabulary do |t| + t.references :software_info + t.boolean :administration + t.boolean :agriculture + t.boolean :business_and_services + t.boolean :communication + t.boolean :culture + t.boolean :national_defense + t.boolean :economy_and_finances + t.boolean :education + t.boolean :energy + t.boolean :sports + t.boolean :habitation + t.boolean :industry + t.boolean :environment + t.boolean :research_and_development + t.boolean :social_security + t.boolean :social_protection + t.boolean :international_relations + t.boolean :sanitation + t.boolean :health + t.boolean :security_public_order + t.boolean :work + t.boolean :transportation + t.boolean :urbanism + + end + end + + def down + drop_table :controlled_vocabulary + end +end diff --git a/src/software_communities/db/migrate/20140528193902_create_license_infos_table.rb b/src/software_communities/db/migrate/20140528193902_create_license_infos_table.rb new file mode 100644 index 0000000..0024f7d --- /dev/null +++ b/src/software_communities/db/migrate/20140528193902_create_license_infos_table.rb @@ -0,0 +1,15 @@ +class CreateLicenseInfosTable < ActiveRecord::Migration + def self.up + create_table :license_infos do |t| + t.string :version + t.string :link + end + + link = "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" + LicenseInfo.create(:version => "CC-GPL-V2", :link => link) + end + + def self.down + drop_table :license_infos + end +end diff --git a/src/software_communities/db/migrate/20140528193905_create_software_infos_table.rb b/src/software_communities/db/migrate/20140528193905_create_software_infos_table.rb new file mode 100644 index 0000000..5d7944a --- /dev/null +++ b/src/software_communities/db/migrate/20140528193905_create_software_infos_table.rb @@ -0,0 +1,23 @@ +class CreateSoftwareInfosTable < ActiveRecord::Migration + def self.up + create_table :software_infos do |t| + t.references :license_info + t.references :community + t.boolean :e_mag, :default => false + t.boolean :icp_brasil,:default => false + t.boolean :intern, :default => false + t.boolean :e_ping, :default => false + t.boolean :e_arq, :default => false + t.string :name, :default => ' ' + t.string :operating_platform + t.string :demonstration_url + t.string :acronym + t.text :objectives + t.text :features + end + end + + def self.down + drop_table :software_infos + end +end diff --git a/src/software_communities/db/migrate/20140528193927_create_libraries_table.rb b/src/software_communities/db/migrate/20140528193927_create_libraries_table.rb new file mode 100644 index 0000000..3200454 --- /dev/null +++ b/src/software_communities/db/migrate/20140528193927_create_libraries_table.rb @@ -0,0 +1,14 @@ +class CreateLibrariesTable < ActiveRecord::Migration + def self.up + create_table :libraries do |t| + t.string :name + t.string :version + t.string :license + t.references :software_info + end + end + + def self.down + drop_table :libraries + end +end diff --git a/src/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb b/src/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb new file mode 100644 index 0000000..2c939eb --- /dev/null +++ b/src/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb @@ -0,0 +1,13 @@ +class CreateProgrammingLanguagesTable < ActiveRecord::Migration + def self.up + create_table :programming_languages do |t| + t.string :name + end + + SoftwareHelper.create_list_with_file("plugins/software_communities/public/static/languages.txt", ProgrammingLanguage) + end + + def self.down + drop_table :programming_languages + end +end diff --git a/src/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb b/src/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb new file mode 100644 index 0000000..af2dda7 --- /dev/null +++ b/src/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb @@ -0,0 +1,14 @@ +class CreateDatabaseDescriptionsTable < ActiveRecord::Migration + def self.up + create_table :database_descriptions do |t| + t.string :name + end + + path_to_file = "plugins/software_communities/public/static/databases.txt" + SoftwareHelper.create_list_with_file(path_to_file, DatabaseDescription) + end + + def self.down + drop_table :database_descriptions + end +end diff --git a/src/software_communities/db/migrate/20140528194129_create_software_databases_table.rb b/src/software_communities/db/migrate/20140528194129_create_software_databases_table.rb new file mode 100644 index 0000000..a70c4b7 --- /dev/null +++ b/src/software_communities/db/migrate/20140528194129_create_software_databases_table.rb @@ -0,0 +1,14 @@ +class CreateSoftwareDatabasesTable < ActiveRecord::Migration + def self.up + create_table :software_databases do |t| + t.string :version + t.string :operating_system + t.references :database_description + t.references :software_info + end + end + + def self.down + drop_table :software_databases + end +end diff --git a/src/software_communities/db/migrate/20140528211914_create_software_languages_table.rb b/src/software_communities/db/migrate/20140528211914_create_software_languages_table.rb new file mode 100644 index 0000000..b08a37c --- /dev/null +++ b/src/software_communities/db/migrate/20140528211914_create_software_languages_table.rb @@ -0,0 +1,14 @@ +class CreateSoftwareLanguagesTable < ActiveRecord::Migration + def self.up + create_table :software_languages do |t| + t.references :software_info + t.references :programming_language + t.string :version + t.string :operating_system + end + end + + def self.down + drop_table :software_languages + end +end diff --git a/src/software_communities/db/migrate/20140710185444_create_operating_system_table.rb b/src/software_communities/db/migrate/20140710185444_create_operating_system_table.rb new file mode 100644 index 0000000..1d5bcdc --- /dev/null +++ b/src/software_communities/db/migrate/20140710185444_create_operating_system_table.rb @@ -0,0 +1,13 @@ +class CreateOperatingSystemTable < ActiveRecord::Migration + def up + create_table :operating_systems do |t| + t.string :name + t.string :version + t.references :software_info + end + end + + def down + drop_table :operating_systems + end +end diff --git a/src/software_communities/db/migrate/20140711144012_remove_name_from_software_info.rb b/src/software_communities/db/migrate/20140711144012_remove_name_from_software_info.rb new file mode 100644 index 0000000..4a72d82 --- /dev/null +++ b/src/software_communities/db/migrate/20140711144012_remove_name_from_software_info.rb @@ -0,0 +1,9 @@ +class RemoveNameFromSoftwareInfo < ActiveRecord::Migration + def up + remove_column :software_infos, :name + end + + def down + add_column :software_infos, :name, :string + end +end diff --git a/src/software_communities/db/migrate/20140714133901_create_operating_name_table.rb b/src/software_communities/db/migrate/20140714133901_create_operating_name_table.rb new file mode 100644 index 0000000..610bcec --- /dev/null +++ b/src/software_communities/db/migrate/20140714133901_create_operating_name_table.rb @@ -0,0 +1,14 @@ +class CreateOperatingNameTable < ActiveRecord::Migration + def up + create_table :operating_system_names do |t| + t.string :name + end + + path_to_file = "plugins/software_communities/public/static/operating_systems.txt" + SoftwareHelper.create_list_with_file(path_to_file, OperatingSystemName) + end + + def down + drop_table :operating_system_names + end +end diff --git a/src/software_communities/db/migrate/20140714135007_change_operating_systems_table.rb b/src/software_communities/db/migrate/20140714135007_change_operating_systems_table.rb new file mode 100644 index 0000000..313bb17 --- /dev/null +++ b/src/software_communities/db/migrate/20140714135007_change_operating_systems_table.rb @@ -0,0 +1,16 @@ +class ChangeOperatingSystemsTable < ActiveRecord::Migration + def up + change_table :operating_systems do |t| + t.remove :name + t.references :operating_system_name + end + + end + + def down + change_table :operating_systems do |t| + t.string :name + t.remove :operating_system_name_id + end + end +end diff --git a/src/software_communities/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb b/src/software_communities/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb new file mode 100644 index 0000000..0d9a7b1 --- /dev/null +++ b/src/software_communities/db/migrate/20140909185547_rename_controlled_vocabulary_to_software_categories.rb @@ -0,0 +1,9 @@ +class RenameControlledVocabularyToSoftwareCategories < ActiveRecord::Migration + def up + rename_table :controlled_vocabulary, :software_categories + end + + def down + rename_table :software_categories, :controlled_vocabulary + end +end diff --git a/src/software_communities/db/migrate/20141007140419_add_finality_field_to_software_table.rb b/src/software_communities/db/migrate/20141007140419_add_finality_field_to_software_table.rb new file mode 100644 index 0000000..941ce26 --- /dev/null +++ b/src/software_communities/db/migrate/20141007140419_add_finality_field_to_software_table.rb @@ -0,0 +1,9 @@ +class AddFinalityFieldToSoftwareTable < ActiveRecord::Migration + def up + add_column :software_infos, :finality, :string, :limit => 140 + end + + def down + remove_column :software_info, :finality + end +end diff --git a/src/software_communities/db/migrate/20141013193939_add_repository_link_to_software.rb b/src/software_communities/db/migrate/20141013193939_add_repository_link_to_software.rb new file mode 100644 index 0000000..61c557e --- /dev/null +++ b/src/software_communities/db/migrate/20141013193939_add_repository_link_to_software.rb @@ -0,0 +1,9 @@ +class AddRepositoryLinkToSoftware < ActiveRecord::Migration + def up + add_column :software_infos, :repository_link, :string + end + + def down + remove_column :software_infos, :repository_link + end +end diff --git a/src/software_communities/db/migrate/20141103180655_add_public_software_field_validation.rb b/src/software_communities/db/migrate/20141103180655_add_public_software_field_validation.rb new file mode 100644 index 0000000..563c2ee --- /dev/null +++ b/src/software_communities/db/migrate/20141103180655_add_public_software_field_validation.rb @@ -0,0 +1,9 @@ +class AddPublicSoftwareFieldValidation < ActiveRecord::Migration + def up + add_column :software_infos, :public_software, :boolean, :default => false + end + + def down + remove_column :software_infos, :public_software + end +end diff --git a/src/software_communities/db/migrate/20141105173616_add_first_edit_to_software.rb b/src/software_communities/db/migrate/20141105173616_add_first_edit_to_software.rb new file mode 100644 index 0000000..a8b058e --- /dev/null +++ b/src/software_communities/db/migrate/20141105173616_add_first_edit_to_software.rb @@ -0,0 +1,9 @@ +class AddFirstEditToSoftware < ActiveRecord::Migration + def up + add_column :software_infos, :first_edit, :boolean, :default => true + end + + def down + remove_column :software_infos, :first_edit + end +end diff --git a/src/software_communities/db/migrate/20141216183111_remove_operating_system_from_software_database.rb b/src/software_communities/db/migrate/20141216183111_remove_operating_system_from_software_database.rb new file mode 100644 index 0000000..6dcdf7e --- /dev/null +++ b/src/software_communities/db/migrate/20141216183111_remove_operating_system_from_software_database.rb @@ -0,0 +1,9 @@ +class RemoveOperatingSystemFromSoftwareDatabase < ActiveRecord::Migration + def up + remove_column :software_databases, :operating_system + end + + def down + add_column :software_databases, :operating_system, :string + end +end diff --git a/src/software_communities/db/migrate/20141216183459_remove_operating_system_from_software_language.rb b/src/software_communities/db/migrate/20141216183459_remove_operating_system_from_software_language.rb new file mode 100644 index 0000000..deb0f3f --- /dev/null +++ b/src/software_communities/db/migrate/20141216183459_remove_operating_system_from_software_language.rb @@ -0,0 +1,9 @@ +class RemoveOperatingSystemFromSoftwareLanguage < ActiveRecord::Migration + def up + remove_column :software_languages, :operating_system + end + + def down + add_column :software_languages, :operating_system, :string + end +end diff --git a/src/software_communities/db/migrate/20150209170529_add_settings_field_to_software_info.rb b/src/software_communities/db/migrate/20150209170529_add_settings_field_to_software_info.rb new file mode 100644 index 0000000..c75c536 --- /dev/null +++ b/src/software_communities/db/migrate/20150209170529_add_settings_field_to_software_info.rb @@ -0,0 +1,9 @@ +class AddSettingsFieldToSoftwareInfo < ActiveRecord::Migration + def up + add_column :software_infos, :settings, :text + end + + def down + remove_column :software_info, :settings + end +end diff --git a/src/software_communities/db/migrate/20150210182519_rename_cc_license.rb b/src/software_communities/db/migrate/20150210182519_rename_cc_license.rb new file mode 100644 index 0000000..9cc7fc8 --- /dev/null +++ b/src/software_communities/db/migrate/20150210182519_rename_cc_license.rb @@ -0,0 +1,13 @@ +class RenameCcLicense < ActiveRecord::Migration + def up + license = LicenseInfo.find_by_version "CC-GPL-V2" + license.version = "Creative Commons GPL V2" + license.save! + end + + def down + license = LicenseInfo.find_by_version "Creative Commons GPL V2" + license.version = "CC-GPL-V2" + license.save! + end +end diff --git a/src/software_communities/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb b/src/software_communities/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb new file mode 100644 index 0000000..d6c186c --- /dev/null +++ b/src/software_communities/db/migrate/20150914185902_add_people_benefited_and_saved_value_to_organization_rating.rb @@ -0,0 +1,11 @@ +class AddPeopleBenefitedAndSavedValueToOrganizationRating < ActiveRecord::Migration + def up + add_column :organization_ratings, :people_benefited, :integer + add_column :organization_ratings, :saved_value, :decimal + end + + def down + remove_column :organization_ratings, :people_benefited + remove_column :organization_ratings, :saved_value + end +end diff --git a/src/software_communities/features/deactivate_user.feature b/src/software_communities/features/deactivate_user.feature new file mode 100644 index 0000000..a6dccdc --- /dev/null +++ b/src/software_communities/features/deactivate_user.feature @@ -0,0 +1,45 @@ +Feature: deactivate user + As a environment admin + I want to be able deactivate my account + So that user data remains persisted and allows the reactivation of the account + + 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 I go to /account/logout + And the following users + | login | name | email | + | joaosilva | Joao Silva | joaosilva@example.com | + And I am logged in as "joaosilva" + + + @selenium-fixme + Scenario: successfull deactivation + Given I go to joaosilva's control panel + And I follow "Edit Profile" + And I follow "Delete profile" + And I follow "Yes, I am sure" + Then I am not logged in + When I go to /profile/joaosilva + Then I should see "This profile is inaccessible." + + @selenium-fixme + Scenario: successfull reactivation of account + Given I go to joaosilva's control panel + And I follow "Edit Profile" + And I follow "Delete profile" + And I follow "Yes, I am sure" + And I go to the homepage + When I follow "Login" + And I follow "New user" + And I fill in the following within ".no-boxes": + | e-Mail | joaosilva@example.com | + | Full name | 123 | + And I follow "Reactive account" + And I fill in the following within ".no-boxes": + | Username or Email | joaosilva@example.com | + And I press "Send instructions" + Then I should see "An e-mail was just sent to your e-mail address" diff --git a/src/software_communities/features/public_software_validation.feature b/src/software_communities/features/public_software_validation.feature new file mode 100644 index 0000000..6f26b1d --- /dev/null +++ b/src/software_communities/features/public_software_validation.feature @@ -0,0 +1,49 @@ +Feature: edit adherent fields + As a user + I want to edit adherent fields + to mantain my public software up to date. + + Background: + Given "SoftwareCommunitiesPlugin" plugin is enabled + And the following users + | login | name | email | + | joaosilva | Joao Silva | joaosilva@example.com | + | mariasilva | Maria Silva | mariasilva@example.com | + And the following softwares + | name | public_software | finality | + | basic software | true | basic software finality | + And SoftwareInfo has initial default values on database + And I am logged in as mpog_admin + And I go to /admin/plugins + And I check "SoftwareCommunitiesPlugin" + Then I press "Save changes" + + Scenario: Disable public software checkbox to non admin users + Given I am logged in as "joaosilva" + And I go to /myprofile/basic-software/plugin/software_communities/edit_software + And I follow "Specifications" + Then I should see "Public software" within ".public_software_disabled" + + Scenario: Enable public software checkbox to admin users + Given I am logged in as mpog_admin + And I go to /myprofile/basic-software/plugin/software_communities/edit_software + And I follow "Specifications" + Then I should see "Public software" within ".public_software_enabled" + + @selenium + Scenario: Show adherent fields when checkbox are checked + Given I am logged in as mpog_admin + And I go to /myprofile/basic-software/plugin/software_communities/edit_software + And I follow "Specifications" + And I uncheck "software[public_software]" + And I check "software[public_software]" + Then I should see "Adherent to e-ping ?" + + @selenium + Scenario: Don't show adherent fields when checkbox are not checked + Given I am logged in as mpog_admin + And I go to /myprofile/basic-software/plugin/software_communities/edit_software + And I follow "Specifications" + And I check "software[public_software]" + And I uncheck "software[public_software]" + Then I should not see "Adherent to e-ping ?" diff --git a/src/software_communities/features/software_block.feature b/src/software_communities/features/software_block.feature new file mode 100644 index 0000000..1f8cf8b --- /dev/null +++ b/src/software_communities/features/software_block.feature @@ -0,0 +1,48 @@ +Feature: edit adherent fields + As a user + I want to edit adherent fields + to mantain my public software up to date. + + 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 the following softwares + | name | public_software | finality | + | Public Software | true | some finality | + | Generic Software | false | some finality | + + Scenario: Add software block + Given I am logged in as mpog_admin + And I follow "Control panel" + And I follow "Edit sideboxes" + When I follow "Add a block" + And I choose "Softwares" + And I press "Add" + Then I should see "softwares" + + Scenario: Change software block to generic software block + Given I am logged in as mpog_admin + And I follow "Control panel" + And I follow "Edit sideboxes" + When I follow "Add a block" + And I choose "Softwares" + And I press "Add" + And I follow "Edit" within ".softwares-block" + And I select "Generic" from "block_software_type" + And I press "Save" + Then I should see "generic software" + + Scenario: Change software block to generic software block + Given I am logged in as mpog_admin + And I follow "Control panel" + And I follow "Edit sideboxes" + When I follow "Add a block" + And I choose "Softwares" + And I press "Add" + And I follow "Edit" within ".softwares-block" + And I select "Public" from "block_software_type" + And I press "Save" + Then I should see "public software" \ No newline at end of file diff --git a/src/software_communities/features/software_catalog.feature b/src/software_communities/features/software_catalog.feature new file mode 100644 index 0000000..e0988cf --- /dev/null +++ b/src/software_communities/features/software_catalog.feature @@ -0,0 +1,82 @@ +Feature: Search software + As a user + I want to be able to search catalogued software + So that I find a software that fit my needs + 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 I go to /account/logout + And the following categories + | name | display_in_menu | + | Software | true | + And the following categories + | parent | name | display_in_menu | + | Software | Health | true | + | Software | Education | true | + And the following softwares + | name | public_software | categories | finality | + | Software One | true | Health | some finality | + | Software Two | true | Health, Education | some finality | + | Software Three | false | Education | some finality | + + + Scenario: Show all "public_software" softwares when open search page + Given I go to /search/software_infos + Then I should see "Software One" + Then I should see "Software Two" + + Scenario: Show all "public_software" softwares when search software + Given I go to /search/software_infos + And I fill in "search-input" with "Software" + Then I should see "Software One" + Then I should see "Software Two" + + @selenium + Scenario: Show software "One" when searching for "Software One" + Given I go to /search/software_infos + And I fill in "search-input" with "One" + And I keyup on selector "#search-input" + Then I should see "Software One" + Then I should not see "Software Two" + + @selenium + Scenario: Show software ordered by name when "Name A-Z" is selected + Given I go to /search/software_infos + And I select "Name A-Z" from "sort" + And I press "Filter" + Then I should see "Software One" before "Software Two" + + @selenium + Scenario: Show software in reverse order by name when "Name Z-A" is selected + Given I go to /search/software_infos + And I select "Name Z-A" from "sort" + And I sleep for 3 seconds + Then I should see "Software Two" before "Software One" + + @selenium + Scenario: Show only "Software Two" when searching for "Education" category + Given I go to /search/software_infos + And I click on anything with selector "#filter-option-catalog-software" + And I check "Education" + Then I should see "Software Two" + And I should not see "Software One" + + @selenium + Scenario: Show both Software "One" and "Two" when searching for "Health" category + Given I go to /search/software_infos + And I click on anything with selector "#filter-option-catalog-software" + And I check "Health" + Then I should see "Software One" + And I should see "Software Two" + + @selenium + Scenario: Show not "public_software" when "Include in results" is checked + Given I go to /search/software_infos + And I click on anything with selector "#filter-option-catalog-software" + And I check "include_non_public" + Then I should see "Software One" + And I should see "Software Two" + And I should see "Software Three" diff --git a/src/software_communities/features/software_registration.feature b/src/software_communities/features/software_registration.feature new file mode 100644 index 0000000..86c7d7a --- /dev/null +++ b/src/software_communities/features/software_registration.feature @@ -0,0 +1,87 @@ +Feature: edit public software information + As a user + I want to add public software information to a software + So that I can have software communities on my network + + Background: + Given "SoftwareCommunitiesPlugin" plugin is enabled + And SoftwareInfo has initial default values on database + And I am logged in as mpog_admin + And I go to /admin/plugins + And I check "SoftwareCommunitiesPlugin" + And I press "Save changes" + And I go to /myprofile/mpog-admin + And the following softwares + | name | public_software | finality | + | basic software | true | basic software finality | + + @selenium + Scenario: Show SoftwareLangue fields when click in New Language + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software + When I follow "Specifications" + And I follow "New language" + And I should see "3" of this selector ".software-language-table" + And I follow "Delete" + Then I should see "2" of this selector ".software-language-table" + #3 because one is always hidden + + @selenium + Scenario: Show databasefields when click in New database + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software + When I follow "Specifications" + And I follow "New Database" + And I should see "3" of this selector ".database-table" + And I follow "Delete" + Then I should see "2" of this selector ".database-table" + #3 because one is always hidden + + @selenium + Scenario: Software database name should be an autocomplete + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software + When I follow "Specifications" + And I follow "New Database" + And I type in "my" in autocomplete list ".database_autocomplete" and I choose "MySQL" + Then selector ".database_autocomplete" should have any "MySQL" + + @selenium + Scenario: Software database name should be an autocomplete + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software + When I follow "Specifications" + And I follow "New language" + And I type in "py" in autocomplete list ".language_autocomplete" and I choose "Python" + Then selector ".database_autocomplete" should have any "Python" + + @selenium + Scenario: Create software with all dynamic table fields filled + Given I go to /myprofile/basic-software/plugin/software_communities/edit_software + When I follow "Specifications" + And I follow "New language" + And I type in "py" in autocomplete list ".language_autocomplete" and I choose "Python" + And I fill in "language__version" with "1.2.3" + And I follow "New Database" + And I type in "my" in autocomplete list ".database_autocomplete" and I choose "MySQL" + And I fill in "database__version" with "4.5.6" + Then I press "Save" + And I follow "Software Info" + And I follow "Specifications" + And selector ".language_autocomplete" should have any "Python" + And selector "#language__version" should have any "1.2.3" + And selector ".database_autocomplete" should have any "MySQL" + And selector "#database__version" should have any "4.5.6" + + @selenium + Scenario: Show license link when a license is selected + Given I am on mpog-admin's control panel + And I follow "Create a new software" + And I fill in "community_name_id" with "another software" + And I fill in "community-identifier" with "another-software" + And I fill in "software_info_finality" with "another software finality" + And I type in "gp" in autocomplete list "#license_info_version" and I choose "GPL-2" + And I should see "Read license" within "#version_link" + And I press "Create" + And I should see "Configure Software Community" + And I press "Save" + And I should see "Control Panel" + And I follow "Software Info" + And I type in "gp" in autocomplete list "#license_info_version" and I choose "GPL-3" + Then I should see "Read license" within "#version_link" diff --git a/src/software_communities/features/step_definitions/software_communities_steps.rb b/src/software_communities/features/step_definitions/software_communities_steps.rb new file mode 100644 index 0000000..e87447b --- /dev/null +++ b/src/software_communities/features/step_definitions/software_communities_steps.rb @@ -0,0 +1,202 @@ +Given /^SoftwareInfo has initial default values on database$/ do + LicenseInfo.create(:version=>"None", :link=>"") + LicenseInfo.create(:version=>"GPL-2", :link =>"www.gpl2.com") + LicenseInfo.create(:version=>"GPL-3", :link =>"www.gpl3.com") + + ProgrammingLanguage.create(:name=>"C") + ProgrammingLanguage.create(:name=>"C++") + ProgrammingLanguage.create(:name=>"Ruby") + ProgrammingLanguage.create(:name=>"Python") + + DatabaseDescription.create(:name => "Oracle") + DatabaseDescription.create(:name => "MySQL") + DatabaseDescription.create(:name => "Apache") + DatabaseDescription.create(:name => "PostgreSQL") + + OperatingSystemName.create(:name=>"Debian") + OperatingSystemName.create(:name=>"Fedora") + OperatingSystemName.create(:name=>"CentOS") +end + + +Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| + # Wait the page javascript load + sleep 1 + # Basicaly it, search for the input field, type something, wait for ajax end select an item + page.driver.browser.execute_script %Q{ + var search_query = "#{input_field_selector}.ui-autocomplete-input"; + var input = jQuery(search_query).first(); + + input.trigger('click'); + input.val('#{typed}'); + input.trigger('keydown'); + + window.setTimeout(function(){ + search_query = ".ui-menu-item a:contains('#{should_select}')"; + var typed = jQuery(search_query).first(); + + typed.trigger('mouseenter').trigger('click'); + console.log(jQuery('#license_info_id')); + }, 1000); + } + sleep 1 +end + + +Given /^the following software language$/ do |table| + table.hashes.each do |item| + programming_language = ProgrammingLanguage.where(:name=>item[:programing_language]).first + software_language = SoftwareLanguage::new + + software_language.programming_language = programming_language + software_language.version = item[:version] + software_language.operating_system = item[:operating_system] + + software_language.save! + end +end + +Given /^the following software databases$/ do |table| + table.hashes.each do |item| + database_description = DatabaseDescription.where(:name=>item[:database_name]).first + software_database = SoftwareDatabase::new + + software_database.database_description = database_description + software_database.version = item[:version] + software_database.operating_system = item[:operating_system] + + software_database.save! + end +end + + +Given /^the following operating systems$/ do |table| + table.hashes.each do |item| + operating_system_name = OperatingSystemName.where(:name=>item[:operating_system_name]).first + operating_system = OperatingSystem::new + + operating_system.operating_system_name = operating_system_name + operating_system.version = item[:version] + + operating_system.save! + end +end + +Given /^the following softwares$/ do |table| + table.hashes.each do |item| + software_info = SoftwareInfo.new + software_info.community = Community.create(:name=>item[:name]) + + software_info.finality = item[:finality] if item[:finality] + software_info.acronym = item[:acronym] if item[:acronym] + software_info.finality = item[:finality] if item[:finality] + software_info.finality ||= "something" + software_info.operating_platform = item[:operating_platform] if item[:operating_platform] + software_info.objectives = item[:objectives] if item[:objectives] + software_info.features = item[:features] if item[:features] + software_info.public_software = item[:public_software] == "true" if item[:public_software] + software_info.license_info = LicenseInfo.create :version=>"GPL - 1.0" + + if item[:software_language] + programming_language = ProgrammingLanguage.where(:name=>item[:software_language]).first + software_language = SoftwareLanguage.where(:programming_language_id=>programming_language).first + software_info.software_languages << software_language + end + + if item[:software_database] + database_description = DatabaseDescription.where(:name=>item[:software_database]).first + software_database = SoftwareDatabase.where(:database_description_id=>database_description).first + software_info.software_databases << software_database + end + + if item[:operating_system] + operating_system_name = OperatingSystemName.where(:name => item[:operating_system]).first + operating_system = OperatingSystem.where(:operating_system_name_id => operating_system_name).first + software_info.operating_systems << operating_system + end + + if item[:categories] + categories = item[:categories].split(",") + categories.map! {|category| category.strip} + + categories.each do |category_name| + category = Category.find_by_name category_name + software_info.community.categories << category + end + end + + software_info.save! + end +end + +# Dynamic table steps +Given /^I fill in first "([^"]*)" class with "([^"]*)"$/ do |selector, value| + evaluate_script "jQuery('#{selector}').first().attr('value', '#{value}') && true" +end + +Given /^I fill in last "([^"]*)" class with "([^"]*)"$/ do |selector, value| + evaluate_script "jQuery('#{selector}').last().attr('value', '#{value}') && true" +end + +Given /^I click on the first button with class "([^"]*)"$/ do |selector| + evaluate_script "jQuery('#{selector}').first().trigger('click') && true" +end + +Given /^I click on the last button with class "([^"]*)"$/ do |selector| + evaluate_script "jQuery('#{selector}').last().trigger('click') && true" +end + +Given /^the user "([^"]*)" has "([^"]*)" as secondary e\-mail$/ do |login, email| + User[login].update_attributes(:secondary_email => email) +end + +Given /^I click on anything with selector "([^"]*)"$/ do |selector| + evaluate_script "jQuery('#{selector}').trigger('click') && true" +end + +Given /^I should see "([^"]*)" of this selector "([^"]*)"$/ do |quantity, selector| + evaluate_script "jQuery('#{selector}').length == '#{quantity}'" +end + +Given /^selector "([^"]*)" should have any "([^"]*)"$/ do |selector, text| + evaluate_script "jQuery('#{selector}').html().indexOf('#{text}') != -1" +end + +Given /^I click on table number "([^"]*)" selector "([^"]*)" and select the value "([^"]*)"$/ do |number, selector, value| + evaluate_script "jQuery('#{selector}:nth-child(#{number}) select option:contains(\"#{value}\")').selected() && true" +end + +Given /^I fill with "([^"]*)" in field with name "([^"]*)" of table number "([^"]*)" with class "([^"]*)"$/ do |value, name, number, selector| + evaluate_script "jQuery('#{selector}:nth-child(#{number}) input[name=\"#{name}\"]').val('#{value}') && true" +end + +Given /^I sleep for (\d+) seconds$/ do |time| + sleep time.to_i +end + +Given /^I am logged in as mpog_admin$/ do + visit('/account/logout') + + user = User.new(:login => 'admin_user', :password => '123456', :password_confirmation => '123456', :email => 'admin_user@example.com') + person = Person.new :name=>"Mpog Admin", :identifier=>"mpog-admin" + user.person = person + user.save! + + user.activate + e = Environment.default + e.add_admin(user.person) + + visit('/account/login') + fill_in("Username", :with => user.login) + fill_in("Password", :with => '123456') + click_button("Log in") +end + +Given /^I should see "([^"]*)" before "([^"]*)"$/ do |before, after| + assert page.body.index("#{before}") < page.body.index("#{after}") +end + +Given /^I keyup on selector "([^"]*)"$/ do |selector| + selector_founded = evaluate_script("jQuery('#{selector}').trigger('keyup').length != 0") + selector_founded.should be_true +end diff --git a/src/software_communities/lib/categories_and_tags_block.rb b/src/software_communities/lib/categories_and_tags_block.rb new file mode 100644 index 0000000..e50f9c4 --- /dev/null +++ b/src/software_communities/lib/categories_and_tags_block.rb @@ -0,0 +1,29 @@ +class CategoriesAndTagsBlock < Block + + attr_accessible :show_name + + settings_items :show_name, :type => :boolean, :default => false + + def self.description + _('Categories and Tags') + end + + def help + _('This block displays the categories and tags of a software.') + end + + def content(args={}) + block = self + s = show_name + lambda do |object| + render( + :file => 'blocks/categories_and_tags', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + false + end +end diff --git a/src/software_communities/lib/categories_software_block.rb b/src/software_communities/lib/categories_software_block.rb new file mode 100644 index 0000000..97e1fda --- /dev/null +++ b/src/software_communities/lib/categories_software_block.rb @@ -0,0 +1,35 @@ +class CategoriesSoftwareBlock < Block + + attr_accessible :show_name + + settings_items :show_name, :type => :boolean, :default => false + + def self.description + _('Categories Softwares') + end + + def help + _('This block displays the categories and the amount of softwares for + each category.') + end + + def content(args={}) + block = self + s = show_name + + software_category = Category.find_by_name("Software") + categories = [] + categories = software_category.children.sort if software_category + + lambda do |object| + render( + :file => 'blocks/categories_software', + :locals => { :block => block, :show_name => s, :categories => categories } + ) + end + end + + def cacheable? + false + end +end diff --git a/src/software_communities/lib/create_software.rb b/src/software_communities/lib/create_software.rb new file mode 100644 index 0000000..7b8b914 --- /dev/null +++ b/src/software_communities/lib/create_software.rb @@ -0,0 +1,113 @@ +class CreateSoftware < Task + include Rails.application.routes.url_helpers + + validates_presence_of :requestor_id, :target_id + validates_presence_of :name + + attr_accessible :name, :finality, :repository_link, :requestor, :environment, + :reject_explanation, :license_info + + alias :environment :target + alias :environment= :target= + + DATA_FIELDS = ['name', 'finality', 'license_info', 'repository_link'] + DATA_FIELDS.each do |field| + settings_items field.to_sym + end + + def perform + software_template = Community["software"] + if (!software_template.blank? && software_template.is_template) + template_id = software_template.id + end + + community = Community.create!(:name => self.name, + :template_id => template_id) + + community.environment = self.environment + community.add_admin(self.requestor) + + software = SoftwareInfo.create!(:finality => self.finality, + :repository_link => self.repository_link, :community_id => community.id, + :license_info => self.license_info) + end + + def title + _("New software") + end + + def subject + name + end + + def information + message = _('%{requestor} wants to create software %{subject} with') + if finality.blank? + { :message => message + _(' no finality.') } + else + { :message => message + _(' this finality:

%{finality}

'), + :variables => {:finality => finality} } + end + end + + def reject_details + true + end + + # tells if this request was rejected + def rejected? + self.status == Task::Status::CANCELLED + end + + # tells if this request was appoved + def approved? + self.status == Task::Status::FINISHED + end + + def target_notification_description + _('%{requestor} wants to create software %{subject}') % + {:requestor => requestor.name, :subject => subject} + end + + def target_notification_message + _("User \"%{user}\" just requested to create software %{software}. + You have to approve or reject it through the \"Pending Validations\" + section in your control panel.\n") % + { :user => self.requestor.name, :software => self.name } + end + + def task_created_message + _("Your request for registering software %{software} at %{environment} was + just sent. Environment administrator will receive it and will approve or + reject your request according to his methods and criteria. + + You will be notified as soon as environment administrator has a position + about your request.") % + { :software => self.name, :environment => self.target } + end + + def task_cancelled_message + _("Your request for registering software %{software} at %{environment} was + not approved by the environment administrator. The following explanation + was given: \n\n%{explanation}") % + { :software => self.name, + :environment => self.environment, + :explanation => self.reject_explanation } + end + + def task_finished_message + _('Your request for registering the software "%{software}" was approved. + You can access %{url} and finish the registration of your software.') % + { :software => self.name, :url => mount_url } + end + + private + + def mount_url + identifier = Community.where(:name => self.name).first.identifier + # The use of url_for doesn't allow the /social within the Public Software + # portal. That's why the url is mounted so 'hard coded' + url = "#{environment.top_url}/myprofile/#{identifier}/profile_editor/edit_software_community" + end + +end diff --git a/src/software_communities/lib/database_description.rb b/src/software_communities/lib/database_description.rb new file mode 100644 index 0000000..ff1e641 --- /dev/null +++ b/src/software_communities/lib/database_description.rb @@ -0,0 +1,15 @@ +class DatabaseDescription < ActiveRecord::Base + + SEARCHABLE_SOFTWARE_FIELDS = { + :name => 1 + } + + attr_accessible :name + + has_many :software_databases + has_many :software_infos, :through => :software_databases + + validates_presence_of :name + validates_uniqueness_of :name + +end diff --git a/src/software_communities/lib/database_helper.rb b/src/software_communities/lib/database_helper.rb new file mode 100644 index 0000000..af7f5e2 --- /dev/null +++ b/src/software_communities/lib/database_helper.rb @@ -0,0 +1,86 @@ +class DatabaseHelper < DynamicTableHelper + MODEL_NAME ="database" + FIELD_NAME = "database_description_id" + + def self.valid_database? database + return false if SoftwareHelper.all_table_is_empty?(database) + + database_description_id_list = DatabaseDescription.select(:id). + collect {|dd| dd.id} + + return database_description_id_list.include?( + database[:database_description_id].to_i + ) + end + + def self.list_database new_databases + return [] if new_databases.nil? or new_databases.length == 0 + list_databases = [] + + new_databases.each do |new_database| + if valid_database? new_database + database = SoftwareDatabase.new + + database.database_description_id = + new_database[:database_description_id] + + database.version = new_database[:version] + list_databases << database + end + end + + list_databases + end + + def self.valid_list_database? list_databases + return false if list_databases.nil? or list_databases.length == 0 + + list_databases.each do |database| + return false unless database.valid? + end + + true + end + + def self.database_as_tables(list_databases, disabled=false) + model_list = list_databases + model_list ||= [{:database_description_id => "", :version => ""}] + + models_as_tables model_list, "database_html_structure", disabled + end + + def self.database_html_structure(database_data, disabled) + database_id = database_data[:database_description_id] + database_name = if database_data[:database_description_id].blank? + "" + else + DatabaseDescription.find( + database_data[:database_description_id], + :select=>"name" + ).name + end + + data = { + model_name: MODEL_NAME, + field_name: FIELD_NAME, + name: { + value: database_name, + id: database_id, + hidden: true, + autocomplete: true, + select_field: false + }, + version: { + value: database_data[:version], + hidden: true, + delete: true + } + } + DATA[:license].delete(:value) + table_html_structure(data, disabled) + end + + def self.add_dynamic_table + database_as_tables(nil).first.call + end +end \ No newline at end of file diff --git a/src/software_communities/lib/download.rb b/src/software_communities/lib/download.rb new file mode 100644 index 0000000..0b63fed --- /dev/null +++ b/src/software_communities/lib/download.rb @@ -0,0 +1,51 @@ +#FIX ME: Turn this into a proper model(next release) +class Download + def initialize data + @name = data[:name] + @link = data[:link] + @software_description = data[:software_description] + @minimum_requirements = data[:minimum_requirements] + @size = data[:size] + + @total_downloads = if data[:total_downloads] + data[:total_downloads] + else + 0 + end + end + + def self.validate_download_list download_list + download_list.select! do |download| + not download[:name].blank? + end + + download_list.map do |download| + Download.new(download).to_hash + end + end + + def to_hash + { + :name => @name, + :link => @link, + :software_description => @software_description, + :minimum_requirements => @minimum_requirements, + :size => @size, + :total_downloads => @total_downloads + } + end + + def total_downloads= value + if value.is_a? Integer + @total_downloads = value + end + end + + def total_downloads + @total_downloads + end + + def link + @link + end +end diff --git a/src/software_communities/lib/download_block.rb b/src/software_communities/lib/download_block.rb new file mode 100644 index 0000000..58048b7 --- /dev/null +++ b/src/software_communities/lib/download_block.rb @@ -0,0 +1,36 @@ +class DownloadBlock < Block + + attr_accessible :show_name, :downloads + + settings_items :show_name, :type => :boolean, :default => false + settings_items :downloads, :type => Array, :default => [] + + validate :download_values + + def download_values + self.downloads = Download.validate_download_list(self.downloads) + end + + def self.description + _('Download Stable Version') + end + + def help + _('This block displays the stable version of a software.') + end + + def content(args={}) + block = self + s = show_name + lambda do |object| + render( + :file => 'blocks/download', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + false + end +end diff --git a/src/software_communities/lib/dynamic_table_helper.rb b/src/software_communities/lib/dynamic_table_helper.rb new file mode 100644 index 0000000..1c9265e --- /dev/null +++ b/src/software_communities/lib/dynamic_table_helper.rb @@ -0,0 +1,153 @@ +class DynamicTableHelper + extend( + ActionView::Helpers::TagHelper, + ActionView::Helpers::FormTagHelper, + ActionView::Helpers::FormOptionsHelper, + ActionView::Helpers::UrlHelper, + ApplicationHelper + ) + + COLLUMN_NAME = { + name: "name", + version: "version", + license: "license" + } + + LABEL_TEXT = { + :name => _("Name"), + :version => _("Version"), + :license => _("License") + } + + DATA = { + name: { + label: LABEL_TEXT[:name], + name: COLLUMN_NAME[:name] + }, + version: { + label: LABEL_TEXT[:version], + name: COLLUMN_NAME[:version] + } , + license: { + label: LABEL_TEXT[:license], + name: COLLUMN_NAME[:license], + delete: true + } + } + @@disabled = false + + def self.table_html_structure data={}, disabled=false + @@disabled = disabled + Proc::new do + content_tag :table , generate_table_lines(data), :class => "dynamic-table" + end + end + + def self.generate_table_lines data={} + @@model = data[:model_name] + @@field_name = data[:field_name] + @@hidden_label = data[:name][:value] + @@hidden_id = data[:name][:id] + + row_data = prepare_row_data data + + table_line_data = [ + self.table_line(row_data[:name]), + self.table_line(row_data[:version]) + ] + + if row_data[:license].has_key?(:value) + table_line_data << self.table_line(row_data[:license]) + end + + table_line_data.join() + end + + def self.table_line row_data={} + unless row_data.blank? + content_tag :tr, [ + self.label_collumn(row_data[:label]), + self.value_collumn( + row_data[:value], + row_data[:name], + row_data[:autocomplete], + row_data[:select_field], + row_data[:options] + ), + self.hidden_collumn(row_data[:delete], row_data[:hidden]) + ].join() + end + end + + def self.label_collumn label="" + content_tag :td, label_tag(label) + end + + def self.value_collumn value="", name="", autocomplete=false, select_field=false, options=[] + html_options = + if autocomplete + { + :class => "#{@@model}_autocomplete", + :placeholder => _("Autocomplete field, type something") + } + else + {} + end + + html_options[:disabled] = @@disabled + + content = if select_field + select_tag("#{@@model}[][#{@@field_name}]", options, html_options) + elsif autocomplete + text_field_tag("#{@@model}_autocomplete", value, html_options) + else + text_field_tag("#{@@model}[][#{name}]", value, html_options) + end + + content_tag :td, content + end + + def self.hidden_collumn delete=false, hidden_data=false + value = + if @@disabled + nil + elsif delete + button_without_text( + :delete, _('Delete'), "#" , :class=>"delete-dynamic-table" + ) + elsif hidden_data + hidden_field_tag( + "#{@@model}[][#{@@field_name}]", + @@hidden_id, + :class => "#{@@field_name}", + :data => {:label => @@hidden_label } #check how to get the name of an object of the current model + ) + else + nil + end + + content_tag(:td, value, :align => 'right') + end + + def self.prepare_row_data data + row_data = { + name: DATA[:name], + version: DATA[:version], + license: DATA[:license] + } + + row_data[:name].merge! data[:name] + row_data[:version].merge! data[:version] + row_data[:license].merge! data[:license] if data.has_key? :license + + row_data + end + + def self.models_as_tables models, callback, disabled=false + lambdas_list = [] + + models.map do |model| + send(callback, model, disabled) + end + end +end \ No newline at end of file diff --git a/src/software_communities/lib/ext/category.rb b/src/software_communities/lib/ext/category.rb new file mode 100644 index 0000000..0c3008c --- /dev/null +++ b/src/software_communities/lib/ext/category.rb @@ -0,0 +1,35 @@ +require_dependency 'category' + +class Category + SOFTWARE_CATEGORIES = [ + _('Agriculture, Fisheries and Extraction'), + _('Science, Information and Communication'), + _('Economy and Finances'), + _('Public Administration'), + _('Habitation, Sanitation and Urbanism'), + _('Individual, Family and Society'), + _('Health'), + _('Social Welfare and Development'), + _('Defense and Security'), + _('Education'), + _('Government and Politics'), + _('Justice and Legislation'), + _('International Relationships'), + _('Transportation and Transit') + ] + + scope :software_categories, lambda { + software_category = Category.find_by_name("Software") + if software_category.nil? + [] + else + software_category.children + end + } + + def software_infos + software_list = self.communities + software_list.collect { |x| software_list.delete(x) unless x.software? } + software_list + end +end diff --git a/src/software_communities/lib/ext/communities_block.rb b/src/software_communities/lib/ext/communities_block.rb new file mode 100644 index 0000000..4a5fcaa --- /dev/null +++ b/src/software_communities/lib/ext/communities_block.rb @@ -0,0 +1,45 @@ +require_dependency 'communities_block' + +class CommunitiesBlock + + def profile_list + result = get_visible_profiles + result.slice(0..get_limit-1) + end + + def profile_count + profile_list.count + end + + private + + def get_visible_profiles + visible_profiles = profiles.visible.includes( + [:image,:domains,:preferred_domain,:environment] + ) + + delete_communities = [] + valid_communities_string = Community.get_valid_communities_string + Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} + + visible_profiles = visible_profiles.where(["profiles.id NOT IN (?)", delete_communities]) unless delete_communities.empty? + + if !prioritize_profiles_with_image + return visible_profiles.all( + :limit => get_limit, + :order => 'profiles.updated_at DESC' + ).sort_by {rand} + elsif profiles.visible.with_image.count >= get_limit + return visible_profiles.with_image.all( + :limit => get_limit * 5, + :order => 'profiles.updated_at DESC' + ).sort_by {rand} + else + visible_profiles = visible_profiles.with_image.sort_by {rand} + + visible_profiles.without_image.all( + :limit => get_limit * 5, :order => 'profiles.updated_at DESC' + ).sort_by {rand} + return visible_profiles + end + end +end diff --git a/src/software_communities/lib/ext/community.rb b/src/software_communities/lib/ext/community.rb new file mode 100644 index 0000000..6f8602f --- /dev/null +++ b/src/software_communities/lib/ext/community.rb @@ -0,0 +1,66 @@ +require_dependency 'community' + +class Community + + SEARCHABLE_SOFTWARE_FIELDS = { + :name => 1, + :identifier => 2, + :nickname => 3 + } + + attr_accessible :visible + + has_one :software_info, :dependent=>:destroy + + settings_items :hits, :type => :integer, :default => 0 + + def self.create_after_moderation(requestor, attributes = {}) + community = Community.new(attributes) + + if community.environment.enabled?('admin_must_approve_new_communities') && + !community.environment.admins.include?(requestor) + + cc = CreateCommunity.create(attributes.merge(:requestor => requestor)) + else + community = Community.create(attributes) + community.add_admin(requestor) + end + community + end + + def self.get_valid_communities_string + remove_of_communities_methods = Community.instance_methods.select{|m| m =~ /remove_of_community_search/} + valid_communities_string = "!(" + remove_of_communities_methods.each do |method| + valid_communities_string += "community.send('#{method}') || " + end + valid_communities_string = valid_communities_string[0..-5] + valid_communities_string += ")" + + valid_communities_string + end + + def software? + return !software_info.nil? + end + + def deactivate + self.visible = false + self.save! + end + + def activate + self.visible = true + self.save! + end + + def remove_of_community_search_software? + return software? + end + + def hit + self.hits += 1 + self.save! + end + +end diff --git a/src/software_communities/lib/ext/organization_rating.rb b/src/software_communities/lib/ext/organization_rating.rb new file mode 100644 index 0000000..cedb7ca --- /dev/null +++ b/src/software_communities/lib/ext/organization_rating.rb @@ -0,0 +1,5 @@ +require_dependency "organization_rating" + +class OrganizationRating + attr_accessible :people_benefited, :saved_value +end diff --git a/src/software_communities/lib/ext/person.rb b/src/software_communities/lib/ext/person.rb new file mode 100644 index 0000000..2ccb9a2 --- /dev/null +++ b/src/software_communities/lib/ext/person.rb @@ -0,0 +1,24 @@ +# encoding: utf-8 + +require_dependency 'person' + +class Person + + delegate :login, :to => :user, :prefix => true + + def software? + false + end + + def softwares + softwares = [] + self.communities.each do |community| + if community.software? + softwares << community + end + end + + softwares + end + +end diff --git a/src/software_communities/lib/ext/profile_controller.rb b/src/software_communities/lib/ext/profile_controller.rb new file mode 100644 index 0000000..e0619f6 --- /dev/null +++ b/src/software_communities/lib/ext/profile_controller.rb @@ -0,0 +1,64 @@ +require_dependency 'profile_controller' + +class ProfileController + + before_filter :hit_view_page + + def communities + type = [] + params[:type].downcase! unless params[:type].nil? + + if params[:type] == "software" + type = profile.softwares + elsif params[:type] == "institution" + type = profile.institutions + else + profile.communities.select do |community| + type << community unless community.software? || community.institution? + end + end + + if is_cache_expired?(profile.communities_cache_key(params)) + @communities = type.paginate(:per_page => per_page, :page => params[:npage], :total_entries => type.count) + end + end + + def members + if is_cache_expired?(profile.members_cache_key(params)) + sort = (params[:sort] == 'desc') ? params[:sort] : 'asc' + @profile_admins = profile.admins.includes(relations_to_include).order("name #{sort}").paginate(:per_page => members_per_page, :page => params[:npage]) + @profile_members = profile.members.order("name #{sort}").paginate(:per_page => members_per_page, :page => params[:npage]) + @profile_members_url = url_for(:controller => 'profile', :action => 'members') + end + end + + def user_is_a_bot? + user_agent= request.env["HTTP_USER_AGENT"] + user_agent.blank? || + user_agent.match(/bot/) || + user_agent.match(/spider/) || + user_agent.match(/crawler/) || + user_agent.match(/\(.*https?:\/\/.*\)/) + end + + def already_visited?(element) + user_id = if user.nil? then -1 else current_user.id end + user_id = "#{user_id}_#{element.id}_#{element.class}" + + if cookies.signed[:visited] == user_id + return true + else + cookies.permanent.signed[:visited] = user_id + return false + end + end + + def hit_view_page + if profile + community = profile + community.hit unless user_is_a_bot? || + already_visited?(community) || + community.class != Community + end + end +end diff --git a/src/software_communities/lib/ext/profile_editor_controller.rb b/src/software_communities/lib/ext/profile_editor_controller.rb new file mode 100644 index 0000000..3645f1f --- /dev/null +++ b/src/software_communities/lib/ext/profile_editor_controller.rb @@ -0,0 +1,28 @@ +require_dependency 'profile_editor_controller' + +class ProfileEditorController + + before_filter :redirect_to_edit_software_community, :only => [:edit] + + def edit_software_community + @profile_data = profile + @possible_domains = profile.possible_domains + @first_edit = profile.software_info.first_edit? + + if @first_edit + profile.software_info.first_edit = false + profile.software_info.save! + end + + edit if request.post? + end + + protected + + def redirect_to_edit_software_community + if profile.class == Community && profile.software? + redirect_to :action => 'edit_software_community' + end + end + +end diff --git a/src/software_communities/lib/ext/profile_helper.rb b/src/software_communities/lib/ext/profile_helper.rb new file mode 100644 index 0000000..7268d4b --- /dev/null +++ b/src/software_communities/lib/ext/profile_helper.rb @@ -0,0 +1,26 @@ +require_dependency 'profile_helper' + +module ProfileHelper + PERSON_CATEGORIES[:mpog_profile_information] = [:secondary_email, + :institutions] + + def display_mpog_field(title, profile, field, force = false) + unless force || profile.may_display_field_to?(field, user) + return '' + end + value = profile.send(field) + if !value.blank? + if block_given? + value = yield(value) + end + content_tag( + 'tr', + content_tag('td', title, :class => 'field-name') + + content_tag('td', value) + ) + else + '' + end + end + +end diff --git a/src/software_communities/lib/ext/search_controller.rb b/src/software_communities/lib/ext/search_controller.rb new file mode 100644 index 0000000..e96cd63 --- /dev/null +++ b/src/software_communities/lib/ext/search_controller.rb @@ -0,0 +1,169 @@ +require_dependency 'search_controller' + +class SearchController + + def communities + delete_communities = [] + valid_communities_string = Community.get_valid_communities_string + Community.all.each{|community| delete_communities << community.id unless eval(valid_communities_string)} + + @scope = visible_profiles(Community) + @scope = @scope.where(["id NOT IN (?)", delete_communities]) unless delete_communities.empty? + + full_text_search + end + + def software_infos + prepare_software_search_page + results = filter_software_infos_list + @software_count = results.count + results = results.paginate(:per_page => @per_page, :page => params[:page]) + @searches[@asset] = {:results => results} + @search = results + + render :layout=>false if request.xhr? + end + + protected + + def filter_communities_list + unfiltered_list = visible_profiles(Community) + + unless params[:query].nil? + unfiltered_list = unfiltered_list.select do |com| + com.name.downcase =~ /#{params[:query].downcase}/ + end + end + + communities_list = [] + unfiltered_list.each do |profile| + if profile.class == Community && !profile.is_template? && yield(profile) + communities_list << profile + end + end + + communities_list + end + + def filter_software_infos_list + filtered_software_list = get_filtered_software_list + filtered_community_list = get_communities_list(filtered_software_list) + sort_communities_list filtered_community_list + end + + def get_filter_category_ids + category_ids = [] + unless params[:selected_categories_id].blank? + category_ids = params[:selected_categories_id] + end + category_ids.map(&:to_i) + end + + def get_filtered_software_list + params[:query] ||= "" + visible_communities = visible_profiles(Community) + + filtered_software_list = SoftwareInfo.search_by_query(params[:query]) + + if params[:only_softwares] + params[:only_softwares].collect!{ |software_name| software_name.to_slug } + filtered_software_list = SoftwareInfo.all.select{ |s| params[:only_softwares].include?(s.identifier) } + @public_software_selected = false + end + + filtered_software_list.select!{ |software| visible_communities.include?(software.community) } + category_ids = get_filter_category_ids + + unless category_ids.empty? + filtered_software_list.select! do |software| + if software.nil? || software.community.nil? + false + else + result_ids = (software.community.category_ids & category_ids).sort + result_ids == category_ids.sort + end + end + end + + filtered_software_list + end + + def get_communities_list software_list + filtered_community_list = [] + software_list.each do |software| + if !@public_software_selected || software.public_software? + filtered_community_list << software.community unless software.community.nil? + end + end + filtered_community_list + end + + def sort_communities_list communities_list + communities_list.sort! {|a, b| a.name.downcase <=> b.name.downcase} + + if params[:sort] && params[:sort] == "desc" + communities_list.reverse! + elsif params[:sort] && params[:sort] == "relevance" + communities_list = sort_by_relevance(communities_list, params[:query]){ |community| [community.software_info.finality, community.name] } + end + communities_list + end + + def prepare_software_search_page + prepare_software_infos_params + prepare_software_infos_message + prepare_software_infos_category_groups + prepare_software_infos_category_enable + end + + def prepare_software_infos_params + @titles[:software_infos] = _("Result Search") + @selected_categories_id = params[:selected_categories_id] + @selected_categories_id ||= [] + @selected_categories_id = @selected_categories_id.map(&:to_i) + @all_selected = params[:software_type] == "all" + @public_software_selected = !@all_selected + @per_page = prepare_per_page + end + + def prepare_per_page + return 15 if params[:software_display].nil? + + if params[:software_display] == "all" + SoftwareInfo.count + else + params[:software_display].to_i + end + end + + def prepare_software_infos_message + @message_selected_options = "" + + @selected_categories = [] + unless @selected_categories_id.empty? + @message_selected_options = _("Selected options: ") + + @selected_categories = Category.find(@selected_categories_id) + @message_selected_options += @selected_categories.collect { |category| + "#{category.name}; " + }.join() + end + end + + def prepare_software_infos_category_groups + @categories = Category.software_categories.sort{|a, b| a.name <=> b.name} + end + + def prepare_software_infos_category_enable + @enabled_check_box = Hash.new + categories = Category.software_categories + + categories.each do |category| + if category.software_infos.count > 0 + @enabled_check_box[category] = :enabled + else + @enabled_check_box[category] = :disabled + end + end + end +end diff --git a/src/software_communities/lib/ext/search_helper.rb b/src/software_communities/lib/ext/search_helper.rb new file mode 100644 index 0000000..025a3b8 --- /dev/null +++ b/src/software_communities/lib/ext/search_helper.rb @@ -0,0 +1,33 @@ +require_dependency 'search_helper' + +module SearchHelper + + COMMON_PROFILE_LIST_BLOCK ||= [] + COMMON_PROFILE_LIST_BLOCK << :software_infos + + def sort_by_relevance list, text + text_splited = text.split + + element_relevance = {} + + list.each do |element| + relevance = 1 + relevance_list = yield(element) + + text_splited.each do |t| + relevance_list.count.times do |i| + relevance = -1 * i if relevance_list[i].downcase.include?(t.downcase) + end + end + + element_relevance[element] = relevance + end + + list.sort! do |a, b| + element_relevance[a] <=> element_relevance[b] + end + + list + end + +end diff --git a/src/software_communities/lib/library.rb b/src/software_communities/lib/library.rb new file mode 100644 index 0000000..d4b2b56 --- /dev/null +++ b/src/software_communities/lib/library.rb @@ -0,0 +1,10 @@ +class Library < ActiveRecord::Base + attr_accessible :name, :version, :license, :software_info_id + + validates :name, :version, :license, + presence: { message: _("can't be blank") }, + length: { + maximum: 20, + too_long: _("Too long (maximum is 20 characters)") + } +end diff --git a/src/software_communities/lib/library_helper.rb b/src/software_communities/lib/library_helper.rb new file mode 100644 index 0000000..dfb0953 --- /dev/null +++ b/src/software_communities/lib/library_helper.rb @@ -0,0 +1,62 @@ +class LibraryHelper < DynamicTableHelper + MODEL_NAME = "library" + + def self.list_library new_libraries + return [] if new_libraries.nil? or new_libraries.length == 0 + list_libraries = [] + + new_libraries.each do |new_library| + unless SoftwareHelper.all_table_is_empty? new_library + library = Library.new + library.name = new_library[:name] + library.version = new_library[:version] + library.license = new_library[:license] + list_libraries << library + end + end + + list_libraries + end + + def self.valid_list_library? list_libraries + return true if list_libraries.nil? or list_libraries.length == 0 + + list_libraries.each do |library| + return false unless library.valid? + end + + true + end + + def self.libraries_as_tables list_libraries, disabled=false + model_list = list_libraries + model_list ||= [{:name=>"", :version=>"", :license=>""}] + + models_as_tables model_list, "library_html_structure", disabled + end + + def self.library_html_structure library_data, disabled + data = { + model_name: MODEL_NAME, + name: { + value: library_data[:name], + hidden: false, + autocomplete: false, + select_field: false + }, + version: { + value: library_data[:version], + delete: false + }, + license: { + value: library_data[:license] + } + } + + table_html_structure(data, disabled) + end + + def self.add_dynamic_table + libraries_as_tables(nil).first.call + end +end \ No newline at end of file diff --git a/src/software_communities/lib/license_helper.rb b/src/software_communities/lib/license_helper.rb new file mode 100644 index 0000000..af390cb --- /dev/null +++ b/src/software_communities/lib/license_helper.rb @@ -0,0 +1,5 @@ +module LicenseHelper + def self.getListLicenses + LicenseInfo.all + end +end \ No newline at end of file diff --git a/src/software_communities/lib/license_info.rb b/src/software_communities/lib/license_info.rb new file mode 100644 index 0000000..6f9bfe7 --- /dev/null +++ b/src/software_communities/lib/license_info.rb @@ -0,0 +1,8 @@ +class LicenseInfo < ActiveRecord::Base + attr_accessible :version, :link + + validates_presence_of :version + + has_many :software_info + +end diff --git a/src/software_communities/lib/operating_system.rb b/src/software_communities/lib/operating_system.rb new file mode 100644 index 0000000..b2763e9 --- /dev/null +++ b/src/software_communities/lib/operating_system.rb @@ -0,0 +1,14 @@ +class OperatingSystem < ActiveRecord::Base + attr_accessible :version + + belongs_to :software_info + belongs_to :operating_system_name + + validates :operating_system_name, presence: true + validates :version, + presence: true, + length: { + maximum: 20, + too_long: _('too long (maximum is 20 characters)') + } +end diff --git a/src/software_communities/lib/operating_system_helper.rb b/src/software_communities/lib/operating_system_helper.rb new file mode 100644 index 0000000..d5bd9a9 --- /dev/null +++ b/src/software_communities/lib/operating_system_helper.rb @@ -0,0 +1,71 @@ +class OperatingSystemHelper < DynamicTableHelper + MODEL_NAME = "operating_system" + FIELD_NAME = "operating_system_name_id" + + def self.list_operating_system new_operating_systems + return [] if new_operating_systems.nil? or new_operating_systems.length == 0 + list_operating_system = [] + + new_operating_systems.each do |new_operating_system| + unless SoftwareHelper.all_table_is_empty?( + new_operating_system, + ["operating_system_name_id"] + ) + + operating_system = OperatingSystem.new + operating_system.operating_system_name = OperatingSystemName.find( + new_operating_system[:operating_system_name_id] + ) + + operating_system.version = new_operating_system[:version] + list_operating_system << operating_system + end + end + list_operating_system + end + + def self.valid_list_operating_system? list_operating_system + return !(list_operating_system.nil? || list_operating_system.length == 0) + + list_operating_system.each do |operating_system| + return false unless operating_system.valid? + end + true + end + + def self.operating_system_as_tables(list_operating_system, disabled=false) + model_list = list_operating_system + model_list ||= [{:operating_system_name_id => "", :version => ""}] + + models_as_tables model_list, "operating_system_html_structure", disabled + end + + def self.operating_system_html_structure (operating_system_data, disabled) + select_options = options_for_select( + OperatingSystemName.all.collect {|osn| [osn.name, osn.id]}, + operating_system_data[:operating_system_name_id] + ) + + data = { + model_name: MODEL_NAME, + field_name: FIELD_NAME, + name: { + hidden: false, + autocomplete: false, + select_field: true, + options: select_options + }, + version: { + value: operating_system_data[:version], + hidden: true, + delete: true + } + } + DATA[:license].delete(:value) + table_html_structure(data, disabled) + end + + def self.add_dynamic_table + operating_system_as_tables(nil).first.call + end +end diff --git a/src/software_communities/lib/operating_system_name.rb b/src/software_communities/lib/operating_system_name.rb new file mode 100644 index 0000000..cc59602 --- /dev/null +++ b/src/software_communities/lib/operating_system_name.rb @@ -0,0 +1,10 @@ +class OperatingSystemName < ActiveRecord::Base + attr_accessible :name + + validates_presence_of :name + validates_uniqueness_of :name + + has_many :operating_systems + has_many :software_infos, :through => :operating_systems + +end diff --git a/src/software_communities/lib/programming_language.rb b/src/software_communities/lib/programming_language.rb new file mode 100644 index 0000000..193225c --- /dev/null +++ b/src/software_communities/lib/programming_language.rb @@ -0,0 +1,15 @@ +class ProgrammingLanguage < ActiveRecord::Base + + SEARCHABLE_SOFTWARE_FIELDS = { + :name => 1 + } + + attr_accessible :name + + validates_presence_of :name + validates_uniqueness_of :name + + has_many :software_languages + has_many :software_infos, :through => :software_languages + +end diff --git a/src/software_communities/lib/repository_block.rb b/src/software_communities/lib/repository_block.rb new file mode 100644 index 0000000..483da7a --- /dev/null +++ b/src/software_communities/lib/repository_block.rb @@ -0,0 +1,29 @@ +class RepositoryBlock < Block + + attr_accessible :show_name + + settings_items :show_name, :type => :boolean, :default => false + + def self.description + _('Repository Link') + end + + def help + _('This block displays the repository link of a software.') + end + + def content(args={}) + block = self + s = show_name + lambda do |object| + render( + :file => 'blocks/repository', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + false + end +end diff --git a/src/software_communities/lib/search_catalog_block.rb b/src/software_communities/lib/search_catalog_block.rb new file mode 100644 index 0000000..4f7b517 --- /dev/null +++ b/src/software_communities/lib/search_catalog_block.rb @@ -0,0 +1,29 @@ +class SearchCatalogBlock < Block + + attr_accessible :show_name + + settings_items :show_name, :type => :boolean, :default => false + + def self.description + _('Search Softwares catalog') + end + + def help + _('This block displays the search categories field ') + end + + def content(args={}) + block = self + s = show_name + lambda do |object| + render( + :file => 'blocks/search_catalog', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + false + end +end diff --git a/src/software_communities/lib/software_communities_plugin.rb b/src/software_communities/lib/software_communities_plugin.rb new file mode 100644 index 0000000..d11c176 --- /dev/null +++ b/src/software_communities/lib/software_communities_plugin.rb @@ -0,0 +1,164 @@ +class SoftwareCommunitiesPlugin < Noosfero::Plugin + include ActionView::Helpers::TagHelper + include ActionView::Helpers::FormTagHelper + include ActionView::Helpers::FormOptionsHelper + include ActionView::Helpers::JavaScriptHelper + include ActionView::Helpers::AssetTagHelper + include FormsHelper + include ActionView::Helpers + include ActionDispatch::Routing + include Rails.application.routes.url_helpers + + def self.plugin_name + 'SoftwareCommunitiesPlugin' + end + + def self.plugin_description + _('Add Public Software and MPOG features.') + end + + def profile_tabs + if context.profile.community? + return profile_tabs_software if context.profile.software? + end + end + + def control_panel_buttons + if context.profile.software? + return software_info_button + elsif context.profile.person? + return create_new_software_button + end + end + + def self.extra_blocks + { + SoftwaresBlock => { :type => [Environment, Person] }, + SoftwareInformationBlock => { :type => [Community] }, + DownloadBlock => { :type => [Community] }, + RepositoryBlock => { :type => [Community] }, + CategoriesAndTagsBlock => { :type => [Community] }, + CategoriesSoftwareBlock => { :type => [Environment] }, + SearchCatalogBlock => { :type => [Environment] }, + SoftwareHighlightsBlock => { :type => [Environment] }, + SoftwareTabDataBlock => {:type => [Community], :position => 1}, + WikiBlock => {:type => [Community]}, + StatisticBlock => { :type => [Community] } + } + end + + def stylesheet? + true + end + + def js_files + %w( + vendor/jquery.maskedinput.min.js + vendor/modulejs-1.5.0.min.js + vendor/jquery.js + lib/noosfero-root.js + lib/select-element.js + 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/search-software-catalog.js + views/profile-tabs-software.js + views/new-community.js + views/comments-software-extra-fields.js + blocks/software-download.js + initializer.js + app.js + ) + end + + module Hotspots + def display_organization_average_rating organization + nil + end + end + + def organization_ratings_plugin_comments_extra_fields + if context.profile.software? + Proc::new { render :file => 'comments_extra_fields' } + end + end + + def organization_ratings_plugin_star_message + Proc::new do _("Rate this software") end + end + + def organization_ratings_title + title = _('Use reports') + Proc::new do "

#{title}

" end + end + + def organization_ratings_plugin_extra_fields_show_data user_rating + Proc::new { + if logged_in? + is_admin = environment.admins.include?(current_user.person) + is_admin ||= user_rating.organization.admins.include?(current_user.person) + + if is_admin and profile.software? + + render :file => 'organization_ratings_extra_fields_show_data', + :locals => {:user_rating => user_rating} + end + end + } + end + + # FIXME - if in error log apears has_permission?, try to use this method + def has_permission?(person, permission, target) + person.has_permission_without_plugins?(permission, target) + end + + protected + + def software_info_transaction + SoftwareInfo.transaction do + context.profile. + software_info. + update_attributes!(context.params[:software_info]) + end + end + + def license_transaction + license = LicenseInfo.find(context.params[:version]) + context.profile.software_info.license_info = license + context.profile.software_info.save! + end + + private + + def software_info_button + { + :title => _('Software Info'), + :icon => 'edit-profile-group control-panel-software-link', + :url => { + :controller => 'software_communities_plugin_myprofile', + :action => 'edit_software' + } + } + end + + def create_new_software_button + { + :title => _('Create a new software'), + :icon => 'design-editor', + :url => { + :controller => 'software_communities_plugin_myprofile', + :action => 'new_software' + } + } + end + + def profile_tabs_software + { :title => _('Software'), + :id => 'software-fields', + :content => Proc::new do render :partial => 'profile/software_tab' end, + :start => true } + end +end diff --git a/src/software_communities/lib/software_database.rb b/src/software_communities/lib/software_database.rb new file mode 100644 index 0000000..6c7911f --- /dev/null +++ b/src/software_communities/lib/software_database.rb @@ -0,0 +1,20 @@ +class SoftwareDatabase < ActiveRecord::Base + attr_accessible :version + + belongs_to :software_info + belongs_to :database_description + + validates_presence_of :database_description_id, :version + + validates_length_of( + :version, + :maximum => 20, + :too_long => _("Software database is too long (maximum is 20 characters)") + ) + + validates( + :database_description_id, + :numericality => {:greater_than_or_equal_to => 1} + ) + +end diff --git a/src/software_communities/lib/software_helper.rb b/src/software_communities/lib/software_helper.rb new file mode 100644 index 0000000..a406c64 --- /dev/null +++ b/src/software_communities/lib/software_helper.rb @@ -0,0 +1,44 @@ +module SoftwareHelper + def self.select_options programming_languages, selected = 0 + value = "" + + programming_languages.each do |language| + selected = selected == language.id ? 'selected' : '' + value += "" + end + + value + end + + def self.create_list_with_file file_name, model + list_file = File.open file_name, "r" + + list_file.each_line do |line| + model.create(:name=>line.strip) + end + + list_file.close + end + + def self.all_table_is_empty? table, ignored_fields=[] + filled_fields = [] + + table.each do |key, value| + unless ignored_fields.include? key + filled_fields << if value.empty? + false + else + true + end + end + end + + if filled_fields.include? true + false + else + true + end + end +end diff --git a/src/software_communities/lib/software_highlights_block.rb b/src/software_communities/lib/software_highlights_block.rb new file mode 100644 index 0000000..a8b2a1c --- /dev/null +++ b/src/software_communities/lib/software_highlights_block.rb @@ -0,0 +1,20 @@ +class SoftwareHighlightsBlock < HighlightsBlock + + def self.description + _('Software Highlights Block') + end + + def help + _('This block displays the softwares icon into a highlight') + end + + def content(args={}) + softwares = self.settings[:images].collect {|h| h[:address].split('/').last} + block = self + proc do + render :file => 'blocks/software_highlights', :locals => { :block => block, :softwares => softwares} + end + end + + +end diff --git a/src/software_communities/lib/software_info.rb b/src/software_communities/lib/software_info.rb new file mode 100644 index 0000000..ffe5364 --- /dev/null +++ b/src/software_communities/lib/software_info.rb @@ -0,0 +1,261 @@ +class SoftwareInfo < ActiveRecord::Base + acts_as_having_settings :field => :settings + + SEARCHABLE_SOFTWARE_FIELDS = { + :acronym => 1, + :finality => 2, + } + + SEARCHABLE_SOFTWARE_CLASSES = [ + SoftwareInfo, + Community, + ProgrammingLanguage, + DatabaseDescription + ] + + scope :search_by_query, lambda { |query = ""| + filtered_query = query.gsub(/[\|\(\)\\\/\s\[\]'"*%&!:]/,' ').split.map{|w| w += ":*"}.join('|') + search_fields = SoftwareInfo.pg_search_plugin_fields + + if query.empty? + SoftwareInfo.joins(:community).where("profiles.visible = ?", true) + else + searchable_software_objects = SoftwareInfo.transform_list_in_methods_list(SEARCHABLE_SOFTWARE_CLASSES) + includes(searchable_software_objects).where("to_tsvector('simple', #{search_fields}) @@ to_tsquery('#{filtered_query}')").where("profiles.visible = ?", true) + end + } + + def self.transform_list_in_methods_list list + methods_list = [] + + list.each do |element| + if SoftwareInfo.instance_methods.include?(element.to_s.underscore.to_sym) + methods_list << element.to_s.underscore.to_sym + elsif SoftwareInfo.instance_methods.include?(element.to_s.underscore.pluralize.to_sym) + methods_list << element.to_s.underscore.pluralize.to_sym + end + end + + methods_list + end + + def self.pg_search_plugin_fields + SEARCHABLE_SOFTWARE_CLASSES.collect { |one_class| + self.get_searchable_fields(one_class) + }.join(" || ' ' || ") + end + + def self.get_searchable_fields one_class + searchable_fields = one_class::SEARCHABLE_SOFTWARE_FIELDS.keys.map(&:to_s).sort.map {|f| "coalesce(#{one_class.table_name}.#{f}, '')"}.join(" || ' ' || ") + searchable_fields + end + + SEARCH_FILTERS = { + :order => %w[], + :display => %w[full] + } + + def self.default_search_display + 'full' + end + + attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, + :operating_platform + + attr_accessible :demonstration_url, :acronym, :objectives, :features, + :license_info + + attr_accessible :community_id, :finality, :repository_link, :public_software, + :first_edit + + has_many :libraries, :dependent => :destroy + has_many :software_databases + has_many :database_descriptions, :through => :software_databases + has_many :software_languages + has_many :operating_systems + has_many :programming_languages, :through => :software_languages + has_many :operating_system_names, :through => :operating_systems + + belongs_to :community, :dependent => :destroy + belongs_to :license_info + + has_one :software_categories + + validates_length_of :finality, :maximum => 120 + validates_length_of :objectives, :maximum => 4000 + validates_length_of :features, :maximum => 4000 + validates_presence_of :finality + + validate :validate_acronym + + settings_items :another_license_version, :another_license_link + + # used on find_by_contents + scope :like_search, lambda{ |name| + joins(:community).where( + "name ILIKE ? OR acronym ILIKE ? OR finality ILIKE ?", + "%#{name}%", "%#{name}%", "%#{name}%" + ) + } + + scope :search, lambda { |name="", database_description_id = "", + programming_language_id = "", operating_system_name_id = "", + license_info_id = "", e_ping = "", e_mag = "", internacionalizable = "", + icp_brasil = "", e_arq = "", software_categories = "" | + + like_sql = "" + values = [] + + unless name.blank? + like_sql << "name ILIKE ? OR identifier ILIKE ? AND " + values << "%#{name}%" << "%#{name}%" + end + + like_sql = like_sql[0..like_sql.length-5] + + { + :joins => [:community], + :conditions=>[like_sql, *values] + } + } + + def license_info + license = LicenseInfo.find_by_id self.license_info_id + license_another = LicenseInfo.find_by_version("Another") + + if license_another && license.id == license_another.id + LicenseInfo.new( + :version => self.another_license_version, + :link => self.another_license_link + ) + else + license + end + end + + def another_license(version, link) + license_another = LicenseInfo.find_by_version("Another") + + if license_another + self.another_license_version = version + self.another_license_link = link + self.license_info = license_another + self.save! + end + end + + def validate_name_lenght + if self.community.name.size > 100 + self.errors.add( + :base, + _("Name is too long (maximum is %{count} characters)") + ) + false + end + true + end + + # if create_after_moderation receive a model object, would be possible to reuse core method + def self.create_after_moderation(requestor, attributes = {}) + environment = attributes.delete(:environment) + name = attributes.delete(:name) + identifier = attributes.delete(:identifier) + image_builder = attributes.delete(:image_builder) + license_info = attributes.delete(:license_info) + another_license_version = attributes.delete(:another_license_version) + another_license_link = attributes.delete(:another_license_link) + + software_info = SoftwareInfo.new(attributes) + if !environment.admins.include? requestor + CreateSoftware.create!( + attributes.merge( + :requestor => requestor, + :environment => environment, + :name => name, + :license_info => license_info + ) + ) + else + software_template = Community["software"] + + community_hash = {:name => name} + community_hash[:identifier] = identifier + community_hash[:image_builder] = image_builder if image_builder + + community = Community.new(community_hash) + community.environment = environment + + if (!software_template.blank? && software_template.is_template) + community.template_id = software_template.id + end + + software_info.license_info = license_info + software_info.save + community.software_info = software_info + community.save! + community.add_admin(requestor) + end + + software_info.verify_license_info(another_license_version, another_license_link) + software_info.save! + software_info + end + + def verify_license_info another_license_version, another_license_link + license_another = LicenseInfo.find_by_version("Another") + + if license_another && self.license_info_id == license_another.id + version = another_license_version + link = another_license_link + + self.another_license(version, link) + end + end + + + def validate_acronym + self.acronym = "" if self.acronym.nil? + if self.acronym.length > 10 && self.errors.messages[:acronym].nil? + self.errors.add(:acronym, _("can't have more than 10 characteres")) + false + elsif self.acronym.match(/\s+/) + self.errors.add(:acronym, _("can't have whitespaces")) + false + end + true + end + + def valid_operating_systems + if self.operating_systems.empty? + self.errors.add(:operating_system, _(": at least one must be filled")) + end + end + + def valid_software_info + if self.software_languages.empty? + self.errors.add(:software_languages, _(": at least one must be filled")) + end + end + + def valid_databases + if self.software_databases.empty? + self.errors.add(:software_databases, _(": at least one must be filled")) + end + end + + def visible? + self.community.visible? + end + + def name + self.community.name + end + + def short_name + self.community.short_name + end + + def identifier + self.community.identifier + end +end diff --git a/src/software_communities/lib/software_information_block.rb b/src/software_communities/lib/software_information_block.rb new file mode 100644 index 0000000..a398c96 --- /dev/null +++ b/src/software_communities/lib/software_information_block.rb @@ -0,0 +1,37 @@ +class SoftwareInformationBlock < Block + + attr_accessible :show_name + + settings_items :show_name, :type => :boolean, :default => false + + def self.description + _('Basic Software Information') + end + + def help + _('This block displays the basic information of a software profile.') + end + + def content(args={}) + block = self + s = show_name + + lambda do |object| + render( + :file => 'blocks/software_information', + :locals => { :block => block, :show_name => s} + ) + end + end + + def cacheable? + false + end + + private + + def owner_has_ratings? + ratings = CommunityRating.where(community_id: block.owner.id) + !ratings.empty? + end +end diff --git a/src/software_communities/lib/software_language.rb b/src/software_communities/lib/software_language.rb new file mode 100644 index 0000000..29f23c4 --- /dev/null +++ b/src/software_communities/lib/software_language.rb @@ -0,0 +1,14 @@ +class SoftwareLanguage < ActiveRecord::Base + attr_accessible :version + + belongs_to :software_info + belongs_to :programming_language + + validates_length_of( + :version, + :maximum => 20, + :too_long => _("Software language is too long (maximum is 20 characters)") + ) + + validates_presence_of :version,:programming_language +end diff --git a/src/software_communities/lib/software_language_helper.rb b/src/software_communities/lib/software_language_helper.rb new file mode 100644 index 0000000..296088d --- /dev/null +++ b/src/software_communities/lib/software_language_helper.rb @@ -0,0 +1,85 @@ +class SoftwareLanguageHelper < DynamicTableHelper + MODEL_NAME ="language" + FIELD_NAME = "programming_language_id" + + def self.valid_language? language + return false if SoftwareHelper.all_table_is_empty?(language) + + programming_language_id_list = ProgrammingLanguage. + select(:id). + collect { |dd| dd.id } + + return programming_language_id_list.include?( + language[:programming_language_id].to_i + ) + end + + def self.list_language new_languages + return [] if new_languages.nil? or new_languages.length == 0 + list_languages = [] + + new_languages.each do |new_language| + if valid_language? new_language + language = SoftwareLanguage.new + language.programming_language = + ProgrammingLanguage.find(new_language[:programming_language_id]) + language.version = new_language[:version] + list_languages << language + end + end + + list_languages + end + + def self.valid_list_language? list_languages + return false if list_languages.nil? or list_languages.length == 0 + + list_languages.each do |language| + return false unless language.valid? + end + + true + end + + def self.language_as_tables(list_languages, disabled=false) + model_list = list_languages + model_list ||= [{:programming_language_id => "", :version => ""}] + + models_as_tables model_list, "language_html_structure", disabled + end + + def self.language_html_structure(language_data, disabled) + language_id = language_data[:programming_language_id] + language_name = if language_data[:programming_language_id].blank? + "" + else + ProgrammingLanguage.find( + language_data[:programming_language_id], + :select=>"name" + ).name + end + + data = { + model_name: MODEL_NAME, + field_name: FIELD_NAME, + name: { + value: language_name, + id: language_id, + hidden: true, + autocomplete: true, + select_field: false + }, + version: { + value: language_data[:version], + hidden: true, + delete: true + } + } + DATA[:license].delete(:value) + table_html_structure(data, disabled) + end + + def self.add_dynamic_table + language_as_tables(nil).first.call + end +end diff --git a/src/software_communities/lib/software_tab_data_block.rb b/src/software_communities/lib/software_tab_data_block.rb new file mode 100644 index 0000000..b32eeb5 --- /dev/null +++ b/src/software_communities/lib/software_tab_data_block.rb @@ -0,0 +1,48 @@ +class SoftwareTabDataBlock < Block + attr_accessible :show_name, :displayed_blog + + settings_items :show_name, :type => :boolean, :default => false + settings_items :displayed_blog, :type => :integer, :default => 0 + + TOTAL_POSTS_DYSPLAYED = 5 + + def self.description + _('Software Tab Data') + end + + def help + _('This block is used by colab to insert data into Noosfero') + end + + def content(args={}) + block = self + + lambda do |object| + render( + :file => 'blocks/software_tab_data', + :locals => { + :block => block + } + ) + end + end + + def blogs + self.owner.blogs + end + + def actual_blog + # As :displayed_blog default value is 0, it falls to the first one + blogs.find_by_id(self.displayed_blog) || blogs.first + end + + def posts + blog = actual_blog + + if blog and (not blog.posts.empty?) + blog.posts.limit(TOTAL_POSTS_DYSPLAYED) + else + [] + end + end +end diff --git a/src/software_communities/lib/softwares_block.rb b/src/software_communities/lib/softwares_block.rb new file mode 100644 index 0000000..067345a --- /dev/null +++ b/src/software_communities/lib/softwares_block.rb @@ -0,0 +1,105 @@ +class SoftwaresBlock < CommunitiesBlock + + settings_items :software_type, :default => "All" + attr_accessible :accessor_id, :accessor_type, :role_id, + :resource_id, :resource_type, :software_type + + def self.description + _('Softwares') + end + + def default_title + if self.software_type == "Generic" + return n_('{#} generic software', '{#} generic softwares', profile_count) + elsif self.software_type == "Public" + return n_('{#} public software', '{#} public softwares', profile_count) + else + return n_('{#} software', '{#} softwares', profile_count) + end + end + + def help + _('This block displays the softwares in which the user is a member.') + end + + def footer + self.software_type ||= "All" + owner = self.owner + case owner + when Profile + lambda do |context| + link_to s_('softwares|View all'), :profile => owner.identifier, + :controller => 'profile', :action => 'communities', + :type => 'Software' + end + when Environment + lambda do |context| + link_to s_('softwares|View all'), :controller => 'search', + :action => 'software_infos' + end + else + '' + end + end + + def profile_count + profile_list.count + end + + def profiles + owner.communities + end + + def profile_list + profiles = get_visible_profiles + + software_profiles = profiles.select do |profile| + profile.class == Community && profile.software? + end + + block_softwares = if self.software_type == "Public" + software_profiles.select { |profile| profile.software_info.public_software? } + elsif self.software_type == "Generic" + software_profiles.select { |profile| !profile.software_info.public_software? } + else # All + software_profiles + end + + block_softwares.slice(0..get_limit-1) + end + + def content(arg={}) + if self.box.owner_type == "Environment" && self.box.position == 1 + block = self + + proc do + render :file => 'blocks/main_area_softwares', + :locals => {:profiles=> block.profile_list(), :block => block} + end + else + super(arg) + end + end + + protected + + def get_visible_profiles + profile_include_list = [:image, :domains, :preferred_domain, :environment] + visible_profiles = profiles.visible.includes(profile_include_list) + + if !prioritize_profiles_with_image + visible_profiles.all( :limit => get_limit, + :order => 'profiles.updated_at DESC' + ).sort_by{ rand } + elsif profiles.visible.with_image.count >= get_limit + visible_profiles.with_image.all( :limit => get_limit * 5, + :order => 'profiles.updated_at DESC' + ).sort_by{ rand } + else + visible_profiles.with_image.sort_by{ rand } + + visible_profiles.without_image.all( :limit => get_limit * 5, + :order => 'profiles.updated_at DESC' + ).sort_by{ rand } + end + end +end diff --git a/src/software_communities/lib/statistic_block.rb b/src/software_communities/lib/statistic_block.rb new file mode 100644 index 0000000..fd45f4f --- /dev/null +++ b/src/software_communities/lib/statistic_block.rb @@ -0,0 +1,52 @@ +class StatisticBlock < Block + + settings_items :benefited_people, :type => :integer, :default => 0 + settings_items :saved_resources, :type => :float, :default => 0.0 + + attr_accessible :benefited_people, :saved_resources + + def self.description + _('Software Statistics') + end + + def help + _('This block displays software statistics.') + end + + def content(args={}) + download_blocks = get_profile_download_blocks(self.owner) + downloads = download_blocks.map do |download_block| + get_downloads_from_block(download_block) + end + + block = self + + lambda do |object| + render( + :file => 'blocks/software_statistics', + :locals => { + :block => block, + :total_downloads => downloads.sum + } + ) + end + end + + def cacheable? + false + end + + private + + def get_profile_download_blocks profile + DownloadBlock.joins(:box).where("boxes.owner_id = ?", profile.id) + end + + def get_downloads_from_block download_block + downloads = download_block.downloads.map do |download| + download[:total_downloads] unless download[:total_downloads].nil? + end + downloads.select! {|value| not value.nil? } + downloads.sum + end +end diff --git a/src/software_communities/lib/tasks/create_categories.rake b/src/software_communities/lib/tasks/create_categories.rake new file mode 100644 index 0000000..29a1cf9 --- /dev/null +++ b/src/software_communities/lib/tasks/create_categories.rake @@ -0,0 +1,20 @@ +namespace :software do + desc "Create software categories" + task :create_categories => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") + print 'Creating categories: ' + software = Category.create(:name => _("Software"), :environment => env) + Category::SOFTWARE_CATEGORIES.each do |category_name| + unless Category.find_by_name(category_name) + print '.' + Category.create(:name => category_name, :environment => env, :parent => software) + else + print 'F' + end + end + puts '' + end + end + end +end diff --git a/src/software_communities/lib/tasks/create_licenses.rake b/src/software_communities/lib/tasks/create_licenses.rake new file mode 100644 index 0000000..3df7c30 --- /dev/null +++ b/src/software_communities/lib/tasks/create_licenses.rake @@ -0,0 +1,42 @@ +namespace :software do + desc "Create software licences" + + task :create_licenses => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") + list_file = File.open "plugins/software_communities/public/static/licences.txt", "r" + + version_or_link = 'version' + can_save = true + licence = nil + + print 'Creating Licenses: ' + list_file.each_line do |line| + data = line.strip + + if data.length != 0 + if version_or_link == 'version' + can_save = LicenseInfo.find_by_version(data) ? false : true + licence = LicenseInfo::new :version => data + version_or_link = 'link' + elsif version_or_link == 'link' + licence.link = data + + if can_save + licence.save! + print '.' + else + print 'F' + end + + version_or_link = 'version' + end + end + end + puts '' + + list_file.close + end + end + end +end diff --git a/src/software_communities/lib/tasks/create_sample_softwares.rake b/src/software_communities/lib/tasks/create_sample_softwares.rake new file mode 100644 index 0000000..1cd00cf --- /dev/null +++ b/src/software_communities/lib/tasks/create_sample_softwares.rake @@ -0,0 +1,71 @@ +NUMBER_OF_SOFTWARES = 10 + +namespace :software do + desc "Create sample softwares" + task :create_sample_softwares => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") + print "Creating softwares: " + + NUMBER_OF_SOFTWARES.times do |i| + number = i < 10 ? "0#{i}" : "#{i}" + software_name = "Software #{number}" + create_software_info(software_name) + end + + create_software_info("Ubuntu") + create_software_info("Debian") + create_software_info("Windows XP") + create_software_info("Windows Vista") + create_software_info("Windows 7") + create_software_info("Windows 8") + create_software_info("Disk Operating System", "DOS") + create_software_info("Sublime") + create_software_info("Vi IMproved", "Vim") + create_software_info("Nano") + create_software_info("Gedit") + create_software_info("Firefox") + create_software_info("InkScape") + create_software_info("Eclipse") + create_software_info("LibreOffice") + create_software_info("Tetris") + create_software_info("Mario") + create_software_info("Pong") + create_software_info("Sonic") + create_software_info("Astah") + create_software_info("Pokemom Red") + create_software_info("Mass Effect") + create_software_info("Deus EX") + create_software_info("Dragon Age") + + puts "" + end + end + end +end + +def create_community(name) + community = Community.new + community.name = name + community.save + community +end + +def create_software_info(name, acronym = "", finality = "default") + community = create_community(name) + software_info = SoftwareInfo.new + software_info.community = community + software_info.public_software = true + software_info.acronym = acronym + software_info.finality = finality + software_info.license_info = LicenseInfo.first + + if software_info.community.valid? && software_info.valid? + print "." + software_info.save + software_info + else + print "F" + nil + end +end diff --git a/src/software_communities/lib/tasks/export.rake b/src/software_communities/lib/tasks/export.rake new file mode 100644 index 0000000..224ae25 --- /dev/null +++ b/src/software_communities/lib/tasks/export.rake @@ -0,0 +1,133 @@ +require 'csv' + +namespace :export do + namespace :catalog do + desc "Export all softwares to CSV" + task :csv => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") + softwares_to_csv + categories_to_csv + software_categories_to_csv + + compress_files + end + end + end + end + + def softwares_to_csv + print "Exporting softwares to softwares.csv: " + + CSV.open('/tmp/softwares.csv', 'w') do |csv| + csv << [ + "id", + "community_id", + "identifier", + "name", + "finality", + "acronym", + "created_at", + "image_filename", + "home_page_name", + "home_page_slug", + "home_page_path", + "home_page_body", + "home_page_abstract", + "home_page_published_at" + ] + + SoftwareInfo.all.each do |software| + if software.community + begin + csv << [ + software.id, + software.community.id, + software.community.identifier, + software.community.name, + software.finality, + software.acronym, + software.community.created_at, + (software.community.image.nil? ? nil : software.community.image.filename), + (software.community.home_page.nil? ? nil : software.community.home_page.name), + (software.community.home_page.nil? ? nil : software.community.home_page.slug), + (software.community.home_page.nil? ? nil : software.community.home_page.path), + (software.community.home_page.nil? ? nil : software.community.home_page.body), + (software.community.home_page.nil? ? nil : software.community.home_page.abstract), + (software.community.home_page.nil? ? nil : software.community.home_page.published_at), + ] + + print '.' + rescue + print 'F' + end + end + end + end + + print "\n" + end + + def categories_to_csv + print "Exporting categories to categories.csv: " + + CSV.open('/tmp/categories.csv', 'w') do |csv| + csv << [ + "id", + "name", + "path", + ] + + Category.all.each do |category| + begin + csv << [ + category.id, + category.name, + category.path, + ] + + print '.' + rescue + print 'F' + end + end + end + + print "\n" + end + + def software_categories_to_csv + print "Exporting software and categories relation to software_categories.csv: " + CSV.open('/tmp/software_categories.csv', 'w') do |csv| + csv << [ + "software_id", + "category_id" + ] + + SoftwareInfo.all.each do |software| + if software.community + software.community.categories.each do |category| + begin + csv << [ + software.id, + category.id + ] + + print '.' + rescue + print 'F' + end + end + end + end + end + + print "\n" + end + + def compress_files + `cd /tmp/ && tar -zcvf software_catalog_csvs.tar.gz softwares.csv categories.csv software_categories.csv` + + `cd /tmp/ && rm softwares.csv categories.csv software_categories.csv` + end +end \ No newline at end of file diff --git a/src/software_communities/lib/tasks/main_data.rake b/src/software_communities/lib/tasks/main_data.rake new file mode 100644 index 0000000..793ec38 --- /dev/null +++ b/src/software_communities/lib/tasks/main_data.rake @@ -0,0 +1,18 @@ +#!/bin/env ruby +# encoding: utf-8 + +namespace :main_data do + desc "Create the main community and its contents" + task :populate => :environment do + Rake::Task["templates:create:all"].invoke + Rake::Task["software:create_licenses"].invoke + Rake::Task["software:create_categories"].invoke + Rake::Task["software:create_sample_softwares"].invoke + end + + desc "Create the main community and its contents" + task :all => :environment do + Rake::Task["templates:destroy"].invoke + Rake::Task["main_data:populate"].invoke + end +end diff --git a/src/software_communities/lib/tasks/templates.rake b/src/software_communities/lib/tasks/templates.rake new file mode 100644 index 0000000..46ad264 --- /dev/null +++ b/src/software_communities/lib/tasks/templates.rake @@ -0,0 +1,42 @@ +#!/bin/env ruby +# encoding: utf-8 + +namespace :templates do + namespace :create do + + desc "Create new templates of software, intitution, person and community" + task :all => :environment do + Rake::Task["templates:create:software"].invoke + end + + desc "Create new templates of software" + task :software => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") + software = Community["software"] + + if software.nil? + software = Community.create!(:name => "Software", :identifier => "software") + end + + software.layout_template = "default" + software.is_template = true + software.save! + + puts "Software Template successfully created!" + end + end + end + end + + desc "Destroy all templates created by this namespace" + task :destroy => :environment do + Environment.all.each do |env| + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") + Community["software"].destroy unless Community["software"].nil? + puts "Software template destoyed with success!" + end + end + end + +end diff --git a/src/software_communities/lib/wiki_block.rb b/src/software_communities/lib/wiki_block.rb new file mode 100644 index 0000000..3d7da90 --- /dev/null +++ b/src/software_communities/lib/wiki_block.rb @@ -0,0 +1,30 @@ +class WikiBlock < Block + + attr_accessible :show_name, :wiki_link + settings_items :show_name, :type => :boolean, :default => false + settings_items :wiki_link, :type => :string, :default => "" + + def self.description + _('Wiki Link') + end + + def help + _('This block displays a link to the software wiki.') + end + + def content(args={}) + block = self + s = show_name + + lambda do |object| + render( + :file => 'blocks/wiki', + :locals => { :block => block, :show_name => s } + ) + end + end + + def cacheable? + true + end +end diff --git a/src/software_communities/po/pt/software_communities.po b/src/software_communities/po/pt/software_communities.po new file mode 100644 index 0000000..037150c --- /dev/null +++ b/src/software_communities/po/pt/software_communities.po @@ -0,0 +1,1361 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: 1.2.1+spb4-2-ged0502e\n" +"POT-Creation-Date: 2015-09-14 14:29-0300\n" +"PO-Revision-Date: 2014-11-12 13:05-0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: plugins/software_communities/lib/search_catalog_block.rb:8 +msgid "Search Softwares catalog" +msgstr "Busca do catálogo de software" + +#: plugins/software_communities/lib/search_catalog_block.rb:12 +msgid "This block displays the search categories field " +msgstr "Este bloco apresenta a busca do campo de categorias" + +#: plugins/software_communities/lib/ext/category.rb:5 +msgid "Agriculture, Fisheries and Extraction" +msgstr "Agricultura, Extrativismo e Pesca" + +#: plugins/software_communities/lib/ext/category.rb:6 +msgid "Science, Information and Communication" +msgstr "Ciência, Informação e Comunicação " + +#: plugins/software_communities/lib/ext/category.rb:7 +msgid "Economy and Finances" +msgstr "Economia e Finanças" + +#: plugins/software_communities/lib/ext/category.rb:8 +msgid "Public Administration" +msgstr "Gestão Pública" + +#: plugins/software_communities/lib/ext/category.rb:9 +msgid "Habitation, Sanitation and Urbanism" +msgstr "Habitação, Saneamento e Urbanismo" + +#: plugins/software_communities/lib/ext/category.rb:10 +msgid "Individual, Family and Society" +msgstr "Pessoa, Família e Sociedade " + +#: plugins/software_communities/lib/ext/category.rb:11 +msgid "Health" +msgstr "Saúde" + +#: plugins/software_communities/lib/ext/category.rb:12 +msgid "Social Welfare and Development" +msgstr "Bem-estar e Desenvolvimento Social" + +#: plugins/software_communities/lib/ext/category.rb:13 +msgid "Defense and Security" +msgstr "Defesa e Segurança" + +#: plugins/software_communities/lib/ext/category.rb:14 +msgid "Education" +msgstr "Educação" + +#: plugins/software_communities/lib/ext/category.rb:15 +msgid "Government and Politics" +msgstr "Governo e Política" + +#: plugins/software_communities/lib/ext/category.rb:16 +msgid "Justice and Legislation" +msgstr "Justiça e Legislação" + +#: plugins/software_communities/lib/ext/category.rb:17 +msgid "International Relationships" +msgstr "Relações Internacionais" + +#: plugins/software_communities/lib/ext/category.rb:18 +msgid "Transportation and Transit" +msgstr "Transporte e Trânsito" + +#: plugins/software_communities/lib/ext/search_controller.rb:118 +msgid "Result Search" +msgstr "Resultado da pesquisa" + +#: plugins/software_communities/lib/ext/search_controller.rb:142 +msgid "Selected options: " +msgstr "Opções selecionadas:" + +#: plugins/software_communities/lib/repository_block.rb:8 +msgid "Repository Link" +msgstr "Link para o Repositório" + +#: plugins/software_communities/lib/repository_block.rb:12 +msgid "This block displays the repository link of a software." +msgstr "Este bloco apresenta o link para o repositório do software." + +#: plugins/software_communities/lib/wiki_block.rb:8 +msgid "Wiki Link" +msgstr "Link da wiki" + +#: plugins/software_communities/lib/wiki_block.rb:12 +msgid "This block displays a link to the software wiki." +msgstr "Este bloco apresenta o link para a wiki do software." + +#: plugins/software_communities/lib/statistic_block.rb:9 +msgid "Software Statistics" +msgstr "Estastísticas de software" + +#: plugins/software_communities/lib/statistic_block.rb:13 +msgid "This block displays software statistics." +msgstr "Este bloco apresenta a estatística de software" + +#: plugins/software_communities/lib/library.rb:5 +msgid "can't be blank" +msgstr "não pode ficar em branco" + +#: plugins/software_communities/lib/library.rb:8 +msgid "Too long (maximum is 20 characters)" +msgstr "Muito grande(máximo é 20 caracteres" + +#: plugins/software_communities/lib/software_info.rb:151 +msgid "Name is too long (maximum is %{count} characters)" +msgstr "Nome é muito longo(máximo é %{count} caracteres)" + +#: plugins/software_communities/lib/software_info.rb:219 +msgid "can't have more than 10 characteres" +msgstr "não pode ter mais de 10 caracteres" + +#: plugins/software_communities/lib/software_info.rb:222 +msgid "can't have whitespaces" +msgstr "não pode ter espaços em branco" + +#: plugins/software_communities/lib/software_info.rb:230 +#: plugins/software_communities/lib/software_info.rb:236 +#: plugins/software_communities/lib/software_info.rb:242 +msgid ": at least one must be filled" +msgstr ": ao menos um deve ser preenchido" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:17 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:3 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:37 +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:3 +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:3 +msgid "Name" +msgstr "Nome" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:18 +msgid "Version" +msgstr "Versão" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:19 +#: plugins/software_communities/views/profile/_software_tab.html.erb:18 +msgid "License" +msgstr "Licença" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:91 +msgid "Autocomplete field, type something" +msgstr "Campo automático, digite algo" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:116 +#: plugins/software_communities/views/box_organizer/_download_list_template.html.erb:8 +#: plugins/software_communities/views/box_organizer/_download_list.html.erb:8 +msgid "Delete" +msgstr "Deletar" + +#: plugins/software_communities/lib/create_software.rb:36 +msgid "New software" +msgstr "Novo software" + +#: plugins/software_communities/lib/create_software.rb:44 +msgid "%{requestor} wants to create software %{subject} with" +msgstr "%{requestor} deseja criar o software %{subject} com" + +#: plugins/software_communities/lib/create_software.rb:46 +msgid " no finality." +msgstr " campo finalidade em branco." + +#: plugins/software_communities/lib/create_software.rb:48 +msgid " this finality:

%{finality}

" +msgstr " esta finalidade:

%{finality}

" + +#: plugins/software_communities/lib/create_software.rb:68 +msgid "%{requestor} wants to create software %{subject}" +msgstr "%{requestor} deseja criar o software %{subject}" + +#: plugins/software_communities/lib/create_software.rb:73 +msgid "" +"User \"%{user}\" just requested to create software %{software}.\n" +" You have to approve or reject it through the \"Pending Validations\"\n" +" section in your control panel.\n" +msgstr "" +"Usuário \"%{user}\" acabou de requisitar a criação do software %{software}.\n" +" Você deve aprovar ou rejeitar pela seção \"Tarefas pendentes\"\n" +" no seu painel de controle.\n" + +#: plugins/software_communities/lib/create_software.rb:80 +msgid "" +"Your request for registering software %{software} at %{environment} was\n" +" just sent. Environment administrator will receive it and will approve " +"or\n" +" reject your request according to his methods and criteria.\n" +"\n" +" You will be notified as soon as environment administrator has a " +"position\n" +" about your request." +msgstr "" +"O seu pedido para registrar o software %{software} no %{environment} foi\n" +" enviada. O administrador do ambiente irá recebe-la e aprovará ou rejeitará " +"seu pedido de acordo com seus métodos e critérios.\n" +"\n" +" Você será notificado assim que o administrador do ambiente tiver uma " +"resposta sobre o seu pedido." + +#: plugins/software_communities/lib/create_software.rb:90 +msgid "" +"Your request for registering software %{software} at %{environment} was\n" +" not approved by the environment administrator. The following " +"explanation\n" +" was given: \n" +"\n" +"%{explanation}" +msgstr "" +"Seu pedido para registro do software %{software} no %{environment} não " +"foi\n" +" aprovado pelo administrador do ambiente. A seguinte explicação\n" +" foi fornecida:\n" +"\n" +"%{explanation}" + +#: plugins/software_communities/lib/create_software.rb:99 +msgid "" +"Your request for registering the software \"%{software}\" was approved.\n" +" You can access %{url} and finish the registration of your software." +msgstr "" +"Seu pedido para registro do software %{software} foi aprovada.\n" +" Você pode acessar %{url} e finalizar o registro do seu software. " + +#: plugins/software_communities/lib/operating_system.rb:12 +msgid "too long (maximum is 20 characters)" +msgstr "muito longo(máximo é 20 caracteres)" + +#: plugins/software_communities/lib/software_highlights_block.rb:4 +msgid "Software Highlights Block" +msgstr "Bloco de software em destaque" + +#: plugins/software_communities/lib/software_highlights_block.rb:8 +msgid "This block displays the softwares icon into a highlight" +msgstr "Esse bloco apresenta o ícone do software em destaque" + +#: plugins/software_communities/lib/categories_software_block.rb:8 +msgid "Categories Softwares" +msgstr "Categorias de Softwares" + +#: plugins/software_communities/lib/categories_software_block.rb:12 +msgid "" +"This block displays the categories and the amount of softwares for\n" +" each category." +msgstr "" +"Este bloco apresenta as categorias e a quantidade de softwares para \n" +" cada categoria." + +#: plugins/software_communities/lib/softwares_block.rb:8 +msgid "Softwares" +msgstr "Softwares" + +#: plugins/software_communities/lib/softwares_block.rb:13 +msgid "{#} generic software" +msgid_plural "{#} generic softwares" +msgstr[0] "{#} software genérico" +msgstr[1] "{#} softwares genéricos" + +#: plugins/software_communities/lib/softwares_block.rb:15 +msgid "{#} public software" +msgid_plural "{#} public softwares" +msgstr[0] "{#} software público" +msgstr[1] "{#} software públicos" + +#: plugins/software_communities/lib/softwares_block.rb:17 +msgid "{#} software" +msgid_plural "{#} softwares" +msgstr[0] "{#} software" +msgstr[1] "{#} softwares" + +#: plugins/software_communities/lib/softwares_block.rb:22 +msgid "This block displays the softwares in which the user is a member." +msgstr "Este bloco apresenta os softwares em que o usuário é membro." + +#: plugins/software_communities/lib/softwares_block.rb:31 +#: plugins/software_communities/lib/softwares_block.rb:37 +msgid "softwares|View all" +msgstr "softwares|Veja todos" + +#: plugins/software_communities/lib/software_communities_plugin.rb:17 +msgid "Add Public Software and MPOG features." +msgstr "Adicionar Software Público e Funcionalidades." + +#: plugins/software_communities/lib/software_communities_plugin.rb:90 +msgid "Rate this software" +msgstr "Avalie esse software" + +#: plugins/software_communities/lib/software_communities_plugin.rb:94 +msgid "Use reports" +msgstr "Relatos de uso" + +#: plugins/software_communities/lib/software_communities_plugin.rb:138 +msgid "Software Info" +msgstr "Informação de Software" + +#: plugins/software_communities/lib/software_communities_plugin.rb:149 +msgid "Create a new software" +msgstr "Criar um novo software" + +#: plugins/software_communities/lib/software_communities_plugin.rb:159 +msgid "Software" +msgstr "Software" + +#: plugins/software_communities/lib/software_language.rb:10 +msgid "Software language is too long (maximum is 20 characters)" +msgstr "Linguagem do software está muito grande (máximo de 20 caracteres)" + +#: plugins/software_communities/lib/software_tab_data_block.rb:10 +msgid "Software Tab Data" +msgstr "Aba de dados do software" + +#: plugins/software_communities/lib/software_tab_data_block.rb:14 +msgid "This block is used by colab to insert data into Noosfero" +msgstr "Esse bloco é usado pelo Colab para inserir dados no noosfero" + +#: plugins/software_communities/lib/download_block.rb:15 +msgid "Download Stable Version" +msgstr "Baixar Versão Estável" + +#: plugins/software_communities/lib/download_block.rb:19 +msgid "This block displays the stable version of a software." +msgstr "Este block apresenta a versão estável do software." + +#: plugins/software_communities/lib/software_database.rb:12 +msgid "Software database is too long (maximum is 20 characters)" +msgstr "Banco de dados do software está muito grande(máximo é 20 caracteres)" + +#: plugins/software_communities/lib/software_information_block.rb:8 +msgid "Basic Software Information" +msgstr "Informação Básica do Software" + +#: plugins/software_communities/lib/software_information_block.rb:12 +msgid "This block displays the basic information of a software profile." +msgstr "Este bloco apresenta a informação básica de um perfil de software." + +#: plugins/software_communities/lib/categories_and_tags_block.rb:8 +msgid "Categories and Tags" +msgstr "Categorias e Marcadores" + +#: plugins/software_communities/lib/categories_and_tags_block.rb:12 +msgid "This block displays the categories and tags of a software." +msgstr "Este block apresenta as categorias e marcadores de um software." + +#: plugins/software_communities/test/unit/software_info_validation_test.rb:108 +msgid "Features is too long (maximum is 4000 characters)" +msgstr "Funcionalidades está muito grande(máximo é 4000 caracteres)" + +#: plugins/software_communities/test/unit/software_info_validation_test.rb:116 +msgid "Objectives is too long (maximum is 4000 characters)" +msgstr "Objetivo está muito grande (máximo é 4000 caracteres)" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:41 +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:19 +msgid "Save and Configure Community" +msgstr "Salvar e Configurar Comunidade" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:45 +msgid "Software updated successfully" +msgstr "Software atualizado com sucesso" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:49 +msgid "Could not update software" +msgstr "Não foi possível atualizar o software" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:130 +msgid "" +"Your new software request will be evaluated by anadministrator. You will be " +"notified." +msgstr "" +"Seu pedido para registro do software será avaliado por um administrador. " +"Você será notificado." + +#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:7 +msgid "Could not find the download file" +msgstr "Não foi possível encontrar o arquivo para download" + +#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:8 +msgid "Invalid download params" +msgstr "Parâmetros de Download inválidos" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:1 +msgid "General information" +msgstr "Informação geral" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:40 +msgid "Address" +msgstr "Endereço" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:46 +msgid "WARNING!" +msgstr "PERIGO!" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:47 +msgid "" +"You are about to change the address, and this will break external links to " +"the homepage or to content inside it. Do you really want to change?" +msgstr "" +"Você está prestes a mudar o endereço, e isso vai quebrar links externos para " +"a página inicial ou para o conteúdo dentro dela. Você realmente quer mudar?" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:49 +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 +#: plugins/software_communities/views/profile/_software_tab.html.erb:8 +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +msgid "Yes" +msgstr "Sim" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:50 +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 +#: plugins/software_communities/views/profile/_software_tab.html.erb:8 +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +msgid "No" +msgstr "Não" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:63 +msgid "Enable \"contact us\"" +msgstr "Habilitar \"entre em contato\"" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:68 +msgid "Products/Services catalog" +msgstr "Catálogo de Produtos/Serviços" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:69 +msgid "Number of products/services displayed per page on catalog" +msgstr "Número de produtos/serviços mostrado por página no catálogo" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:4 +msgid "Configure Software Community" +msgstr "Configurar Comunidade do Software" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:8 +msgid "Set the basic settings of the software associated community" +msgstr "Defina as configurações básicas da comunidade do software" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:18 +msgid "This profile is a template" +msgstr "Este perfil é um template" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:24 +msgid "Privacy options" +msgstr "Opções de privacidade" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:28 +msgid "Public — show my contents to all internet users" +msgstr "Público — mostrar meus conteúdos a todos os usuários na internet" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:31 +msgid "Private — show my contents only to friends" +msgstr "Privado — mostrar meus conteudos apenas aos amigos" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:35 +msgid "Public — show content of this group to all internet users" +msgstr "" +"Público — mostrar conteudos deste grupo a todos os usuários na internet" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:38 +msgid "Private — show content of this group only to members" +msgstr "Privado — mostrar meus conteudos deste grupo apenas aos membros" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:43 +msgid "Page to redirect after login" +msgstr "Página para redirecionar após o login" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:47 +msgid "Translations" +msgstr "Traduções" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:49 +msgid "" +"Automaticaly redirect the visitor to the article translated to his/her " +"language" +msgstr "" +"Redirecionar automaticamente o visitante para o artigo traduzido para sua " +"língua" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:53 +msgid "Suggestions" +msgstr "Sugestões" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:55 +msgid "Send me relationship suggestions by email" +msgstr "Envie-me sugestões de relacionamento por e-mail" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:65 +#: plugins/software_communities/views/search/_full_community.html.erb:27 +msgid "Software Categories" +msgstr "Categorias de Software" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:68 +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:18 +msgid "Save" +msgstr "Salvar" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:71 +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:20 +msgid "Back to control panel" +msgstr "Voltar para o painel de controle" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:77 +msgid "Delete software and community" +msgstr "Remover software e comunidade" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 +msgid "Deactivate software and community" +msgstr "Desativar software e comunidade" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 +msgid "Are you sure you want to deactivate this profile?" +msgstr "Tem certeza de que deseja desativar esse perfil?" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 +msgid "Activate software and community" +msgstr "Ativar software e comunidade" + +#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:3 +msgid "Step 1 - Software Creation" +msgstr "Passo 1 - Criação do Software" + +#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:7 +msgid "Step 2 - Community Settings" +msgstr "Passo 2 - Configuração da Comunidade" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:5 +msgid "Autocomplete field, type some license" +msgstr "Campo com auto completar, digite uma licença" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:8 +msgid "Read license" +msgstr "Ler licença" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:10 +#: plugins/software_communities/views/search/_software_search_form.html.erb:14 +msgid "Public Software" +msgstr "Software Público" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 +msgid "Public software" +msgstr "Software Público" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:12 +msgid "Adherent to e-PING ?" +msgstr "Aderente ao e-PING ?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:21 +msgid "Adherent to e-MAG ?" +msgstr "Aderente ao e-MAG ?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:30 +msgid "Adherent to ICP-Brasil ?" +msgstr "Aderente ao ICP-Brasil ?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:39 +msgid "Adherent to e-ARQ ?" +msgstr "Aderente ao e-ARQ ?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:48 +msgid "Internacionalizable ?" +msgstr "Internacionalizável ?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:59 +msgid "Operating Platform" +msgstr "Plataforma Operacional" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:64 +msgid "Features" +msgstr "Características" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:69 +msgid "Demonstration url" +msgstr "Url de demonstração" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:74 +#: plugins/software_communities/views/profile/_software_tab.html.erb:35 +msgid "Libraries" +msgstr "Bibliotecas" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:82 +msgid "Operating Systems" +msgstr "Sistemas Operacionais" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:90 +msgid "Programming languages" +msgstr "Linguagens de programação" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:97 +msgid "Databases" +msgstr "Banco de dados" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:1 +msgid "Edit Software" +msgstr "Editar Software" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:9 +msgid "Main Information" +msgstr "Informação" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:12 +msgid "Specifications" +msgstr "Especificações" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb:11 +msgid "New language" +msgstr "Nova linguagem" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb:11 +msgid "New Library" +msgstr "Nova Biblioteca" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb:11 +msgid "New Operating System" +msgstr "Novo Sistema Operacional" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb:11 +msgid "New Database" +msgstr "Novo Banco de Dados" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:8 +msgid "Short Name" +msgstr "Nome Curto" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:14 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:56 +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:10 +msgid "Finality" +msgstr "Finalidade" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:15 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:57 +msgid "What is the software for?" +msgstr "Para quê serve o software?" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:21 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:64 +msgid "Software Logo" +msgstr "Marca do Software" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 +msgid "Image:" +msgstr "Imagem:" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 +msgid "Max size: %s (.jpg, .gif, .png)" +msgstr "Tamanho máximo: %s (.jpg, .gif, .png)" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:33 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:76 +msgid "License Version: " +msgstr "Versão da Licença: " + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:45 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:89 +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:29 +msgid "Link to Repository: " +msgstr "Link para o Repositório" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:5 +msgid "Creating new software" +msgstr "Criando novo software" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:9 +msgid "" +"Enter the basic information about the software.
\n" +" You can add the details after you create it." +msgstr "" +"Entre com as informações básicas do software.
\n" +" Você pode adicionar os detalhes após sua criação." + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:16 +msgid "" +"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." +msgstr "" +"Note que a criação de comunidades nesse ambiente é restrita. Sua requisição " +"para criar essa nova comunidade será enviada aos administradores do " +"%{environment} para ser aprovada ou rejeitada de acordo com os seus métodos " +"e critérios" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 +msgid "\"Can`t create new software: #{@errors.length} errors\"" +msgstr "\"Não foi possível criar o software: #{@errors.length} errors\"" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 +msgid "Domain" +msgstr "Domínio" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:97 +msgid "Create" +msgstr "Criar" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:98 +msgid "Cancel" +msgstr "Cancelar" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:12 +msgid "see all (%d)" +msgstr "ver todos (%d)" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:34 +msgid "No software found. Try more general filters" +msgstr "Nenhum software encontrado. Tente outros filtros" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:36 +msgid "" +"No software found. Try more general filters or check the software category " +"individually" +msgstr "" +"Nenhum software encontrado. Tente outros filtros ou verifique a categoria do " +"software individualmente" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:41 +#: plugins/software_communities/views/search/_full_community.html.erb:35 +#: plugins/software_communities/views/search/_catalog_filter.html.erb:10 +#: plugins/software_communities/views/blocks/categories_software.html.erb:15 +msgid "\"#{category.name}\"" +msgstr "\"#{category.name}\"" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:3 +msgid "Search Public Software Catalog" +msgstr "Pesquisar Catálogo de Software Público" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:15 +msgid "" +"Projects that have passed by the Avalia SPB process according to the " +"requirements of IN 01/2011." +msgstr "" +"Projetos que passaram pelo processo Avalia SPB de acordo com os Requisitos " +"da IN 01/2011." + +#: plugins/software_communities/views/search/_software_search_form.html.erb:18 +msgid "All" +msgstr "Todos" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:19 +msgid "Projects included in the portal as cases provided by the IN 01/2011." +msgstr "Projetos incluidos no portal como os casos fornecidos pela IN 01/2011." + +#: plugins/software_communities/views/search/_software_search_form.html.erb:24 +msgid "" +"Type words about the software you're looking for (the search begins after 3 " +"characters)" +msgstr "" +"Digite palavras sobre o software que você está procurando (a busca começa " +"depois de 3 caracteres" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:27 +msgid "Filter" +msgstr "Filtro" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:52 +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:5 +msgid "Name A-Z" +msgstr "Nome A-Z" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:53 +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:6 +msgid "Name Z-A" +msgstr "Nome Z-A" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:54 +msgid "Relevance" +msgstr "Relevância" + +#: plugins/software_communities/views/search/software_infos.html.erb:6 +msgid "Type words about the %s you're looking for" +msgstr "Digite palavras sobre o %s que você está procurando" + +#: plugins/software_communities/views/search/_full_community.html.erb:46 +msgid "This software doesn't have categories" +msgstr "Este software nào contém categorias" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:4 +#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:2 +msgid "Categories" +msgstr "Categorias" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:16 +msgid "More options" +msgstr "Mais opções" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:18 +msgid "Clean up" +msgstr "Limpar" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:19 +msgid "Close" +msgstr "Fechar" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:3 +msgid "Additional informations" +msgstr "Informações adicionais" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:11 +msgid "Number of Beneficiaries" +msgstr "Número de beneficiados" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:17 +msgid "Saved resources" +msgstr "Recursos economizados" + +#: plugins/software_communities/views/box_organizer/_wiki_block.html.erb:3 +msgid "Wiki link" +msgstr "Link da wiki" + +#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:5 +msgid "Which blog should have its posts displayed: " +msgstr "Qual blog deve ter seus posts exibidos: " + +#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:13 +msgid "This community has no blogs" +msgstr "Essa comunidade não possui blogs" + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:5 +msgid "Benefited People" +msgstr "Pessoas Beneficiadas" + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:6 +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:8 +msgid "Portal suggested value: " +msgstr "Valor sugerido pelo portal: " + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:7 +msgid "Saved Resources" +msgstr "Recursos economizados" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:4 +msgid "Link" +msgstr "Link" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:5 +msgid "Platforms" +msgstr "Plataformas" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:6 +#: plugins/software_communities/views/blocks/download.html.erb:17 +msgid "Minimum Requirements" +msgstr "Requisitos Mínimos" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:7 +msgid "Size:" +msgstr "Tamanho:" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:16 +msgid "New link" +msgstr "Novo link" + +#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:2 +msgid "Limit of items" +msgstr "Limite de itens" + +#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:3 +msgid "Software Type:" +msgstr "Tipo de Software:" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:1 +#: plugins/software_communities/views/profile/_software_tab.html.erb:3 +msgid "Software Information" +msgstr "Informação de Software" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:15 +msgid "Licenses" +msgstr "Licenças" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:20 +msgid "License link" +msgstr "Link para a licença" + +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:2 +msgid "Sort by:" +msgstr "Ordenar por:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:6 +msgid "Name:" +msgstr "Nome:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 +msgid "Adherent to e_mag:" +msgstr "Aderente ao e_mag:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:8 +msgid "Adherent to icp_brasil:" +msgstr "Aderente ao icp_brasil:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +msgid "Adherent to e_ping:" +msgstr "Aderente ao e_ping" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +msgid "Adherent to e_arq:" +msgstr "Aderente ao e_arq" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +msgid "Internacionalizable:" +msgstr "Internacionalizável:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:12 +msgid "Operating Platform:" +msgstr "Plataforma Operacional:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:13 +msgid "Demonstration URL:" +msgstr "URL de Demonstração:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:14 +msgid "Short Name:" +msgstr "Nome Curto:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:15 +msgid "Objectives:" +msgstr "Objetivos:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:16 +msgid "Features:" +msgstr "Funcionalidades:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:19 +msgid "Version:" +msgstr "Versão:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:20 +msgid "Link:" +msgstr "Link:" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:25 +msgid "Show Libraries" +msgstr "Mostrar Bibliotecas" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:26 +msgid "Hide Libraries" +msgstr "Ocultar Bibliotecas" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:53 +msgid "Show Database" +msgstr "Mostrar Banco de Dados" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:54 +msgid "Hide Database" +msgstr "Ocultar Banco de Dados" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:63 +msgid "Software Databases" +msgstr "Bancos de Dados do Software" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:81 +msgid "Show Languages" +msgstr "Mostrar Linguagens" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:82 +msgid "Hide Languages" +msgstr "Ocultar Linguagens" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:91 +msgid "Software Languages" +msgstr "Linguagens do Software" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:109 +msgid "Show Operating Systems" +msgstr "Mostrar Sistema Operacional" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:110 +msgid "Hide Operating Systems" +msgstr "Ocultar Sistema Operacional" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:120 +msgid "Operating System" +msgstr "Sistema Operacional" + +#: plugins/software_communities/views/profile/members.html.erb:3 +#: plugins/software_communities/views/profile/members.html.erb:26 +msgid "Members" +msgstr "Membros" + +#: plugins/software_communities/views/profile/members.html.erb:4 +msgid "%s" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:43 +msgid "Administrators" +msgstr "Administradores" + +#: plugins/software_communities/views/profile/members.html.erb:57 +msgid "Go back" +msgstr "Voltar" + +#: plugins/software_communities/views/profile/members.html.erb:60 +msgid "Invite people to join" +msgstr "Convide pessoas para entrar" + +#: plugins/software_communities/views/profile/members.html.erb:63 +msgid "Send e-mail to members" +msgstr "Envie e-mail para os membros" + +#: plugins/software_communities/views/profile/index.html.erb:17 +msgid "Control Panel" +msgstr "Painel de Controle" + +#: plugins/software_communities/views/blocks/main_area_softwares.html.erb:23 +msgid "See More" +msgstr "Veja Mais" + +#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:5 +msgid "This community has no posts in its blog" +msgstr "Essa comunidade não possui posts nesse blog" + +#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:13 +msgid "Read more" +msgstr "Leia mais" + +#: plugins/software_communities/views/blocks/repository.html.erb:2 +#: plugins/software_communities/views/blocks/download.html.erb:2 +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:2 +#: plugins/software_communities/views/blocks/wiki.html.erb:2 +#: plugins/software_communities/views/blocks/software_information.html.erb:4 +msgid "This community needs a software to use this block" +msgstr "Essa comunidade precisa de um software para usar este block" + +#: plugins/software_communities/views/blocks/repository.html.erb:4 +msgid "Repository" +msgstr "Repositório" + +#: plugins/software_communities/views/blocks/download.html.erb:4 +msgid "\"Download #{block.owner.software_info.community.name}\"" +msgstr "\"Baixar #{block.owner.software_info.community.name}\"" + +#: plugins/software_communities/views/blocks/download.html.erb:9 +msgid "Download the software" +msgstr "Baixar o software" + +#: plugins/software_communities/views/blocks/download.html.erb:15 +msgid "\"#{download[:name]}\"" +msgstr "\"#{download[:name]}\"" + +#: plugins/software_communities/views/blocks/download.html.erb:16 +msgid "\"Platform:#{download[:software_description]}\"" +msgstr "\"Platform:#{download[:software_description]}\"" + +#: plugins/software_communities/views/blocks/download.html.erb:23 +msgid "\"License: #{block.owner.software_info.license_info.version}\"" +msgstr "\"License: #{block.owner.software_info.license_info.version}\"" + +#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:12 +msgid "Tags" +msgstr "Tags" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:5 +msgid " benefited people*" +msgstr " pessoas beneficiadas*" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:6 +msgid " saved resources*" +msgstr " recursos economizados*" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:10 +msgid "Data estimated by the software administrator." +msgstr "Dados estimados pelo administrador do software" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:4 +msgid "See more Software" +msgstr "Veja mais softwares" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:8 +msgid "Categories:" +msgstr "Categorias:" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:23 +#: plugins/software_communities/views/blocks/search_catalog.html.erb:9 +msgid "Access the complete catalog" +msgstr "Acessar o catálogo completo" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:6 +msgid "Discussions" +msgstr "Discussões" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:7 +msgid "Blog" +msgstr "" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:8 +msgid "Repository Feed" +msgstr "Feed do Repositório" + +#: plugins/software_communities/views/blocks/wiki.html.erb:4 +msgid "Wiki" +msgstr "" + +#: plugins/software_communities/views/blocks/software_highlights.html.erb:13 +msgid "See all" +msgstr "ver todos (%d)" + +#: plugins/software_communities/views/blocks/software_information.html.erb:16 +msgid "Control panel" +msgstr "Painel de Controle" + +#: plugins/software_communities/views/blocks/software_information.html.erb:24 +msgid "\"#{block.owner.software_info.acronym} - \"" +msgstr "\"#{block.owner.software_info.acronym} - \"" + +#: plugins/software_communities/views/blocks/software_information.html.erb:25 +msgid "\"#{block.owner.name}\"" +msgstr "\"#{block.owner.name}\"" + +#: plugins/software_communities/views/blocks/search_catalog.html.erb:2 +msgid "Catalog of Public Software" +msgstr "Catálogo de Software Público" + +#: plugins/software_communities/views/blocks/search_catalog.html.erb:5 +msgid "Search" +msgstr "Procurar" + +#~ msgid "Software Projects:" +#~ msgstr "Projetos de Software:" + +#~ msgid "Include in results" +#~ msgstr "Incluir em resultados" + +#~ msgid "" +#~ "Include software development projects that are not yet officially " +#~ "Brazilian Public Software." +#~ msgstr "" +#~ "Incluir projetos de desenvolvimento de software que não são ainda " +#~ "oficialmente Software Público Brasileiro" + +#~ msgid "Email must be different from secondary email." +#~ msgstr "Email deve ser diferente do email secundário." + +#~ msgid "E-mail or secondary e-mail already taken." +#~ msgstr "Email ou email secundário já foram escolhidos por outro usuário." + +#~ msgid "Invalid secondary email format." +#~ msgstr "Formato do email secundário inválido." + +#~ msgid "The governamental email must be the primary one." +#~ msgstr "O email governamental deve ser o email primário." + +#~ msgid "Institution is obligatory if user has a government email." +#~ msgstr "Instituição é obrigatório se usuário tem um email governamental." + +#~ msgid "Institution Catalog" +#~ msgstr "Catálogo de Instituição" + +#~ msgid "Create Institution" +#~ msgstr "Criar Instituição" + +#~ msgid "Institution Info" +#~ msgstr "Informação de Instituição" + +#~ msgid "Institution" +#~ msgstr "Instituição" + +#~ msgid "Institutions" +#~ msgstr "Instituições" + +#~ msgid "{#} institution" +#~ msgid_plural "{#} institutions" +#~ msgstr[0] "{#} instituição" +#~ msgstr[1] "{#} instituições" + +#~ msgid "This block displays the institutions in which the user is a member." +#~ msgstr "Este bloco apresenta as instituições em que o usuário é membro." + +#~ msgid "institutions|View all" +#~ msgstr "instituições|Veja todos" + +#~ msgid "invalid, only public and private institutions are allowed." +#~ msgstr "inválido, apenas instituições públicas e privadas são permitidas." + +#~ msgid "invalid format" +#~ msgstr "formato inválido" + +#~ msgid "Could not find Governmental Power or Governmental Sphere" +#~ msgstr "Não foi possível encontrar o poder ou esfera governamental" + +#~ msgid "Institution successful created!" +#~ msgstr "Instituição criada com sucesso!" + +#~ msgid "Institution could not be created!" +#~ msgstr "Instituição não pode ser criada!" + +#~ msgid "Name Should begin with a capital letter and no special characters" +#~ msgstr "" +#~ "Nome deve começar com letra maiúscula e não pode ter caracteres especiais" + +#~ msgid "Secondary e-mail" +#~ msgstr "Email secundário" + +#~ msgid "No institution found" +#~ msgstr "Nenhuma instituição encontrada" + +#~ msgid "Add new institution" +#~ msgstr "Adicionar nova instituiço" + +#~ msgid "Create new institution" +#~ msgstr "Criar nova instituição" + +#~ msgid "Should begin with a capital letter and no special characters" +#~ msgstr "Deve começar com letra maíuscula e sem caracteres especiais" + +#~ msgid "Email should have the following format: name@host.br" +#~ msgstr "Email deve ter o seguinte formato: name@host.br" + +#~ msgid "Site should have a valid format: http://name.hosts" +#~ msgstr "Site deve ter um formato válido: http://name.hosts" + +#~ msgid "If you work in a public agency use your government e-Mail" +#~ msgstr "Se você trabalha em um órgão público use seu e-Mail governamental" + +#~ msgid "New Institution" +#~ msgstr "Nova Instituição" + +#~ msgid "\"Can`t create new Institution: #{flash[:errors].length} errors\"" +#~ msgstr "" +#~ "\"Não foi possível criar a Instituição: #{flash[:errors].length} errors\"" + +#~ msgid "All fields with (*) are mandatory" +#~ msgstr "Todos os campos com (*) são obrigatórios" + +#~ msgid "Public Institution" +#~ msgstr "Insituição Pública" + +#~ msgid "Private Institution" +#~ msgstr "Instituição Privada" + +#~ msgid "Institution name already exists" +#~ msgstr "Instituição com o nome informado já existe" + +#~ msgid "Country" +#~ msgstr "País" + +#~ msgid "State" +#~ msgstr "Estado" + +#~ msgid "CNPJ" +#~ msgstr "CNPJ" + +#~ msgid "Acronym" +#~ msgstr "Sigla" + +#~ msgid "Fantasy name" +#~ msgstr "Nome fantasia" + +#~ msgid "Governmental Sphere:" +#~ msgstr "Esfera Governamental:" + +#~ msgid "Select a Governmental Sphere" +#~ msgstr "Selecione a Esfera Governamental" + +#~ msgid "Governmental Power:" +#~ msgstr "Poder Governamental:" + +#~ msgid "Select a Governmental Power" +#~ msgstr "Selecione um Poder Governamental" + +#~ msgid "Juridical Nature:" +#~ msgstr "Natureza Jurídica" + +#~ msgid "Select a Juridical Nature" +#~ msgstr "Selecione uma Natureza Jurídica" + +#~ msgid "SISP?" +#~ msgstr "SISP?" + +#~ msgid "Could not send the form data to the server" +#~ msgstr "Não foi possível enviar os dados do formulário ao servidor" + +#~ msgid "Creating institution" +#~ msgstr "Criando instituição" + +#~ msgid "Institution Information" +#~ msgstr "Informações de Instituição" + +#~ msgid "Type:" +#~ msgstr "Tipo:" + +#~ msgid "CNPJ:" +#~ msgstr "CNPJ:" + +#~ msgid "Last modification:" +#~ msgstr "Última modificação:" + +#~ msgid "Country:" +#~ msgstr "País" + +#~ msgid "State:" +#~ msgstr "Estado" + +#~ msgid "City:" +#~ msgstr "Cidade" + +#~ msgid "Fantasy Name:" +#~ msgstr "Nome Fantasia:" + +#~ msgid "Acronym:" +#~ msgstr "Sigla:" + +#~ msgid "SISP:" +#~ msgstr "SISP:" + +#~ msgid "Edit Institution" +#~ msgstr "Editar Instituíção" + +#~ msgid "Link to Repository" +#~ msgstr "Link para o Repositório" + +#~ msgid "Select the categories of your interest" +#~ msgstr "Selecione as categorias de seu interesse" + +#~ msgid "Delete profile" +#~ msgstr "Deletar perfil" + +#~ msgid "Deactivate profile" +#~ msgstr "Desativar perfil" + +#~ msgid "Activate profile" +#~ msgstr "Ativar perfil" + +#~ msgid "Complete Profile" +#~ msgstr "Completar Perfil" + +#~ msgid "Complete your profile" +#~ msgstr "Complete seu perfil" + +#~ msgid "Hide" +#~ msgstr "Esconder" + +#~ msgid "Most downloaded" +#~ msgstr "Mais baixado" + +#~ msgid "Top rated" +#~ msgstr "Mais Populares" + +#~ msgid "Recently updated" +#~ msgstr "Atualizado Recentemente" + +#~ msgid "New in portal" +#~ msgstr "Novo no portal" diff --git a/src/software_communities/po/software_communities.pot b/src/software_communities/po/software_communities.pot new file mode 100644 index 0000000..5885eee --- /dev/null +++ b/src/software_communities/po/software_communities.pot @@ -0,0 +1,1044 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.2-143-g8dfded9\n" +"POT-Creation-Date: 2015-09-11 17:15-0000\n" +"PO-Revision-Date: 2015-09-11 17:15-0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: plugins/software_communities/test/unit/software_info_validation_test.rb:108 +msgid "Features is too long (maximum is 4000 characters)" +msgstr "" + +#: plugins/software_communities/test/unit/software_info_validation_test.rb:116 +msgid "Objectives is too long (maximum is 4000 characters)" +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:41 +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:19 +msgid "Save and Configure Community" +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:45 +msgid "Software updated successfully" +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:49 +msgid "Could not update software" +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:130 +msgid "Your new software request will be evaluated by anadministrator. You will be notified." +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:7 +msgid "Could not find the download file" +msgstr "" + +#: plugins/software_communities/controllers/software_communities_plugin_profile_controller.rb:8 +msgid "Invalid download params" +msgstr "" + +#: plugins/software_communities/lib/operating_system.rb:12 +msgid "too long (maximum is 20 characters)" +msgstr "" + +#: plugins/software_communities/lib/statistic_block.rb:9 +msgid "Software Statistics" +msgstr "" + +#: plugins/software_communities/lib/statistic_block.rb:13 +msgid "This block displays software statistics." +msgstr "" + +#: plugins/software_communities/lib/categories_and_tags_block.rb:8 +msgid "Categories and Tags" +msgstr "" + +#: plugins/software_communities/lib/categories_and_tags_block.rb:12 +msgid "This block displays the categories and tags of a software." +msgstr "" + +#: plugins/software_communities/lib/wiki_block.rb:8 +msgid "Wiki Link" +msgstr "" + +#: plugins/software_communities/lib/wiki_block.rb:12 +msgid "This block displays a link to the software wiki." +msgstr "" + +#: plugins/software_communities/lib/library.rb:5 +msgid "can't be blank" +msgstr "" + +#: plugins/software_communities/lib/library.rb:8 +msgid "Too long (maximum is 20 characters)" +msgstr "" + +#: plugins/software_communities/lib/search_catalog_block.rb:8 +msgid "Search Softwares catalog" +msgstr "" + +#: plugins/software_communities/lib/search_catalog_block.rb:12 +msgid "This block displays the search categories field " +msgstr "" + +#: plugins/software_communities/lib/software_database.rb:12 +msgid "Software database is too long (maximum is 20 characters)" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:5 +msgid "Agriculture, Fisheries and Extraction" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:6 +msgid "Science, Information and Communication" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:7 +msgid "Economy and Finances" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:8 +msgid "Public Administration" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:9 +msgid "Habitation, Sanitation and Urbanism" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:10 +msgid "Individual, Family and Society" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:11 +msgid "Health" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:12 +msgid "Social Welfare and Development" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:13 +msgid "Defense and Security" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:14 +msgid "Education" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:15 +msgid "Government and Politics" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:16 +msgid "Justice and Legislation" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:17 +msgid "International Relationships" +msgstr "" + +#: plugins/software_communities/lib/ext/category.rb:18 +msgid "Transportation and Transit" +msgstr "" + +#: plugins/software_communities/lib/ext/search_controller.rb:118 +msgid "Result Search" +msgstr "" + +#: plugins/software_communities/lib/ext/search_controller.rb:142 +msgid "Selected options: " +msgstr "" + +#: plugins/software_communities/lib/download_block.rb:15 +msgid "Download Stable Version" +msgstr "" + +#: plugins/software_communities/lib/download_block.rb:19 +msgid "This block displays the stable version of a software." +msgstr "" + +#: plugins/software_communities/lib/software_tab_data_block.rb:10 +msgid "Software Tab Data" +msgstr "" + +#: plugins/software_communities/lib/software_tab_data_block.rb:14 +msgid "This block is used by colab to insert data into Noosfero" +msgstr "" + +#: plugins/software_communities/lib/software_highlights_block.rb:4 +msgid "Software Highlights Block" +msgstr "" + +#: plugins/software_communities/lib/software_highlights_block.rb:8 +msgid "This block displays the softwares icon into a highlight" +msgstr "" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:17 +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:3 +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:3 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:37 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:3 +msgid "Name" +msgstr "" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:18 +msgid "Version" +msgstr "" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:19 +#: plugins/software_communities/views/profile/_software_tab.html.erb:18 +msgid "License" +msgstr "" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:91 +msgid "Autocomplete field, type something" +msgstr "" + +#: plugins/software_communities/lib/dynamic_table_helper.rb:116 +#: plugins/software_communities/views/box_organizer/_download_list_template.html.erb:8 +#: plugins/software_communities/views/box_organizer/_download_list.html.erb:8 +msgid "Delete" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:36 +msgid "New software" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:44 +msgid "%{requestor} wants to create software %{subject} with" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:46 +msgid " no finality." +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:48 +msgid " this finality:

%{finality}

" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:68 +msgid "%{requestor} wants to create software %{subject}" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:73 +msgid "User \"%{user}\" just requested to create software %{software}.\n You have to approve or reject it through the \"Pending Validations\"\n section in your control panel.\n" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:80 +msgid "Your request for registering software %{software} at %{environment} was\n just sent. Environment administrator will receive it and will approve or\n reject your request according to his methods and criteria.\n\n You will be notified as soon as environment administrator has a position\n about your request." +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:90 +msgid "Your request for registering software %{software} at %{environment} was\n not approved by the environment administrator. The following explanation\n was given: \n\n%{explanation}" +msgstr "" + +#: plugins/software_communities/lib/create_software.rb:99 +msgid "Your request for registering the software \"%{software}\" was approved.\n You can access %{url} and finish the registration of your software." +msgstr "" + +#: plugins/software_communities/lib/software_communities_plugin.rb:17 +msgid "Add Public Software and MPOG features." +msgstr "" + +#: plugins/software_communities/lib/software_communities_plugin.rb:90 +msgid "Rate this software" +msgstr "" + +#: plugins/software_communities/lib/software_communities_plugin.rb:136 +msgid "Software Info" +msgstr "" + +#: plugins/software_communities/lib/software_communities_plugin.rb:147 +msgid "Create a new software" +msgstr "" + +#: plugins/software_communities/lib/software_communities_plugin.rb:157 +msgid "Software" +msgstr "" + +#: plugins/software_communities/lib/repository_block.rb:8 +msgid "Repository Link" +msgstr "" + +#: plugins/software_communities/lib/repository_block.rb:12 +msgid "This block displays the repository link of a software." +msgstr "" + +#: plugins/software_communities/lib/software_info.rb:151 +msgid "Name is too long (maximum is %{count} characters)" +msgstr "" + +#: plugins/software_communities/lib/software_info.rb:219 +msgid "can't have more than 10 characteres" +msgstr "" + +#: plugins/software_communities/lib/software_info.rb:222 +msgid "can't have whitespaces" +msgstr "" + +#: plugins/software_communities/lib/software_info.rb:230 plugins/software_communities/lib/software_info.rb:236 +#: plugins/software_communities/lib/software_info.rb:242 +msgid ": at least one must be filled" +msgstr "" + +#: plugins/software_communities/lib/software_information_block.rb:8 +msgid "Basic Software Information" +msgstr "" + +#: plugins/software_communities/lib/software_information_block.rb:12 +msgid "This block displays the basic information of a software profile." +msgstr "" + +#: plugins/software_communities/lib/software_language.rb:10 +msgid "Software language is too long (maximum is 20 characters)" +msgstr "" + +#: plugins/software_communities/lib/categories_software_block.rb:8 +msgid "Categories Softwares" +msgstr "" + +#: plugins/software_communities/lib/categories_software_block.rb:12 +msgid "This block displays the categories and the amount of softwares for\n each category." +msgstr "" + +#: plugins/software_communities/lib/softwares_block.rb:8 +msgid "Softwares" +msgstr "" + +#: plugins/software_communities/lib/softwares_block.rb:13 +msgid "{#} generic software" +msgid_plural "{#} generic softwares" +msgstr[0] "" +msgstr[1] "" + +#: plugins/software_communities/lib/softwares_block.rb:15 +msgid "{#} public software" +msgid_plural "{#} public softwares" +msgstr[0] "" +msgstr[1] "" + +#: plugins/software_communities/lib/softwares_block.rb:17 +msgid "{#} software" +msgid_plural "{#} softwares" +msgstr[0] "" +msgstr[1] "" + +#: plugins/software_communities/lib/softwares_block.rb:22 +msgid "This block displays the softwares in which the user is a member." +msgstr "" + +#: plugins/software_communities/lib/softwares_block.rb:31 plugins/software_communities/lib/softwares_block.rb:37 +msgid "softwares|View all" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:3 plugins/software_communities/views/profile/members.html.erb:26 +msgid "Members" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:4 +msgid "%s" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:43 +msgid "Administrators" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:57 +msgid "Go back" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:60 +msgid "Invite people to join" +msgstr "" + +#: plugins/software_communities/views/profile/members.html.erb:63 +msgid "Send e-mail to members" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:3 +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:1 +msgid "Software Information" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:6 +msgid "Name:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 +msgid "Adherent to e_mag:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 plugins/software_communities/views/profile/_software_tab.html.erb:8 +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:49 +msgid "Yes" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:7 plugins/software_communities/views/profile/_software_tab.html.erb:8 +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:50 +msgid "No" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:8 +msgid "Adherent to icp_brasil:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:9 +msgid "Adherent to e_ping:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:10 +msgid "Adherent to e_arq:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:11 +msgid "Internacionalizable:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:12 +msgid "Operating Platform:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:13 +msgid "Demonstration URL:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:14 +msgid "Short Name:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:15 +msgid "Objectives:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:16 +msgid "Features:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:19 +msgid "Version:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:20 +msgid "Link:" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:25 +msgid "Show Libraries" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:26 +msgid "Hide Libraries" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:35 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:74 +msgid "Libraries" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:53 +msgid "Show Database" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:54 +msgid "Hide Database" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:63 +msgid "Software Databases" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:81 +msgid "Show Languages" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:82 +msgid "Hide Languages" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:91 +msgid "Software Languages" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:109 +msgid "Show Operating Systems" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:110 +msgid "Hide Operating Systems" +msgstr "" + +#: plugins/software_communities/views/profile/_software_tab.html.erb:120 +msgid "Operating System" +msgstr "" + +#: plugins/software_communities/views/profile/index.html.erb:17 +msgid "Control Panel" +msgstr "" + +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:2 +msgid "Sort by:" +msgstr "" + +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:5 +#: plugins/software_communities/views/search/_software_search_form.html.erb:52 +msgid "Name A-Z" +msgstr "" + +#: plugins/software_communities/views/profile/_profile_members_list.html.erb:6 +#: plugins/software_communities/views/search/_software_search_form.html.erb:53 +msgid "Name Z-A" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:5 +msgid "Which blog should have its posts displayed: " +msgstr "" + +#: plugins/software_communities/views/box_organizer/_software_tab_data_block.html.erb:13 +msgid "This community has no blogs" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:2 +msgid "Limit of items" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_softwares_block.html.erb:3 +msgid "Software Type:" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:5 +msgid "Benefited People" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:6 +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:8 +msgid "Portal suggested value: " +msgstr "" + +#: plugins/software_communities/views/box_organizer/_statistic_block.html.erb:7 +msgid "Saved Resources" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:4 +msgid "Link" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:5 +msgid "Platforms" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:6 plugins/software_communities/views/blocks/download.html.erb:17 +msgid "Minimum Requirements" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:7 +msgid "Size:" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_download_block.html.erb:16 +msgid "New link" +msgstr "" + +#: plugins/software_communities/views/box_organizer/_wiki_block.html.erb:3 +msgid "Wiki link" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:4 +#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:2 +msgid "Categories" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:10 +#: plugins/software_communities/views/search/_full_community.html.erb:35 +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:41 +#: plugins/software_communities/views/blocks/categories_software.html.erb:15 +msgid "\"#{category.name}\"" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:16 +msgid "More options" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:18 +msgid "Clean up" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_filter.html.erb:19 +msgid "Close" +msgstr "" + +#: plugins/software_communities/views/search/_full_community.html.erb:27 +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:65 +msgid "Software Categories" +msgstr "" + +#: plugins/software_communities/views/search/_full_community.html.erb:46 +msgid "This software doesn't have categories" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:12 +msgid "see all (%d)" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:34 +msgid "No software found. Try more general filters" +msgstr "" + +#: plugins/software_communities/views/search/_catalog_result_list.html.erb:36 +msgid "No software found. Try more general filters or check the software category individually" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:3 +msgid "Search Public Software Catalog" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:14 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:10 +msgid "Public Software" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:15 +msgid "Projects that have passed by the Avalia SPB process according to the requirements of IN 01/2011." +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:18 +msgid "All" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:19 +msgid "Projects included in the portal as cases provided by the IN 01/2011." +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:24 +msgid "Type words about the software you're looking for (the search begins after 3 characters)" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:27 +msgid "Filter" +msgstr "" + +#: plugins/software_communities/views/search/_software_search_form.html.erb:54 +msgid "Relevance" +msgstr "" + +#: plugins/software_communities/views/search/software_infos.html.erb:6 +msgid "Type words about the %s you're looking for" +msgstr "" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:10 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:56 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:14 +msgid "Finality" +msgstr "" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:15 +msgid "Licenses" +msgstr "" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:20 +msgid "License link" +msgstr "" + +#: plugins/software_communities/views/_main_software_editor_extras.html.erb:29 +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:89 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:45 +msgid "Link to Repository: " +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:4 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:7 +msgid "Public software" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:12 +msgid "Adherent to e-PING ?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:21 +msgid "Adherent to e-MAG ?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:30 +msgid "Adherent to ICP-Brasil ?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:39 +msgid "Adherent to e-ARQ ?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:48 +msgid "Internacionalizable ?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:59 +msgid "Operating Platform" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:64 +msgid "Features" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:69 +msgid "Demonstration url" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:82 +msgid "Operating Systems" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:90 +msgid "Programming languages" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb:97 +msgid "Databases" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb:11 +msgid "New Database" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:5 +msgid "Autocomplete field, type some license" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb:8 +msgid "Read license" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb:11 +msgid "New language" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb:11 +msgid "New Operating System" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:5 +msgid "Creating new software" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:9 +msgid "Enter the basic information about the software.
\n You can add the details after you create it." +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:16 +msgid "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." +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:22 +msgid "\"Can`t create new software: #{@errors.length} errors\"" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:45 +msgid "Domain" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:57 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:15 +msgid "What is the software for?" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:64 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:21 +msgid "Software Logo" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 +msgid "Image:" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:69 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:26 +msgid "Max size: %s (.jpg, .gif, .png)" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:76 +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:33 +msgid "License Version: " +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:97 +msgid "Create" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb:98 +msgid "Cancel" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb:8 +msgid "Short Name" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:1 +msgid "Edit Software" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:9 +msgid "Main Information" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:12 +msgid "Specifications" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:18 +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:68 +msgid "Save" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb:20 +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:71 +msgid "Back to control panel" +msgstr "" + +#: plugins/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb:11 +msgid "New Library" +msgstr "" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:4 +msgid "See more Software" +msgstr "" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:8 +msgid "Categories:" +msgstr "" + +#: plugins/software_communities/views/blocks/categories_software.html.erb:23 plugins/software_communities/views/blocks/search_catalog.html.erb:9 +msgid "Access the complete catalog" +msgstr "" + +#: plugins/software_communities/views/blocks/wiki.html.erb:2 +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:2 plugins/software_communities/views/blocks/download.html.erb:2 +#: plugins/software_communities/views/blocks/software_information.html.erb:4 plugins/software_communities/views/blocks/repository.html.erb:2 +msgid "This community needs a software to use this block" +msgstr "" + +#: plugins/software_communities/views/blocks/wiki.html.erb:4 +msgid "Wiki" +msgstr "" + +#: plugins/software_communities/views/blocks/main_area_softwares.html.erb:23 +msgid "See More" +msgstr "" + +#: plugins/software_communities/views/blocks/search_catalog.html.erb:2 +msgid "Catalog of Public Software" +msgstr "" + +#: plugins/software_communities/views/blocks/search_catalog.html.erb:5 +msgid "Search" +msgstr "" + +#: plugins/software_communities/views/blocks/categories_and_tags.html.erb:12 +msgid "Tags" +msgstr "" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:6 +msgid "Discussions" +msgstr "" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:7 +msgid "Blog" +msgstr "" + +#: plugins/software_communities/views/blocks/software_tab_data.html.erb:8 +msgid "Repository Feed" +msgstr "" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:5 +msgid " benefited people*" +msgstr "" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:6 +msgid " saved resources*" +msgstr "" + +#: plugins/software_communities/views/blocks/software_statistics.html.erb:10 +msgid "Data estimated by the software administrator." +msgstr "" + +#: plugins/software_communities/views/blocks/download.html.erb:4 +msgid "\"Download #{block.owner.software_info.community.name}\"" +msgstr "" + +#: plugins/software_communities/views/blocks/download.html.erb:9 +msgid "Download the software" +msgstr "" + +#: plugins/software_communities/views/blocks/download.html.erb:15 +msgid "\"#{download[:name]}\"" +msgstr "" + +#: plugins/software_communities/views/blocks/download.html.erb:16 +msgid "\"Platform:#{download[:software_description]}\"" +msgstr "" + +#: plugins/software_communities/views/blocks/download.html.erb:23 +msgid "\"License: #{block.owner.software_info.license_info.version}\"" +msgstr "" + +#: plugins/software_communities/views/blocks/software_highlights.html.erb:13 +msgid "See all" +msgstr "" + +#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:5 +msgid "This community has no posts in its blog" +msgstr "" + +#: plugins/software_communities/views/blocks/_software_tab_blog.html.erb:13 +msgid "Read more" +msgstr "" + +#: plugins/software_communities/views/blocks/software_information.html.erb:16 +msgid "Control panel" +msgstr "" + +#: plugins/software_communities/views/blocks/software_information.html.erb:24 +msgid "\"#{block.owner.software_info.acronym} - \"" +msgstr "" + +#: plugins/software_communities/views/blocks/software_information.html.erb:25 +msgid "\"#{block.owner.name}\"" +msgstr "" + +#: plugins/software_communities/views/blocks/repository.html.erb:4 +msgid "Repository" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:1 +msgid "General information" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:40 +msgid "Address" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:46 +msgid "WARNING!" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:47 +msgid "You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:63 +msgid "Enable \"contact us\"" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:68 +msgid "Products/Services catalog" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_software_community.html.erb:69 +msgid "Number of products/services displayed per page on catalog" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:4 +msgid "Configure Software Community" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:8 +msgid "Set the basic settings of the software associated community" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:18 +msgid "This profile is a template" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:24 +msgid "Privacy options" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:28 +msgid "Public — show my contents to all internet users" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:31 +msgid "Private — show my contents only to friends" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:35 +msgid "Public — show content of this group to all internet users" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:38 +msgid "Private — show content of this group only to members" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:43 +msgid "Page to redirect after login" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:47 +msgid "Translations" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:49 +msgid "Automaticaly redirect the visitor to the article translated to his/her language" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:53 +msgid "Suggestions" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:55 +msgid "Send me relationship suggestions by email" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:77 +msgid "Delete software and community" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 +msgid "Deactivate software and community" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:80 +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 +msgid "Are you sure you want to deactivate this profile?" +msgstr "" + +#: plugins/software_communities/views/profile_editor/edit_software_community.html.erb:82 +msgid "Activate software and community" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:3 +msgid "Step 1 - Software Creation" +msgstr "" + +#: plugins/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb:7 +msgid "Step 2 - Community Settings" +msgstr "" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:3 +msgid "Additional informations" +msgstr "" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:11 +msgid "Number of Beneficiaries" +msgstr "" + +#: plugins/software_communities/views/comments_extra_fields.html.erb:17 +msgid "Saved resources" +msgstr "" diff --git a/src/software_communities/public/app.js b/src/software_communities/public/app.js new file mode 100644 index 0000000..7e98375 --- /dev/null +++ b/src/software_communities/public/app.js @@ -0,0 +1,11 @@ +(function() { + 'use strict'; + + var $ = modulejs.require('jquery'); + var Initializer = modulejs.require('Initializer'); + + + $(document).ready(function() { + Initializer.init(); + }); +})(); diff --git a/src/software_communities/public/blocks/software-download.js b/src/software_communities/public/blocks/software-download.js new file mode 100644 index 0000000..94bda3f --- /dev/null +++ b/src/software_communities/public/blocks/software-download.js @@ -0,0 +1,51 @@ +modulejs.define('SoftwareDownload', ['jquery', 'NoosferoRoot'], function($, NoosferoRoot) { + 'use strict'; + + var AJAX_URL = { + get_download_template: + NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_block_template") + }; + + var $download_html_template; + + function getDownloadListTemplate() { + var block_template = sessionStorage.getItem('download_list_block_template'); + + if(block_template && block_template.length > 0) { + $download_html_template = block_template; + } else { + $.get(AJAX_URL.get_download_template, function(response) { + $download_html_template = response; + sessionStorage.setItem('download_list_block_template', response); + }); + } + } + + + function SoftwareDownload() { + getDownloadListTemplate(); + } + + + SoftwareDownload.prototype.addNewDonwload = function() { + var new_download = $($download_html_template); + $("#droppable-list-downloads").append(new_download); + } + + + SoftwareDownload.prototype.deleteDownload = function(element) { + var delete_download = $(element).parent().parent().parent().remove(); + } + + + return { + isCurrentPage: function() { + return $('.download-block').length !== 0; + }, + + + init: function() { + window.softwareDownload = new SoftwareDownload(); + } + } +}); diff --git a/src/software_communities/public/initializer.js b/src/software_communities/public/initializer.js new file mode 100644 index 0000000..b0d3be6 --- /dev/null +++ b/src/software_communities/public/initializer.js @@ -0,0 +1,35 @@ +(function() { + 'use strict'; + + var dependencies = [ + 'ControlPanel', + 'EditSoftware', + 'NewSoftware', + 'SearchSoftwareCatalog', + 'SoftwareDownload', + 'ProfileTabsSoftware', + 'NewCommunity', + 'CommentsSoftwareExtraFields' + ]; + + + modulejs.define('Initializer', dependencies, function() { + var __dependencies = arguments; + + + function call_dependency(dependency) { + if( dependency.isCurrentPage() ) { + dependency.init(); + } + } + + + return { + init: function() { + for(var i=0, len = __dependencies.length; i < len; i++) { + call_dependency(__dependencies[i]); + } + } + }; + }); +})(); diff --git a/src/software_communities/public/lib/auto-complete.js b/src/software_communities/public/lib/auto-complete.js new file mode 100644 index 0000000..f96c04b --- /dev/null +++ b/src/software_communities/public/lib/auto-complete.js @@ -0,0 +1,64 @@ +modulejs.define('AutoComplete', ['jquery'], function($) { + 'use strict'; + + + function get_hidden_description_field(autocomplete_field, klass) { + var field = $(autocomplete_field); + field = field.parent().parent().find(klass); + return field; + } + + + function verify_autocomplete(field, klass) { + var field = $(field); + var selected = get_hidden_description_field(field, klass); + var message_error = $(field).parent().find(".autocomplete_validation_message"); + + if( field.length === 0 || selected.val().length === 0 ) { + message_error.removeClass("hide-field"); + selected.val(""); + + message_error.show(); + } else { + field.val(selected.attr("data-label")); + message_error.hide(); + } + } + + + function enable_autocomplete(field_name, field_value_class, autocomplete_class, ajax_url, select_callback) { + $(autocomplete_class).autocomplete({ + source : function(request, response){ + $.ajax({ + type: "GET", + url: ajax_url, + data: {query: request.term, field: field_name}, + success: function(result){ + response(result); + } + }); + }, + + minLength: 0, + + select : function (event, selected) { + var description = get_hidden_description_field(this, field_value_class); + description.val(selected.item.id); + description.attr("data-label", selected.item.label); + + if( select_callback !== undefined ) { + select_callback(selected); + } + } + }).blur(function(){ + verify_autocomplete(this, field_value_class); + }).click(function(){ + $(this).autocomplete("search", ""); + }); + } + + + return { + enable: enable_autocomplete + } +}); \ No newline at end of file diff --git a/src/software_communities/public/lib/noosfero-root.js b/src/software_communities/public/lib/noosfero-root.js new file mode 100644 index 0000000..cd3c8bf --- /dev/null +++ b/src/software_communities/public/lib/noosfero-root.js @@ -0,0 +1,13 @@ +modulejs.define('NoosferoRoot', function() { + 'use strict'; + + + function url_with_subdirectory(url) { + return noosfero_root() + url; + } + + + return { + urlWithSubDirectory: url_with_subdirectory + } +}); diff --git a/src/software_communities/public/lib/select-element.js b/src/software_communities/public/lib/select-element.js new file mode 100644 index 0000000..26880ae --- /dev/null +++ b/src/software_communities/public/lib/select-element.js @@ -0,0 +1,35 @@ +modulejs.define('SelectElement', function() { + 'use strict'; + + + function SelectElement(name, id) { + this.select = document.createElement("select"); + } + + + SelectElement.prototype.setAttr = function(attr, value) { + return this.select.setAttribute(attr, value); + }; + + + SelectElement.prototype.addOption = function(option) { + return this.select.add(option); + }; + + + SelectElement.prototype.getSelect = function() { + return this.select; + }; + + + SelectElement.generateOption = function(value, text) { + var option; + option = document.createElement("option"); + option.setAttribute("value", value); + option.text = text; + return option; + }; + + + return SelectElement; +}); diff --git a/src/software_communities/public/lib/select-field-choices.js b/src/software_communities/public/lib/select-field-choices.js new file mode 100644 index 0000000..095d4e1 --- /dev/null +++ b/src/software_communities/public/lib/select-field-choices.js @@ -0,0 +1,81 @@ +modulejs.define('SelectFieldChoices', ['jquery', 'SelectElement'], function($, SelectElement) { + 'use strict'; + + + function SelectFieldChoices(state_id, city_id, state_url) { + this.state_id = state_id; + this.input_html = $(state_id).parent().html(); + this.old_value = $(state_id).val(); + this.city_parent_div = $(city_id).parent().parent().parent(); + this.state_url = state_url; + } + + + SelectFieldChoices.prototype.getCurrentStateElement = function() { + return $(this.state_id); + }; + + + SelectFieldChoices.prototype.replaceWith = function(html) { + var parent_div = this.getCurrentStateElement().parent(); + parent_div.html(html); + }; + + + SelectFieldChoices.prototype.generateSelect = function(state_list) { + var select_element, option; + + select_element = new SelectElement(); + select_element.setAttr("name", "profile_data[state]"); + select_element.setAttr("id", "state_field"); + select_element.setAttr("class", "type-select valid"); + + state_list.forEach(function(state) { + option = SelectElement.generateOption(state, state); + select_element.addOption(option); + }); + + return select_element.getSelect(); + }; + + + SelectFieldChoices.prototype.replaceStateWithSelectElement = function() { + var klass = this; + + $.get(this.state_url, function(response) { + var select_html; + + if (response.length > 0) { + select_html = klass.generateSelect(response); + klass.replaceWith(select_html); + + if (klass.old_value.length !== 0 && response.include(klass.old_value)) { + klass.getCurrentStateElement().val(klass.old_value); + } + } + }); + }; + + + SelectFieldChoices.prototype.replaceStateWithInputElement = function() { + this.replaceWith(this.input_html); + }; + + + SelectFieldChoices.prototype.hideCity = function() { + this.city_parent_div.addClass("mpog_hidden_field"); + }; + + + SelectFieldChoices.prototype.showCity = function() { + this.city_parent_div.removeClass("mpog_hidden_field"); + }; + + + SelectFieldChoices.prototype.actualFieldIsInput = function() { + return this.getCurrentStateElement().attr("type") === "text"; + }; + + + return SelectFieldChoices; +}); diff --git a/src/software_communities/public/lib/software-catalog-component.js b/src/software_communities/public/lib/software-catalog-component.js new file mode 100644 index 0000000..c16e343 --- /dev/null +++ b/src/software_communities/public/lib/software-catalog-component.js @@ -0,0 +1,38 @@ +modulejs.define('SoftwareCatalogComponent', ['jquery'], function($) { + 'use strict'; + + var dispatch_ajax_function; + + function clearCatalogCheckbox() { + $("#group-categories input:checked").each(function() { + $(this).prop('checked', false); + }); + + dispatch_ajax_function(true); + } + + + function selectCheckboxCategory(dispatch_ajax) { + dispatch_ajax_function(true); + } + + + function selectProjectSoftwareCheckbox() { + dispatch_ajax_function(true); + } + + + function set_events() { + $("#cleanup-filter-catalg").click(clearCatalogCheckbox); + $(".categories-catalog").click(selectCheckboxCategory); + $(".project-software").click(selectProjectSoftwareCheckbox); + } + + return { + init: function(dispatch_ajax) { + dispatch_ajax_function = dispatch_ajax; + set_events(); + }, + } +}); + diff --git a/src/software_communities/public/static/databases.txt b/src/software_communities/public/static/databases.txt new file mode 100644 index 0000000..69efefa --- /dev/null +++ b/src/software_communities/public/static/databases.txt @@ -0,0 +1,101 @@ +Accumulo +Adabas +Aerospike +AllegroGraph +Altibase +Berkeley DB +Caché +Cassandra +CloudSearch +Cloudant +Coherence +CouchDB +Couchbase +D3 +DB2 +DataEase +Datameer +Db4o +Derby +Drizzle +DynamoDB +Ehcache +Elasticsearch +Endeca +EnterpriseDB +FileMaker +Firebird +GemFire +Google BigQuery +Google Search Appliance +Greenplum +H2 +HBase +Hazelcast +Hive +HyperSQL +IDMS +IMS +Infinispan +Infobright +Informix +Ingres +Interbase +Jackrabbit +Jena +LevelDB +MariaDB +MarkLogic +MaxDB +MemSQL +Memcached +Microsoft Access +Microsoft Azure SQL Database +Microsoft SQL Server +Mnesia +MongoDB +MySQL +Neo4j +Netezza +NuoDB +ObjectStore +OpenEdge +Oracle +Oracle NoSQL +OrientDB +ParAccel +Percona Server +PostgreSQL +RavenDB +Red Brick +Redis +Redshift +RethinkDB +Riak +SAP HANA +SQL Anywhere +SQLite +Sedna +Sesame +SimpleDB +Solr +Sparksee +Sphinx +Splunk +Sybase ADS +Sybase ASE +Sybase IQ +Teradata +Teradata Aster +TimesTen +Titan +UniData +UniVerse +Versant Object Database +Vertica +Virtuoso +VoltDB +dBASE +jBASE +mSQL +Other \ No newline at end of file diff --git a/src/software_communities/public/static/languages.txt b/src/software_communities/public/static/languages.txt new file mode 100644 index 0000000..a6ec626 --- /dev/null +++ b/src/software_communities/public/static/languages.txt @@ -0,0 +1,101 @@ +ASP +ActionScript +Ada +Apex +AppleScript +Arduino +Assembly +AutoHotkey +AutoIt +Awk +BlitzBasic +C +C# +C++ +CSS +Clojure +CoffeeScript +ColdFusion +Common Lisp +Coq +Cuda +D +DCPU-16 ASM +DOT +Dart +Delphi +Eiffel +Elixir +Elm +Emacs Lisp +Erlang +F# +FORTRAN +Go +Gosu +Groovy +HaXe +Haskell +Haxe +IDL +Io +Java +JavaScript +Julia +Kotlin +Lasso +LiveScript +Logos +Lua +M +Matlab +Max +Nemerle +Nimrod +OCaml +Objective-C +Objective-C++ +Objective-J +OpenEdge ABL +PHP +Parrot +Pascal +Perl +PowerShell +Processing +Prolog +Puppet +Pure Data +PureScript +Python +R +Racket +Ruby +Rust +SQL +Scala +Scheme +Scilab +Shell +Slash +Smalltalk +Standard ML +SuperCollider +Swift +Tcl +TeX +TypeScript +UnrealScript +VHDL +Vala +Verilog +VimL +Visual Basic +XC +XML +XQuery +XSLT +Xtend +nesC +xBase +Other \ No newline at end of file diff --git a/src/software_communities/public/static/licences.txt b/src/software_communities/public/static/licences.txt new file mode 100644 index 0000000..14e83c2 --- /dev/null +++ b/src/software_communities/public/static/licences.txt @@ -0,0 +1,212 @@ +Academic Free License 3.0 (AFL-3.0) +http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl + +Affero GNU Public License (AGPL-3.0) +http://www.gnu.org/licenses/agpl-3.0.html + +Adaptive Public License (APL-1.0) +http://opensource.org/licenses/APL-1.0 + +Apache License 2.0 (Apache-2.0) +http://www.apache.org/licenses/LICENSE-2.0 + +Apple Public Source License (APSL-2.0) +http://www.opensource.apple.com/license/apsl/ + +Artistic license 2.0 (Artistic-2.0) +http://opensource.org/licenses/Artistic-2.0 + +Attribution Assurance Licenses (AAL) +http://opensource.org/licenses/AAL + +BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) +http://opensource.org/licenses/BSD-3-Clause + +BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause) +http://opensource.org/licenses/BSD-2-Clause + +Boost Software License (BSL-1.0) +http://www.boost.org/users/license.html + +Computer Associates Trusted Open Source License 1.1 (CATOSL-1.1) +http://opensource.org/licenses/CATOSL-1.1 + +Common Development and Distribution License 1.0 (CDDL-1.0) +http://opensource.org/licenses/CDDL-1.0 + +Common Public Attribution License 1.0 (CPAL-1.0) +http://opensource.org/licenses/CPAL-1.0 + +CUA Office Public License Version 1.0 (CUA-OPL-1.0) +http://opensource.org/licenses/CUA-OPL-1.0 + +EU DataGrid Software License (EUDatagrid) +http://opensource.org/licenses/EUDatagrid + +Eclipse Public License 1.0 (EPL-1.0) +https://www.eclipse.org/legal/epl-v10.html + +Educational Community License, Version 2.0 (ECL-2.0) +http://opensource.org/licenses/ECL-2.0 + +Eiffel Forum License V2.0 (EFL-2.0) +http://opensource.org/licenses/EFL-2.0 + +Entessa Public License (Entessa) +http://opensource.org/licenses/entessa.php + +European Union Public License, Version 1.1 (EUPL-1.1) +http://ec.europa.eu/idabc/eupl.html + +Fair License (FAIR) +http://opensource.org/licenses/Fair + +Frameworx License (Frameworx-1.0) +http://opensource.org/licenses/Frameworx-1.0 + +GNU Affero General Public License v3 (AGPL-3.0) +http://www.gnu.org/licenses/agpl-3.0.html + +GNU General Public License version 2.0 (GPL-2.0) +http://www.gnu.org/licenses/gpl-2.0.html + +GNU General Public License version 3.0 (GPL-3.0) +http://www.gnu.org/copyleft/gpl.html + +GNU Library or "Lesser" General Public License version 2.1 (LGPL-2.1) +https://www.gnu.org/licenses/lgpl-2.1.html + +GNU Library or "Lesser" General Public License version 3.0 (LGPL-3.0) +https://www.gnu.org/licenses/lgpl.html + +Historical Permission Notice and Disclaimer (HPND) +http://opensource.org/licenses/HPND + +IBM Public License 1.0 (IPL-1.0) +http://opensource.org/licenses/IPL-1.0 + +IPA Font License (IPA) +http://opensource.org/licenses/IPA + +ISC License (ISC) +#No-link-found + +LaTeX Project Public License 1.3c (LPPL-1.3c) +http://latex-project.org/lppl/lppl-1-3c.html + +Lucent Public License Version 1.02 (LPL-1.02) +http://opensource.org/licenses/LPL-1.02 + +MirOS Licence (MirOS) +http://opensource.org/licenses/MirOS + +Microsoft Public License (Ms-PL) +http://opensource.org/licenses/MS-PL + +Microsoft Reciprocal License (Ms-RL) +http://opensource.org/licenses/MS-RL + +MIT license (MIT) +http://opensource.org/licenses/MIT + +Motosoto License (Motosoto) +http://opensource.org/licenses/Motosoto + +Mozilla Public License 2.0 (MPL-2.0) +https://www.mozilla.org/MPL/2.0/ + +Multics License (Multics) +http://opensource.org/licenses/Multics + +NASA Open Source Agreement 1.3 (NASA 1.3) +http://worldwind.arc.nasa.gov/worldwind-nosa-1.3.html + +NTP License (NTP) +http://opensource.org/licenses/NTP + +Naumen Public License (Naumen) +http://opensource.org/licenses/Naumen + +Nethack General Public License (NGPL) +http://www.nethack.org/common/license.html + +Nokia Open Source License (Nokia) +http://opensource.org/licenses/nokia.php + +Non-Profit Open Software License 3.0 (NPOSL-3.0) +http://opensource.org/licenses/NPOSL-3.0 + +OCLC Research Public License 2.0 (OCLC-2.0) +http://opensource.org/licenses/OCLC-2.0 + +Open Font License 1.1 (OFL 1.1) +http://opensource.org/licenses/OFL-1.1 + +Open Group Test Suite License (OGTSL) +http://opensource.org/licenses/OGTSL + +Open Software License 3.0 (OSL-3.0) +http://opensource.org/licenses/OSL-3.0 + +PHP License v3.0 (PHP-3.0) +http://php.net/license/3_0.txt + +PHP License v3.01 (PHP 4, PHP 5) +http://php.net/license/3_01.txt + +The PostgreSQL License (PostgreSQL) +http://www.postgresql.org/about/licence/ + +Python License (Python-2.0) +http://opensource.org/licenses/Python-2.0 + +CNRI Python license (CNRI-Python) +http://www.openfoundry.org/en/licenses/35-python-license-python + +Q Public License (QPL-1.0) +http://opensource.org/licenses/QPL-1.0 + +RealNetworks Public Source License V1.0 (RPSL-1.0) +http://opensource.org/licenses/RPSL-1.0 + +Reciprocal Public License 1.5 (RPL-1.5) +http://opensource.org/licenses/RPL-1.5 + +Ricoh Source Code Public License (RSCPL) +http://opensource.org/licenses/RSCPL + +Simple Public License 2.0 (SimPL-2.0) +http://opensource.org/licenses/Simple-2.0 + +Sleepycat License (Sleepycat) +http://opensource.org/licenses/Sleepycat + +Sun Public License 1.0 (SPL-1.0) +http://opensource.org/licenses/SPL-1.0 + +Sybase Open Watcom Public License 1.0 (Watcom-1.0) +http://www.openwatcom.org/index.php/Open_Watcom_Public_License + +University of Illinois/NCSA Open Source License (NCSA) +http://otm.illinois.edu/uiuc_openSource + +Vovida Software License v. 1.0 (VSL-1.0) +http://opensource.org/licenses/VSL-1.0 + +W3C License (W3C) +http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +wxWindows Library License (WXwindows) +https://www.wxwidgets.org/about/licence/ + +X.Net License (Xnet) +http://opensource.org/licenses/xnet.php + +Zope Public License 2.0 (ZPL-2.0) +http://opensource.org/licenses/ZPL-2.0 + +zlib/libpng license (Zlib) +http://www.openfoundry.org/en/licenses/36-zliblibpng-license-zliblibpng + +Another +# \ No newline at end of file diff --git a/src/software_communities/public/static/operating_systems.txt b/src/software_communities/public/static/operating_systems.txt new file mode 100644 index 0000000..445ec6e --- /dev/null +++ b/src/software_communities/public/static/operating_systems.txt @@ -0,0 +1,9 @@ +Debian +Ubuntu +Windows +CentOS +RedHat +Mint +MacOS +Fedora +Arch \ No newline at end of file diff --git a/src/software_communities/public/style.css b/src/software_communities/public/style.css new file mode 100644 index 0000000..5d4c536 --- /dev/null +++ b/src/software_communities/public/style.css @@ -0,0 +1,112 @@ +.mpog_hidden_field { + display: none; +} + +.dynamic-table { + border: solid 1px #000; + margin-top: 5px; + margin-bottom: 15px; +} +.dynamic-table td, .dynamic-table tr { + border: none; +} +.dynamic-table input { + width: 220px; +} + +#institution_dialog { + display: none; +} + +.errorExplanation { + color: red; + margin-left: 10px; +} + +.hide-field { + display: none !important; +} + +.show-field { + display: block !important; +} + +.formfieldline { + margin-top: 10px; +} +.formfieldline input[type="text"] { + width: 180px; +} + +#profile-data .invalid { + border-color: rgb(127, 0, 0); + box-shadow: 0px 0px 7px red; +} + +#profile-data .validated { + box-shadow: 0px 0px 7px green; + border-color: rgb(0, 80, 0); +} + +#software-name-field { + padding-bottom: 10px; +} + +#software-hostname { + padding: 0px 7px; + font-size: 18px; +} + +.mandatory::after { + color: red; + content: ' (*)'; +} + +.autocomplete_validation_message { + color: red; +} + +#content .softwares-block ul { + min-width: 196px; + width: 192px; + margin: 0px 0px 0px -3px; + padding: 0px; +} + +#content .box-1 .softwares-block ul { + width: auto; + display: block; +} + +#content .softwares-block .block-footer-content a { + background: url(../../../designs/themes/base/imgs/arrow-right-p.png) 100% 50% no-repeat; +} + +/*FIX-ME: necessary while there is +* not a defined theme style for the +* forms */ +.improve_input_size { + width: 315px !important; +} + +.software-block { + position: relative; + float: left; + overflow: hidden; +} + +.software-block-content, .software-block-finality { + width: 100%; + position: absolute; +} + +/*===== Communities rate hotspot extra fields =====*/ + +.comments-software-extra-fields div { + display: none; +} + +#content .star-rate-form .star-comment-container .comments-display-fields { + cursor: pointer; +} + diff --git a/src/software_communities/public/vendor/jquery.js b/src/software_communities/public/vendor/jquery.js new file mode 100644 index 0000000..a3f4ebf --- /dev/null +++ b/src/software_communities/public/vendor/jquery.js @@ -0,0 +1,3 @@ +modulejs.define('jquery', function() { + return jQuery; +}); diff --git a/src/software_communities/public/vendor/jquery.maskedinput.min.js b/src/software_communities/public/vendor/jquery.maskedinput.min.js new file mode 100644 index 0000000..0d9ce6e --- /dev/null +++ b/src/software_communities/public/vendor/jquery.maskedinput.min.js @@ -0,0 +1,7 @@ +/* + Masked Input plugin for jQuery + Copyright (c) 2007-2013 Josh Bush (digitalbush.com) + Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) + Version: 1.3.1 +*/ +(function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery); \ No newline at end of file diff --git a/src/software_communities/public/vendor/modulejs-1.5.0.min.js b/src/software_communities/public/vendor/modulejs-1.5.0.min.js new file mode 100644 index 0000000..9905b63 --- /dev/null +++ b/src/software_communities/public/vendor/modulejs-1.5.0.min.js @@ -0,0 +1,2 @@ +/* modulejs 1.5.0 - http://larsjung.de/modulejs/ */ +!function(n){this.modulejs=n()}(function(){"use strict";function n(n){return function(r){return l.toString.call(r)==="[object "+n+"]"}}function r(n){return n===new Object(n)}function t(n,r){return l.hasOwnProperty.call(n,r)}function e(n,r,e){if(p&&n.forEach===p)n.forEach(r,e);else if(n.length===+n.length)for(var i=0,o=n.length;o>i;i+=1)r.call(e,n[i],i,n);else for(var u in n)t(n,u)&&r.call(e,n[u],u,n)}function i(n,r){for(var t=0,e=n.length;e>t;t+=1)if(n[t]===r)return!0;return!1}function o(n){var r={},i=[];return e(n,function(n){t(r,n)||(i.push(n),r[n]=1)}),i}function u(n,r,t){if(n){var e=new Error("[modulejs-"+r+"] "+t);throw e.code=r,e}}function c(n,r,a){if(u(!h(n),31,'id must be a string "'+n+'"'),!r&&t(b,n))return b[n];var f=y[n];u(!f,32,'id not defined "'+n+'"'),a=(a||[]).slice(0),a.push(n);var s=[];if(e(f.deps,function(n){u(i(a,n),33,"circular dependencies: "+a+" & "+n),r?(s=s.concat(c(n,r,a)),s.push(n)):s.push(c(n,r,a))}),r)return o(s);var d=f.fn.apply(void 0,s);return b[n]=d,d}function a(n,t,e){void 0===e&&(e=t,t=[]),u(!h(n),11,'id must be a string "'+n+'"'),u(y[n],12,'id already defined "'+n+'"'),u(!g(t),13,'dependencies for "'+n+'" must be an array "'+t+'"'),u(!r(e)&&!v(e),14,'arg for "'+n+'" must be object or function "'+e+'"'),y[n]={id:n,deps:t,fn:v(e)?e:function(){return e}}}function f(n){return c(n)}function s(){var n={};return e(y,function(r,e){n[e]={deps:r.deps.slice(0),reqs:c(e,!0),init:t(b,e)}}),e(y,function(r,t){var o=[];e(y,function(r,e){i(n[e].reqs,t)&&o.push(e)}),n[t].reqd=o}),n}function d(n){var r="\n";return e(s(),function(t,e){var i=n?t.reqd:t.reqs;r+=(t.init?"* ":" ")+e+" -> [ "+i.join(", ")+" ]\n"}),r}var l=Object.prototype,p=Array.prototype.forEach,h=n("String"),v=n("Function"),g=Array.isArray||n("Array"),y={},b={};return{define:a,require:f,state:s,log:d,_private:{isString:h,isFunction:v,isArray:g,isObject:r,has:t,each:e,contains:i,uniq:o,err:u,definitions:y,instances:b,resolve:c}}}); \ No newline at end of file diff --git a/src/software_communities/public/views/comments-software-extra-fields.js b/src/software_communities/public/views/comments-software-extra-fields.js new file mode 100644 index 0000000..c270cd9 --- /dev/null +++ b/src/software_communities/public/views/comments-software-extra-fields.js @@ -0,0 +1,30 @@ +modulejs.define('CommentsSoftwareExtraFields', ['jquery'], function($) { + 'use strict'; + + var DATA = { + information_display_state: "hidden" + } + + function set_show_additional_information() { + $(".comments-display-fields").on("click", function() { + if (DATA.information_display_state === "hidden") { + DATA.information_display_state = "show"; + $(".comments-software-extra-fields div").show(); + } else { + DATA.information_display_state = "hidden"; + $(".comments-software-extra-fields div").hide(); + } + }); + } + + return { + isCurrentPage: function() { + return $(".star-rate-form").length === 1; + }, + + + init: function() { + set_show_additional_information(); + } + } +}); diff --git a/src/software_communities/public/views/control-panel.js b/src/software_communities/public/views/control-panel.js new file mode 100644 index 0000000..e7d6e29 --- /dev/null +++ b/src/software_communities/public/views/control-panel.js @@ -0,0 +1,31 @@ +modulejs.define('ControlPanel', ['jquery'], function($) { + 'use strict'; + + function add_software_on_control_panel(control_panel) { + var software_link = $(".control-panel-software-link").remove(); + + if( software_link.size() > 0 ) { + control_panel.prepend(software_link); + } + } + + function add_itens_on_controla_panel() { + var control_panel = $(".control-panel"); + + if( control_panel.size() > 0 ) { + add_software_on_control_panel(control_panel); + } + } + + + return { + isCurrentPage: function() { + return $("#profile-editor-index").length === 1; + }, + + + init: function() { + add_itens_on_controla_panel(); + } + } +}); diff --git a/src/software_communities/public/views/edit-software.js b/src/software_communities/public/views/edit-software.js new file mode 100644 index 0000000..142077d --- /dev/null +++ b/src/software_communities/public/views/edit-software.js @@ -0,0 +1,111 @@ +modulejs.define('EditSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewSoftware'], function($, NoosferoRoot, AutoComplete, NewSoftware) { + 'use strict'; + + var AJAX_URL = { + get_field_data: + NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_field_data") + }; + + + function database_autocomplete() { + AutoComplete.enable("database", ".database_description_id", ".database_autocomplete", AJAX_URL.get_field_data); + } + + + function language_autocomplete() { + AutoComplete.enable("software_language", ".programming_language_id", ".language_autocomplete", AJAX_URL.get_field_data); + } + + + function delete_dynamic_table() { + var button = $(".delete-dynamic-table"); + + button.each(function(){ + var table = $(this).parent().parent().parent().parent(); + var color = table.css("background-color"); + + $(this).click(function(){ + table.remove(); + return false; + }).mouseover(function(){ + table.css("background-color", "#eee"); + }).mouseout(function(){ + table.css("background-color", color); + }); + }); + } + + + function has_more_than_one(table_class) { + return ($("."+table_class).length > 2); // One is always added by defaul and its hidden + } + + + function add_dynamic_table(element_id, content) { + $("#"+element_id).append(content); + } + + + function hide_show_public_software_fields() { + if ($("#software_public_software").is(":checked")) { + $(".public-software-fields").show(); + } else { + $(".public-software-fields").hide(); + } + } + + + function replace_software_creations_step() { + var software_creation_step = $("#software_creation_step").remove(); + + if( software_creation_step.size() > 0 ) { + $("#profile-data").parent().prepend(software_creation_step); + } + } + + + return { + isCurrentPage: function() { + return $("#especific-info").length === 1; + }, + + + init: function() { + var dynamic_tables = ["dynamic-databases", "dynamic-languages", "dynamic-libraries","dynamic-operating_systems"]; + + delete_dynamic_table(); + database_autocomplete(); + language_autocomplete(); + + $(".new-dynamic-table").click(function(){ + var link = $(this); + + dynamic_tables.forEach(function(value){ + if( link.hasClass(value) ) { + var table_id = value.split("-")[1]; + + var table_html = $("#table_structure_"+table_id).html(); + + add_dynamic_table(table_id, table_html); + } + }); + + delete_dynamic_table(); + database_autocomplete(); + language_autocomplete(); + + return false; + }); + + + + + hide_show_public_software_fields(); + $("#software_public_software").click(hide_show_public_software_fields); + + replace_software_creations_step(); + + NewSoftware.init(); + } + } +}); diff --git a/src/software_communities/public/views/new-community.js b/src/software_communities/public/views/new-community.js new file mode 100644 index 0000000..b665e8f --- /dev/null +++ b/src/software_communities/public/views/new-community.js @@ -0,0 +1,28 @@ +modulejs.define("NewCommunity", ['jquery'], function($) { + + function replace_mandatory_message() { + $(".required-field").first() + .replaceWith(" Os campos em destaque são obrigatórios. "); + } + + function remove_image_builder_text() { + $("label:contains('Image builder')").hide(); + } + + function hide_organization_template_fields(){ + $('#template-options').hide(); + } + + return { + + isCurrentPage: function() { + return true; + }, + + init: function() { + replace_mandatory_message(); + remove_image_builder_text(); + hide_organization_template_fields(); + } + } +}) diff --git a/src/software_communities/public/views/new-software.js b/src/software_communities/public/views/new-software.js new file mode 100644 index 0000000..180ff70 --- /dev/null +++ b/src/software_communities/public/views/new-software.js @@ -0,0 +1,69 @@ +modulejs.define('NewSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewCommunity'], function($, NoosferoRoot, AutoComplete, Community) { + 'use strict'; + + var AJAX_URL = { + get_license_data: + NoosferoRoot.urlWithSubDirectory("/plugin/software_communities/get_license_data") + }; + + function replace_domain_and_repository_link(){ + var community_name = $("#community_name_id").val(); + var domain = 'https://'; + domain = domain.concat($("#software-hostname").text()); + + var slug_name = community_name.replace(/\s+/g, '-').toLowerCase(); + + var custom_domain = domain.concat(''); + custom_domain = custom_domain.concat('/'); + custom_domain = custom_domain.concat(slug_name); + + $("#community-identifier").val(slug_name); + $("#software-info-repository-link").val(custom_domain); + } + + function show_another_license_on_page_load() { + $("#license_info_id").trigger("change"); + } + + + function display_another_license_fields(selected) { + if( selected === "Another" ) { + $("#another_license").removeClass("hide-field"); + $("#version_link").addClass("hide-field"); + } else { + $("#another_license").addClass("hide-field"); + $("#version_link").removeClass("hide-field"); + } + } + + + function display_license_link_on_autocomplete(selected) { + var link = $("#version_" + selected.item.id).val(); + $("#version_link").attr("href", link); + + display_another_license_fields(selected.item.label); + } + + + function license_info_autocomplete() { + AutoComplete.enable( + "license_info", ".license_info_id", ".license_info_version", + AJAX_URL.get_license_data, display_license_link_on_autocomplete + ); + } + + + return { + isCurrentPage: function() { + return $('#new-software-page').length === 1; + }, + + + init: function() { + license_info_autocomplete(); + Community.init(); + + $("#community_name_id").blur(replace_domain_and_repository_link); + } + } +}); diff --git a/src/software_communities/public/views/profile-tabs-software.js b/src/software_communities/public/views/profile-tabs-software.js new file mode 100644 index 0000000..92ee237 --- /dev/null +++ b/src/software_communities/public/views/profile-tabs-software.js @@ -0,0 +1,86 @@ +modulejs.define("ProfileTabsSoftware", ["jquery"], function($) { + "use strict"; + + function hide_infos(){ + $(".language-info").hide(); + $(".database-info").hide(); + $(".libraries-info").hide(); + $(".operating-system-info").hide(); + $(".language-button-hide").hide(); + $(".database-button-hide").hide(); + $(".libraries-button-hide").hide(); + $(".operating-system-button-hide").hide(); + } + + + function set_show_hide_dynamic_table_events() { + $(".language-button-hide").click(function(event){ + event.preventDefault(); + $(".language-info").hide(); + $(".language-button-show").show(); + $(".language-button-hide").hide(); + }); + + $(".language-button-show").click(function(event){ + event.preventDefault(); + $(".language-info").show(); + $(".language-button-show").hide(); + $(".language-button-hide").show(); + }); + + $(".operating-system-button-hide").click(function(event){ + event.preventDefault(); + $(".operating-system-info").hide(); + $(".operating-system-button-show").show(); + $(".operating-system-button-hide").hide(); + }); + + $(".operating-system-button-show").click(function(event){ + event.preventDefault(); + $(".operating-system-info").show(); + $(".operating-system-button-show").hide(); + $(".operating-system-button-hide").show(); + }); + + $(".database-button-hide").click(function(event){ + event.preventDefault(); + $(".database-info").hide(); + $(".database-button-show").show(); + $(".database-button-hide").hide(); + }); + + $(".database-button-show").click(function(event){ + event.preventDefault(); + $(".database-info").show(); + $(".database-button-show").hide(); + $(".database-button-hide").show(); + }); + + $(".libraries-button-hide").click(function(event){ + event.preventDefault(); + $(".libraries-info").hide(); + $(".libraries-button-show").show(); + $(".libraries-button-hide").hide(); + }); + + $(".libraries-button-show").click(function(event){ + event.preventDefault(); + $(".libraries-info").show(); + $(".libraries-button-show").hide(); + $(".libraries-button-hide").show(); + }); + } + + + return { + isCurrentPage: function() { + return $("#software-fields").length === 1; + }, + + + init: function() { + hide_infos(); + set_show_hide_dynamic_table_events(); + } + } +}); diff --git a/src/software_communities/public/views/search-software-catalog.js b/src/software_communities/public/views/search-software-catalog.js new file mode 100644 index 0000000..552b055 --- /dev/null +++ b/src/software_communities/public/views/search-software-catalog.js @@ -0,0 +1,172 @@ +modulejs.define('SearchSoftwareCatalog', ['jquery', 'NoosferoRoot', 'SoftwareCatalogComponent'], function($, NoosferoRoot, SoftwareCatalogComponent) { + 'use strict'; + + var AJAX_URL = { + software_infos: + NoosferoRoot.urlWithSubDirectory("/search/software_infos") + }; + + + function dispatch_search_ajax(enable_load) { + var search_params = get_search_params(); + + if(enable_load) { + open_loading("Loading"); + } + + $.ajax({ + url: AJAX_URL.software_infos, + type: "GET", + data: search_params, + success: update_search_page_on_ajax, + error: function(){ + close_loading(); + } + }); + } + + + function get_search_params() { + var params = {}; + + params.query = $("#search-input").val(); + params.selected_categories_id = []; + + $(".categories-catalog:checked").each(function(index, element) { + params.selected_categories_id.push(element.value); + }); + + params.software_display = $("#software_display").val(); + params.sort = $("#sort").val(); + + if($("#all_radio_button").is(":checked")) { + params.software_type = $("#all_radio_button").val(); + } else { + params.software_type = $("#public_software_radio_button").val(); + } + + return params; + } + + + function get_result_div_core(message) { + $("#search-results-empty").html(message); + } + + + function catalog_message() { + var empty_result = $('#empty_result').val() === 'true'; + var user_selected_categories = $('.categories-catalog:checked').length !== 0; + + if(empty_result && !user_selected_categories) { + get_result_div_core($('#message-no-catalog-selected').val()); + } else if (empty_result && user_selected_categories) { + get_result_div_core($('#message-catalog-selected').val()); + } + } + + + function update_search_page_on_ajax(response) { + response = $(response); + + var search_list = $("#search-results"); + var selected_categories_field = $("#filter-categories-select-catalog"); + var pagination = $("#software-pagination"); + var software_count = $("#software-count"); + var individually_category = $("#individually-category"); + + var result_list = response.find("#search-results").html(); + var result_categories = response.find("#filter-categories-select-catalog").html(); + var result_pagination = response.find("#software-pagination").html(); + var result_software_count = response.find("#software-count").html(); + var result_individually_category = response.find("#individually-category").html(); + + search_list.html(result_list); + selected_categories_field.html(result_categories); + pagination.html(result_pagination); + software_count.html(result_software_count); + individually_category.html(result_individually_category); + + highlight_searched_terms(); + catalog_message(); + + hide_load_after_ajax(); + } + + + function hide_load_after_ajax() { + if ($("#overlay_loading_modal").is(":visible")) { + close_loading(); + setTimeout(hide_load_after_ajax, 1500); + } + } + + + function highlight_searched_terms() { + var searched_terms = $("#search-input").val(); + + if( searched_terms.length === 0 ) { + return undefined; + } + + var content_result = $(".search-content-result"); + var regex = new RegExp("("+searched_terms.replace(/\s/g, "|")+")", "gi"); + + content_result.each(function(i, e){ + var element = $(e); + + var new_text = element.text().replace(regex, function(text) { + return ""+text+""; + }); + + element.html(new_text); + }); + } + + + function update_page_by_ajax_on_select_change() { + dispatch_search_ajax(true); + } + + function update_page_by_text_filter() { + var text = this.value; + dispatch_search_ajax(false); + } + + + function search_input_keyup() { + var timer = null; + + $("#search-input").keyup(function() { + // Only start the search(with ajax) after 3 characters + if(this.value.length >= 3) { + timer = setTimeout(update_page_by_text_filter, 400); + } + }).keydown(function() { + clearTimeout(timer); + }); + } + + + function set_events() { + $("#software_display").change(update_page_by_ajax_on_select_change); + $("#sort").change(update_page_by_ajax_on_select_change); + + search_input_keyup(); + } + + + return { + isCurrentPage: function() { + return $('#software-search-container').length === 1; + }, + + + init: function() { + set_events(); + catalog_message(); + SoftwareCatalogComponent.init(dispatch_search_ajax); + } + } +}); + diff --git a/src/software_communities/script/schedule_institution_update.sh b/src/software_communities/script/schedule_institution_update.sh new file mode 100755 index 0000000..a5d1281 --- /dev/null +++ b/src/software_communities/script/schedule_institution_update.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cp plugins/software_communities/config/institutions_update.example /etc/cron.d/institutions_update +echo "Created crontab file in /etc/cron.d/institution_update..." diff --git a/src/software_communities/test/functional/profile_controller_test.rb b/src/software_communities/test/functional/profile_controller_test.rb new file mode 100644 index 0000000..3805787 --- /dev/null +++ b/src/software_communities/test/functional/profile_controller_test.rb @@ -0,0 +1,40 @@ +require "test_helper" +require 'profile_controller' + +# Re-raise errors caught by the controller. +class ProfileController; def rescue_action(e) raise e end; end + +class ProfileControllerTest < ActionController::TestCase + def setup + Environment.default.enable('products_for_enterprises') + @profile = create_user('testuser').person + end + attr_reader :profile + + should 'not count a visit twice for the same user' do + profile = create_user('someone').person + login_as(@profile.identifier) + community = fast_create('Community') + + get :index, :profile => community.identifier + community.reload + assert_equal 1, community.hits + + get :index, :profile => community.identifier + community.reload + assert_equal 1, community.hits + end + + should 'not count a visit twice for unlogged users' do + profile = create_user('someone').person + community = fast_create('Community') + get :index, :profile => community.identifier + community.reload + assert_equal 1, community.hits + + get :index, :profile => community.identifier + community.reload + assert_equal 1, community.hits + end +end + diff --git a/src/software_communities/test/functional/profile_editor_controller_test.rb b/src/software_communities/test/functional/profile_editor_controller_test.rb new file mode 100644 index 0000000..b677a1d --- /dev/null +++ b/src/software_communities/test/functional/profile_editor_controller_test.rb @@ -0,0 +1,70 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require( + File.dirname(__FILE__) + + '/../../../../app/controllers/my_profile/profile_editor_controller' +) + +class ProfileEditorController; def rescue_action(e) raise e end; end + +class ProfileEditorControllerTest < ActionController::TestCase + + def setup + @controller = ProfileEditorController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @profile = create_user('default_user').person + + Environment.default.affiliate( + @profile, + [Environment::Roles.admin(Environment.default.id)] + + Profile::Roles.all_roles(Environment.default.id) + ) + + @environment = Environment.default + @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] + admin = create_user("adminuser").person + admin.stubs(:has_permission?).returns("true") + login_as('adminuser') + @environment.add_admin(admin) + @environment.save + end + + should "redirect to edit_software_community on edit community of software" do + software = create_software_info("Test Software") + + post :edit, :profile => software.community.identifier + + assert_redirected_to :controller => 'profile_editor', :action => 'edit_software_community' + end + + + protected + + def create_basic_user + user = fast_create(User) + user.person = fast_create(Person) + user.person.user = user + user.save! + user.person.save! + user + end + + def create_community name + community = fast_create(Community) + community.name = name + community.save + community + end + + def create_software_info name, finality = "something", acronym = "" + community = create_community(name) + software_info = SoftwareInfo.new + software_info.community = community + software_info.finality = finality + software_info.acronym = acronym + software_info.public_software = true + software_info.save + software_info + end + +end diff --git a/src/software_communities/test/functional/search_controller_test.rb b/src/software_communities/test/functional/search_controller_test.rb new file mode 100644 index 0000000..606337d --- /dev/null +++ b/src/software_communities/test/functional/search_controller_test.rb @@ -0,0 +1,304 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' +require( + File.dirname(__FILE__) + + '/../../../../app/controllers/public/search_controller' +) + +class SearchController; def rescue_action(e) raise e end; end + +class SearchControllerTest < ActionController::TestCase + include PluginTestHelper + + def setup + @environment = Environment.default + @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] + @environment.save + + @controller = SearchController.new + @request = ActionController::TestRequest.new + @request.stubs(:ssl?).returns(:false) + @response = ActionController::TestResponse.new + + @licenses = [ + LicenseInfo.create(:version => "GPL - 1"), + LicenseInfo.create(:version => "GPL - 2") + ] + + create_software_categories + + @softwares = [] + + @softwares << create_software_info("Software One", :acronym => "SFO", :finality => "Help") + @softwares << create_software_info("Software Two", :acronym => "SFT", :finality => "Task") + + @softwares[0].community.categories << Category.first + @softwares[1].community.categories << Category.last + + @softwares[0].license_info = @licenses.first + @softwares[1].license_info = @licenses.last + + @softwares[0].save! + @softwares[1].save! + end + + should "communities searches don't have software" do + community = create_community("Community One") + + get :communities, :query => "One" + + assert_includes assigns(:searches)[:communities][:results], community + assert_not_includes assigns(:searches)[:communities][:results], @softwares.first.community + end + + should "software_infos search don't have community" do + community = create_community("Community One") + + get :software_infos, :query => "One" + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], community + end + + + should "Don't have template in communities search result" do + communities = [] + communities << create_community("Community One") + communities << create_community("Community Two") + + community_template = create_community("Community Template") + community_template.is_template = true + community_template.visible = false + community_template.save! + + get :communities, :query => "Comm" + + assert_not_includes( + assigns(:searches)[:communities][:results], + community_template + ) + end + + should "software_infos search by category" do + get( + :software_infos, + :query => "", + :selected_categories_id => [Category.first.id] + ) + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community + end + + should "software_infos search by programming language" do + @softwares.first.software_languages << create_software_language("Python", "1.0") + @softwares.last.software_languages << create_software_language("Java", "8.1") + + @softwares.first.save! + @softwares.last.save! + + get( + :software_infos, + :query => "python", + ) + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community + end + + should "software_infos search by database description" do + @softwares.first.software_databases << create_software_database("MySQL", "1.0") + @softwares.last.software_databases << create_software_database("Postgrees", "8.1") + + @softwares.first.save! + @softwares.last.save! + + get( + :software_infos, + :query => "mysql", + ) + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community + end + + should "software_infos search by finality" do + get( + :software_infos, + :query => "help", + ) + + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community + end + + should "software_infos search by acronym" do + get( + :software_infos, + :query => "SFO", + ) + + assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community + assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community + end + + should "software_infos search by relevance" do + @softwares << create_software_info("Software Three", :acronym => "SFW", :finality => "Java") + @softwares.last.license_info = LicenseInfo.create :version => "GPL - 3.0" + + + @softwares.first.software_languages << create_software_language("Java", "8.0") + @softwares.first.save! + + @softwares[1].community.name = "Java" + @softwares[1].community.save! + + get( + :software_infos, + :sort => "relevance", + :query => "Java" + ) + + assert_equal assigns(:searches)[:software_infos][:results][0], @softwares[1].community + assert_equal assigns(:searches)[:software_infos][:results][1], @softwares[2].community + assert_equal assigns(:searches)[:software_infos][:results][2], @softwares[0].community + end + + should "software_infos search only public_software" do + software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") + software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") + software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") + software_three.public_software = false + software_three.save! + + get( + :software_infos, + :software_type => "public_software" + ) + + assert_includes assigns(:searches)[:software_infos][:results], software_one.community + assert_includes assigns(:searches)[:software_infos][:results], software_two.community + assert_not_includes assigns(:searches)[:software_infos][:results], software_three.community + end + + should "software_infos search public_software and other all" do + software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") + software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") + software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") + software_three.public_software = false + software_three.save! + + get( + :software_infos, + :software_type => "all" + ) + + assert_includes assigns(:searches)[:software_infos][:results], software_one.community + assert_includes assigns(:searches)[:software_infos][:results], software_two.community + assert_includes assigns(:searches)[:software_infos][:results], software_three.community + end + + should "software_infos search return only the software in params" do + software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") + software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") + software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") + + get( + :software_infos, + :only_softwares => ["software-three", "java"] + ) + + assert_includes assigns(:searches)[:software_infos][:results], software_two.community + assert_includes assigns(:searches)[:software_infos][:results], software_three.community + assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community + end + + should "software_infos search return only enabled softwares" do + s1 = SoftwareInfo.first + s2 = SoftwareInfo.last + + # First get them all normally + get( + :software_infos, + :query => "software" + ) + + assert_includes assigns(:searches)[:software_infos][:results], s1.community + assert_includes assigns(:searches)[:software_infos][:results], s2.community + + s2.community.disable + + # Now it should not contain the disabled community + get( + :software_infos, + :query => "software" + ) + + assert_includes assigns(:searches)[:software_infos][:results], s1.community + assert_not_includes assigns(:searches)[:software_infos][:results], s2.community + end + + should "software_infos search not return software with secret community" do + software_one = create_software_info("Software ABC", :acronym => "SFO", :finality => "Help") + software_two = create_software_info("Python", :acronym => "SFT", :finality => "Task") + software_three = create_software_info("Software DEF", :acronym => "SFW", :finality => "Java") + + software_one.community.secret = true + software_one.community.save! + + get( + :software_infos, + ) + + assert_includes assigns(:searches)[:software_infos][:results], software_two.community + assert_includes assigns(:searches)[:software_infos][:results], software_three.community + assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community + end + + private + + def create_software_categories + category_software = Category.create!( + :name => "Software", + :environment => @environment + ) + Category.create( + :name => "Category One", + :environment => @environment, + :parent => category_software + ) + Category.create( + :name => "Category Two", + :environment => @environment, + :parent => category_software + ) + end + + def create_software_language(name, version) + unless ProgrammingLanguage.find_by_name(name) + ProgrammingLanguage.create(:name => name) + end + + software_language = SoftwareLanguage.new + software_language.programming_language = ProgrammingLanguage.find_by_name(name) + software_language.version = version + software_language.save! + + software_language + end + + def create_software_database(name, version) + unless DatabaseDescription.find_by_name(name) + DatabaseDescription.create(:name => name) + end + + software_database = SoftwareDatabase.new + software_database.database_description = DatabaseDescription.find_by_name(name) + software_database.version = version + software_database.save! + + software_database + end + +end diff --git a/src/software_communities/test/functional/software_communities_plugin_controller_test.rb b/src/software_communities/test/functional/software_communities_plugin_controller_test.rb new file mode 100644 index 0000000..78ae2e0 --- /dev/null +++ b/src/software_communities/test/functional/software_communities_plugin_controller_test.rb @@ -0,0 +1,116 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../../controllers/software_communities_plugin_controller' + +class SoftwareCommunitiesPluginController; def rescue_action(e) raise e end; end + +class SoftwareCommunitiesPluginControllerTest < ActionController::TestCase + def setup + @admin = create_user("adminuser").person + @admin.stubs(:has_permission?).returns("true") + @controller.stubs(:current_user).returns(@admin.user) + + @environment = Environment.default + @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] + @environment.add_admin(@admin) + @environment.save + + LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") + LicenseInfo.create(:version=>"Academic Free License 3.0 (AFL-3.0)", :link=>"http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl") + LicenseInfo.create(:version=>"Apache License 2.0 (Apache-2.0)", :link=>"http://www.apache.org/licenses/LICENSE-2.0") + LicenseInfo.create(:version=>'BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause)', :link=>"http://opensource.org/licenses/BSD-2-Clause") + + ProgrammingLanguage.create(:name =>"Java") + ProgrammingLanguage.create(:name =>"Ruby") + ProgrammingLanguage.create(:name =>"C") + ProgrammingLanguage.create(:name =>"C++") + DatabaseDescription.create(:name => "PostgreSQL") + DatabaseDescription.create(:name => "MySQL") + DatabaseDescription.create(:name => "MongoDB") + DatabaseDescription.create(:name => "Oracle") + OperatingSystemName.create(:name=>"Debian") + + @response = ActionController::TestResponse.new + end + + should 'return the licenses datas' do + xhr :get, :get_license_data, :query => "" + + licenses = JSON.parse(@response.body) + + assert_equal 4, licenses.count + end + + should 'return licenses that has Free on their version name' do + xhr :get, :get_license_data, :query => "Free" + + licenses = JSON.parse(@response.body) + + assert_equal 2, licenses.count + end + + should 'return no licenses that has Common on their version name' do + xhr :get, :get_license_data, :query => "Common" + + licenses = JSON.parse(@response.body) + + assert_equal 0, licenses.count + end + + should 'render block template' do + xhr :get, :get_block_template + + assert_tag :tag => 'input', :attributes => { :class => "block_download_name" } + assert_tag :tag => 'input', :attributes => { :class => "block_download_link" } + assert_tag :tag => 'input', :attributes => { :class => "block_download_software_description" } + assert_tag :tag => 'input', :attributes => { :class => "block_download_minimum_requirements" } + assert_tag :tag => 'input', :attributes => { :class => "block_download_size" } + end + + should 'return the programming languages' do + xhr :get, :get_field_data, :query => "", :field => "software_language" + + languages = JSON.parse(@response.body) + + assert_equal 4, languages.count + end + + should 'return the programming languages that has C on their name' do + xhr :get, :get_field_data, :query => "C", :field => "software_language" + + languages = JSON.parse(@response.body) + + assert_equal 2, languages.count + end + + should 'dont return the programming languages that has HTML on their name' do + xhr :get, :get_field_data, :query => "HTML", :field => "software_language" + + languages = JSON.parse(@response.body) + + assert_equal 1, languages.count + end + + should 'return the databases' do + xhr :get, :get_field_data, :query => "", :field => "software_database" + + databases = JSON.parse(@response.body) + + assert_equal 4, databases.count + end + + should 'return the databases that has SQL on their name' do + xhr :get, :get_field_data, :query => "SQL", :field => "software_database" + + databases = JSON.parse(@response.body) + + assert_equal 3, databases.count + end + + should 'dont return the database that has on their name' do + xhr :get, :get_field_data, :query => "Cache", :field => "software_database" + + databases = JSON.parse(@response.body) + + assert_equal 1, databases.count + end +end diff --git a/src/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb b/src/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb new file mode 100644 index 0000000..bb72b8a --- /dev/null +++ b/src/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb @@ -0,0 +1,154 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/software_test_helper' +require( + File.dirname(__FILE__) + + '/../../controllers/software_communities_plugin_myprofile_controller' +) + +class SoftwareCommunitiesPluginMyprofileController; def rescue_action(e) raise e end; +end + +class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestCase + include SoftwareTestHelper + def setup + @controller = SoftwareCommunitiesPluginMyprofileController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @person = create_user('person').person + @offer = create_user('Angela Silva') + @offer_1 = create_user('Ana de Souza') + @offer_2 = create_user('Angelo Roberto') + + LicenseInfo.create( + :version=>"CC-GPL-V2", + :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" + ) + + ProgrammingLanguage.create(:name =>"language") + DatabaseDescription.create(:name => "database") + OperatingSystemName.create(:name=>"Debian") + + login_as(@person.user_login) + @environment = Environment.default + @environment.enable_plugin('SoftwareCommunitiesPlugin') + @environment.save! + end + + attr_accessor :person, :offer + + should 'Add offer to admin in new software' do + @hash_list = software_fields + @software = create_software @hash_list + @software.community.add_admin(@offer.person) + @software.save + assert_equal @offer.person.id, @software.community.admins.last.id + end + + should 'create a new software with all fields filled in' do + fields = software_fields + @environment.add_admin(@person) + post( + :new_software, + :profile => @person.identifier, + :community => fields[1], + :license => fields[0], + :software_info => fields[2] + ) + assert_equal SoftwareInfo.last.community.name, "Debian" + end + + should 'edit a new software adding basic information' do + fields_software = software_fields + fields = software_edit_basic_fields + + software = create_software fields_software + post( + :edit_software, + :profile => software.community.identifier, + :license => fields[1], + :software => fields[0], + :library => {}, + :operating_system => {}, + :language => {}, + :database => {} + ) + assert_equal SoftwareInfo.last.repository_link, "www.github.com/test" + end + + should 'edit a new software adding specific information' do + fields_software = software_fields + fields = software_edit_specific_fields + + software = create_software fields_software + post( + :edit_software, + :profile => software.community.identifier, + :library => fields[0], + :language => fields[1], + :database => fields[2], + :operating_system => fields[3], + :software => fields[4], + :license => fields[5] + ) + assert_equal SoftwareInfo.last.acronym, "test" + end + + should 'upgrade a generic software to a public software' do + fields_software = software_fields + fields = software_edit_specific_fields + + fields[4]['public_software'] = true + software = create_software fields_software + + post( + :edit_software, + :profile => software.community.identifier, + :library => fields[0], + :language => fields[1], + :database => fields[2], + :operating_system => fields[3], + :software => fields[4], + :license => fields[5] + ) + + assert_equal true, SoftwareInfo.last.public_software? + end + + should "create software_info with existing license_info" do + @environment.add_admin(@person) + + post( + :new_software, + :community => {:name =>"New Software", :identifier => "new-software"}, + :software_info => {:finality => "something", :repository_link => ""}, + :license =>{:license_infos_id => LicenseInfo.last.id}, + :profile => @person.identifier + ) + + assert_equal SoftwareInfo.last.license_info, LicenseInfo.last + end + + should "create software_info with 'Another' license_info" do + license_another = LicenseInfo.create(:version => "Another", :link => "#") + @environment.add_admin(@person) + + another_license_version = "Different License" + another_license_link = "http://diferent.link" + + post( + :new_software, + :community => { :name => "New Software", :identifier => "new-software" }, + :software_info => { :finality => "something", :repository_link => "" }, + :license => { :license_infos_id => license_another.id, + :version => another_license_version, + :link=> another_license_link + }, + :profile => @person.identifier + ) + + assert_equal SoftwareInfo.last.license_info_id, license_another.id + assert_equal SoftwareInfo.last.license_info.id, nil + assert_equal SoftwareInfo.last.license_info.version, another_license_version + assert_equal SoftwareInfo.last.license_info.link, another_license_link + end +end diff --git a/src/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb b/src/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb new file mode 100644 index 0000000..00c715e --- /dev/null +++ b/src/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb @@ -0,0 +1,67 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/software_test_helper' +require File.dirname(__FILE__) + '/../../controllers/software_communities_plugin_profile_controller' + +class SoftwareCommunitiesPluginProfileController; def rescue_action(e) raise e end; end + +class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCase + include SoftwareTestHelper + + def setup + @controller = SoftwareCommunitiesPluginProfileController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + + @environment = Environment.default + @environment.enable_plugin('SoftwareCommunitiesPlugin') + @environment.save! + + LicenseInfo.create( + :version=>"CC-GPL-V2", + :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" + ) + @download_data = { + :name=>"Google", + :link=>"http://google.com", + :software_description=>"all", + :minimum_requirements=>"none", + :size=>"?", + :total_downloads=>0 + } + + @software = create_software(software_fields) + @software.save! + + download_block = DownloadBlock.new + download_block.downloads = Download.validate_download_list([@download_data]) + download_block.save! + + @software.community.blocks << download_block + @software.community.save! + end + + should 'redirect to download link with correct params' do + download_block = DownloadBlock.last + get :download_file, :profile=>@software.community.identifier, + :block => download_block.id, :download_index => 0 + + assert_equal nil, session[:notice] + assert_redirected_to download_block.downloads[0][:link] + end + + should "notice when the download was not found" do + download_block = DownloadBlock.last + get :download_file, :profile=>@software.community.identifier, + :block => 123, :download_index => 0 + + assert_equal "Could not find the download file", session[:notice] + end + + should "notice when given invalid download params" do + download_block = DownloadBlock.last + get :download_file, :profile=>@software.community.identifier, + :block => download_block.id, :download_index => -5 + + assert_equal "Invalid download params", session[:notice] + end +end diff --git a/src/software_communities/test/helpers/plugin_test_helper.rb b/src/software_communities/test/helpers/plugin_test_helper.rb new file mode 100644 index 0000000..d7458ce --- /dev/null +++ b/src/software_communities/test/helpers/plugin_test_helper.rb @@ -0,0 +1,64 @@ +module PluginTestHelper + + def create_community name + community = fast_create(Community) + community.name = name + community.identifier = name.to_slug + community.save + community + end + + def create_software_info name, finality = "something", acronym = "" + community = create_community(name) + software_info = SoftwareInfo.new + software_info.community = community + software_info.finality = finality + software_info.acronym = acronym + software_info.public_software = true + software_info.save! + + software_info + end + + def create_person name, email, password, password_confirmation, state, city + user = create_user( + name.to_slug, + email, + password, + password_confirmation, + ) + person = Person::new + + user.person = person + person.user = user + + person.name = name + person.identifier = name.to_slug + person.state = state + person.city = city + + user.save + person.save + + person + end + + def create_user login, email, password, password_confirmation + user = User.new + + user.login = login + user.email = email + user.password = password + user.password_confirmation = password_confirmation + + user + end + + def create_license_info version, link = "" + license = LicenseInfo.create(:version => version) + license.link = link + license.save + + license + end +end diff --git a/src/software_communities/test/helpers/software_test_helper.rb b/src/software_communities/test/helpers/software_test_helper.rb new file mode 100644 index 0000000..285fd27 --- /dev/null +++ b/src/software_communities/test/helpers/software_test_helper.rb @@ -0,0 +1,193 @@ +module SoftwareTestHelper + + def create_language language_fields + language = SoftwareLanguage.new + + language_fields[0].each do |k,v| + language[k] = v + end + language.save! + language + end + + def create_database database_fields + + database = SoftwareDatabase.new + + database_fields[0].each do |k,v| + database[k] = v + end + + database.save! + database + end + + def create_library library_fields + library = Library.new + + library_fields[0].each do |k,v| + library[k] = v + end + library.save! + library + end + + def create_operating_system operating_system_hash + operating_system = OperatingSystem.new + + operating_system_hash[0].each do |k,v| + operating_system[k] = v + end + operating_system.save + operating_system + end + + def create_license license_hash + license_info = LicenseInfo.new + + license_hash.each do |k,v| + license_info[k] = v + end + license_info.save + license_info + end + + def create_categories categories_hash + software_categories = SoftwareCategories.new + + categories_hash.each do |k,v| + software_categories[k] = v + end + software_categories.save + software_categories + end + + def create_software fields + + software = SoftwareInfo.new + community = Community.new + software_hash = fields[2] + license_system_hash = fields[0] + community_hash = fields[1] + + software_hash.each do |k,v| + software[k] = v + end + + community_hash.each do |k,v| + community[k] = v + end + + community.save! + software.community = community + software.license_info_id = license_system_hash[:license_infos_id] + + software.save! + + software + end + + def software_edit_basic_fields + fields = Hash.new + fields_license = Hash.new + hash_list = [] + + fields['repository_link'] = 'www.github.com/test' + fields['finality'] = 'This is the new finality of the software' + hash_list << fields + + #Fields for license info + fields_license['license_infos_id'] = LicenseInfo.last.id + hash_list << fields_license + + hash_list + end + + def software_edit_specific_fields + fields_library = Hash.new + fields_language = Hash.new + fields_database = Hash.new + fields_operating_system = Hash.new + fields_software = Hash.new + fields_categories = Hash.new + fields_license = Hash.new + + hash_list = [] + list_database = [] + list_language = [] + list_operating_system = [] + list_library = [] + + #Fields for library + fields_library['version'] = 'test' + fields_library['name'] = 'test' + fields_library['license'] = 'test' + list_library << fields_library + list_library << {} + hash_list << list_library + + #Fields for software language + fields_language['version'] = 'test' + fields_language['programming_language_id'] = ProgrammingLanguage.last.id + fields_language['operating_system'] = 'test' + list_language << fields_language + list_language << {} + hash_list << list_language + + #Fields for database + fields_database['version'] = 'test' + fields_database['database_description_id'] = DatabaseDescription.last.id + fields_database['operating_system'] = 'test' + list_database << fields_database + list_database << {} + hash_list << list_database + + #Fields for operating system + fields_operating_system['version'] = 'version' + fields_operating_system['operating_system_name_id'] = OperatingSystemName.last.id + list_operating_system << fields_operating_system + list_operating_system << {} + hash_list << list_operating_system + + #software fields + fields_software['acronym'] = 'test' + fields_software['operating_platform'] = 'Linux' + fields_software['objectives'] = 'This is the objective of the software' + fields_software['features'] = 'This software does nothing' + fields_software['demonstration_url'] = 'www.test.com' + hash_list << fields_software + + #Fields for license + fields_license['license_infos_id'] = LicenseInfo.last.id + hash_list << fields_license + + hash_list + end + + def software_fields + hash_list = [] + + #Fields for license info + fields_license = { + license_infos_id: LicenseInfo.last.id + } + hash_list << fields_license + + #Fields for community + fields_community = { + name: 'Debian', + identifier: 'debian' + } + hash_list << fields_community + + #Fields for basic information + fields = { + finality: 'This is the finality of the software' + } + hash_list << fields + + hash_list + end +end +#version: LicenseInfo.last.version, +#id: LicenseInfo.last.id \ No newline at end of file diff --git a/src/software_communities/test/unit/categories_and_tags_block_test.rb b/src/software_communities/test/unit/categories_and_tags_block_test.rb new file mode 100644 index 0000000..a7e0bef --- /dev/null +++ b/src/software_communities/test/unit/categories_and_tags_block_test.rb @@ -0,0 +1,19 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class CategoriesAndTagsBlockTest < ActiveSupport::TestCase + include PluginTestHelper + should 'inherit from Block' do + assert_kind_of Block, CategoriesAndTagsBlock.new + end + + should 'declare its default title' do + CategoriesAndTagsBlock.any_instance.stubs(:profile_count).returns(0) + assert_equal Block.new.default_title, CategoriesAndTagsBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal Block.description, CategoriesAndTagsBlock.description + end + +end diff --git a/src/software_communities/test/unit/categories_software_block_test.rb b/src/software_communities/test/unit/categories_software_block_test.rb new file mode 100644 index 0000000..b02f9b4 --- /dev/null +++ b/src/software_communities/test/unit/categories_software_block_test.rb @@ -0,0 +1,19 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class CategoriesSoftwareBlockTest < ActiveSupport::TestCase + include PluginTestHelper + should 'inherit from Block' do + assert_kind_of Block, CategoriesSoftwareBlock.new + end + + should 'declare its default title' do + CategoriesSoftwareBlock.any_instance.stubs(:profile_count).returns(0) + assert_equal Block.new.default_title, CategoriesSoftwareBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal Block.description, CategoriesSoftwareBlock.description + end + +end diff --git a/src/software_communities/test/unit/communities_block_test.rb b/src/software_communities/test/unit/communities_block_test.rb new file mode 100644 index 0000000..e10251b --- /dev/null +++ b/src/software_communities/test/unit/communities_block_test.rb @@ -0,0 +1,31 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class CommunitiesBlockTest < ActiveSupport::TestCase + include PluginTestHelper + def setup + @person = create_person("My Name", "user@email.com", "123456", "123456", "Any State", "Some City") + + @software_info = create_software_info("Novo Software") + @software_info.community.add_member(@person) + + @community = create_community("Nova Comunidade") + @community.add_member(@person) + + + @comminities_block = CommunitiesBlock.new + @comminities_block.expects(:owner).at_least_once.returns(@person) + end + + def teardown + CommunitiesBlock.destroy_all + @person = nil + @community = nil + @software_info = nil + end + should "not have community of software or institution in block" do + assert_includes @comminities_block.profile_list, @community + assert_not_includes @comminities_block.profile_list, @software_info.community + end + +end diff --git a/src/software_communities/test/unit/database_helper_test.rb b/src/software_communities/test/unit/database_helper_test.rb new file mode 100644 index 0000000..d7f2444 --- /dev/null +++ b/src/software_communities/test/unit/database_helper_test.rb @@ -0,0 +1,58 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class DatabaseHelperTest < ActiveSupport::TestCase + + def setup + dd1 = DatabaseDescription.create(:name => "Oracle") + dd2 = DatabaseDescription.create!(:name => "MySQL") + + @database_objects = [ + {:database_description_id => dd1.id.to_s ,:version => "2.0"}, + {:database_description_id => dd2.id.to_s ,:version => "2.1"} + ] + end + + def teardown + @database_objects = nil + SoftwareDatabase.destroy_all + DatabaseDescription.destroy_all + end + + should "return an empty list" do + empty_list = [] + assert_equal [], DatabaseHelper.list_database(empty_list) + end + + should "return a list with current database objects" do + list_compare = [] + db_tables = DatabaseHelper.list_database(@database_objects) + assert_equal list_compare.class, db_tables.class + end + + should "have same information from the list passed as parameter" do + list_compare = DatabaseHelper.list_database(@database_objects) + db_objects_id = @database_objects.first[:database_description_id] + assert_equal db_objects_id.to_i, list_compare.first.database_description_id + end + + should "return a list with the same size of the parameter" do + list_compare = DatabaseHelper.list_database(@database_objects) + assert_equal @database_objects.count, list_compare.count + end + + should "return false if list_database are empty or null" do + list_compare = [] + assert_equal false,DatabaseHelper.valid_list_database?(list_compare) + end + + should "remove invalid tables from the list" do + @database_objects.push({ + :database_description_id => "I'm not a valid id", + :version => "2.5" + }) + + database_objects_length = @database_objects.count + list_compare = DatabaseHelper.list_database(@database_objects) + assert_equal list_compare.count, database_objects_length-1 + end +end diff --git a/src/software_communities/test/unit/database_validation_test.rb b/src/software_communities/test/unit/database_validation_test.rb new file mode 100644 index 0000000..5466779 --- /dev/null +++ b/src/software_communities/test/unit/database_validation_test.rb @@ -0,0 +1,37 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class DatabaseValidationTest < ActiveSupport::TestCase + + def setup + @database_desc = DatabaseDescription.create(:name => "ABC") + @database = SoftwareDatabase.new + @database.database_description = @database_desc + @database.version = "MYSQL" + @database + end + + def teardown + @database = nil + DatabaseDescription.destroy_all + SoftwareDatabase.destroy_all + end + + should "Save database if all fields are filled" do + assert_equal true, @database.save + end + + should "not save database if database_description is empty" do + @database.database_description = nil + assert_equal true, !@database.save + end + + should "not save database if version are empty" do + @database.version = " " + assert_equal true, !@database.save + end + + should "not save database if version is too long" do + @database.version = "A too long version to be a valid version for database" + assert !@database.save + end +end diff --git a/src/software_communities/test/unit/download_block_test.rb b/src/software_communities/test/unit/download_block_test.rb new file mode 100644 index 0000000..adfcdd3 --- /dev/null +++ b/src/software_communities/test/unit/download_block_test.rb @@ -0,0 +1,34 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class DownloadBlockTest < ActiveSupport::TestCase + include PluginTestHelper + should 'inherit from Block' do + assert_kind_of Block, DownloadBlock.new + end + + should 'declare its default title' do + DownloadBlock.any_instance.stubs(:profile_count).returns(0) + assert_equal Block.new.default_title, DownloadBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal Block.description, DownloadBlock.description + end + + should 'have software info to download it' do + + link1 = "gitlab.com/teste" + name1 = "Test Software" + + link2 = "gitlab.com/teste/2" + name2 = "Test Software2" + + block = DownloadBlock.create(:downloads => [{:name => name1, :link => link1}, {:name => name2, :link => link2}]) + + assert_equal block.downloads[0][:link], link1, "Link should not be empty" + assert_equal block.downloads[0][:name], name1, "Name should not be empty" + assert_equal block.downloads[1][:link], link2, "Link should not be empty" + assert_equal block.downloads[1][:name], name2, "Name should not be empty" + end +end diff --git a/src/software_communities/test/unit/download_test.rb b/src/software_communities/test/unit/download_test.rb new file mode 100644 index 0000000..4b301fd --- /dev/null +++ b/src/software_communities/test/unit/download_test.rb @@ -0,0 +1,53 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class DownloadTest < ActiveSupport::TestCase + include PluginTestHelper + + def setup + @downloads_sample_data = [ + { + :name=>"Sample data A", + :link=>"http://some.url.com", + :software_description=>"all", + :minimum_requirements=>"none", + :size=>"10 mb", + :total_downloads=>0 + }, + { + :name=>"Sample data B", + :link=>"http://other.url", + :software_description=>"Linux", + :minimum_requirements=>"500 mb Ram", + :size=>"3 GB", + :total_downloads=>123 + } + ] + end + + should "Set as 0(zero) total_downloads if it is not given" do + without_total_downloads = Download.new({}) + with_total_downloads = Download.new(@downloads_sample_data.last) + + assert_equal 0, without_total_downloads.total_downloads + assert_equal @downloads_sample_data.last[:total_downloads], with_total_downloads.total_downloads + end + + should "Remove downloads without a name" do + @downloads_sample_data[1] = @downloads_sample_data[1].slice! :name + downloads = Download.validate_download_list @downloads_sample_data + + assert_equal 1, downloads.size + assert_equal @downloads_sample_data[0][:name], downloads[0][:name] + end + + should "Only set total_downloads if the value is integer" do + download = Download.new(@downloads_sample_data.last) + + download.total_downloads = "456" + assert_not_equal 456, download.total_downloads + + download.total_downloads = 456 + assert_equal 456, download.total_downloads + end +end diff --git a/src/software_communities/test/unit/library_helper_test.rb b/src/software_communities/test/unit/library_helper_test.rb new file mode 100644 index 0000000..28e58e3 --- /dev/null +++ b/src/software_communities/test/unit/library_helper_test.rb @@ -0,0 +1,53 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class LibraryHelperTest < ActiveSupport::TestCase + + def setup + @license_objects = [ + {"name" => "license1" ,"version" => "2.0", "license" => "debian", "software_id" => "1"}, + {"name" => "license2" ,"version" => "2.1", "license" => "debian", "software_id" => "1"}, + {"name" => "license3" ,"version" => "2.2", "license" => "debian", "software_id" => "1"}] + end + + def teardown + @license_objects = nil + end + + should "return an empty list" do + empty_list = [] + assert_equal [],LibraryHelper.list_library(empty_list) + end + + should "return a list with current library objects" do + list_compare = [] + lib_table = LibraryHelper.list_library(@license_objects) + assert_equal list_compare.class, lib_table.class + end + + should "have same information from the list passed as parameter" do + list_compare = LibraryHelper.list_library(@license_objects) + assert_equal @license_objects.first[:name], list_compare.first.name + end + + should "return a list with the same size of the parameter" do + list_compare = LibraryHelper.list_library(@license_objects) + assert_equal @license_objects.count, list_compare.count + end + + should "return false if list_database are empty or null" do + list_compare = [] + assert_equal true, LibraryHelper.valid_list_library?(list_compare) + end + + should "return a html text with license name equals to linux" do + libraries = [] + + library_description = Library.new + library_description.name = "Lib" + + libraries << library_description + lib_table = LibraryHelper.libraries_as_tables(libraries) + + assert_not_nil lib_table.first.call.index("lib") + end +end diff --git a/src/software_communities/test/unit/library_validation_test.rb b/src/software_communities/test/unit/library_validation_test.rb new file mode 100644 index 0000000..f45cc9e --- /dev/null +++ b/src/software_communities/test/unit/library_validation_test.rb @@ -0,0 +1,49 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class LibraryValidationTest < ActiveSupport::TestCase + + def setup + @library = Library.new + @library.name = "name" + @library.version = "version" + @library.license = "license" + end + + def teardown + @Libray = nil + end + + should "Save Libray if all fields are filled" do + assert @library.save + end + + should "Don't save Library of name are not filed" do + @library.name = "" + assert !@library.save + end + + should "Don't save Library of version are not filed" do + @library.version = "" + assert !@library.save + end + + should "Don't save Library of license are not filed" do + @library.license = "" + assert !@library.save + end + + should "Don't save Library if name is too long" do + @library.name = "A too long name to be a valid name for library" + assert !@library.save + end + + should "Don't save Library if version is too long" do + @library.version = "A too long version to be a valid version for library" + assert !@library.save + end + + should "Don't save Library if license is too long" do + @library.license = "A too long license to be a valid license for library" + assert !@library.save + end +end diff --git a/src/software_communities/test/unit/operating_system_helper_test.rb b/src/software_communities/test/unit/operating_system_helper_test.rb new file mode 100644 index 0000000..8b2e506 --- /dev/null +++ b/src/software_communities/test/unit/operating_system_helper_test.rb @@ -0,0 +1,64 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +OperatingSystemName.create(:name=>"Debina") +OperatingSystemName.create(:name=>"Fedora") +OperatingSystemName.create(:name=>"CentOS") + +class OperatingSystemHelperTest < ActiveSupport::TestCase + + def setup + @operating_system_objects = [ + {:operating_system_name_id => "1" ,:version => "2.0"}, + {:operating_system_name_id => "2" ,"version" => "2.1"}, + {:operating_system_name_id => "3" ,"version" => "2.2"} + ] + @operating_system_objects + end + + def teardown + @operating_system_objects = nil + end + + should "return an empty list" do + empty_list = [] + assert_equal [],OperatingSystemHelper.list_operating_system(empty_list) + end + + should "return a list with current OperatingSystems" do + list_compare = [] + list_op = OperatingSystemHelper.list_operating_system(@operating_system_objects) + assert_equal list_compare.class, list_op.class + end + + should "have same information from the list passed as parameter" do + list_compare = OperatingSystemHelper.list_operating_system(@operating_system_objects) + first_operating = @operating_system_objects.first[:operating_system_name_id] + assert_equal first_operating, list_compare.first.operating_system_name_id.to_s + end + + should "return a list with the same size of the parameter" do + list_compare = OperatingSystemHelper.list_operating_system(@operating_system_objects) + assert_equal @operating_system_objects.count, list_compare.count + end + + should "return false if list_operating_system are empty or null" do + list_compare = [] + assert_equal false,OperatingSystemHelper.valid_list_operating_system?(list_compare) + end + + should "return a html text with operating system" do + operating_systems = [] + + operating_system = OperatingSystemName.new + operating_system.name = "teste" + + software_operating_system = OperatingSystem.new + software_operating_system.version = 2 + software_operating_system.operating_system_name = operating_system + + operating_systems << software_operating_system + op_table = OperatingSystemHelper.operating_system_as_tables(operating_systems) + + assert_not_nil op_table.first.call.index(OperatingSystemName.first.name) + end +end diff --git a/src/software_communities/test/unit/operating_system_validation_test.rb b/src/software_communities/test/unit/operating_system_validation_test.rb new file mode 100644 index 0000000..1f4a42b --- /dev/null +++ b/src/software_communities/test/unit/operating_system_validation_test.rb @@ -0,0 +1,34 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class OperatingSystemValidationTest < ActiveSupport::TestCase + + def setup + operating_system_name = OperatingSystemName::new :name=>"Linux" + @operating_system = OperatingSystem::new :version=>"3.0" + @operating_system.operating_system_name = operating_system_name + @operating_system + end + + def teardown + @operating_system.destroy + end + + should "save OperatingSystem if all fields are filled" do + assert_equal true, @operating_system.save + end + + should "not save if OperatingSystem does not have version" do + @operating_system.version = " " + assert_equal false, @operating_system.save + end + + should "not save if OperatingSystem does not have operating_system_name" do + @operating_system.operating_system_name = nil + assert_equal false, @operating_system.save + end + + should "not save if OperatingSystem have a version too long" do + @operating_system.version = "A too long version to be a valid" + assert_equal false, @operating_system.save + end +end diff --git a/src/software_communities/test/unit/repository_block_test.rb b/src/software_communities/test/unit/repository_block_test.rb new file mode 100644 index 0000000..2580e79 --- /dev/null +++ b/src/software_communities/test/unit/repository_block_test.rb @@ -0,0 +1,19 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class RepositoryBlockTest < ActiveSupport::TestCase + include PluginTestHelper + + should 'inherit from Block' do + assert_kind_of Block, RepositoryBlock.new + end + + should 'declare its default title' do + RepositoryBlock.any_instance.stubs(:profile_count).returns(0) + assert_equal Block.new.default_title, RepositoryBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal Block.description, RepositoryBlock.description + end +end diff --git a/src/software_communities/test/unit/search_catalog_block_test.rb b/src/software_communities/test/unit/search_catalog_block_test.rb new file mode 100644 index 0000000..64376ef --- /dev/null +++ b/src/software_communities/test/unit/search_catalog_block_test.rb @@ -0,0 +1,19 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class SearchCatalogBlockTest < ActiveSupport::TestCase + include PluginTestHelper + should 'inherit from Block' do + assert_kind_of Block, SearchCatalogBlock.new + end + + should 'declare its default title' do + SearchCatalogBlock.any_instance.stubs(:profile_count).returns(0) + assert_equal Block.new.default_title, SearchCatalogBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal Block.description, SearchCatalogBlock.description + end + +end diff --git a/src/software_communities/test/unit/search_helper_test.rb b/src/software_communities/test/unit/search_helper_test.rb new file mode 100644 index 0000000..f9a38f8 --- /dev/null +++ b/src/software_communities/test/unit/search_helper_test.rb @@ -0,0 +1,53 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../../lib/ext/search_helper.rb' + +class SearchHelperTest < ActiveSupport::TestCase + + include SearchHelper + + should "return communities list with relevance by nickname" do + communities_list = [] + communities_list << Community.create(:name => "Help One", :nickname => "need") + communities_list << Community.create(:name => "Need Two", :nickname => "help") + communities_list << Community.create(:name => "Help Three", :nickname => "need") + communities_list << Community.create(:name => "Need Four", :nickname => "help") + + relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.nickname] } + + assert_equal relevanced_list[0].nickname, "need" + assert_equal relevanced_list[1].nickname, "need" + assert_equal relevanced_list[2].nickname, "help" + assert_equal relevanced_list[3].nickname, "help" + end + + should "return communities list with relevance by name" do + communities_list = [] + communities_list << Community.create(:name => "Help One", :nickname => "need") + communities_list << Community.create(:name => "Need Two", :nickname => "help") + communities_list << Community.create(:name => "Help Three", :nickname => "need") + communities_list << Community.create(:name => "Need Four", :nickname => "help") + + relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.name] } + + assert relevanced_list[0].name.include?("Need") + assert relevanced_list[1].name.include?("Need") + assert relevanced_list[2].name.include?("Help") + assert relevanced_list[3].name.include?("Help") + end + + should "return communities list with relevance by nickname first and custom_header second" do + communities_list = [] + communities_list << Community.create(:name => "Help One", :nickname => "need", :custom_header => "help") + communities_list << Community.create(:name => "Need Two", :nickname => "help", :custom_header => "need") + communities_list << Community.create(:name => "Help Three", :nickname => "need", :custom_header => "help") + communities_list << Community.create(:name => "Need Four", :nickname => "help", :custom_header => "help") + + relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.custom_header, community.nickname] } + + assert relevanced_list[0].nickname.include?("need") + assert relevanced_list[1].nickname.include?("need") + assert relevanced_list[2].custom_header.include?("need") + assert relevanced_list[3].custom_header.include?("help") + end + +end diff --git a/src/software_communities/test/unit/software_communities_person_test.rb b/src/software_communities/test/unit/software_communities_person_test.rb new file mode 100644 index 0000000..3db9473 --- /dev/null +++ b/src/software_communities/test/unit/software_communities_person_test.rb @@ -0,0 +1,39 @@ +# encoding: utf-8 + +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class GovUserPluginPersonTest < ActiveSupport::TestCase + include PluginTestHelper + + def setup + @plugin = SoftwareCommunitiesPlugin.new + + @user = fast_create(User) + @person = create_person( + "My Name", + "user@email.com", + "123456", + "123456", + "Any State", + "Some City" + ) + end + + def teardown + @plugin = nil + end + + should 'get a list of softwares of a person' do + software1 = create_software_info "noosfero" + software2 = create_software_info "colab" + community = create_community "simple_community" + + software1.community.add_member @person + software1.save! + community.add_member @person + community.save! + + assert_equal 1, @person.softwares.count + end +end diff --git a/src/software_communities/test/unit/software_database_test.rb b/src/software_communities/test/unit/software_database_test.rb new file mode 100644 index 0000000..c73a359 --- /dev/null +++ b/src/software_communities/test/unit/software_database_test.rb @@ -0,0 +1,35 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareDatabaseTest < ActiveSupport::TestCase + def setup + DatabaseDescription.create!(name: "PostgreSQL") + @software_database = SoftwareDatabase.new( + :version => "1.0" + ) + @software_database.database_description_id = 1 + end + + def teardown + DatabaseDescription.destroy_all + SoftwareDatabase.destroy_all + end + + should "save if all informations of @software_database are filled" do + assert @software_database.save, "Database should have been saved" + end + + should "not save if database description id is empty" do + @software_database.database_description_id = nil + assert !@software_database.save, "Database description must be filled" + end + + should "not save if version is empty" do + @software_database.version = nil + assert !@software_database.save, "Version must be filled" + end + + should "not save if version has more than 20 characters" do + @software_database.version = "a"*21 + assert !@software_database.save, "Version must have until 20 characters" + end +end diff --git a/src/software_communities/test/unit/software_helper_test.rb b/src/software_communities/test/unit/software_helper_test.rb new file mode 100644 index 0000000..cddadea --- /dev/null +++ b/src/software_communities/test/unit/software_helper_test.rb @@ -0,0 +1,20 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareHelperTest < ActiveSupport::TestCase + + include SoftwareHelper + + should "Create ProgrammingLanguages based on file with languages names" do + ProgrammingLanguage.delete_all + PATH_TO_FILE = "plugins/software_communities/public/static/languages.txt" + + SoftwareHelper.create_list_with_file(PATH_TO_FILE, ProgrammingLanguage) + + list = File.open(PATH_TO_FILE, "r") + count = list.readlines.count + list.close + + assert(ProgrammingLanguage.count == count) + end + +end diff --git a/src/software_communities/test/unit/software_info_test.rb b/src/software_communities/test/unit/software_info_test.rb new file mode 100644 index 0000000..930436c --- /dev/null +++ b/src/software_communities/test/unit/software_info_test.rb @@ -0,0 +1,44 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class SoftwareInfoValidationTest < ActiveSupport::TestCase + + include PluginTestHelper + + should "Return original license_info when license is not 'Another'" do + @software_info = create_software_info("software_test") + @license_info = create_license_info("license_test") + + @software_info.license_info = @license_info + @software_info.save! + + assert_equal @software_info.license_info, @license_info + end + + should "Return license_info with nil id when license is 'Another'" do + @software_info = create_software_info("software_test") + @license_another = create_license_info("Another") + + @software_info.license_info = @license_another + @software_info.save! + + assert_equal @software_info.license_info_id, @license_another.id + assert_equal @software_info.license_info.id, nil + end + + should "Return fake license_info when call method another_license" do + @software_info = create_software_info("software_test") + @license_another = create_license_info("Another") + + another_license_version = "Another Version" + another_license_link = "#another_link" + + @software_info.another_license(another_license_version, another_license_link) + + assert_equal @software_info.license_info_id, @license_another.id + assert_equal @software_info.license_info.id, nil + assert_equal @software_info.license_info.version, another_license_version + assert_equal @software_info.license_info.link, another_license_link + end + +end \ No newline at end of file diff --git a/src/software_communities/test/unit/software_info_validation_test.rb b/src/software_communities/test/unit/software_info_validation_test.rb new file mode 100644 index 0000000..e42bf9b --- /dev/null +++ b/src/software_communities/test/unit/software_info_validation_test.rb @@ -0,0 +1,121 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareInfoValidationTest < ActiveSupport::TestCase + + def setup + @community = fast_create( + Community, + :identifier => 'new-software', + :name => 'New Software' + ) + + @language = ProgrammingLanguage.new(:name => 'C++') + @language.save + @software_language = SoftwareLanguage.new( + :version => '1' + ) + @software_language.programming_language = @language + @software_language.save + + @database = DatabaseDescription.new(:name => 'Oracle') + @database.save + @software_database = SoftwareDatabase.new( + :version => '2' + ) + @software_database.database_description = @database + @software_database.save + + @operating_system_name = OperatingSystemName.new(:name => 'Debian') + @operating_system_name.save + @operating_system = OperatingSystem.new(:version => '1.0') + @operating_system.operating_system_name = @operating_system_name + @operating_system.save + + @software_info = SoftwareInfo.new( + :acronym => "SFTW", + :e_mag => true, + :icp_brasil => true, + :intern => true, + :e_ping => true, + :e_arq => true, + :operating_platform => true, + :objectives => "", + :features => "", + :finality => "something" + ) + @software_info.software_languages << @software_language + @software_info.software_databases << @software_database + @software_info.operating_systems << @operating_system + + @software_info.features = "Do a lot of things" + @software_info.objectives = "All tests should pass !" + end + + def teardown + ProgrammingLanguage.destroy_all + SoftwareLanguage.destroy_all + DatabaseDescription.destroy_all + SoftwareDatabase.destroy_all + OperatingSystem.destroy_all + OperatingSystemName.destroy_all + SoftwareInfo.destroy_all + end + + should 'Save SoftwareInfo if all fields are filled' do + assert_equal true, @software_info.save + end + + should 'Save SoftwareInfo if operating_platform is blank' do + @software_info.operating_platform = '' + assert_equal true, @software_info.save + end + + should 'Save SoftwareInfo without demonstration_url be filled' do + @software_info.demonstration_url = '' + assert_equal true, @software_info.save + end + + should "Save SoftwareInfo if acronym is blank" do + @software_info.acronym = "" + + assert_equal true, @software_info.save + end + + should "Not save SoftwareInfo if acronym has more than 8 characters" do + @software_info.acronym = "12345678901" + assert_equal false, @software_info.save + end + + should "Save SoftwareInfo if acronym has whitespaces" do + @software_info.acronym = "AC DC" + assert_equal false, @software_info.save + end + + should "Save if objectives are empty" do + @software_info.objectives = "" + + assert_equal true, @software_info.save + end + + should "Save if features are empty" do + @software_info.features = "" + + assert_equal true, @software_info.save + end + + should "Not save if features are longer than 4000" do + @software_info.features = "a"*4001 + error_msg = _("Features is too long (maximum is 4000 characters)") + + assert_equal false, @software_info.save + assert_equal true, @software_info.errors.full_messages.include?(error_msg) + end + + should "Not save if objectives are longer than 4000" do + @software_info.objectives = "a"*4001 + error_msg = _("Objectives is too long (maximum is 4000 characters)") + + assert_equal false, @software_info.save + assert_equal true, @software_info.errors.full_messages.include?(error_msg) + end +end diff --git a/src/software_communities/test/unit/software_language_helper_test.rb b/src/software_communities/test/unit/software_language_helper_test.rb new file mode 100644 index 0000000..9465f91 --- /dev/null +++ b/src/software_communities/test/unit/software_language_helper_test.rb @@ -0,0 +1,60 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareLanguageHelperTest < ActiveSupport::TestCase + + def setup + pl1 = ProgrammingLanguage.create(:name => "Python") + pl2 = ProgrammingLanguage.create(:name => "Java") + + @software_language_objects = [ + {:programming_language_id => pl1.id.to_s ,:version => "2.0"}, + {:programming_language_id => pl2.id.to_s ,:version => "2.1"}, + {:programming_language_id => pl1.id.to_s ,:version => "2.2"}] + @software_language_objects + end + + def teardown + @software_language_objects = nil + ProgrammingLanguage.destroy_all + end + + should "return an empty list" do + empty_list = [] + assert_equal [], SoftwareLanguageHelper.list_language(empty_list) + end + + should "return a list with current software language objects" do + list_compare = [] + softwares = SoftwareLanguageHelper.list_language(@software_language_objects) + assert_equal list_compare.class, softwares.class + end + + should "have same information from the list passed as parameter" do + list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) + lang_id = @software_language_objects.first[:programming_language_id].to_i + + assert_equal lang_id, list_compare.first.programming_language_id + end + + should "return a list with the same size of the parameter" do + list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) + assert_equal @software_language_objects.count, list_compare.count + end + + should "return false if list_language are empty or null" do + list_compare = [] + assert_equal false,SoftwareLanguageHelper.valid_list_language?(list_compare) + end + + should "remove invalid tables from the list" do + @software_language_objects.push({ + :programming_language_id => "I'm not a valid id", + :version => "2.0" + }) + + software_language_objects_length = @software_language_objects.count + list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) + + assert_equal software_language_objects_length-1, list_compare.count + end +end diff --git a/src/software_communities/test/unit/software_language_validation.rb b/src/software_communities/test/unit/software_language_validation.rb new file mode 100644 index 0000000..8a1b21d --- /dev/null +++ b/src/software_communities/test/unit/software_language_validation.rb @@ -0,0 +1,69 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareLanguageValidationTest < ActiveSupport::TestCase + def setup + create_programming_language + @software_info = create_software_info + @software_info.save + end + + def teardown + @software_info = nil + SoftwareInfo.destroy_all + end + + should "Save SoftwareLanguage if version and prog_language are filled" do + @software_language = create_software_language + assert_equal true, @software_language.save + end + + should "Don't save SoftwareLanguage if programming_language is not filed" do + @software_language = create_software_language + @software_language.programming_language = nil + assert_equal true, !@software_language.save + end + + should "Don't save SoftwareLanguage if version is not filed" do + @software_language = create_software_language + @software_language.version = "" + assert_equal true, !@software_language.save + end + + should "Don't save SoftwareLanguage if version is too long" do + @software_language = create_software_language + @software_language.version = "A too long version to be valid as a version" + assert_equal true, !@software_language.save + end + + private + + def create_software_language + software_language = SoftwareLanguage.new + software_language.software_info = @software_info + software_language.programming_language = ProgrammingLanguage.last + software_language.version = "version" + software_language + end + + def create_software_info + software_info = SoftwareInfo.new + software_info.community_id = fast_create(Community).id + software_info.community.name = 'Noosfero' + software_info.e_mag = true + software_info.icp_brasil = true + software_info.intern = true + software_info.e_ping = true + software_info.e_arq = true + software_info.operating_platform = 'GNU/Linux' + software_info.features = "Do a lot of things" + software_info.objectives = "All tests should pass !" + software_info + end + + def create_programming_language + ProgrammingLanguage.create(:name=>"C") + ProgrammingLanguage.create(:name=>"C++") + ProgrammingLanguage.create(:name=>"Ruby") + ProgrammingLanguage.create(:name=>"Python") + end +end diff --git a/src/software_communities/test/unit/software_license_info_test.rb b/src/software_communities/test/unit/software_license_info_test.rb new file mode 100644 index 0000000..81ab2ee --- /dev/null +++ b/src/software_communities/test/unit/software_license_info_test.rb @@ -0,0 +1,29 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareDatabaseTest < ActiveSupport::TestCase + + should "save if all informations are filled" do + @software_license_info = LicenseInfo.create( + :version => "GPL", + :link => "www.gpl2.com" + ) + assert @software_license_info.save!, "License Info should have been saved" + end + + should "not save if license info version is empty" do + @software_license_info = LicenseInfo.create( + :version => "GPL", + :link => "www.gpl2.com" + ) + @software_license_info.version = nil + assert !@software_license_info.save, "Version can't be blank" + end + + should "save if link is empty" do + @software_license_info = LicenseInfo.create( + :version => "GPL", + :link => "www.gpl2.com") + @software_license_info.link = nil + assert @software_license_info.save, "License info should have been saved" + end +end diff --git a/src/software_communities/test/unit/software_registration_test.rb b/src/software_communities/test/unit/software_registration_test.rb new file mode 100644 index 0000000..397adf7 --- /dev/null +++ b/src/software_communities/test/unit/software_registration_test.rb @@ -0,0 +1,42 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareRegistrationTest < ActiveSupport::TestCase + + def setup + @environment = Environment.default + @environment.enable_plugin(SoftwareCommunitiesPlugin) + end + + def teardown + Community.destroy_all + SoftwareInfo.destroy_all + Task.destroy_all + end + + should 'include software registration task if is admin' do + person = create_user('molly').person + @environment.add_admin(person) + task = CreateSoftware.create!( + :name => "Teste One", + :requestor => person, + :environment => @environment + ) + assert_equal [task], Task.to(person).pending + end + + should 'create software when admin accept software create task' do + person = create_user('Pedro').person + @environment.add_admin(person) + task = CreateSoftware.create!( + :name => "Teste Two", + :requestor => person, + :environment => @environment, + :finality => "something" + ) + + software_count = SoftwareInfo.count + task.finish + + assert_equal software_count+1, SoftwareInfo.count + end +end diff --git a/src/software_communities/test/unit/software_tab_data_block_test.rb b/src/software_communities/test/unit/software_tab_data_block_test.rb new file mode 100644 index 0000000..aad8c8c --- /dev/null +++ b/src/software_communities/test/unit/software_tab_data_block_test.rb @@ -0,0 +1,66 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class SoftwareTabDataBlockTest < ActiveSupport::TestCase + include PluginTestHelper + + def setup + @software_info = create_software_info("A new Software") + @software_info.save! + + @soft_community = @software_info.community + + @soft_community.blogs << Blog.new(:name=>"First blog") + @soft_community.blogs << Blog.new(:name=>"Second blog") + @soft_community.save! + + SoftwareTabDataBlock.any_instance.stubs(:owner).returns(@soft_community) + end + + should "get its owner blogs" do + assert_equal @soft_community.blogs, SoftwareTabDataBlock.new.blogs + end + + should "actual_blog get the first blog if it is not defined" do + assert_equal @soft_community.blogs.first, SoftwareTabDataBlock.new.actual_blog + end + + should "actual_blog get the defined community blog" do + last_blog = @soft_community.blogs.last + soft_tab_data = create_software_tab_data_block(last_blog) + + assert_equal last_blog, soft_tab_data.actual_blog + end + + should "get the actual_blog posts" do + last_blog = @soft_community.blogs.last + soft_tab_data = create_software_tab_data_block(last_blog) + craete_sample_posts(last_blog, 2) + + assert_equal last_blog.posts.first.id, soft_tab_data.posts.first.id + assert_equal last_blog.posts.last.id, soft_tab_data.posts.last.id + end + + should "limit the number of posts" do + last_blog = @soft_community.blogs.last + soft_tab_data = create_software_tab_data_block(last_blog) + craete_sample_posts(last_blog, 6) + + assert_equal SoftwareTabDataBlock::TOTAL_POSTS_DYSPLAYED, soft_tab_data.posts.count + end + + private + + def create_software_tab_data_block blog + soft_tab_data = SoftwareTabDataBlock.new + soft_tab_data.displayed_blog = blog.id + soft_tab_data + end + + def craete_sample_posts blog, quantity=1 + quantity.times do |number| + TinyMceArticle.create! :name=>"Simple post #{number}", :body=>"Simple post #{number}", + :parent=> blog, :profile=>@soft_community + end + end +end diff --git a/src/software_communities/test/unit/softwares_block_test.rb b/src/software_communities/test/unit/softwares_block_test.rb new file mode 100644 index 0000000..44b5064 --- /dev/null +++ b/src/software_communities/test/unit/softwares_block_test.rb @@ -0,0 +1,43 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' + +class SoftwaresBlockTest < ActiveSupport::TestCase + include PluginTestHelper + should 'inherit from ProfileListBlock' do + assert_kind_of ProfileListBlock, SoftwaresBlock.new + end + + should 'declare its default title' do + SoftwaresBlock.any_instance.stubs(:profile_count).returns(0) + assert_not_equal ProfileListBlock.new.default_title, SoftwaresBlock.new.default_title + end + + should 'describe itself' do + assert_not_equal ProfileListBlock.description, SoftwaresBlock.description + end + + should 'give empty footer on unsupported owner type' do + block = SoftwaresBlock.new + block.expects(:owner).returns(1) + assert_equal '', block.footer + end + + should 'list softwares' do + user = create_person("Jose_Augusto", + "jose_augusto@email.com", + "aaaaaaa", + "aaaaaaa", + "DF", + "Gama" + ) + + software_info = create_software_info("new software") + software_info.community.add_member(user) + + block = SoftwaresBlock.new + block.expects(:owner).at_least_once.returns(user) + + assert_equivalent [software_info.community], block.profiles + end + +end diff --git a/src/software_communities/views/_main_software_editor_extras.html.erb b/src/software_communities/views/_main_software_editor_extras.html.erb new file mode 100644 index 0000000..942256d --- /dev/null +++ b/src/software_communities/views/_main_software_editor_extras.html.erb @@ -0,0 +1,32 @@ +

<%= _('Software Information') %>

+ +<%= label_tag("name", _('Name'), {:class => 'formlabel'}) %> + +
+ <%= context.profile.environment.default_hostname %>/ + <%= text_field_tag(:name, context.profile.software_info.community.name) %> +
+ +

<%= _("Finality") %>

+
+ <%= text_field_tag(:finality, context.profile.software_info.finality) %> +
+ +

<%= _("Licenses") %>

+
+ <%= select_tag(:id, options_for_select(LicenseHelper.getListLicenses.collect{|l| [l.version, l.id]}, :selected => context.profile.software_info.license_info.id), :onchange => "get_license_link('version')") %> +
+ +

<%= _("License link") %>

+ <% LicenseHelper.getListLicenses.each do | license | %> + + <% end %> + + <%= context.profile.software_info.license_info.link %> +
+ +
+ <%= label_tag "repository_url", _("Link to Repository: ") %> + <%= text_field_tag(:reository_url) %> +
+ diff --git a/src/software_communities/views/blocks/_software_tab_blog.html.erb b/src/software_communities/views/blocks/_software_tab_blog.html.erb new file mode 100644 index 0000000..ec1f867 --- /dev/null +++ b/src/software_communities/views/blocks/_software_tab_blog.html.erb @@ -0,0 +1,17 @@ +
+
+ <% if block.posts.empty? %> +
+ <%= _("This community has no posts in its blog") %> +
+ <% else %> +
+ <%= list_posts(block.posts, format: "short+pic", paginate: false) %> +
+ +
+ <%= link_to _("Read more"), block.actual_blog.url %> +
+ <% end %> +
+
diff --git a/src/software_communities/views/blocks/categories_and_tags.html.erb b/src/software_communities/views/blocks/categories_and_tags.html.erb new file mode 100644 index 0000000..507ddbf --- /dev/null +++ b/src/software_communities/views/blocks/categories_and_tags.html.erb @@ -0,0 +1,19 @@ +<% if block.owner.categories.count > 0 %> +

<%= _("Categories:") %>

+ +
+ <% block.owner.categories.each do |category| %> + <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> + <% end %> +
+<% end %> + +<% if block.owner.tag_list.count > 0 %> +

<%= _("Tags") %>

+ +
+ <% block.owner.tag_list.each do |tag| %> + <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%> + <% end %> +
+<% end %> \ No newline at end of file diff --git a/src/software_communities/views/blocks/categories_software.html.erb b/src/software_communities/views/blocks/categories_software.html.erb new file mode 100644 index 0000000..6e914de --- /dev/null +++ b/src/software_communities/views/blocks/categories_software.html.erb @@ -0,0 +1,22 @@ +
+
+ +

<%= _("See more Software") %>

+
+ +
+

<%= _("Categories:") %>

+
    + + <% categories.each do |category| %> + <% unless category.software_infos.count < 1 %> +
  • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %>
  • + <% end %> + <% end %> +
+
+ + +
diff --git a/src/software_communities/views/blocks/download.html.erb b/src/software_communities/views/blocks/download.html.erb new file mode 100644 index 0000000..ffab889 --- /dev/null +++ b/src/software_communities/views/blocks/download.html.erb @@ -0,0 +1,25 @@ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> +<% else %> +

<%= _("Download #{block.owner.software_info.community.name}") %>

+
    + <% block.downloads.each_with_index do |download, index| %> +
  • +
    + <%= link_to :controller => 'software_communities_plugin_profile', :action=> 'download_file', :block=>block.id, :download_index=> index , title: _("Download the software") do %> + + <%= download[:size] %> + <% end %> +
    +
    + <%= _("#{download[:name]}") %> + <%= _("Platform:#{download[:software_description]}") %> + <%= link_to _("Minimum Requirements"), download[:minimum_requirements] %> +
    +
  • + <% end %> +
+
+ <%= link_to _("License: #{block.owner.software_info.license_info.version}"), block.owner.software_info.license_info.link %> +
+<% end %> diff --git a/src/software_communities/views/blocks/main_area_softwares.html.erb b/src/software_communities/views/blocks/main_area_softwares.html.erb new file mode 100644 index 0000000..155a021 --- /dev/null +++ b/src/software_communities/views/blocks/main_area_softwares.html.erb @@ -0,0 +1,27 @@ +<%= block_title(block.title) %> +<% profiles.each do |profile| %> + <%= link_to profile.url do %> +
+
+ + +
+
+

<%=profile.name%>

+
+
<%= profile.description %>
+
+
+ +
+

+ <%= profile.software_info.finality %> +

+ + <%= _("See More") %> +
+
+ <% end %> +<% end %> diff --git a/src/software_communities/views/blocks/repository.html.erb b/src/software_communities/views/blocks/repository.html.erb new file mode 100644 index 0000000..dd9817d --- /dev/null +++ b/src/software_communities/views/blocks/repository.html.erb @@ -0,0 +1,5 @@ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> +<% else %> + <%= link_to _("Repository") , block.owner.software_info.repository_link, :id => "bt_repositorio", :target => "_blank" %> +<% end %> diff --git a/src/software_communities/views/blocks/search_catalog.html.erb b/src/software_communities/views/blocks/search_catalog.html.erb new file mode 100644 index 0000000..2ea3ffc --- /dev/null +++ b/src/software_communities/views/blocks/search_catalog.html.erb @@ -0,0 +1,11 @@ + diff --git a/src/software_communities/views/blocks/software_highlights.html.erb b/src/software_communities/views/blocks/software_highlights.html.erb new file mode 100644 index 0000000..fc1e650 --- /dev/null +++ b/src/software_communities/views/blocks/software_highlights.html.erb @@ -0,0 +1,20 @@ +<%= render :file => 'blocks/highlights.html.erb', :locals => { :block => block } %> + + + +mais informações + +? + + diff --git a/src/software_communities/views/blocks/software_information.html.erb b/src/software_communities/views/blocks/software_information.html.erb new file mode 100644 index 0000000..dd82bea --- /dev/null +++ b/src/software_communities/views/blocks/software_information.html.erb @@ -0,0 +1,36 @@ +
+ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> +<% else %> + + + + + +
+
+
+ + <%= link_to profile_image(block.owner, :big) +"\n", profile.url %> + + +
+
+
+

+ <%= _("#{block.owner.software_info.acronym} - ") unless block.owner.software_info.acronym.blank? %> + <%= _("#{block.owner.name}") %> +

+ + <%= block.owner.software_info.finality %> + + + <%= @plugins.dispatch(:display_organization_average_rating, block.owner).collect { |content| instance_exec(&content) }.join("") %> +
+<% end %> +
diff --git a/src/software_communities/views/blocks/software_statistics.html.erb b/src/software_communities/views/blocks/software_statistics.html.erb new file mode 100644 index 0000000..b9f1cd1 --- /dev/null +++ b/src/software_communities/views/blocks/software_statistics.html.erb @@ -0,0 +1,36 @@ +
+
    +
  • + + + <%= pluralize(profile.hits, 'visita', 'visitas') %> + +
  • +
  • + + + <%= pluralize(total_downloads, 'download', 'downloads') %> + +
  • +
  • + + + <%= block.benefited_people.to_s + _(' benefited people*') %> + +
  • +
  • + + + + <%= number_to_currency(block.saved_resources, unit: 'R$ ', + separator: ',', delimiter: '.') %> + + <%= _(' saved resources*') %> + +
  • +
+ +
+ * <%= _("Data estimated by the software administrator.") %> +
+
diff --git a/src/software_communities/views/blocks/software_tab_data.html.erb b/src/software_communities/views/blocks/software_tab_data.html.erb new file mode 100644 index 0000000..3b0a1ce --- /dev/null +++ b/src/software_communities/views/blocks/software_tab_data.html.erb @@ -0,0 +1,13 @@ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> +<% else %> +
+ <% tabs = [] %> + <% tabs << {:title => _("Discussions"), :id => 'discussions-tab', :content => ""} %> + <% tabs << {:title => _("Blog"), :id => 'blog-tab', :content => (render partial: "blocks/software_tab_blog", :locals => {block: block})} %> + <% tabs << {:title => _("Repository Feed"), :id => 'repository-feed-tab', :content => ""} %> + + <%= render_tabs(tabs) %> +
+<% end %> + diff --git a/src/software_communities/views/blocks/wiki.html.erb b/src/software_communities/views/blocks/wiki.html.erb new file mode 100644 index 0000000..24cda6f --- /dev/null +++ b/src/software_communities/views/blocks/wiki.html.erb @@ -0,0 +1,6 @@ +<% if block.owner.software_info.nil? %> + <%= _("This community needs a software to use this block") %> +<% else %> + <%= link_to _("Wiki") , block.wiki_link, :id => "bt_wiki", :target => "_blank" %> +<% end %> + diff --git a/src/software_communities/views/box_organizer/_download_block.html.erb b/src/software_communities/views/box_organizer/_download_block.html.erb new file mode 100644 index 0000000..6a621ec --- /dev/null +++ b/src/software_communities/views/box_organizer/_download_block.html.erb @@ -0,0 +1,17 @@ +
+ + +
+ <% @block.downloads.each do |download| %> + <%= render :partial => 'download_list', :locals => {:download => download} %> + <% end %> +
+ + <%= link_to_function _('New link'), 'softwareDownload.addNewDonwload(); return false', :class => 'button icon-add with-text download-new-link-button' %> +
diff --git a/src/software_communities/views/box_organizer/_download_list.html.erb b/src/software_communities/views/box_organizer/_download_list.html.erb new file mode 100644 index 0000000..1cbd524 --- /dev/null +++ b/src/software_communities/views/box_organizer/_download_list.html.erb @@ -0,0 +1,10 @@ +
  • +
      +
    • <%= text_field_tag('block[downloads][][name]', download[:name], :class => "block_download_name") %>
    • +
    • <%= text_field_tag('block[downloads][][link]', download[:link], :class => "block_download_link") %>
    • +
    • <%= text_field_tag('block[downloads][][software_description]', download[:software_description], :class => "block_download_software_description") %>
    • +
    • <%= text_field_tag('block[downloads][][minimum_requirements]', download[:minimum_requirements], :class => "block_download_minimum_requirements") %>
    • +
    • <%= text_field_tag('block[downloads][][size]', download[:size], :class => "block_download_size") %>
    • +
    • <%= button_without_text(:delete, _('Delete'), "#" , { :onclick => 'softwareDownload.deleteDownload(this); return false', :class=>"delete-link-list-row" }) %>
    • +
    +
  • diff --git a/src/software_communities/views/box_organizer/_download_list_template.html.erb b/src/software_communities/views/box_organizer/_download_list_template.html.erb new file mode 100644 index 0000000..eb9e4cf --- /dev/null +++ b/src/software_communities/views/box_organizer/_download_list_template.html.erb @@ -0,0 +1,10 @@ +
  • +
      +
    • <%= text_field_tag('block[downloads][][name]', '', :class => "block_download_name") %>
    • +
    • <%= text_field_tag('block[downloads][][link]', '', :class => "block_download_link") %>
    • +
    • <%= text_field_tag('block[downloads][][software_description]', '', :class => "block_download_software_description") %>
    • +
    • <%= text_field_tag('block[downloads][][minimum_requirements]', '', :class => "block_download_minimum_requirements") %>
    • +
    • <%= text_field_tag('block[downloads][][size]', '', :class => "block_download_size") %>
    • +
    • <%= button_without_text(:delete, _('Delete'), "#" , { :onclick => 'softwareDownload.deleteDownload(this); return false', :class=>"delete-link-list-row" }) %>
    • +
    +
  • diff --git a/src/software_communities/views/box_organizer/_software_tab_data_block.html.erb b/src/software_communities/views/box_organizer/_software_tab_data_block.html.erb new file mode 100644 index 0000000..a4d5147 --- /dev/null +++ b/src/software_communities/views/box_organizer/_software_tab_data_block.html.erb @@ -0,0 +1,15 @@ +
    + +<% if not @block.blogs.empty? %> + + +
    + + <%= select_tag 'block[displayed_blog]', options_from_collection_for_select(@block.blogs, :id, :name, @block.actual_blog.id) %> +<% else %> +
    +

    <%= _("This community has no blogs") %>

    +
    +<% end %> diff --git a/src/software_communities/views/box_organizer/_softwares_block.html.erb b/src/software_communities/views/box_organizer/_softwares_block.html.erb new file mode 100644 index 0000000..2a54c32 --- /dev/null +++ b/src/software_communities/views/box_organizer/_softwares_block.html.erb @@ -0,0 +1,4 @@ +
    + <%= labelled_form_field _('Limit of items'), text_field(:block, :limit, :size => 3) %> + <%= labelled_form_field _('Software Type:'), select_tag('block[software_type]', options_for_select(["Public", "Generic", "All"], @block.software_type) )%> +
    diff --git a/src/software_communities/views/box_organizer/_statistic_block.html.erb b/src/software_communities/views/box_organizer/_statistic_block.html.erb new file mode 100644 index 0000000..48037c8 --- /dev/null +++ b/src/software_communities/views/box_organizer/_statistic_block.html.erb @@ -0,0 +1,10 @@ +
    + <% suggestion_benefited_people = @block.owner.organization_ratings.collect{ |r| r.people_benefited.to_f }.inject(:+) || 0.0 %> + <% suggestion_saved_resources = @block.owner.organization_ratings.collect{ |r| r.saved_value.to_f }.inject(:+) || 0.0 %> + + <%= labelled_form_field _('Benefited People'), text_field(:block, :benefited_people) %> +

    <%= _("Portal suggested value: ") %> <%= "%d" % (suggestion_benefited_people) %>

    + <%= labelled_form_field _('Saved Resources'), text_field(:block, :saved_resources) %> +

    <%= _("Portal suggested value: ") %> <%= "R$%.2f" % (suggestion_saved_resources) %>

    +
    + diff --git a/src/software_communities/views/box_organizer/_wiki_block.html.erb b/src/software_communities/views/box_organizer/_wiki_block.html.erb new file mode 100644 index 0000000..489b85d --- /dev/null +++ b/src/software_communities/views/box_organizer/_wiki_block.html.erb @@ -0,0 +1,10 @@ +
    + + +
    + <%= text_field_tag "block[wiki_link]", value=@block.wiki_link %> +
    +
    + diff --git a/src/software_communities/views/comments_extra_fields.html.erb b/src/software_communities/views/comments_extra_fields.html.erb new file mode 100644 index 0000000..f50992a --- /dev/null +++ b/src/software_communities/views/comments_extra_fields.html.erb @@ -0,0 +1,21 @@ +
    + + <%= _("Additional informations") %> + + + +
    + +
    +
    + <%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> + + <%= text_field_tag "organization_rating[people_benefited]", "" %> +
    + +
    + <%= label_tag "comments_saved_value", _("Saved resources")%> + + <%= text_field_tag "organization_rating[saved_value]", "", :placeholder=>"R$"%> +
    +
    diff --git a/src/software_communities/views/environment_design b/src/software_communities/views/environment_design new file mode 120000 index 0000000..a75d184 --- /dev/null +++ b/src/software_communities/views/environment_design @@ -0,0 +1 @@ +box_organizer \ No newline at end of file diff --git a/src/software_communities/views/organization_ratings_extra_fields_show_data.html.erb b/src/software_communities/views/organization_ratings_extra_fields_show_data.html.erb new file mode 100644 index 0000000..0e57615 --- /dev/null +++ b/src/software_communities/views/organization_ratings_extra_fields_show_data.html.erb @@ -0,0 +1,10 @@ +
    +
    + <%=_("Benefited People")%> : <%= user_rating.people_benefited unless user_rating.nil? %> +
    + +
    + <%=_("Saved Resources")%> : <%= user_rating.saved_value unless user_rating.nil? %> +
    +
    + diff --git a/src/software_communities/views/profile/_profile_members_list.html.erb b/src/software_communities/views/profile/_profile_members_list.html.erb new file mode 100644 index 0000000..0e6c700 --- /dev/null +++ b/src/software_communities/views/profile/_profile_members_list.html.erb @@ -0,0 +1,14 @@ +
    + <%= label_tag("sort-#{role}", _("Sort by:")) %> + <%= select_tag("sort-#{role}", + options_for_select([ + [_("Name A-Z"), 'asc'], + [_("Name Z-A"), 'desc'], + ], :selected=>params[:sort]) + ) %> +
    +
      + <% users.each do |u| %> + <%= profile_image_link(u) %> + <% end %> +
    diff --git a/src/software_communities/views/profile/_software_tab.html.erb b/src/software_communities/views/profile/_software_tab.html.erb new file mode 100644 index 0000000..805c656 --- /dev/null +++ b/src/software_communities/views/profile/_software_tab.html.erb @@ -0,0 +1,138 @@ + + + + + + <%= display_mpog_field(_('Name:'), profile, :name, true) %> + <%= content_tag('tr', content_tag('td', _("Adherent to e_mag:")) + content_tag('td', profile.software_info.e_mag ? _("Yes") : _("No"))) %> + <%= content_tag('tr', content_tag('td', _("Adherent to icp_brasil:")) + content_tag('td', profile.software_info.icp_brasil ? _("Yes") : _("No"))) %> + <%= content_tag('tr', content_tag('td', _("Adherent to e_ping:")) + content_tag('td', profile.software_info.e_ping ? _("Yes") : _("No"))) %> + <%= content_tag('tr', content_tag('td', _("Adherent to e_arq:")) + content_tag('td', profile.software_info.e_arq ? _("Yes") : _("No"))) %> + <%= content_tag('tr', content_tag('td', _("Internacionalizable:")) + content_tag('td', profile.software_info.intern ? _("Yes") : _("No"))) %> + <%= display_mpog_field(_('Operating Platform:'), profile.software_info, :operating_platform, true) %> + <%= display_mpog_field(_('Demonstration URL:'), profile.software_info, :demonstration_url, true) %> + <%= display_mpog_field(_('Short Name:'), profile.software_info, :acronym, true) %> + <%= display_mpog_field(_('Objectives:'), profile.software_info, :objectives, true) %> + <%= display_mpog_field(_('Features:'), profile.software_info, :features, true) %> + + <%= content_tag('tr', content_tag('td', _("License"))) %> + <%= display_mpog_field(_('Version:'), profile.software_info.license_info, :version, true) %> + <%= display_mpog_field(_('Link:'), profile.software_info.license_info, :link, true) %> +
    <%= _('Software Information')%>
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <%= _('Show Libraries') %> + <%= _('Hide Libraries') %> +
    + + + + + + + + + + + +
    <%= _("Libraries") %>
    + <% libraries = profile.software_info.libraries %> + <% LibraryHelper.libraries_as_tables(libraries, true).each do |tab| %> + <%= tab.call %> + <%end%> +
    +
    <%= _('Show Database') %> + <%= _('Hide Database') %> +
    + + + + + + + + + + + +
    <%= _("Software Databases") %>
    + <% databases = profile.software_info.software_databases %> + <% DatabaseHelper.database_as_tables(databases, true).each do |tab| %> + <%= tab.call %> + <%end%> +
    +
    <%= _('Show Languages') %> + <%= _('Hide Languages') %> +
    + + + + + + + + + + + +
    <%= _("Software Languages") %>
    + <% languages = profile.software_info.software_languages %> + <% SoftwareLanguageHelper.language_as_tables(languages, true).each do |tab| %> + <%= tab.call %> + <%end%> +
    +
    <%= _('Show Operating Systems') %> + <%= _('Hide Operating Systems') %> +
    + + + + + + + + + + + +
    <%= _("Operating System") %>
    + <% operating_systems = profile.software_info.operating_systems %> + <% OperatingSystemHelper.operating_system_as_tables(operating_systems, true).each do |tab| %> + <%= tab.call %> + <%end%> +
    +
    diff --git a/src/software_communities/views/profile/index.html.erb b/src/software_communities/views/profile/index.html.erb new file mode 100644 index 0000000..6e2d6c2 --- /dev/null +++ b/src/software_communities/views/profile/index.html.erb @@ -0,0 +1,26 @@ +

    <%= h profile.name %>

    + +<% if @action %> + <%= render :partial => 'private_profile' %> +<% else %> + <% unless profile.description.blank? %> +
    + <%= profile.description %> +
    + <% end %> +<% end %> + +
    + <%= render "blocks/profile_info_actions/join_leave_community" if profile.class == "Community" %> + <% if !user.nil? && user.has_permission?('edit_profile', profile) %> +
    + <%= button :control_panel, _('Control Panel'), profile.admin_url %> +
    + <% end %> +
    + +<% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %> + + +
    +<% end %> diff --git a/src/software_communities/views/profile/members.html.erb b/src/software_communities/views/profile/members.html.erb new file mode 100644 index 0000000..2b1280b --- /dev/null +++ b/src/software_communities/views/profile/members.html.erb @@ -0,0 +1,58 @@ +
    + +
    +

    <%= _("Members (%d)") % @profile_members.total_entries %>

    +

    <%= profile.name %>

    + <%= render "blocks/profile_info_actions/community" %> +
    + +<% cache_timeout(profile.members_cache_key(params), 4.hours) do %> +
    + <% tabs = [] %> + + <% div_members = content_tag :div, :class => "profile-members" do + render :partial => 'profile_members_list', + :locals => { + :users => @profile_members, + :role => "members" + } + end %> + + <% tabs << {:title => _("%d Members") % @profile_members.total_entries, + :id => "members-tab", + :content => div_members + } %> + + <% div_admins = content_tag :div, :class => "profile-admins" do + render :partial => 'profile_members_list', + :locals => { + :users => @profile_admins, + :role => "admins" + } + end %> + + <% tabs << {:title => _("%d Administrators") % @profile_admins.total_entries, + :id => "admins-tab", + :content => div_admins + } %> + + <%= render_tabs(tabs) %> +
    +<% end %> + +<% button_bar do %> + <%= button :back, _('Go back'), { :controller => 'profile' } %> + <% if profile.community? and user %> + <% if user.has_permission?(:invite_members, profile) %> + <%= button :person, _('Invite people to join'), :controller => 'invite', :action => 'invite_friends' %> + <% end %> + <% if user.has_permission?(:send_mail_to_members, profile) %> + <%= button :send, _('Send e-mail to members'), :controller => 'profile', :action => 'send_mail' %> + <% end %> + <% end %> +<% end %> + +<%= hidden_field_tag "profile_url", @profile_members_url %> +
    + +<%= javascript_include_tag "members_page.js" %> diff --git a/src/software_communities/views/profile_design b/src/software_communities/views/profile_design new file mode 120000 index 0000000..a75d184 --- /dev/null +++ b/src/software_communities/views/profile_design @@ -0,0 +1 @@ +box_organizer \ No newline at end of file diff --git a/src/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb b/src/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb new file mode 100644 index 0000000..86ed273 --- /dev/null +++ b/src/software_communities/views/profile_editor/_first_edit_software_community_extras.html.erb @@ -0,0 +1,9 @@ +
    +
    > +

    <%= _("Step 1 - Software Creation")%>

    +
    + +
    > +

    <%= _("Step 2 - Community Settings")%>

    +
    +
    diff --git a/src/software_communities/views/profile_editor/_software_community.html.erb b/src/software_communities/views/profile_editor/_software_community.html.erb new file mode 100644 index 0000000..f4d0281 --- /dev/null +++ b/src/software_communities/views/profile_editor/_software_community.html.erb @@ -0,0 +1,70 @@ +

    <%= _('General information') %>

    + + <%= required_fields_message %> + + <%= @plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }.join("") %> + +<% if @environment.enabled?('enable_organization_url_change') %> + +<% end %> + +<% if @environment.enabled?('enable_organization_url_change') %> + + + <%= hidden_field_tag 'old_profile_identifier', @profile.identifier %> +
    + <%= required labelled_form_field( _('Address'), + content_tag('code', + url_for(profile.url).gsub(/#{profile.identifier}$/, '') + + text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25) + ) + + content_tag('div', + content_tag('strong', _('WARNING!')) + ' ' + + _("You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?") + + content_tag('div', + button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' + + button_to_function(:cancel, _('No'), 'no_change()') + ), + :id => 'identifier-change-confirmation', + :class => 'change-confirmation', + :style => 'display: none;' + ) + ) + %> +
    +<% end %> + +<%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile } %> + +<%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %> + +<%= render :partial => 'moderation', :locals => { :profile => @profile } %> + +<% if profile.enterprise? && profile.environment.enabled?('products_for_enterprises') %> +

    <%=_('Products/Services catalog')%>

    + <%= labelled_form_field(_('Number of products/services displayed per page on catalog'), text_field(:profile_data, :products_per_catalog_page, :size => 3)) %> +<% end %> diff --git a/src/software_communities/views/profile_editor/edit_software_community.html.erb b/src/software_communities/views/profile_editor/edit_software_community.html.erb new file mode 100644 index 0000000..5c181b8 --- /dev/null +++ b/src/software_communities/views/profile_editor/edit_software_community.html.erb @@ -0,0 +1,90 @@ + +<%= render :partial => 'first_edit_software_community_extras', :locals => {:class_step_one => "another-step", :class_step_two => "current-step"} if @first_edit %> + +

    <%= _('Configure Software Community') %>

    + +
    + + <%= _('Set the basic settings of the software associated community') %> + +
    + +<%= error_messages_for :profile_data %> + +<%= labelled_form_for :profile_data, :html => { :id => 'profile-data', :multipart => true } do |f| %> + + <% if environment.admins.include?(user) %> +
    + <%= labelled_check_box(_('This profile is a template'), 'profile_data[is_template]', true, @profile.is_template) %> +
    + <% end %> + + <%= render :partial => 'software_community', :locals => { :f => f } %> + +

    <%= _('Privacy options') %>

    + + <% if profile.person? %> +
    + <%= labelled_radio_button _('Public — show my contents to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> +
    +
    + <%= labelled_radio_button _('Private — show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %> +
    + <% else %> +
    + <%= labelled_check_box _("Secret — hide the community and all its contents for non members and other people can't join this community unless they are invited to."), 'profile_data[secret]', true, profile.secret, :class => "profile-secret-box" %> +
    +
    + <%= labelled_radio_button _('Public — show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> +
    +
    + <%= labelled_radio_button _('Private — show content of this group only to members'), 'profile_data[public_profile]', false, !@profile.public_profile? %> +
    + <% end %> + + <% if environment.enabled?('allow_change_of_redirection_after_login') %> +

    <%= _('Page to redirect after login') %>

    + <%= select 'profile_data', 'redirection_after_login', Environment.login_redirection_options.map{|key,value|[value,key]}, { :selected => @profile.preferred_login_redirection} %> + <% end %> + +

    <%= _('Translations') %>

    + <%= labelled_check_box( + _('Automaticaly redirect the visitor to the article translated to his/her language'), + 'profile_data[redirect_l10n]', true, @profile.redirect_l10n + )%> + +

    <%= _('Suggestions') %>

    + <%= labelled_check_box( + _('Send me relationship suggestions by email'), + 'profile_data[email_suggestions]', true, @profile.email_suggestions + )%> + + <%= + @plugins.dispatch(:profile_editor_extras).map do |content| + content.kind_of?(Proc) ? self.instance_exec(&content) : content + end.join("\n") + %> + + <%= select_categories(:profile_data, _('Software Categories'), 2) %> + + <% button_bar do %> + <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> + + <% unless @first_edit %> + <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> + <% end %> + <% end %> + + <% if user && user.has_permission?('destroy_profile', profile) && !@first_edit %> + <% button_bar(:id => 'delete-profile') do %> + <%= button(:remove, _('Delete software and community'), {:action => :destroy_profile}) %> + <% if environment.admins.include?(current_person) %> + <% if profile.visible? %> + <%= button(:remove, _('Deactivate software and community'), {:action => :deactivate_profile, :id=>profile.id}, :id=>'deactivate_profile_button', :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %> + <% else %> + <%= button(:add, _('Activate software and community'), {:action => :activate_profile, :id=>profile.id}, :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %> + <% end %> + <% end %> + <% end %> + <% end %> +<% end %> diff --git a/src/software_communities/views/search/_catalog_filter.html.erb b/src/software_communities/views/search/_catalog_filter.html.erb new file mode 100644 index 0000000..e6a9dd7 --- /dev/null +++ b/src/software_communities/views/search/_catalog_filter.html.erb @@ -0,0 +1,20 @@ +
    + +
    +

    <%= _("Categories") %>

    +
    +
      + <% @categories.each do |category| %> +
    • + <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> + <%= _("#{category.name}") %> +
    • + <% end %> +
    +
    +
    +
    <%= _("More options") %>
    +
    + <%= button_tag _("Clean up"), :id => "cleanup-filter-catalg", :type => "button" %> + <%= button_tag _("Close"), :id => "close-filter-catalog", :type => "button" %> +
    diff --git a/src/software_communities/views/search/_catalog_result_list.html.erb b/src/software_communities/views/search/_catalog_result_list.html.erb new file mode 100644 index 0000000..976a13d --- /dev/null +++ b/src/software_communities/views/search/_catalog_result_list.html.erb @@ -0,0 +1,51 @@ +
    + <% @assets.each do |name| %> + <% search = @searches[name] %> + + + + <% if !search[:results].blank? %> + + <% if multiple_search?(@searches) %> +

    <%= @names[name] %>

    + <% if search[:results].total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %> + <%= link_to(_("see all (%d)") % search[:results].total_entries, params.merge(:action => name), :class => 'see-more' ) %> + <% end %> + <% end %> + + <% display = display_filter(name, params[:display]) %> + +
    +
      + <% search[:results].each do |hit| %> + <% partial = partial_for_class(hit.class, display) %> + <% variable_name = partial.gsub("#{display}_", '').to_sym %> + <%= render :partial => partial, :locals => {variable_name => hit} %> + <% end %> +
    +
    + <% else %> + <% if multiple_search? %> +

    <%= @names[name] %>

    + <% end %> + +
    + + + + + +
    + <% @selected_categories.each do |category| %> +
    + <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %> + <% end %> +
    + + <% end %> + <% end %> + +
    + + <%= add_zoom_to_images %> +
    diff --git a/src/software_communities/views/search/_full_community.html.erb b/src/software_communities/views/search/_full_community.html.erb new file mode 100644 index 0000000..23e2b14 --- /dev/null +++ b/src/software_communities/views/search/_full_community.html.erb @@ -0,0 +1,53 @@ +<% software = community.software_info %> +
  • +
    + <%= profile_image_link community, :portrait, 'div', community.send(@order + '_label') + show_date(community.created_at) %> +
    + +
    + +
    + + <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %> +

    + <%= link_to_homepage(link_name, community.identifier) %> +

    +
    + + <% body_stripped = strip_tags(software.finality) %> + <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %> + +
    + +
    + +
    + + + <%= _("Software Categories") %>: + + + + <% if !community.categories.empty? %> +
      + <% community.categories.each do |category| %> +
    • + <%= link_to _("#{category.name}"), { + :controller => :search, + :action => :software_infos, + :selected_categories_id => [category.id], + :software_type => params[:software_type] + } %> +
    • + <% end %> +
    + <% else %> + + <%= _("This software doesn't have categories") %> + + <% end %> +
    +
    + +
    +
  • diff --git a/src/software_communities/views/search/_software_search_form.html.erb b/src/software_communities/views/search/_software_search_form.html.erb new file mode 100644 index 0000000..f400c66 --- /dev/null +++ b/src/software_communities/views/search/_software_search_form.html.erb @@ -0,0 +1,67 @@ +
    +
    +

    <%= _("Search Public Software Catalog") %>

    + + <%= form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.path : nil ) }, + :method => 'get') do %> + +
    +
    + + <%= hidden_field_tag :display, params[:display] %> + <%= hidden_field_tag :filter, params[:filter] %> + + <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> + ? + + + <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> + ? + + +
    + + <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50, :placeholder=>_("Type words about the software you're looking for (the search begins after 3 characters)") %> + + + <%= submit_button(:search, _('Filter')) %> +
    + <%= render :partial => 'search_form_extra_fields' %> + <%= render :partial => 'catalog_filter' %> + <% end %> +
    + +
    +
    + <%= "#{@software_count} Software(s)" %> +
    + +
    +
    + Show: + <%= select_tag("software_display", + options_for_select(['15', '30', '90', 'All'], :selected=>params[:display]) + ) %> +
    + +
    + Sort by: + <%= select_tag("sort", + options_for_select( + [ + [_("Name A-Z"), 'asc'], + [_("Name Z-A"), 'desc'], + [_("Relevance"), 'relevance'] + ], :selected=>params[:sort]) + ) %> +
    +
    +
    +
    + +<% if @empty_query %> + <% hint = environment.search_hints[@asset] %> + <% if hint and !hint.blank? %> +
    <%= hint %>
    + <% end %> +<% end %> diff --git a/src/software_communities/views/search/software_infos.html.erb b/src/software_communities/views/search/software_infos.html.erb new file mode 100644 index 0000000..c68f6fc --- /dev/null +++ b/src/software_communities/views/search/software_infos.html.erb @@ -0,0 +1,21 @@ +

    Catálogo de Software Público

    + +
    + <%= search_page_title( @titles[@asset], @category ) %> + + <%= render :partial => 'software_search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> + + <% if @asset == :product %> + <%= javascript_tag do %> + jQuery('.search-product-price-details').altBeautify(); + <% end %> + <% end %> +
    + +<%= render partial:"catalog_result_list" %> + +
    + <% if params[:display] != 'map' %> + <%= pagination_links @searches[@asset][:results] %> + <% end %> +
    diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb new file mode 100644 index 0000000..e0b994e --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_database_fields.html.erb @@ -0,0 +1,12 @@ +<%= fields_for :database_description, @database_description do |db| %> + +
    + <% database = [] if database.blank? %> + <% DatabaseHelper.database_as_tables(database).each do |tab| %> + <%= tab.call %> + <%end%> +
    + + +<%= link_to _('New Database'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-databases"%> +<% end %> diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb new file mode 100644 index 0000000..a7d31a1 --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_language_fields.html.erb @@ -0,0 +1,12 @@ +<%= fields_for :software_language, @software_language do |lng| %> + +
    + <% languages = [] if languages.blank? %> + <% SoftwareLanguageHelper.language_as_tables(languages).each do |tab| %> + <%= tab.call %> + <%end%> +
    + + +<%= link_to _('New language'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-languages"%> +<% end %> \ No newline at end of file diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb new file mode 100644 index 0000000..332654b --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_library_fields.html.erb @@ -0,0 +1,12 @@ +<%= fields_for :library ,@library do |lib| %> + +
    + <% libraries = [] if libraries.blank? %> + <% LibraryHelper.libraries_as_tables(libraries).each do |tab| %> + <%= tab.call %> + <% end %> +
    + + +<%= link_to _('New Library'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-libraries"%> +<% end %> diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb new file mode 100644 index 0000000..3cde616 --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_license_info_fields.html.erb @@ -0,0 +1,14 @@ +<% LicenseHelper.getListLicenses.each do | license | %> + +<% end %> + +<%= text_field_tag "license_info[version]", license_version, :id=>"license_info_version", :class=>"license_info_version", :placeholder=>_('Autocomplete field, type some license') %> +<%= hidden_field_tag "license[license_infos_id]", license_id, :id=>"license_info_id", :class=>"license_info_id", :data => {:label=>license_version} %> + +<%= _("Read license") %> + +
    + <%= labelled_text_field "Licence version", "license[version]", another_version, :id=>"licence_version" %> +
    + <%= labelled_text_field "Licence link", "license[link]", another_link, :id=>"licence_link" %> +
    diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb new file mode 100644 index 0000000..a40b62d --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb @@ -0,0 +1,47 @@ + +
    > + <%= label_tag("community[name]", _('Name'), {:class => 'formlabel mandatory'}) %> + <%= text_field_tag("community[name]", @profile.name, :id => 'community_name_id') %> +
    + +
    > + <%= label_tag("software[acronym]", _('Short Name'), {:class => 'formlabel mandatory'}) %> + <%= text_field_tag("software[acronym]", @profile.software_info.acronym, :id => 'software_acronym_id', :maxlength=>"10") %> +
    + +
    > +
    + <%= label_tag("software[finality]", _('Finality'), {:class => 'formlabel mandatory'}) %> + <%= text_area_tag "software[finality]", @profile.software_info.finality, :placeholder => _("What is the software for?"), :maxlength => 120 %> +
    +
    + +
    + +
    +
    + <%= f.fields_for :image_builder, @profile.image do |i| %> + <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> + <% end %> +
    + +
    > +
    + + <%= render :partial => "license_info_fields", :locals => { + :license_version => @license_version, + :license_id => @license_id, + :another_version => @another_license_version, + :another_link => @another_license_link + } %> +
    +
    + +
    + <%= label_tag("software[repository_link]", _('Link to Repository: '), {:class => 'formlabel'}) %> + <%= text_field_tag("software[repository_link]", @profile.software_info.repository_link, :class => "improve_input_size", :id => "software-info-repository-link") %> +
    diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb new file mode 100644 index 0000000..7585db5 --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb @@ -0,0 +1,12 @@ +<%= fields_for :operating_systems ,@operating_systems do |lib| %> + +
    + <% operating_systems_fields = [] if operating_systems_fields.nil? %> + <% OperatingSystemHelper.operating_system_as_tables(operating_systems_fields).each do |tab| %> + <%= tab.call %> + <% end %> +
    + + +<%= link_to _('New Operating System'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-operating_systems"%> +<% end %> diff --git a/src/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb new file mode 100644 index 0000000..1f3466c --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/_public_software_info.html.erb @@ -0,0 +1,102 @@ +
    + <% if @disabled_public_software_field == true %> + <%= check_box_tag("software[public_software]", "true", @software_info.public_software?, :disabled => "disabled") %> + <%= label_tag _("Public Software"), _("Public software"), :class => "public_software_disabled" %> + <% else %> + <%= check_box_tag("software[public_software]", "true", @software_info.public_software?) %> + <%= label_tag _("Public Software"), _("Public software"), :class => "public_software_enabled" %> + <% end %> +
    +

    <%= _("Public Software") %>

    +
    + <%= label_tag _("Adherent to e-PING ?") %> + + <%= label_tag "e_ping_true", "Yes" %> + <%= radio_button_tag("software[e_ping]", true, @software_info.e_ping)%> + <%= label_tag "e_ping_false", "No"%> + <%= radio_button_tag("software[e_ping]", false, !@software_info.e_ping)%> +
    + +
    + <%= label_tag _("Adherent to e-MAG ?") %> + + <%= label_tag "e_mag_true", "Yes"%> + <%= radio_button_tag("software[e_mag]", true, @software_info.e_mag)%> + <%= label_tag "e_mag_false", "No"%> + <%= radio_button_tag("software[e_mag]", false, !@software_info.e_mag)%> +
    + +
    + <%= label_tag _("Adherent to ICP-Brasil ?") %> + + <%= label_tag "icp_brasil_true", "Yes"%> + <%= radio_button_tag("software[icp_brasil]", true, @software_info.icp_brasil)%> + <%= label_tag "icp_brasil_false", "No"%> + <%= radio_button_tag("software[icp_brasil]", false, !@software_info.icp_brasil)%> +
    + +
    + <%= label_tag _("Adherent to e-ARQ ?") %> + + <%= label_tag "e_arq_true", "Yes"%> + <%= radio_button_tag("software[e_arq]", true, @software_info.e_arq)%> + <%= label_tag "e_arq_false", "No"%> + <%= radio_button_tag("software[e_arq]", false, !@software_info.e_arq)%> +
    + +
    + <%= label_tag _("Internacionalizable ?") %> + + <%= label_tag "intern_true", "Yes" %> + <%= radio_button_tag("software[intern]", true, @software_info.intern)%> + <%= label_tag "intern_false", "No"%> + <%= radio_button_tag("software[intern]", false, !@software_info.intern)%> +
    +
    +
    + +
    +

    <%= _("Operating Platform") %>

    + <%= text_area_tag "software[operating_platform]", @software_info.operating_platform, :cols => 40, :rows => 5%> +
    + +
    +

    <%= _("Features") %>

    + <%= text_area_tag "software[features]", @software_info.features, :maxlength=>"4000", :cols => 40, :rows => 5%> +
    + +
    +

    <%= _("Demonstration url") %>

    + <%= text_field_tag("software[demonstration_url]", @software_info.demonstration_url) %> +
    + +
    +

    <%= _("Libraries") %>

    + + <%= render :partial => 'library_fields', :locals => {:object_name => 'community', :profile => @community, :libraries => @list_libraries } %> +
    + +
    + +
    +

    <%= _("Operating Systems") %>

    + + <%= render :partial => 'operating_system_fields', :locals => {:object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %> +
    +
    + +
    +
    +

    <%= _("Programming languages") %>

    + + <%= render :partial => 'language_fields', :locals => { :object_name => 'community', :profile => @community, :languages => @list_languages } %> +
    + +
    +
    +

    <%= _("Databases") %>

    + + <%= render :partial => 'database_fields', :locals => {:object_name => 'community', :profile => @community, :database => @list_databases } %> +
    + +
    diff --git a/src/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb new file mode 100644 index 0000000..0b25696 --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/edit_software.html.erb @@ -0,0 +1,22 @@ +

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

    + +<% tabs = [] %> + +<%= error_messages_for :software_info, :community %> + +<%= labelled_form_for :community, :html => { :multipart => true, :id => 'edit-form' } do |f| %> + + <% tabs << {:title => _("Main Information"), :id => 'basic-info', + :content => (render :partial => 'main_software_editor_extras', :locals => {:f => f})} %> + + <% tabs << {:title => _("Specifications"), :id => 'especific-info', + :content => (render :partial => 'public_software_info')} %> + + <%= render_tabs(tabs) %> + + <% button_bar do %> + <%= submit_button(:save, _('Save')) %> + <%= submit_button(:save, _('Save and Configure Community')) %> + <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> + <% end %> +<% end %> diff --git a/src/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb b/src/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb new file mode 100644 index 0000000..ad9795d --- /dev/null +++ b/src/software_communities/views/software_communities_plugin_myprofile/new_software.html.erb @@ -0,0 +1,103 @@ + + +<%= render :partial => 'profile_editor/first_edit_software_community_extras', :locals => {:class_step_one => "current-step", :class_step_two => "another-step"} %> + +

    <%= _('Creating new software') %>

    + +
    + + <%= _('Enter the basic information about the software.
    + You can add the details after you create it.') %> +
    +
    + +<% 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 @errors.blank? %> +
    +

    <%= _("Can`t create new software: #{@errors.length} errors") %>

    +
      + <% @errors.each do |error| %> +
    • <%= error %>
    • + <% end %> +
    +
    +<% end %> + +
    + <%= labelled_form_for :community, :html => { :multipart => true } do |f| %> + + <%= required_fields_message %> + +
    > + <%= label("name", _('Name'), {:class => 'formlabel mandatory'}) %> + <%= required text_field(:community, :name, :size => 30, :maxlength => 100, :id => 'community_name_id') %> +
    + +
    +
    + +
    > + <%= label("domain", _('Domain'), {:class => "formlabel mandatory"}) %> +
    + + <%= environment.default_hostname %>/ + <%= required text_field(:community, :identifier, :size => 30, :maxlength => 100, :id => 'community-identifier') %> +
    +
    + +
    > + <%= fields_for @software_info do |swf| %> +
    + <%= swf.label("finality" ,_("Finality"), :class=>"formlabel mandatory") %> + <%= required swf.text_area(:finality, :placeholder => _("What is the software for?"), :maxlength => 120) %> +
    + <% end %> +
    + +
    + +
    +
    + <%= f.fields_for :image_builder, @community.image do |i| %> + <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> + <% end %> +
    + +
    > +
    + + <%= render :partial => "license_info_fields", :locals => { + :license_version => "", + :license_id => "", + :another_version=>"", + :another_link=>"" + } %> +
    +
    + + <%= fields_for @software_info do |swf| %> +
    + <%= swf.label "repository_url", _("Link to Repository: "), :class => "formlabel"%> + <%= swf.text_field :repository_link, :class => "improve_input_size", :id => "software-info-repository-link" %> +
    + <% end %> + + <%= hidden_field_tag('back_to', @back_to) %> + + <% button_bar do %> + <%= submit_button(:save, _('Create')) %> + <%= button(:cancel, _('Cancel'), @back_to ) %> + <% end %> + + <% end %> + +
    diff --git a/src/software_communities/views/software_editor_extras.rhtml b/src/software_communities/views/software_editor_extras.rhtml new file mode 100644 index 0000000..c4a119e --- /dev/null +++ b/src/software_communities/views/software_editor_extras.rhtml @@ -0,0 +1,35 @@ +

    <%= _('Software Information') %>

    + +
    + <%= _("Adherent to e-PING?") %> + <%= labelled_radio_button(_('Sim'), 'software_info[e_ping]', 'sim', context.profile.software_info.e_ping == 'sim')%> + <%= labelled_radio_button(_('Não'), 'software_info[e_ping]', 'nao', context.profile.software_info.e_ping == 'nao')%> +
    +
    + <%= _("Adherent to e-MAG?") %> + <%= labelled_radio_button(_('Sim'), 'software_info[e_mag]', 'sim', context.profile.software_info.e_mag == 'sim')%> + <%= labelled_radio_button(_('Não'), 'software_info[e_mag]', 'nao', context.profile.software_info.e_mag == 'nao')%> +
    +
    + <%= _("Adherent to ICP-Brasil?") %> + <%= labelled_radio_button(_('Sim'), 'software_info[icp_brasil]', 'sim', context.profile.software_info.icp_brasil == 'sim')%> + <%= labelled_radio_button(_('Não'), 'software_info[icp_brasil]', 'nao', context.profile.software_info.icp_brasil == 'nao')%> +
    +
    + <%= _("Adherent to e-ARQ?") %> + <%= labelled_radio_button(_('Sim'), 'software_info[e_arq]', 'sim', context.profile.software_info.e_arq == 'sim')%> + <%= labelled_radio_button(_('Não'), 'software_info[e_arq]', 'nao', context.profile.software_info.e_arq == 'nao')%> +
    +
    + <%= _("Internacionalizable") %> + <%= labelled_radio_button(_('Sim'), 'software_info[intern]', 'sim', context.profile.software_info.intern == 'sim')%> + <%= labelled_radio_button(_('Não'), 'software_info[intern]', 'nao', context.profile.software_info.intern == 'nao')%> +
    + +
    + <%= label_tag('software_info[operating_platform]', 'Operating Platform:') %> + <%= text_area_tag('software_info[operating_platform]', context.profile.software_info.operating_platform, :size => '40x20') %> +
    +
    + <%= labelled_text_field('Demonstration URL', 'software_info[demonstration_url]', context.profile.software_info.demonstration_url) %> +
    diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb deleted file mode 100644 index 3805787..0000000 --- a/test/functional/profile_controller_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -require "test_helper" -require 'profile_controller' - -# Re-raise errors caught by the controller. -class ProfileController; def rescue_action(e) raise e end; end - -class ProfileControllerTest < ActionController::TestCase - def setup - Environment.default.enable('products_for_enterprises') - @profile = create_user('testuser').person - end - attr_reader :profile - - should 'not count a visit twice for the same user' do - profile = create_user('someone').person - login_as(@profile.identifier) - community = fast_create('Community') - - get :index, :profile => community.identifier - community.reload - assert_equal 1, community.hits - - get :index, :profile => community.identifier - community.reload - assert_equal 1, community.hits - end - - should 'not count a visit twice for unlogged users' do - profile = create_user('someone').person - community = fast_create('Community') - get :index, :profile => community.identifier - community.reload - assert_equal 1, community.hits - - get :index, :profile => community.identifier - community.reload - assert_equal 1, community.hits - end -end - diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb deleted file mode 100644 index b677a1d..0000000 --- a/test/functional/profile_editor_controller_test.rb +++ /dev/null @@ -1,70 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require( - File.dirname(__FILE__) + - '/../../../../app/controllers/my_profile/profile_editor_controller' -) - -class ProfileEditorController; def rescue_action(e) raise e end; end - -class ProfileEditorControllerTest < ActionController::TestCase - - def setup - @controller = ProfileEditorController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @profile = create_user('default_user').person - - Environment.default.affiliate( - @profile, - [Environment::Roles.admin(Environment.default.id)] + - Profile::Roles.all_roles(Environment.default.id) - ) - - @environment = Environment.default - @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] - admin = create_user("adminuser").person - admin.stubs(:has_permission?).returns("true") - login_as('adminuser') - @environment.add_admin(admin) - @environment.save - end - - should "redirect to edit_software_community on edit community of software" do - software = create_software_info("Test Software") - - post :edit, :profile => software.community.identifier - - assert_redirected_to :controller => 'profile_editor', :action => 'edit_software_community' - end - - - protected - - def create_basic_user - user = fast_create(User) - user.person = fast_create(Person) - user.person.user = user - user.save! - user.person.save! - user - end - - def create_community name - community = fast_create(Community) - community.name = name - community.save - community - end - - def create_software_info name, finality = "something", acronym = "" - community = create_community(name) - software_info = SoftwareInfo.new - software_info.community = community - software_info.finality = finality - software_info.acronym = acronym - software_info.public_software = true - software_info.save - software_info - end - -end diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb deleted file mode 100644 index 606337d..0000000 --- a/test/functional/search_controller_test.rb +++ /dev/null @@ -1,304 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' -require( - File.dirname(__FILE__) + - '/../../../../app/controllers/public/search_controller' -) - -class SearchController; def rescue_action(e) raise e end; end - -class SearchControllerTest < ActionController::TestCase - include PluginTestHelper - - def setup - @environment = Environment.default - @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] - @environment.save - - @controller = SearchController.new - @request = ActionController::TestRequest.new - @request.stubs(:ssl?).returns(:false) - @response = ActionController::TestResponse.new - - @licenses = [ - LicenseInfo.create(:version => "GPL - 1"), - LicenseInfo.create(:version => "GPL - 2") - ] - - create_software_categories - - @softwares = [] - - @softwares << create_software_info("Software One", :acronym => "SFO", :finality => "Help") - @softwares << create_software_info("Software Two", :acronym => "SFT", :finality => "Task") - - @softwares[0].community.categories << Category.first - @softwares[1].community.categories << Category.last - - @softwares[0].license_info = @licenses.first - @softwares[1].license_info = @licenses.last - - @softwares[0].save! - @softwares[1].save! - end - - should "communities searches don't have software" do - community = create_community("Community One") - - get :communities, :query => "One" - - assert_includes assigns(:searches)[:communities][:results], community - assert_not_includes assigns(:searches)[:communities][:results], @softwares.first.community - end - - should "software_infos search don't have community" do - community = create_community("Community One") - - get :software_infos, :query => "One" - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], community - end - - - should "Don't have template in communities search result" do - communities = [] - communities << create_community("Community One") - communities << create_community("Community Two") - - community_template = create_community("Community Template") - community_template.is_template = true - community_template.visible = false - community_template.save! - - get :communities, :query => "Comm" - - assert_not_includes( - assigns(:searches)[:communities][:results], - community_template - ) - end - - should "software_infos search by category" do - get( - :software_infos, - :query => "", - :selected_categories_id => [Category.first.id] - ) - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community - end - - should "software_infos search by programming language" do - @softwares.first.software_languages << create_software_language("Python", "1.0") - @softwares.last.software_languages << create_software_language("Java", "8.1") - - @softwares.first.save! - @softwares.last.save! - - get( - :software_infos, - :query => "python", - ) - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community - end - - should "software_infos search by database description" do - @softwares.first.software_databases << create_software_database("MySQL", "1.0") - @softwares.last.software_databases << create_software_database("Postgrees", "8.1") - - @softwares.first.save! - @softwares.last.save! - - get( - :software_infos, - :query => "mysql", - ) - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community - end - - should "software_infos search by finality" do - get( - :software_infos, - :query => "help", - ) - - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community - end - - should "software_infos search by acronym" do - get( - :software_infos, - :query => "SFO", - ) - - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community - end - - should "software_infos search by relevance" do - @softwares << create_software_info("Software Three", :acronym => "SFW", :finality => "Java") - @softwares.last.license_info = LicenseInfo.create :version => "GPL - 3.0" - - - @softwares.first.software_languages << create_software_language("Java", "8.0") - @softwares.first.save! - - @softwares[1].community.name = "Java" - @softwares[1].community.save! - - get( - :software_infos, - :sort => "relevance", - :query => "Java" - ) - - assert_equal assigns(:searches)[:software_infos][:results][0], @softwares[1].community - assert_equal assigns(:searches)[:software_infos][:results][1], @softwares[2].community - assert_equal assigns(:searches)[:software_infos][:results][2], @softwares[0].community - end - - should "software_infos search only public_software" do - software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") - software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") - software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") - software_three.public_software = false - software_three.save! - - get( - :software_infos, - :software_type => "public_software" - ) - - assert_includes assigns(:searches)[:software_infos][:results], software_one.community - assert_includes assigns(:searches)[:software_infos][:results], software_two.community - assert_not_includes assigns(:searches)[:software_infos][:results], software_three.community - end - - should "software_infos search public_software and other all" do - software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") - software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") - software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") - software_three.public_software = false - software_three.save! - - get( - :software_infos, - :software_type => "all" - ) - - assert_includes assigns(:searches)[:software_infos][:results], software_one.community - assert_includes assigns(:searches)[:software_infos][:results], software_two.community - assert_includes assigns(:searches)[:software_infos][:results], software_three.community - end - - should "software_infos search return only the software in params" do - software_one = create_software_info("Software One", :acronym => "SFO", :finality => "Help") - software_two = create_software_info("Java", :acronym => "SFT", :finality => "Task") - software_three = create_software_info("Software Three", :acronym => "SFW", :finality => "Java") - - get( - :software_infos, - :only_softwares => ["software-three", "java"] - ) - - assert_includes assigns(:searches)[:software_infos][:results], software_two.community - assert_includes assigns(:searches)[:software_infos][:results], software_three.community - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community - end - - should "software_infos search return only enabled softwares" do - s1 = SoftwareInfo.first - s2 = SoftwareInfo.last - - # First get them all normally - get( - :software_infos, - :query => "software" - ) - - assert_includes assigns(:searches)[:software_infos][:results], s1.community - assert_includes assigns(:searches)[:software_infos][:results], s2.community - - s2.community.disable - - # Now it should not contain the disabled community - get( - :software_infos, - :query => "software" - ) - - assert_includes assigns(:searches)[:software_infos][:results], s1.community - assert_not_includes assigns(:searches)[:software_infos][:results], s2.community - end - - should "software_infos search not return software with secret community" do - software_one = create_software_info("Software ABC", :acronym => "SFO", :finality => "Help") - software_two = create_software_info("Python", :acronym => "SFT", :finality => "Task") - software_three = create_software_info("Software DEF", :acronym => "SFW", :finality => "Java") - - software_one.community.secret = true - software_one.community.save! - - get( - :software_infos, - ) - - assert_includes assigns(:searches)[:software_infos][:results], software_two.community - assert_includes assigns(:searches)[:software_infos][:results], software_three.community - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community - end - - private - - def create_software_categories - category_software = Category.create!( - :name => "Software", - :environment => @environment - ) - Category.create( - :name => "Category One", - :environment => @environment, - :parent => category_software - ) - Category.create( - :name => "Category Two", - :environment => @environment, - :parent => category_software - ) - end - - def create_software_language(name, version) - unless ProgrammingLanguage.find_by_name(name) - ProgrammingLanguage.create(:name => name) - end - - software_language = SoftwareLanguage.new - software_language.programming_language = ProgrammingLanguage.find_by_name(name) - software_language.version = version - software_language.save! - - software_language - end - - def create_software_database(name, version) - unless DatabaseDescription.find_by_name(name) - DatabaseDescription.create(:name => name) - end - - software_database = SoftwareDatabase.new - software_database.database_description = DatabaseDescription.find_by_name(name) - software_database.version = version - software_database.save! - - software_database - end - -end diff --git a/test/functional/software_communities_plugin_controller_test.rb b/test/functional/software_communities_plugin_controller_test.rb deleted file mode 100644 index 78ae2e0..0000000 --- a/test/functional/software_communities_plugin_controller_test.rb +++ /dev/null @@ -1,116 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../../controllers/software_communities_plugin_controller' - -class SoftwareCommunitiesPluginController; def rescue_action(e) raise e end; end - -class SoftwareCommunitiesPluginControllerTest < ActionController::TestCase - def setup - @admin = create_user("adminuser").person - @admin.stubs(:has_permission?).returns("true") - @controller.stubs(:current_user).returns(@admin.user) - - @environment = Environment.default - @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] - @environment.add_admin(@admin) - @environment.save - - LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") - LicenseInfo.create(:version=>"Academic Free License 3.0 (AFL-3.0)", :link=>"http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl") - LicenseInfo.create(:version=>"Apache License 2.0 (Apache-2.0)", :link=>"http://www.apache.org/licenses/LICENSE-2.0") - LicenseInfo.create(:version=>'BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause)', :link=>"http://opensource.org/licenses/BSD-2-Clause") - - ProgrammingLanguage.create(:name =>"Java") - ProgrammingLanguage.create(:name =>"Ruby") - ProgrammingLanguage.create(:name =>"C") - ProgrammingLanguage.create(:name =>"C++") - DatabaseDescription.create(:name => "PostgreSQL") - DatabaseDescription.create(:name => "MySQL") - DatabaseDescription.create(:name => "MongoDB") - DatabaseDescription.create(:name => "Oracle") - OperatingSystemName.create(:name=>"Debian") - - @response = ActionController::TestResponse.new - end - - should 'return the licenses datas' do - xhr :get, :get_license_data, :query => "" - - licenses = JSON.parse(@response.body) - - assert_equal 4, licenses.count - end - - should 'return licenses that has Free on their version name' do - xhr :get, :get_license_data, :query => "Free" - - licenses = JSON.parse(@response.body) - - assert_equal 2, licenses.count - end - - should 'return no licenses that has Common on their version name' do - xhr :get, :get_license_data, :query => "Common" - - licenses = JSON.parse(@response.body) - - assert_equal 0, licenses.count - end - - should 'render block template' do - xhr :get, :get_block_template - - assert_tag :tag => 'input', :attributes => { :class => "block_download_name" } - assert_tag :tag => 'input', :attributes => { :class => "block_download_link" } - assert_tag :tag => 'input', :attributes => { :class => "block_download_software_description" } - assert_tag :tag => 'input', :attributes => { :class => "block_download_minimum_requirements" } - assert_tag :tag => 'input', :attributes => { :class => "block_download_size" } - end - - should 'return the programming languages' do - xhr :get, :get_field_data, :query => "", :field => "software_language" - - languages = JSON.parse(@response.body) - - assert_equal 4, languages.count - end - - should 'return the programming languages that has C on their name' do - xhr :get, :get_field_data, :query => "C", :field => "software_language" - - languages = JSON.parse(@response.body) - - assert_equal 2, languages.count - end - - should 'dont return the programming languages that has HTML on their name' do - xhr :get, :get_field_data, :query => "HTML", :field => "software_language" - - languages = JSON.parse(@response.body) - - assert_equal 1, languages.count - end - - should 'return the databases' do - xhr :get, :get_field_data, :query => "", :field => "software_database" - - databases = JSON.parse(@response.body) - - assert_equal 4, databases.count - end - - should 'return the databases that has SQL on their name' do - xhr :get, :get_field_data, :query => "SQL", :field => "software_database" - - databases = JSON.parse(@response.body) - - assert_equal 3, databases.count - end - - should 'dont return the database that has on their name' do - xhr :get, :get_field_data, :query => "Cache", :field => "software_database" - - databases = JSON.parse(@response.body) - - assert_equal 1, databases.count - end -end diff --git a/test/functional/software_communities_plugin_myprofile_controller_test.rb b/test/functional/software_communities_plugin_myprofile_controller_test.rb deleted file mode 100644 index bb72b8a..0000000 --- a/test/functional/software_communities_plugin_myprofile_controller_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/software_test_helper' -require( - File.dirname(__FILE__) + - '/../../controllers/software_communities_plugin_myprofile_controller' -) - -class SoftwareCommunitiesPluginMyprofileController; def rescue_action(e) raise e end; -end - -class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestCase - include SoftwareTestHelper - def setup - @controller = SoftwareCommunitiesPluginMyprofileController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @person = create_user('person').person - @offer = create_user('Angela Silva') - @offer_1 = create_user('Ana de Souza') - @offer_2 = create_user('Angelo Roberto') - - LicenseInfo.create( - :version=>"CC-GPL-V2", - :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" - ) - - ProgrammingLanguage.create(:name =>"language") - DatabaseDescription.create(:name => "database") - OperatingSystemName.create(:name=>"Debian") - - login_as(@person.user_login) - @environment = Environment.default - @environment.enable_plugin('SoftwareCommunitiesPlugin') - @environment.save! - end - - attr_accessor :person, :offer - - should 'Add offer to admin in new software' do - @hash_list = software_fields - @software = create_software @hash_list - @software.community.add_admin(@offer.person) - @software.save - assert_equal @offer.person.id, @software.community.admins.last.id - end - - should 'create a new software with all fields filled in' do - fields = software_fields - @environment.add_admin(@person) - post( - :new_software, - :profile => @person.identifier, - :community => fields[1], - :license => fields[0], - :software_info => fields[2] - ) - assert_equal SoftwareInfo.last.community.name, "Debian" - end - - should 'edit a new software adding basic information' do - fields_software = software_fields - fields = software_edit_basic_fields - - software = create_software fields_software - post( - :edit_software, - :profile => software.community.identifier, - :license => fields[1], - :software => fields[0], - :library => {}, - :operating_system => {}, - :language => {}, - :database => {} - ) - assert_equal SoftwareInfo.last.repository_link, "www.github.com/test" - end - - should 'edit a new software adding specific information' do - fields_software = software_fields - fields = software_edit_specific_fields - - software = create_software fields_software - post( - :edit_software, - :profile => software.community.identifier, - :library => fields[0], - :language => fields[1], - :database => fields[2], - :operating_system => fields[3], - :software => fields[4], - :license => fields[5] - ) - assert_equal SoftwareInfo.last.acronym, "test" - end - - should 'upgrade a generic software to a public software' do - fields_software = software_fields - fields = software_edit_specific_fields - - fields[4]['public_software'] = true - software = create_software fields_software - - post( - :edit_software, - :profile => software.community.identifier, - :library => fields[0], - :language => fields[1], - :database => fields[2], - :operating_system => fields[3], - :software => fields[4], - :license => fields[5] - ) - - assert_equal true, SoftwareInfo.last.public_software? - end - - should "create software_info with existing license_info" do - @environment.add_admin(@person) - - post( - :new_software, - :community => {:name =>"New Software", :identifier => "new-software"}, - :software_info => {:finality => "something", :repository_link => ""}, - :license =>{:license_infos_id => LicenseInfo.last.id}, - :profile => @person.identifier - ) - - assert_equal SoftwareInfo.last.license_info, LicenseInfo.last - end - - should "create software_info with 'Another' license_info" do - license_another = LicenseInfo.create(:version => "Another", :link => "#") - @environment.add_admin(@person) - - another_license_version = "Different License" - another_license_link = "http://diferent.link" - - post( - :new_software, - :community => { :name => "New Software", :identifier => "new-software" }, - :software_info => { :finality => "something", :repository_link => "" }, - :license => { :license_infos_id => license_another.id, - :version => another_license_version, - :link=> another_license_link - }, - :profile => @person.identifier - ) - - assert_equal SoftwareInfo.last.license_info_id, license_another.id - assert_equal SoftwareInfo.last.license_info.id, nil - assert_equal SoftwareInfo.last.license_info.version, another_license_version - assert_equal SoftwareInfo.last.license_info.link, another_license_link - end -end diff --git a/test/functional/software_communities_plugin_profile_controller_test.rb b/test/functional/software_communities_plugin_profile_controller_test.rb deleted file mode 100644 index 00c715e..0000000 --- a/test/functional/software_communities_plugin_profile_controller_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/software_test_helper' -require File.dirname(__FILE__) + '/../../controllers/software_communities_plugin_profile_controller' - -class SoftwareCommunitiesPluginProfileController; def rescue_action(e) raise e end; end - -class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCase - include SoftwareTestHelper - - def setup - @controller = SoftwareCommunitiesPluginProfileController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @environment = Environment.default - @environment.enable_plugin('SoftwareCommunitiesPlugin') - @environment.save! - - LicenseInfo.create( - :version=>"CC-GPL-V2", - :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" - ) - @download_data = { - :name=>"Google", - :link=>"http://google.com", - :software_description=>"all", - :minimum_requirements=>"none", - :size=>"?", - :total_downloads=>0 - } - - @software = create_software(software_fields) - @software.save! - - download_block = DownloadBlock.new - download_block.downloads = Download.validate_download_list([@download_data]) - download_block.save! - - @software.community.blocks << download_block - @software.community.save! - end - - should 'redirect to download link with correct params' do - download_block = DownloadBlock.last - get :download_file, :profile=>@software.community.identifier, - :block => download_block.id, :download_index => 0 - - assert_equal nil, session[:notice] - assert_redirected_to download_block.downloads[0][:link] - end - - should "notice when the download was not found" do - download_block = DownloadBlock.last - get :download_file, :profile=>@software.community.identifier, - :block => 123, :download_index => 0 - - assert_equal "Could not find the download file", session[:notice] - end - - should "notice when given invalid download params" do - download_block = DownloadBlock.last - get :download_file, :profile=>@software.community.identifier, - :block => download_block.id, :download_index => -5 - - assert_equal "Invalid download params", session[:notice] - end -end diff --git a/test/helpers/plugin_test_helper.rb b/test/helpers/plugin_test_helper.rb deleted file mode 100644 index d7458ce..0000000 --- a/test/helpers/plugin_test_helper.rb +++ /dev/null @@ -1,64 +0,0 @@ -module PluginTestHelper - - def create_community name - community = fast_create(Community) - community.name = name - community.identifier = name.to_slug - community.save - community - end - - def create_software_info name, finality = "something", acronym = "" - community = create_community(name) - software_info = SoftwareInfo.new - software_info.community = community - software_info.finality = finality - software_info.acronym = acronym - software_info.public_software = true - software_info.save! - - software_info - end - - def create_person name, email, password, password_confirmation, state, city - user = create_user( - name.to_slug, - email, - password, - password_confirmation, - ) - person = Person::new - - user.person = person - person.user = user - - person.name = name - person.identifier = name.to_slug - person.state = state - person.city = city - - user.save - person.save - - person - end - - def create_user login, email, password, password_confirmation - user = User.new - - user.login = login - user.email = email - user.password = password - user.password_confirmation = password_confirmation - - user - end - - def create_license_info version, link = "" - license = LicenseInfo.create(:version => version) - license.link = link - license.save - - license - end -end diff --git a/test/helpers/software_test_helper.rb b/test/helpers/software_test_helper.rb deleted file mode 100644 index 285fd27..0000000 --- a/test/helpers/software_test_helper.rb +++ /dev/null @@ -1,193 +0,0 @@ -module SoftwareTestHelper - - def create_language language_fields - language = SoftwareLanguage.new - - language_fields[0].each do |k,v| - language[k] = v - end - language.save! - language - end - - def create_database database_fields - - database = SoftwareDatabase.new - - database_fields[0].each do |k,v| - database[k] = v - end - - database.save! - database - end - - def create_library library_fields - library = Library.new - - library_fields[0].each do |k,v| - library[k] = v - end - library.save! - library - end - - def create_operating_system operating_system_hash - operating_system = OperatingSystem.new - - operating_system_hash[0].each do |k,v| - operating_system[k] = v - end - operating_system.save - operating_system - end - - def create_license license_hash - license_info = LicenseInfo.new - - license_hash.each do |k,v| - license_info[k] = v - end - license_info.save - license_info - end - - def create_categories categories_hash - software_categories = SoftwareCategories.new - - categories_hash.each do |k,v| - software_categories[k] = v - end - software_categories.save - software_categories - end - - def create_software fields - - software = SoftwareInfo.new - community = Community.new - software_hash = fields[2] - license_system_hash = fields[0] - community_hash = fields[1] - - software_hash.each do |k,v| - software[k] = v - end - - community_hash.each do |k,v| - community[k] = v - end - - community.save! - software.community = community - software.license_info_id = license_system_hash[:license_infos_id] - - software.save! - - software - end - - def software_edit_basic_fields - fields = Hash.new - fields_license = Hash.new - hash_list = [] - - fields['repository_link'] = 'www.github.com/test' - fields['finality'] = 'This is the new finality of the software' - hash_list << fields - - #Fields for license info - fields_license['license_infos_id'] = LicenseInfo.last.id - hash_list << fields_license - - hash_list - end - - def software_edit_specific_fields - fields_library = Hash.new - fields_language = Hash.new - fields_database = Hash.new - fields_operating_system = Hash.new - fields_software = Hash.new - fields_categories = Hash.new - fields_license = Hash.new - - hash_list = [] - list_database = [] - list_language = [] - list_operating_system = [] - list_library = [] - - #Fields for library - fields_library['version'] = 'test' - fields_library['name'] = 'test' - fields_library['license'] = 'test' - list_library << fields_library - list_library << {} - hash_list << list_library - - #Fields for software language - fields_language['version'] = 'test' - fields_language['programming_language_id'] = ProgrammingLanguage.last.id - fields_language['operating_system'] = 'test' - list_language << fields_language - list_language << {} - hash_list << list_language - - #Fields for database - fields_database['version'] = 'test' - fields_database['database_description_id'] = DatabaseDescription.last.id - fields_database['operating_system'] = 'test' - list_database << fields_database - list_database << {} - hash_list << list_database - - #Fields for operating system - fields_operating_system['version'] = 'version' - fields_operating_system['operating_system_name_id'] = OperatingSystemName.last.id - list_operating_system << fields_operating_system - list_operating_system << {} - hash_list << list_operating_system - - #software fields - fields_software['acronym'] = 'test' - fields_software['operating_platform'] = 'Linux' - fields_software['objectives'] = 'This is the objective of the software' - fields_software['features'] = 'This software does nothing' - fields_software['demonstration_url'] = 'www.test.com' - hash_list << fields_software - - #Fields for license - fields_license['license_infos_id'] = LicenseInfo.last.id - hash_list << fields_license - - hash_list - end - - def software_fields - hash_list = [] - - #Fields for license info - fields_license = { - license_infos_id: LicenseInfo.last.id - } - hash_list << fields_license - - #Fields for community - fields_community = { - name: 'Debian', - identifier: 'debian' - } - hash_list << fields_community - - #Fields for basic information - fields = { - finality: 'This is the finality of the software' - } - hash_list << fields - - hash_list - end -end -#version: LicenseInfo.last.version, -#id: LicenseInfo.last.id \ No newline at end of file diff --git a/test/unit/categories_and_tags_block_test.rb b/test/unit/categories_and_tags_block_test.rb deleted file mode 100644 index a7e0bef..0000000 --- a/test/unit/categories_and_tags_block_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class CategoriesAndTagsBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from Block' do - assert_kind_of Block, CategoriesAndTagsBlock.new - end - - should 'declare its default title' do - CategoriesAndTagsBlock.any_instance.stubs(:profile_count).returns(0) - assert_equal Block.new.default_title, CategoriesAndTagsBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, CategoriesAndTagsBlock.description - end - -end diff --git a/test/unit/categories_software_block_test.rb b/test/unit/categories_software_block_test.rb deleted file mode 100644 index b02f9b4..0000000 --- a/test/unit/categories_software_block_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class CategoriesSoftwareBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from Block' do - assert_kind_of Block, CategoriesSoftwareBlock.new - end - - should 'declare its default title' do - CategoriesSoftwareBlock.any_instance.stubs(:profile_count).returns(0) - assert_equal Block.new.default_title, CategoriesSoftwareBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, CategoriesSoftwareBlock.description - end - -end diff --git a/test/unit/communities_block_test.rb b/test/unit/communities_block_test.rb deleted file mode 100644 index e10251b..0000000 --- a/test/unit/communities_block_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class CommunitiesBlockTest < ActiveSupport::TestCase - include PluginTestHelper - def setup - @person = create_person("My Name", "user@email.com", "123456", "123456", "Any State", "Some City") - - @software_info = create_software_info("Novo Software") - @software_info.community.add_member(@person) - - @community = create_community("Nova Comunidade") - @community.add_member(@person) - - - @comminities_block = CommunitiesBlock.new - @comminities_block.expects(:owner).at_least_once.returns(@person) - end - - def teardown - CommunitiesBlock.destroy_all - @person = nil - @community = nil - @software_info = nil - end - should "not have community of software or institution in block" do - assert_includes @comminities_block.profile_list, @community - assert_not_includes @comminities_block.profile_list, @software_info.community - end - -end diff --git a/test/unit/database_helper_test.rb b/test/unit/database_helper_test.rb deleted file mode 100644 index d7f2444..0000000 --- a/test/unit/database_helper_test.rb +++ /dev/null @@ -1,58 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class DatabaseHelperTest < ActiveSupport::TestCase - - def setup - dd1 = DatabaseDescription.create(:name => "Oracle") - dd2 = DatabaseDescription.create!(:name => "MySQL") - - @database_objects = [ - {:database_description_id => dd1.id.to_s ,:version => "2.0"}, - {:database_description_id => dd2.id.to_s ,:version => "2.1"} - ] - end - - def teardown - @database_objects = nil - SoftwareDatabase.destroy_all - DatabaseDescription.destroy_all - end - - should "return an empty list" do - empty_list = [] - assert_equal [], DatabaseHelper.list_database(empty_list) - end - - should "return a list with current database objects" do - list_compare = [] - db_tables = DatabaseHelper.list_database(@database_objects) - assert_equal list_compare.class, db_tables.class - end - - should "have same information from the list passed as parameter" do - list_compare = DatabaseHelper.list_database(@database_objects) - db_objects_id = @database_objects.first[:database_description_id] - assert_equal db_objects_id.to_i, list_compare.first.database_description_id - end - - should "return a list with the same size of the parameter" do - list_compare = DatabaseHelper.list_database(@database_objects) - assert_equal @database_objects.count, list_compare.count - end - - should "return false if list_database are empty or null" do - list_compare = [] - assert_equal false,DatabaseHelper.valid_list_database?(list_compare) - end - - should "remove invalid tables from the list" do - @database_objects.push({ - :database_description_id => "I'm not a valid id", - :version => "2.5" - }) - - database_objects_length = @database_objects.count - list_compare = DatabaseHelper.list_database(@database_objects) - assert_equal list_compare.count, database_objects_length-1 - end -end diff --git a/test/unit/database_validation_test.rb b/test/unit/database_validation_test.rb deleted file mode 100644 index 5466779..0000000 --- a/test/unit/database_validation_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class DatabaseValidationTest < ActiveSupport::TestCase - - def setup - @database_desc = DatabaseDescription.create(:name => "ABC") - @database = SoftwareDatabase.new - @database.database_description = @database_desc - @database.version = "MYSQL" - @database - end - - def teardown - @database = nil - DatabaseDescription.destroy_all - SoftwareDatabase.destroy_all - end - - should "Save database if all fields are filled" do - assert_equal true, @database.save - end - - should "not save database if database_description is empty" do - @database.database_description = nil - assert_equal true, !@database.save - end - - should "not save database if version are empty" do - @database.version = " " - assert_equal true, !@database.save - end - - should "not save database if version is too long" do - @database.version = "A too long version to be a valid version for database" - assert !@database.save - end -end diff --git a/test/unit/download_block_test.rb b/test/unit/download_block_test.rb deleted file mode 100644 index adfcdd3..0000000 --- a/test/unit/download_block_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class DownloadBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from Block' do - assert_kind_of Block, DownloadBlock.new - end - - should 'declare its default title' do - DownloadBlock.any_instance.stubs(:profile_count).returns(0) - assert_equal Block.new.default_title, DownloadBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, DownloadBlock.description - end - - should 'have software info to download it' do - - link1 = "gitlab.com/teste" - name1 = "Test Software" - - link2 = "gitlab.com/teste/2" - name2 = "Test Software2" - - block = DownloadBlock.create(:downloads => [{:name => name1, :link => link1}, {:name => name2, :link => link2}]) - - assert_equal block.downloads[0][:link], link1, "Link should not be empty" - assert_equal block.downloads[0][:name], name1, "Name should not be empty" - assert_equal block.downloads[1][:link], link2, "Link should not be empty" - assert_equal block.downloads[1][:name], name2, "Name should not be empty" - end -end diff --git a/test/unit/download_test.rb b/test/unit/download_test.rb deleted file mode 100644 index 4b301fd..0000000 --- a/test/unit/download_test.rb +++ /dev/null @@ -1,53 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class DownloadTest < ActiveSupport::TestCase - include PluginTestHelper - - def setup - @downloads_sample_data = [ - { - :name=>"Sample data A", - :link=>"http://some.url.com", - :software_description=>"all", - :minimum_requirements=>"none", - :size=>"10 mb", - :total_downloads=>0 - }, - { - :name=>"Sample data B", - :link=>"http://other.url", - :software_description=>"Linux", - :minimum_requirements=>"500 mb Ram", - :size=>"3 GB", - :total_downloads=>123 - } - ] - end - - should "Set as 0(zero) total_downloads if it is not given" do - without_total_downloads = Download.new({}) - with_total_downloads = Download.new(@downloads_sample_data.last) - - assert_equal 0, without_total_downloads.total_downloads - assert_equal @downloads_sample_data.last[:total_downloads], with_total_downloads.total_downloads - end - - should "Remove downloads without a name" do - @downloads_sample_data[1] = @downloads_sample_data[1].slice! :name - downloads = Download.validate_download_list @downloads_sample_data - - assert_equal 1, downloads.size - assert_equal @downloads_sample_data[0][:name], downloads[0][:name] - end - - should "Only set total_downloads if the value is integer" do - download = Download.new(@downloads_sample_data.last) - - download.total_downloads = "456" - assert_not_equal 456, download.total_downloads - - download.total_downloads = 456 - assert_equal 456, download.total_downloads - end -end diff --git a/test/unit/library_helper_test.rb b/test/unit/library_helper_test.rb deleted file mode 100644 index 28e58e3..0000000 --- a/test/unit/library_helper_test.rb +++ /dev/null @@ -1,53 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class LibraryHelperTest < ActiveSupport::TestCase - - def setup - @license_objects = [ - {"name" => "license1" ,"version" => "2.0", "license" => "debian", "software_id" => "1"}, - {"name" => "license2" ,"version" => "2.1", "license" => "debian", "software_id" => "1"}, - {"name" => "license3" ,"version" => "2.2", "license" => "debian", "software_id" => "1"}] - end - - def teardown - @license_objects = nil - end - - should "return an empty list" do - empty_list = [] - assert_equal [],LibraryHelper.list_library(empty_list) - end - - should "return a list with current library objects" do - list_compare = [] - lib_table = LibraryHelper.list_library(@license_objects) - assert_equal list_compare.class, lib_table.class - end - - should "have same information from the list passed as parameter" do - list_compare = LibraryHelper.list_library(@license_objects) - assert_equal @license_objects.first[:name], list_compare.first.name - end - - should "return a list with the same size of the parameter" do - list_compare = LibraryHelper.list_library(@license_objects) - assert_equal @license_objects.count, list_compare.count - end - - should "return false if list_database are empty or null" do - list_compare = [] - assert_equal true, LibraryHelper.valid_list_library?(list_compare) - end - - should "return a html text with license name equals to linux" do - libraries = [] - - library_description = Library.new - library_description.name = "Lib" - - libraries << library_description - lib_table = LibraryHelper.libraries_as_tables(libraries) - - assert_not_nil lib_table.first.call.index("lib") - end -end diff --git a/test/unit/library_validation_test.rb b/test/unit/library_validation_test.rb deleted file mode 100644 index f45cc9e..0000000 --- a/test/unit/library_validation_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class LibraryValidationTest < ActiveSupport::TestCase - - def setup - @library = Library.new - @library.name = "name" - @library.version = "version" - @library.license = "license" - end - - def teardown - @Libray = nil - end - - should "Save Libray if all fields are filled" do - assert @library.save - end - - should "Don't save Library of name are not filed" do - @library.name = "" - assert !@library.save - end - - should "Don't save Library of version are not filed" do - @library.version = "" - assert !@library.save - end - - should "Don't save Library of license are not filed" do - @library.license = "" - assert !@library.save - end - - should "Don't save Library if name is too long" do - @library.name = "A too long name to be a valid name for library" - assert !@library.save - end - - should "Don't save Library if version is too long" do - @library.version = "A too long version to be a valid version for library" - assert !@library.save - end - - should "Don't save Library if license is too long" do - @library.license = "A too long license to be a valid license for library" - assert !@library.save - end -end diff --git a/test/unit/operating_system_helper_test.rb b/test/unit/operating_system_helper_test.rb deleted file mode 100644 index 8b2e506..0000000 --- a/test/unit/operating_system_helper_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -OperatingSystemName.create(:name=>"Debina") -OperatingSystemName.create(:name=>"Fedora") -OperatingSystemName.create(:name=>"CentOS") - -class OperatingSystemHelperTest < ActiveSupport::TestCase - - def setup - @operating_system_objects = [ - {:operating_system_name_id => "1" ,:version => "2.0"}, - {:operating_system_name_id => "2" ,"version" => "2.1"}, - {:operating_system_name_id => "3" ,"version" => "2.2"} - ] - @operating_system_objects - end - - def teardown - @operating_system_objects = nil - end - - should "return an empty list" do - empty_list = [] - assert_equal [],OperatingSystemHelper.list_operating_system(empty_list) - end - - should "return a list with current OperatingSystems" do - list_compare = [] - list_op = OperatingSystemHelper.list_operating_system(@operating_system_objects) - assert_equal list_compare.class, list_op.class - end - - should "have same information from the list passed as parameter" do - list_compare = OperatingSystemHelper.list_operating_system(@operating_system_objects) - first_operating = @operating_system_objects.first[:operating_system_name_id] - assert_equal first_operating, list_compare.first.operating_system_name_id.to_s - end - - should "return a list with the same size of the parameter" do - list_compare = OperatingSystemHelper.list_operating_system(@operating_system_objects) - assert_equal @operating_system_objects.count, list_compare.count - end - - should "return false if list_operating_system are empty or null" do - list_compare = [] - assert_equal false,OperatingSystemHelper.valid_list_operating_system?(list_compare) - end - - should "return a html text with operating system" do - operating_systems = [] - - operating_system = OperatingSystemName.new - operating_system.name = "teste" - - software_operating_system = OperatingSystem.new - software_operating_system.version = 2 - software_operating_system.operating_system_name = operating_system - - operating_systems << software_operating_system - op_table = OperatingSystemHelper.operating_system_as_tables(operating_systems) - - assert_not_nil op_table.first.call.index(OperatingSystemName.first.name) - end -end diff --git a/test/unit/operating_system_validation_test.rb b/test/unit/operating_system_validation_test.rb deleted file mode 100644 index 1f4a42b..0000000 --- a/test/unit/operating_system_validation_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class OperatingSystemValidationTest < ActiveSupport::TestCase - - def setup - operating_system_name = OperatingSystemName::new :name=>"Linux" - @operating_system = OperatingSystem::new :version=>"3.0" - @operating_system.operating_system_name = operating_system_name - @operating_system - end - - def teardown - @operating_system.destroy - end - - should "save OperatingSystem if all fields are filled" do - assert_equal true, @operating_system.save - end - - should "not save if OperatingSystem does not have version" do - @operating_system.version = " " - assert_equal false, @operating_system.save - end - - should "not save if OperatingSystem does not have operating_system_name" do - @operating_system.operating_system_name = nil - assert_equal false, @operating_system.save - end - - should "not save if OperatingSystem have a version too long" do - @operating_system.version = "A too long version to be a valid" - assert_equal false, @operating_system.save - end -end diff --git a/test/unit/repository_block_test.rb b/test/unit/repository_block_test.rb deleted file mode 100644 index 2580e79..0000000 --- a/test/unit/repository_block_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class RepositoryBlockTest < ActiveSupport::TestCase - include PluginTestHelper - - should 'inherit from Block' do - assert_kind_of Block, RepositoryBlock.new - end - - should 'declare its default title' do - RepositoryBlock.any_instance.stubs(:profile_count).returns(0) - assert_equal Block.new.default_title, RepositoryBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, RepositoryBlock.description - end -end diff --git a/test/unit/search_catalog_block_test.rb b/test/unit/search_catalog_block_test.rb deleted file mode 100644 index 64376ef..0000000 --- a/test/unit/search_catalog_block_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class SearchCatalogBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from Block' do - assert_kind_of Block, SearchCatalogBlock.new - end - - should 'declare its default title' do - SearchCatalogBlock.any_instance.stubs(:profile_count).returns(0) - assert_equal Block.new.default_title, SearchCatalogBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal Block.description, SearchCatalogBlock.description - end - -end diff --git a/test/unit/search_helper_test.rb b/test/unit/search_helper_test.rb deleted file mode 100644 index f9a38f8..0000000 --- a/test/unit/search_helper_test.rb +++ /dev/null @@ -1,53 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../../lib/ext/search_helper.rb' - -class SearchHelperTest < ActiveSupport::TestCase - - include SearchHelper - - should "return communities list with relevance by nickname" do - communities_list = [] - communities_list << Community.create(:name => "Help One", :nickname => "need") - communities_list << Community.create(:name => "Need Two", :nickname => "help") - communities_list << Community.create(:name => "Help Three", :nickname => "need") - communities_list << Community.create(:name => "Need Four", :nickname => "help") - - relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.nickname] } - - assert_equal relevanced_list[0].nickname, "need" - assert_equal relevanced_list[1].nickname, "need" - assert_equal relevanced_list[2].nickname, "help" - assert_equal relevanced_list[3].nickname, "help" - end - - should "return communities list with relevance by name" do - communities_list = [] - communities_list << Community.create(:name => "Help One", :nickname => "need") - communities_list << Community.create(:name => "Need Two", :nickname => "help") - communities_list << Community.create(:name => "Help Three", :nickname => "need") - communities_list << Community.create(:name => "Need Four", :nickname => "help") - - relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.name] } - - assert relevanced_list[0].name.include?("Need") - assert relevanced_list[1].name.include?("Need") - assert relevanced_list[2].name.include?("Help") - assert relevanced_list[3].name.include?("Help") - end - - should "return communities list with relevance by nickname first and custom_header second" do - communities_list = [] - communities_list << Community.create(:name => "Help One", :nickname => "need", :custom_header => "help") - communities_list << Community.create(:name => "Need Two", :nickname => "help", :custom_header => "need") - communities_list << Community.create(:name => "Help Three", :nickname => "need", :custom_header => "help") - communities_list << Community.create(:name => "Need Four", :nickname => "help", :custom_header => "help") - - relevanced_list = sort_by_relevance(communities_list, "need") { |community| [community.custom_header, community.nickname] } - - assert relevanced_list[0].nickname.include?("need") - assert relevanced_list[1].nickname.include?("need") - assert relevanced_list[2].custom_header.include?("need") - assert relevanced_list[3].custom_header.include?("help") - end - -end diff --git a/test/unit/software_communities_person_test.rb b/test/unit/software_communities_person_test.rb deleted file mode 100644 index 3db9473..0000000 --- a/test/unit/software_communities_person_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# encoding: utf-8 - -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class GovUserPluginPersonTest < ActiveSupport::TestCase - include PluginTestHelper - - def setup - @plugin = SoftwareCommunitiesPlugin.new - - @user = fast_create(User) - @person = create_person( - "My Name", - "user@email.com", - "123456", - "123456", - "Any State", - "Some City" - ) - end - - def teardown - @plugin = nil - end - - should 'get a list of softwares of a person' do - software1 = create_software_info "noosfero" - software2 = create_software_info "colab" - community = create_community "simple_community" - - software1.community.add_member @person - software1.save! - community.add_member @person - community.save! - - assert_equal 1, @person.softwares.count - end -end diff --git a/test/unit/software_database_test.rb b/test/unit/software_database_test.rb deleted file mode 100644 index c73a359..0000000 --- a/test/unit/software_database_test.rb +++ /dev/null @@ -1,35 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareDatabaseTest < ActiveSupport::TestCase - def setup - DatabaseDescription.create!(name: "PostgreSQL") - @software_database = SoftwareDatabase.new( - :version => "1.0" - ) - @software_database.database_description_id = 1 - end - - def teardown - DatabaseDescription.destroy_all - SoftwareDatabase.destroy_all - end - - should "save if all informations of @software_database are filled" do - assert @software_database.save, "Database should have been saved" - end - - should "not save if database description id is empty" do - @software_database.database_description_id = nil - assert !@software_database.save, "Database description must be filled" - end - - should "not save if version is empty" do - @software_database.version = nil - assert !@software_database.save, "Version must be filled" - end - - should "not save if version has more than 20 characters" do - @software_database.version = "a"*21 - assert !@software_database.save, "Version must have until 20 characters" - end -end diff --git a/test/unit/software_helper_test.rb b/test/unit/software_helper_test.rb deleted file mode 100644 index cddadea..0000000 --- a/test/unit/software_helper_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareHelperTest < ActiveSupport::TestCase - - include SoftwareHelper - - should "Create ProgrammingLanguages based on file with languages names" do - ProgrammingLanguage.delete_all - PATH_TO_FILE = "plugins/software_communities/public/static/languages.txt" - - SoftwareHelper.create_list_with_file(PATH_TO_FILE, ProgrammingLanguage) - - list = File.open(PATH_TO_FILE, "r") - count = list.readlines.count - list.close - - assert(ProgrammingLanguage.count == count) - end - -end diff --git a/test/unit/software_info_test.rb b/test/unit/software_info_test.rb deleted file mode 100644 index 930436c..0000000 --- a/test/unit/software_info_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class SoftwareInfoValidationTest < ActiveSupport::TestCase - - include PluginTestHelper - - should "Return original license_info when license is not 'Another'" do - @software_info = create_software_info("software_test") - @license_info = create_license_info("license_test") - - @software_info.license_info = @license_info - @software_info.save! - - assert_equal @software_info.license_info, @license_info - end - - should "Return license_info with nil id when license is 'Another'" do - @software_info = create_software_info("software_test") - @license_another = create_license_info("Another") - - @software_info.license_info = @license_another - @software_info.save! - - assert_equal @software_info.license_info_id, @license_another.id - assert_equal @software_info.license_info.id, nil - end - - should "Return fake license_info when call method another_license" do - @software_info = create_software_info("software_test") - @license_another = create_license_info("Another") - - another_license_version = "Another Version" - another_license_link = "#another_link" - - @software_info.another_license(another_license_version, another_license_link) - - assert_equal @software_info.license_info_id, @license_another.id - assert_equal @software_info.license_info.id, nil - assert_equal @software_info.license_info.version, another_license_version - assert_equal @software_info.license_info.link, another_license_link - end - -end \ No newline at end of file diff --git a/test/unit/software_info_validation_test.rb b/test/unit/software_info_validation_test.rb deleted file mode 100644 index e42bf9b..0000000 --- a/test/unit/software_info_validation_test.rb +++ /dev/null @@ -1,121 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareInfoValidationTest < ActiveSupport::TestCase - - def setup - @community = fast_create( - Community, - :identifier => 'new-software', - :name => 'New Software' - ) - - @language = ProgrammingLanguage.new(:name => 'C++') - @language.save - @software_language = SoftwareLanguage.new( - :version => '1' - ) - @software_language.programming_language = @language - @software_language.save - - @database = DatabaseDescription.new(:name => 'Oracle') - @database.save - @software_database = SoftwareDatabase.new( - :version => '2' - ) - @software_database.database_description = @database - @software_database.save - - @operating_system_name = OperatingSystemName.new(:name => 'Debian') - @operating_system_name.save - @operating_system = OperatingSystem.new(:version => '1.0') - @operating_system.operating_system_name = @operating_system_name - @operating_system.save - - @software_info = SoftwareInfo.new( - :acronym => "SFTW", - :e_mag => true, - :icp_brasil => true, - :intern => true, - :e_ping => true, - :e_arq => true, - :operating_platform => true, - :objectives => "", - :features => "", - :finality => "something" - ) - @software_info.software_languages << @software_language - @software_info.software_databases << @software_database - @software_info.operating_systems << @operating_system - - @software_info.features = "Do a lot of things" - @software_info.objectives = "All tests should pass !" - end - - def teardown - ProgrammingLanguage.destroy_all - SoftwareLanguage.destroy_all - DatabaseDescription.destroy_all - SoftwareDatabase.destroy_all - OperatingSystem.destroy_all - OperatingSystemName.destroy_all - SoftwareInfo.destroy_all - end - - should 'Save SoftwareInfo if all fields are filled' do - assert_equal true, @software_info.save - end - - should 'Save SoftwareInfo if operating_platform is blank' do - @software_info.operating_platform = '' - assert_equal true, @software_info.save - end - - should 'Save SoftwareInfo without demonstration_url be filled' do - @software_info.demonstration_url = '' - assert_equal true, @software_info.save - end - - should "Save SoftwareInfo if acronym is blank" do - @software_info.acronym = "" - - assert_equal true, @software_info.save - end - - should "Not save SoftwareInfo if acronym has more than 8 characters" do - @software_info.acronym = "12345678901" - assert_equal false, @software_info.save - end - - should "Save SoftwareInfo if acronym has whitespaces" do - @software_info.acronym = "AC DC" - assert_equal false, @software_info.save - end - - should "Save if objectives are empty" do - @software_info.objectives = "" - - assert_equal true, @software_info.save - end - - should "Save if features are empty" do - @software_info.features = "" - - assert_equal true, @software_info.save - end - - should "Not save if features are longer than 4000" do - @software_info.features = "a"*4001 - error_msg = _("Features is too long (maximum is 4000 characters)") - - assert_equal false, @software_info.save - assert_equal true, @software_info.errors.full_messages.include?(error_msg) - end - - should "Not save if objectives are longer than 4000" do - @software_info.objectives = "a"*4001 - error_msg = _("Objectives is too long (maximum is 4000 characters)") - - assert_equal false, @software_info.save - assert_equal true, @software_info.errors.full_messages.include?(error_msg) - end -end diff --git a/test/unit/software_language_helper_test.rb b/test/unit/software_language_helper_test.rb deleted file mode 100644 index 9465f91..0000000 --- a/test/unit/software_language_helper_test.rb +++ /dev/null @@ -1,60 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareLanguageHelperTest < ActiveSupport::TestCase - - def setup - pl1 = ProgrammingLanguage.create(:name => "Python") - pl2 = ProgrammingLanguage.create(:name => "Java") - - @software_language_objects = [ - {:programming_language_id => pl1.id.to_s ,:version => "2.0"}, - {:programming_language_id => pl2.id.to_s ,:version => "2.1"}, - {:programming_language_id => pl1.id.to_s ,:version => "2.2"}] - @software_language_objects - end - - def teardown - @software_language_objects = nil - ProgrammingLanguage.destroy_all - end - - should "return an empty list" do - empty_list = [] - assert_equal [], SoftwareLanguageHelper.list_language(empty_list) - end - - should "return a list with current software language objects" do - list_compare = [] - softwares = SoftwareLanguageHelper.list_language(@software_language_objects) - assert_equal list_compare.class, softwares.class - end - - should "have same information from the list passed as parameter" do - list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) - lang_id = @software_language_objects.first[:programming_language_id].to_i - - assert_equal lang_id, list_compare.first.programming_language_id - end - - should "return a list with the same size of the parameter" do - list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) - assert_equal @software_language_objects.count, list_compare.count - end - - should "return false if list_language are empty or null" do - list_compare = [] - assert_equal false,SoftwareLanguageHelper.valid_list_language?(list_compare) - end - - should "remove invalid tables from the list" do - @software_language_objects.push({ - :programming_language_id => "I'm not a valid id", - :version => "2.0" - }) - - software_language_objects_length = @software_language_objects.count - list_compare = SoftwareLanguageHelper.list_language(@software_language_objects) - - assert_equal software_language_objects_length-1, list_compare.count - end -end diff --git a/test/unit/software_language_validation.rb b/test/unit/software_language_validation.rb deleted file mode 100644 index 8a1b21d..0000000 --- a/test/unit/software_language_validation.rb +++ /dev/null @@ -1,69 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareLanguageValidationTest < ActiveSupport::TestCase - def setup - create_programming_language - @software_info = create_software_info - @software_info.save - end - - def teardown - @software_info = nil - SoftwareInfo.destroy_all - end - - should "Save SoftwareLanguage if version and prog_language are filled" do - @software_language = create_software_language - assert_equal true, @software_language.save - end - - should "Don't save SoftwareLanguage if programming_language is not filed" do - @software_language = create_software_language - @software_language.programming_language = nil - assert_equal true, !@software_language.save - end - - should "Don't save SoftwareLanguage if version is not filed" do - @software_language = create_software_language - @software_language.version = "" - assert_equal true, !@software_language.save - end - - should "Don't save SoftwareLanguage if version is too long" do - @software_language = create_software_language - @software_language.version = "A too long version to be valid as a version" - assert_equal true, !@software_language.save - end - - private - - def create_software_language - software_language = SoftwareLanguage.new - software_language.software_info = @software_info - software_language.programming_language = ProgrammingLanguage.last - software_language.version = "version" - software_language - end - - def create_software_info - software_info = SoftwareInfo.new - software_info.community_id = fast_create(Community).id - software_info.community.name = 'Noosfero' - software_info.e_mag = true - software_info.icp_brasil = true - software_info.intern = true - software_info.e_ping = true - software_info.e_arq = true - software_info.operating_platform = 'GNU/Linux' - software_info.features = "Do a lot of things" - software_info.objectives = "All tests should pass !" - software_info - end - - def create_programming_language - ProgrammingLanguage.create(:name=>"C") - ProgrammingLanguage.create(:name=>"C++") - ProgrammingLanguage.create(:name=>"Ruby") - ProgrammingLanguage.create(:name=>"Python") - end -end diff --git a/test/unit/software_license_info_test.rb b/test/unit/software_license_info_test.rb deleted file mode 100644 index 81ab2ee..0000000 --- a/test/unit/software_license_info_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareDatabaseTest < ActiveSupport::TestCase - - should "save if all informations are filled" do - @software_license_info = LicenseInfo.create( - :version => "GPL", - :link => "www.gpl2.com" - ) - assert @software_license_info.save!, "License Info should have been saved" - end - - should "not save if license info version is empty" do - @software_license_info = LicenseInfo.create( - :version => "GPL", - :link => "www.gpl2.com" - ) - @software_license_info.version = nil - assert !@software_license_info.save, "Version can't be blank" - end - - should "save if link is empty" do - @software_license_info = LicenseInfo.create( - :version => "GPL", - :link => "www.gpl2.com") - @software_license_info.link = nil - assert @software_license_info.save, "License info should have been saved" - end -end diff --git a/test/unit/software_registration_test.rb b/test/unit/software_registration_test.rb deleted file mode 100644 index 397adf7..0000000 --- a/test/unit/software_registration_test.rb +++ /dev/null @@ -1,42 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' - -class SoftwareRegistrationTest < ActiveSupport::TestCase - - def setup - @environment = Environment.default - @environment.enable_plugin(SoftwareCommunitiesPlugin) - end - - def teardown - Community.destroy_all - SoftwareInfo.destroy_all - Task.destroy_all - end - - should 'include software registration task if is admin' do - person = create_user('molly').person - @environment.add_admin(person) - task = CreateSoftware.create!( - :name => "Teste One", - :requestor => person, - :environment => @environment - ) - assert_equal [task], Task.to(person).pending - end - - should 'create software when admin accept software create task' do - person = create_user('Pedro').person - @environment.add_admin(person) - task = CreateSoftware.create!( - :name => "Teste Two", - :requestor => person, - :environment => @environment, - :finality => "something" - ) - - software_count = SoftwareInfo.count - task.finish - - assert_equal software_count+1, SoftwareInfo.count - end -end diff --git a/test/unit/software_tab_data_block_test.rb b/test/unit/software_tab_data_block_test.rb deleted file mode 100644 index aad8c8c..0000000 --- a/test/unit/software_tab_data_block_test.rb +++ /dev/null @@ -1,66 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class SoftwareTabDataBlockTest < ActiveSupport::TestCase - include PluginTestHelper - - def setup - @software_info = create_software_info("A new Software") - @software_info.save! - - @soft_community = @software_info.community - - @soft_community.blogs << Blog.new(:name=>"First blog") - @soft_community.blogs << Blog.new(:name=>"Second blog") - @soft_community.save! - - SoftwareTabDataBlock.any_instance.stubs(:owner).returns(@soft_community) - end - - should "get its owner blogs" do - assert_equal @soft_community.blogs, SoftwareTabDataBlock.new.blogs - end - - should "actual_blog get the first blog if it is not defined" do - assert_equal @soft_community.blogs.first, SoftwareTabDataBlock.new.actual_blog - end - - should "actual_blog get the defined community blog" do - last_blog = @soft_community.blogs.last - soft_tab_data = create_software_tab_data_block(last_blog) - - assert_equal last_blog, soft_tab_data.actual_blog - end - - should "get the actual_blog posts" do - last_blog = @soft_community.blogs.last - soft_tab_data = create_software_tab_data_block(last_blog) - craete_sample_posts(last_blog, 2) - - assert_equal last_blog.posts.first.id, soft_tab_data.posts.first.id - assert_equal last_blog.posts.last.id, soft_tab_data.posts.last.id - end - - should "limit the number of posts" do - last_blog = @soft_community.blogs.last - soft_tab_data = create_software_tab_data_block(last_blog) - craete_sample_posts(last_blog, 6) - - assert_equal SoftwareTabDataBlock::TOTAL_POSTS_DYSPLAYED, soft_tab_data.posts.count - end - - private - - def create_software_tab_data_block blog - soft_tab_data = SoftwareTabDataBlock.new - soft_tab_data.displayed_blog = blog.id - soft_tab_data - end - - def craete_sample_posts blog, quantity=1 - quantity.times do |number| - TinyMceArticle.create! :name=>"Simple post #{number}", :body=>"Simple post #{number}", - :parent=> blog, :profile=>@soft_community - end - end -end diff --git a/test/unit/softwares_block_test.rb b/test/unit/softwares_block_test.rb deleted file mode 100644 index 44b5064..0000000 --- a/test/unit/softwares_block_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' - -class SoftwaresBlockTest < ActiveSupport::TestCase - include PluginTestHelper - should 'inherit from ProfileListBlock' do - assert_kind_of ProfileListBlock, SoftwaresBlock.new - end - - should 'declare its default title' do - SoftwaresBlock.any_instance.stubs(:profile_count).returns(0) - assert_not_equal ProfileListBlock.new.default_title, SoftwaresBlock.new.default_title - end - - should 'describe itself' do - assert_not_equal ProfileListBlock.description, SoftwaresBlock.description - end - - should 'give empty footer on unsupported owner type' do - block = SoftwaresBlock.new - block.expects(:owner).returns(1) - assert_equal '', block.footer - end - - should 'list softwares' do - user = create_person("Jose_Augusto", - "jose_augusto@email.com", - "aaaaaaa", - "aaaaaaa", - "DF", - "Gama" - ) - - software_info = create_software_info("new software") - software_info.community.add_member(user) - - block = SoftwaresBlock.new - block.expects(:owner).at_least_once.returns(user) - - assert_equivalent [software_info.community], block.profiles - end - -end diff --git a/views/_main_software_editor_extras.html.erb b/views/_main_software_editor_extras.html.erb deleted file mode 100644 index 942256d..0000000 --- a/views/_main_software_editor_extras.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -

    <%= _('Software Information') %>

    - -<%= label_tag("name", _('Name'), {:class => 'formlabel'}) %> - -
    - <%= context.profile.environment.default_hostname %>/ - <%= text_field_tag(:name, context.profile.software_info.community.name) %> -
    - -

    <%= _("Finality") %>

    -
    - <%= text_field_tag(:finality, context.profile.software_info.finality) %> -
    - -

    <%= _("Licenses") %>

    -
    - <%= select_tag(:id, options_for_select(LicenseHelper.getListLicenses.collect{|l| [l.version, l.id]}, :selected => context.profile.software_info.license_info.id), :onchange => "get_license_link('version')") %> -
    - -

    <%= _("License link") %>

    - <% LicenseHelper.getListLicenses.each do | license | %> - - <% end %> - - <%= context.profile.software_info.license_info.link %> -
    - -
    - <%= label_tag "repository_url", _("Link to Repository: ") %> - <%= text_field_tag(:reository_url) %> -
    - diff --git a/views/blocks/_software_tab_blog.html.erb b/views/blocks/_software_tab_blog.html.erb deleted file mode 100644 index ec1f867..0000000 --- a/views/blocks/_software_tab_blog.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -
    -
    - <% if block.posts.empty? %> -
    - <%= _("This community has no posts in its blog") %> -
    - <% else %> -
    - <%= list_posts(block.posts, format: "short+pic", paginate: false) %> -
    - -
    - <%= link_to _("Read more"), block.actual_blog.url %> -
    - <% end %> -
    -
    diff --git a/views/blocks/categories_and_tags.html.erb b/views/blocks/categories_and_tags.html.erb deleted file mode 100644 index 507ddbf..0000000 --- a/views/blocks/categories_and_tags.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% if block.owner.categories.count > 0 %> -

    <%= _("Categories:") %>

    - -
    - <% block.owner.categories.each do |category| %> - <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> - <% end %> -
    -<% end %> - -<% if block.owner.tag_list.count > 0 %> -

    <%= _("Tags") %>

    - -
    - <% block.owner.tag_list.each do |tag| %> - <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%> - <% end %> -
    -<% end %> \ No newline at end of file diff --git a/views/blocks/categories_software.html.erb b/views/blocks/categories_software.html.erb deleted file mode 100644 index 6e914de..0000000 --- a/views/blocks/categories_software.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
    -
    - -

    <%= _("See more Software") %>

    -
    - -
    -

    <%= _("Categories:") %>

    -
      - - <% categories.each do |category| %> - <% unless category.software_infos.count < 1 %> -
    • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %>
    • - <% end %> - <% end %> -
    -
    - - -
    diff --git a/views/blocks/download.html.erb b/views/blocks/download.html.erb deleted file mode 100644 index ffab889..0000000 --- a/views/blocks/download.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<% if block.owner.software_info.nil? %> - <%= _("This community needs a software to use this block") %> -<% else %> -

    <%= _("Download #{block.owner.software_info.community.name}") %>

    -
      - <% block.downloads.each_with_index do |download, index| %> -
    • -
      - <%= link_to :controller => 'software_communities_plugin_profile', :action=> 'download_file', :block=>block.id, :download_index=> index , title: _("Download the software") do %> - - <%= download[:size] %> - <% end %> -
      -
      - <%= _("#{download[:name]}") %> - <%= _("Platform:#{download[:software_description]}") %> - <%= link_to _("Minimum Requirements"), download[:minimum_requirements] %> -
      -
    • - <% end %> -
    -
    - <%= link_to _("License: #{block.owner.software_info.license_info.version}"), block.owner.software_info.license_info.link %> -
    -<% end %> diff --git a/views/blocks/main_area_softwares.html.erb b/views/blocks/main_area_softwares.html.erb deleted file mode 100644 index 155a021..0000000 --- a/views/blocks/main_area_softwares.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= block_title(block.title) %> -<% profiles.each do |profile| %> - <%= link_to profile.url do %> -
    -
    - - -
    -
    -

    <%=profile.name%>

    -
    -
    <%= profile.description %>
    -
    -
    - -
    -

    - <%= profile.software_info.finality %> -

    - - <%= _("See More") %> -
    -
    - <% end %> -<% end %> diff --git a/views/blocks/repository.html.erb b/views/blocks/repository.html.erb deleted file mode 100644 index dd9817d..0000000 --- a/views/blocks/repository.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if block.owner.software_info.nil? %> - <%= _("This community needs a software to use this block") %> -<% else %> - <%= link_to _("Repository") , block.owner.software_info.repository_link, :id => "bt_repositorio", :target => "_blank" %> -<% end %> diff --git a/views/blocks/search_catalog.html.erb b/views/blocks/search_catalog.html.erb deleted file mode 100644 index 2ea3ffc..0000000 --- a/views/blocks/search_catalog.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/views/blocks/software_highlights.html.erb b/views/blocks/software_highlights.html.erb deleted file mode 100644 index fc1e650..0000000 --- a/views/blocks/software_highlights.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<%= render :file => 'blocks/highlights.html.erb', :locals => { :block => block } %> - - - -mais informações - -? - - diff --git a/views/blocks/software_information.html.erb b/views/blocks/software_information.html.erb deleted file mode 100644 index dd82bea..0000000 --- a/views/blocks/software_information.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -
    - -<% if block.owner.software_info.nil? %> - <%= _("This community needs a software to use this block") %> -<% else %> - - - - - -
    -
    -
    - - <%= link_to profile_image(block.owner, :big) +"\n", profile.url %> - - -
    -
    -
    -

    - <%= _("#{block.owner.software_info.acronym} - ") unless block.owner.software_info.acronym.blank? %> - <%= _("#{block.owner.name}") %> -

    - - <%= block.owner.software_info.finality %> - - - <%= @plugins.dispatch(:display_organization_average_rating, block.owner).collect { |content| instance_exec(&content) }.join("") %> -
    -<% end %> -
    diff --git a/views/blocks/software_statistics.html.erb b/views/blocks/software_statistics.html.erb deleted file mode 100644 index b9f1cd1..0000000 --- a/views/blocks/software_statistics.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -
    -
      -
    • - - - <%= pluralize(profile.hits, 'visita', 'visitas') %> - -
    • -
    • - - - <%= pluralize(total_downloads, 'download', 'downloads') %> - -
    • -
    • - - - <%= block.benefited_people.to_s + _(' benefited people*') %> - -
    • -
    • - - - - <%= number_to_currency(block.saved_resources, unit: 'R$ ', - separator: ',', delimiter: '.') %> - - <%= _(' saved resources*') %> - -
    • -
    - -
    - * <%= _("Data estimated by the software administrator.") %> -
    -
    diff --git a/views/blocks/software_tab_data.html.erb b/views/blocks/software_tab_data.html.erb deleted file mode 100644 index 3b0a1ce..0000000 --- a/views/blocks/software_tab_data.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% if block.owner.software_info.nil? %> - <%= _("This community needs a software to use this block") %> -<% else %> -
    - <% tabs = [] %> - <% tabs << {:title => _("Discussions"), :id => 'discussions-tab', :content => ""} %> - <% tabs << {:title => _("Blog"), :id => 'blog-tab', :content => (render partial: "blocks/software_tab_blog", :locals => {block: block})} %> - <% tabs << {:title => _("Repository Feed"), :id => 'repository-feed-tab', :content => ""} %> - - <%= render_tabs(tabs) %> -
    -<% end %> - diff --git a/views/blocks/wiki.html.erb b/views/blocks/wiki.html.erb deleted file mode 100644 index 24cda6f..0000000 --- a/views/blocks/wiki.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% if block.owner.software_info.nil? %> - <%= _("This community needs a software to use this block") %> -<% else %> - <%= link_to _("Wiki") , block.wiki_link, :id => "bt_wiki", :target => "_blank" %> -<% end %> - diff --git a/views/box_organizer/_download_block.html.erb b/views/box_organizer/_download_block.html.erb deleted file mode 100644 index 6a621ec..0000000 --- a/views/box_organizer/_download_block.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -
    - - -
    - <% @block.downloads.each do |download| %> - <%= render :partial => 'download_list', :locals => {:download => download} %> - <% end %> -
    - - <%= link_to_function _('New link'), 'softwareDownload.addNewDonwload(); return false', :class => 'button icon-add with-text download-new-link-button' %> -
    diff --git a/views/box_organizer/_download_list.html.erb b/views/box_organizer/_download_list.html.erb deleted file mode 100644 index 1cbd524..0000000 --- a/views/box_organizer/_download_list.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
  • -
      -
    • <%= text_field_tag('block[downloads][][name]', download[:name], :class => "block_download_name") %>
    • -
    • <%= text_field_tag('block[downloads][][link]', download[:link], :class => "block_download_link") %>
    • -
    • <%= text_field_tag('block[downloads][][software_description]', download[:software_description], :class => "block_download_software_description") %>
    • -
    • <%= text_field_tag('block[downloads][][minimum_requirements]', download[:minimum_requirements], :class => "block_download_minimum_requirements") %>
    • -
    • <%= text_field_tag('block[downloads][][size]', download[:size], :class => "block_download_size") %>
    • -
    • <%= button_without_text(:delete, _('Delete'), "#" , { :onclick => 'softwareDownload.deleteDownload(this); return false', :class=>"delete-link-list-row" }) %>
    • -
    -
  • diff --git a/views/box_organizer/_download_list_template.html.erb b/views/box_organizer/_download_list_template.html.erb deleted file mode 100644 index eb9e4cf..0000000 --- a/views/box_organizer/_download_list_template.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
  • -
      -
    • <%= text_field_tag('block[downloads][][name]', '', :class => "block_download_name") %>
    • -
    • <%= text_field_tag('block[downloads][][link]', '', :class => "block_download_link") %>
    • -
    • <%= text_field_tag('block[downloads][][software_description]', '', :class => "block_download_software_description") %>
    • -
    • <%= text_field_tag('block[downloads][][minimum_requirements]', '', :class => "block_download_minimum_requirements") %>
    • -
    • <%= text_field_tag('block[downloads][][size]', '', :class => "block_download_size") %>
    • -
    • <%= button_without_text(:delete, _('Delete'), "#" , { :onclick => 'softwareDownload.deleteDownload(this); return false', :class=>"delete-link-list-row" }) %>
    • -
    -
  • diff --git a/views/box_organizer/_software_tab_data_block.html.erb b/views/box_organizer/_software_tab_data_block.html.erb deleted file mode 100644 index a4d5147..0000000 --- a/views/box_organizer/_software_tab_data_block.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -
    - -<% if not @block.blogs.empty? %> - - -
    - - <%= select_tag 'block[displayed_blog]', options_from_collection_for_select(@block.blogs, :id, :name, @block.actual_blog.id) %> -<% else %> -
    -

    <%= _("This community has no blogs") %>

    -
    -<% end %> diff --git a/views/box_organizer/_softwares_block.html.erb b/views/box_organizer/_softwares_block.html.erb deleted file mode 100644 index 2a54c32..0000000 --- a/views/box_organizer/_softwares_block.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -
    - <%= labelled_form_field _('Limit of items'), text_field(:block, :limit, :size => 3) %> - <%= labelled_form_field _('Software Type:'), select_tag('block[software_type]', options_for_select(["Public", "Generic", "All"], @block.software_type) )%> -
    diff --git a/views/box_organizer/_statistic_block.html.erb b/views/box_organizer/_statistic_block.html.erb deleted file mode 100644 index 48037c8..0000000 --- a/views/box_organizer/_statistic_block.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
    - <% suggestion_benefited_people = @block.owner.organization_ratings.collect{ |r| r.people_benefited.to_f }.inject(:+) || 0.0 %> - <% suggestion_saved_resources = @block.owner.organization_ratings.collect{ |r| r.saved_value.to_f }.inject(:+) || 0.0 %> - - <%= labelled_form_field _('Benefited People'), text_field(:block, :benefited_people) %> -

    <%= _("Portal suggested value: ") %> <%= "%d" % (suggestion_benefited_people) %>

    - <%= labelled_form_field _('Saved Resources'), text_field(:block, :saved_resources) %> -

    <%= _("Portal suggested value: ") %> <%= "R$%.2f" % (suggestion_saved_resources) %>

    -
    - diff --git a/views/box_organizer/_wiki_block.html.erb b/views/box_organizer/_wiki_block.html.erb deleted file mode 100644 index 489b85d..0000000 --- a/views/box_organizer/_wiki_block.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
    - - -
    - <%= text_field_tag "block[wiki_link]", value=@block.wiki_link %> -
    -
    - diff --git a/views/comments_extra_fields.html.erb b/views/comments_extra_fields.html.erb deleted file mode 100644 index f50992a..0000000 --- a/views/comments_extra_fields.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -
    - - <%= _("Additional informations") %> - - - -
    - -
    -
    - <%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> - - <%= text_field_tag "organization_rating[people_benefited]", "" %> -
    - -
    - <%= label_tag "comments_saved_value", _("Saved resources")%> - - <%= text_field_tag "organization_rating[saved_value]", "", :placeholder=>"R$"%> -
    -
    diff --git a/views/environment_design b/views/environment_design deleted file mode 120000 index a75d184..0000000 --- a/views/environment_design +++ /dev/null @@ -1 +0,0 @@ -box_organizer \ No newline at end of file diff --git a/views/organization_ratings_extra_fields_show_data.html.erb b/views/organization_ratings_extra_fields_show_data.html.erb deleted file mode 100644 index 0e57615..0000000 --- a/views/organization_ratings_extra_fields_show_data.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
    -
    - <%=_("Benefited People")%> : <%= user_rating.people_benefited unless user_rating.nil? %> -
    - -
    - <%=_("Saved Resources")%> : <%= user_rating.saved_value unless user_rating.nil? %> -
    -
    - diff --git a/views/profile/_profile_members_list.html.erb b/views/profile/_profile_members_list.html.erb deleted file mode 100644 index 0e6c700..0000000 --- a/views/profile/_profile_members_list.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -
    - <%= label_tag("sort-#{role}", _("Sort by:")) %> - <%= select_tag("sort-#{role}", - options_for_select([ - [_("Name A-Z"), 'asc'], - [_("Name Z-A"), 'desc'], - ], :selected=>params[:sort]) - ) %> -
    -
      - <% users.each do |u| %> - <%= profile_image_link(u) %> - <% end %> -
    diff --git a/views/profile/_software_tab.html.erb b/views/profile/_software_tab.html.erb deleted file mode 100644 index 805c656..0000000 --- a/views/profile/_software_tab.html.erb +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - <%= display_mpog_field(_('Name:'), profile, :name, true) %> - <%= content_tag('tr', content_tag('td', _("Adherent to e_mag:")) + content_tag('td', profile.software_info.e_mag ? _("Yes") : _("No"))) %> - <%= content_tag('tr', content_tag('td', _("Adherent to icp_brasil:")) + content_tag('td', profile.software_info.icp_brasil ? _("Yes") : _("No"))) %> - <%= content_tag('tr', content_tag('td', _("Adherent to e_ping:")) + content_tag('td', profile.software_info.e_ping ? _("Yes") : _("No"))) %> - <%= content_tag('tr', content_tag('td', _("Adherent to e_arq:")) + content_tag('td', profile.software_info.e_arq ? _("Yes") : _("No"))) %> - <%= content_tag('tr', content_tag('td', _("Internacionalizable:")) + content_tag('td', profile.software_info.intern ? _("Yes") : _("No"))) %> - <%= display_mpog_field(_('Operating Platform:'), profile.software_info, :operating_platform, true) %> - <%= display_mpog_field(_('Demonstration URL:'), profile.software_info, :demonstration_url, true) %> - <%= display_mpog_field(_('Short Name:'), profile.software_info, :acronym, true) %> - <%= display_mpog_field(_('Objectives:'), profile.software_info, :objectives, true) %> - <%= display_mpog_field(_('Features:'), profile.software_info, :features, true) %> - - <%= content_tag('tr', content_tag('td', _("License"))) %> - <%= display_mpog_field(_('Version:'), profile.software_info.license_info, :version, true) %> - <%= display_mpog_field(_('Link:'), profile.software_info.license_info, :link, true) %> -
    <%= _('Software Information')%>
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    <%= _('Show Libraries') %> - <%= _('Hide Libraries') %> -
    - - - - - - - - - - - -
    <%= _("Libraries") %>
    - <% libraries = profile.software_info.libraries %> - <% LibraryHelper.libraries_as_tables(libraries, true).each do |tab| %> - <%= tab.call %> - <%end%> -
    -
    <%= _('Show Database') %> - <%= _('Hide Database') %> -
    - - - - - - - - - - - -
    <%= _("Software Databases") %>
    - <% databases = profile.software_info.software_databases %> - <% DatabaseHelper.database_as_tables(databases, true).each do |tab| %> - <%= tab.call %> - <%end%> -
    -
    <%= _('Show Languages') %> - <%= _('Hide Languages') %> -
    - - - - - - - - - - - -
    <%= _("Software Languages") %>
    - <% languages = profile.software_info.software_languages %> - <% SoftwareLanguageHelper.language_as_tables(languages, true).each do |tab| %> - <%= tab.call %> - <%end%> -
    -
    <%= _('Show Operating Systems') %> - <%= _('Hide Operating Systems') %> -
    - - - - - - - - - - - -
    <%= _("Operating System") %>
    - <% operating_systems = profile.software_info.operating_systems %> - <% OperatingSystemHelper.operating_system_as_tables(operating_systems, true).each do |tab| %> - <%= tab.call %> - <%end%> -
    -
    diff --git a/views/profile/index.html.erb b/views/profile/index.html.erb deleted file mode 100644 index 6e2d6c2..0000000 --- a/views/profile/index.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -

    <%= h profile.name %>

    - -<% if @action %> - <%= render :partial => 'private_profile' %> -<% else %> - <% unless profile.description.blank? %> -
    - <%= profile.description %> -
    - <% end %> -<% end %> - -
    - <%= render "blocks/profile_info_actions/join_leave_community" if profile.class == "Community" %> - <% if !user.nil? && user.has_permission?('edit_profile', profile) %> -
    - <%= button :control_panel, _('Control Panel'), profile.admin_url %> -
    - <% end %> -
    - -<% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %> - - -
    -<% end %> diff --git a/views/profile/members.html.erb b/views/profile/members.html.erb deleted file mode 100644 index 2b1280b..0000000 --- a/views/profile/members.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -
    - -
    -

    <%= _("Members (%d)") % @profile_members.total_entries %>

    -

    <%= profile.name %>

    - <%= render "blocks/profile_info_actions/community" %> -
    - -<% cache_timeout(profile.members_cache_key(params), 4.hours) do %> -
    - <% tabs = [] %> - - <% div_members = content_tag :div, :class => "profile-members" do - render :partial => 'profile_members_list', - :locals => { - :users => @profile_members, - :role => "members" - } - end %> - - <% tabs << {:title => _("%d Members") % @profile_members.total_entries, - :id => "members-tab", - :content => div_members - } %> - - <% div_admins = content_tag :div, :class => "profile-admins" do - render :partial => 'profile_members_list', - :locals => { - :users => @profile_admins, - :role => "admins" - } - end %> - - <% tabs << {:title => _("%d Administrators") % @profile_admins.total_entries, - :id => "admins-tab", - :content => div_admins - } %> - - <%= render_tabs(tabs) %> -
    -<% end %> - -<% button_bar do %> - <%= button :back, _('Go back'), { :controller => 'profile' } %> - <% if profile.community? and user %> - <% if user.has_permission?(:invite_members, profile) %> - <%= button :person, _('Invite people to join'), :controller => 'invite', :action => 'invite_friends' %> - <% end %> - <% if user.has_permission?(:send_mail_to_members, profile) %> - <%= button :send, _('Send e-mail to members'), :controller => 'profile', :action => 'send_mail' %> - <% end %> - <% end %> -<% end %> - -<%= hidden_field_tag "profile_url", @profile_members_url %> -
    - -<%= javascript_include_tag "members_page.js" %> diff --git a/views/profile_design b/views/profile_design deleted file mode 120000 index a75d184..0000000 --- a/views/profile_design +++ /dev/null @@ -1 +0,0 @@ -box_organizer \ No newline at end of file diff --git a/views/profile_editor/_first_edit_software_community_extras.html.erb b/views/profile_editor/_first_edit_software_community_extras.html.erb deleted file mode 100644 index 86ed273..0000000 --- a/views/profile_editor/_first_edit_software_community_extras.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
    -
    > -

    <%= _("Step 1 - Software Creation")%>

    -
    - -
    > -

    <%= _("Step 2 - Community Settings")%>

    -
    -
    diff --git a/views/profile_editor/_software_community.html.erb b/views/profile_editor/_software_community.html.erb deleted file mode 100644 index f4d0281..0000000 --- a/views/profile_editor/_software_community.html.erb +++ /dev/null @@ -1,70 +0,0 @@ -

    <%= _('General information') %>

    - - <%= required_fields_message %> - - <%= @plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }.join("") %> - -<% if @environment.enabled?('enable_organization_url_change') %> - -<% end %> - -<% if @environment.enabled?('enable_organization_url_change') %> - - - <%= hidden_field_tag 'old_profile_identifier', @profile.identifier %> -
    - <%= required labelled_form_field( _('Address'), - content_tag('code', - url_for(profile.url).gsub(/#{profile.identifier}$/, '') + - text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25) - ) + - content_tag('div', - content_tag('strong', _('WARNING!')) + ' ' + - _("You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?") + - content_tag('div', - button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' + - button_to_function(:cancel, _('No'), 'no_change()') - ), - :id => 'identifier-change-confirmation', - :class => 'change-confirmation', - :style => 'display: none;' - ) - ) - %> -
    -<% end %> - -<%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile } %> - -<%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %> - -<%= render :partial => 'moderation', :locals => { :profile => @profile } %> - -<% if profile.enterprise? && profile.environment.enabled?('products_for_enterprises') %> -

    <%=_('Products/Services catalog')%>

    - <%= labelled_form_field(_('Number of products/services displayed per page on catalog'), text_field(:profile_data, :products_per_catalog_page, :size => 3)) %> -<% end %> diff --git a/views/profile_editor/edit_software_community.html.erb b/views/profile_editor/edit_software_community.html.erb deleted file mode 100644 index 5c181b8..0000000 --- a/views/profile_editor/edit_software_community.html.erb +++ /dev/null @@ -1,90 +0,0 @@ - -<%= render :partial => 'first_edit_software_community_extras', :locals => {:class_step_one => "another-step", :class_step_two => "current-step"} if @first_edit %> - -

    <%= _('Configure Software Community') %>

    - -
    - - <%= _('Set the basic settings of the software associated community') %> - -
    - -<%= error_messages_for :profile_data %> - -<%= labelled_form_for :profile_data, :html => { :id => 'profile-data', :multipart => true } do |f| %> - - <% if environment.admins.include?(user) %> -
    - <%= labelled_check_box(_('This profile is a template'), 'profile_data[is_template]', true, @profile.is_template) %> -
    - <% end %> - - <%= render :partial => 'software_community', :locals => { :f => f } %> - -

    <%= _('Privacy options') %>

    - - <% if profile.person? %> -
    - <%= labelled_radio_button _('Public — show my contents to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> -
    -
    - <%= labelled_radio_button _('Private — show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %> -
    - <% else %> -
    - <%= labelled_check_box _("Secret — hide the community and all its contents for non members and other people can't join this community unless they are invited to."), 'profile_data[secret]', true, profile.secret, :class => "profile-secret-box" %> -
    -
    - <%= labelled_radio_button _('Public — show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> -
    -
    - <%= labelled_radio_button _('Private — show content of this group only to members'), 'profile_data[public_profile]', false, !@profile.public_profile? %> -
    - <% end %> - - <% if environment.enabled?('allow_change_of_redirection_after_login') %> -

    <%= _('Page to redirect after login') %>

    - <%= select 'profile_data', 'redirection_after_login', Environment.login_redirection_options.map{|key,value|[value,key]}, { :selected => @profile.preferred_login_redirection} %> - <% end %> - -

    <%= _('Translations') %>

    - <%= labelled_check_box( - _('Automaticaly redirect the visitor to the article translated to his/her language'), - 'profile_data[redirect_l10n]', true, @profile.redirect_l10n - )%> - -

    <%= _('Suggestions') %>

    - <%= labelled_check_box( - _('Send me relationship suggestions by email'), - 'profile_data[email_suggestions]', true, @profile.email_suggestions - )%> - - <%= - @plugins.dispatch(:profile_editor_extras).map do |content| - content.kind_of?(Proc) ? self.instance_exec(&content) : content - end.join("\n") - %> - - <%= select_categories(:profile_data, _('Software Categories'), 2) %> - - <% button_bar do %> - <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> - - <% unless @first_edit %> - <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> - <% end %> - <% end %> - - <% if user && user.has_permission?('destroy_profile', profile) && !@first_edit %> - <% button_bar(:id => 'delete-profile') do %> - <%= button(:remove, _('Delete software and community'), {:action => :destroy_profile}) %> - <% if environment.admins.include?(current_person) %> - <% if profile.visible? %> - <%= button(:remove, _('Deactivate software and community'), {:action => :deactivate_profile, :id=>profile.id}, :id=>'deactivate_profile_button', :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %> - <% else %> - <%= button(:add, _('Activate software and community'), {:action => :activate_profile, :id=>profile.id}, :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %> - <% end %> - <% end %> - <% end %> - <% end %> -<% end %> diff --git a/views/search/_catalog_filter.html.erb b/views/search/_catalog_filter.html.erb deleted file mode 100644 index e6a9dd7..0000000 --- a/views/search/_catalog_filter.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
    - -
    -

    <%= _("Categories") %>

    -
    -
      - <% @categories.each do |category| %> -
    • - <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> - <%= _("#{category.name}") %> -
    • - <% end %> -
    -
    -
    -
    <%= _("More options") %>
    -
    - <%= button_tag _("Clean up"), :id => "cleanup-filter-catalg", :type => "button" %> - <%= button_tag _("Close"), :id => "close-filter-catalog", :type => "button" %> -
    diff --git a/views/search/_catalog_result_list.html.erb b/views/search/_catalog_result_list.html.erb deleted file mode 100644 index 976a13d..0000000 --- a/views/search/_catalog_result_list.html.erb +++ /dev/null @@ -1,51 +0,0 @@ -
    - <% @assets.each do |name| %> - <% search = @searches[name] %> - - - - <% if !search[:results].blank? %> - - <% if multiple_search?(@searches) %> -

    <%= @names[name] %>

    - <% if search[:results].total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %> - <%= link_to(_("see all (%d)") % search[:results].total_entries, params.merge(:action => name), :class => 'see-more' ) %> - <% end %> - <% end %> - - <% display = display_filter(name, params[:display]) %> - -
    -
      - <% search[:results].each do |hit| %> - <% partial = partial_for_class(hit.class, display) %> - <% variable_name = partial.gsub("#{display}_", '').to_sym %> - <%= render :partial => partial, :locals => {variable_name => hit} %> - <% end %> -
    -
    - <% else %> - <% if multiple_search? %> -

    <%= @names[name] %>

    - <% end %> - -
    - - - - - -
    - <% @selected_categories.each do |category| %> -
    - <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %> - <% end %> -
    - - <% end %> - <% end %> - -
    - - <%= add_zoom_to_images %> -
    diff --git a/views/search/_full_community.html.erb b/views/search/_full_community.html.erb deleted file mode 100644 index 23e2b14..0000000 --- a/views/search/_full_community.html.erb +++ /dev/null @@ -1,53 +0,0 @@ -<% software = community.software_info %> -
  • -
    - <%= profile_image_link community, :portrait, 'div', community.send(@order + '_label') + show_date(community.created_at) %> -
    - -
    - -
    - - <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %> -

    - <%= link_to_homepage(link_name, community.identifier) %> -

    -
    - - <% body_stripped = strip_tags(software.finality) %> - <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %> - -
    - -
    - -
    - - - <%= _("Software Categories") %>: - - - - <% if !community.categories.empty? %> -
      - <% community.categories.each do |category| %> -
    • - <%= link_to _("#{category.name}"), { - :controller => :search, - :action => :software_infos, - :selected_categories_id => [category.id], - :software_type => params[:software_type] - } %> -
    • - <% end %> -
    - <% else %> - - <%= _("This software doesn't have categories") %> - - <% end %> -
    -
    - -
    -
  • diff --git a/views/search/_software_search_form.html.erb b/views/search/_software_search_form.html.erb deleted file mode 100644 index f400c66..0000000 --- a/views/search/_software_search_form.html.erb +++ /dev/null @@ -1,67 +0,0 @@ -
    -
    -

    <%= _("Search Public Software Catalog") %>

    - - <%= form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.path : nil ) }, - :method => 'get') do %> - -
    -
    - - <%= hidden_field_tag :display, params[:display] %> - <%= hidden_field_tag :filter, params[:filter] %> - - <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> - ? - - - <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> - ? - - -
    - - <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50, :placeholder=>_("Type words about the software you're looking for (the search begins after 3 characters)") %> - - - <%= submit_button(:search, _('Filter')) %> -
    - <%= render :partial => 'search_form_extra_fields' %> - <%= render :partial => 'catalog_filter' %> - <% end %> -
    - -
    -
    - <%= "#{@software_count} Software(s)" %> -
    - -
    -
    - Show: - <%= select_tag("software_display", - options_for_select(['15', '30', '90', 'All'], :selected=>params[:display]) - ) %> -
    - -
    - Sort by: - <%= select_tag("sort", - options_for_select( - [ - [_("Name A-Z"), 'asc'], - [_("Name Z-A"), 'desc'], - [_("Relevance"), 'relevance'] - ], :selected=>params[:sort]) - ) %> -
    -
    -
    -
    - -<% if @empty_query %> - <% hint = environment.search_hints[@asset] %> - <% if hint and !hint.blank? %> -
    <%= hint %>
    - <% end %> -<% end %> diff --git a/views/search/software_infos.html.erb b/views/search/software_infos.html.erb deleted file mode 100644 index c68f6fc..0000000 --- a/views/search/software_infos.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -

    Catálogo de Software Público

    - -
    - <%= search_page_title( @titles[@asset], @category ) %> - - <%= render :partial => 'software_search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> - - <% if @asset == :product %> - <%= javascript_tag do %> - jQuery('.search-product-price-details').altBeautify(); - <% end %> - <% end %> -
    - -<%= render partial:"catalog_result_list" %> - -
    - <% if params[:display] != 'map' %> - <%= pagination_links @searches[@asset][:results] %> - <% end %> -
    diff --git a/views/software_communities_plugin_myprofile/_database_fields.html.erb b/views/software_communities_plugin_myprofile/_database_fields.html.erb deleted file mode 100644 index e0b994e..0000000 --- a/views/software_communities_plugin_myprofile/_database_fields.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= fields_for :database_description, @database_description do |db| %> - -
    - <% database = [] if database.blank? %> - <% DatabaseHelper.database_as_tables(database).each do |tab| %> - <%= tab.call %> - <%end%> -
    - - -<%= link_to _('New Database'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-databases"%> -<% end %> diff --git a/views/software_communities_plugin_myprofile/_language_fields.html.erb b/views/software_communities_plugin_myprofile/_language_fields.html.erb deleted file mode 100644 index a7d31a1..0000000 --- a/views/software_communities_plugin_myprofile/_language_fields.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= fields_for :software_language, @software_language do |lng| %> - -
    - <% languages = [] if languages.blank? %> - <% SoftwareLanguageHelper.language_as_tables(languages).each do |tab| %> - <%= tab.call %> - <%end%> -
    - - -<%= link_to _('New language'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-languages"%> -<% end %> \ No newline at end of file diff --git a/views/software_communities_plugin_myprofile/_library_fields.html.erb b/views/software_communities_plugin_myprofile/_library_fields.html.erb deleted file mode 100644 index 332654b..0000000 --- a/views/software_communities_plugin_myprofile/_library_fields.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= fields_for :library ,@library do |lib| %> - -
    - <% libraries = [] if libraries.blank? %> - <% LibraryHelper.libraries_as_tables(libraries).each do |tab| %> - <%= tab.call %> - <% end %> -
    - - -<%= link_to _('New Library'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-libraries"%> -<% end %> diff --git a/views/software_communities_plugin_myprofile/_license_info_fields.html.erb b/views/software_communities_plugin_myprofile/_license_info_fields.html.erb deleted file mode 100644 index 3cde616..0000000 --- a/views/software_communities_plugin_myprofile/_license_info_fields.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% LicenseHelper.getListLicenses.each do | license | %> - -<% end %> - -<%= text_field_tag "license_info[version]", license_version, :id=>"license_info_version", :class=>"license_info_version", :placeholder=>_('Autocomplete field, type some license') %> -<%= hidden_field_tag "license[license_infos_id]", license_id, :id=>"license_info_id", :class=>"license_info_id", :data => {:label=>license_version} %> - -<%= _("Read license") %> - -
    - <%= labelled_text_field "Licence version", "license[version]", another_version, :id=>"licence_version" %> -
    - <%= labelled_text_field "Licence link", "license[link]", another_link, :id=>"licence_link" %> -
    diff --git a/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb b/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb deleted file mode 100644 index a40b62d..0000000 --- a/views/software_communities_plugin_myprofile/_main_software_editor_extras.html.erb +++ /dev/null @@ -1,47 +0,0 @@ - -
    > - <%= label_tag("community[name]", _('Name'), {:class => 'formlabel mandatory'}) %> - <%= text_field_tag("community[name]", @profile.name, :id => 'community_name_id') %> -
    - -
    > - <%= label_tag("software[acronym]", _('Short Name'), {:class => 'formlabel mandatory'}) %> - <%= text_field_tag("software[acronym]", @profile.software_info.acronym, :id => 'software_acronym_id', :maxlength=>"10") %> -
    - -
    > -
    - <%= label_tag("software[finality]", _('Finality'), {:class => 'formlabel mandatory'}) %> - <%= text_area_tag "software[finality]", @profile.software_info.finality, :placeholder => _("What is the software for?"), :maxlength => 120 %> -
    -
    - -
    - -
    -
    - <%= f.fields_for :image_builder, @profile.image do |i| %> - <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> - <% end %> -
    - -
    > -
    - - <%= render :partial => "license_info_fields", :locals => { - :license_version => @license_version, - :license_id => @license_id, - :another_version => @another_license_version, - :another_link => @another_license_link - } %> -
    -
    - -
    - <%= label_tag("software[repository_link]", _('Link to Repository: '), {:class => 'formlabel'}) %> - <%= text_field_tag("software[repository_link]", @profile.software_info.repository_link, :class => "improve_input_size", :id => "software-info-repository-link") %> -
    diff --git a/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb b/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb deleted file mode 100644 index 7585db5..0000000 --- a/views/software_communities_plugin_myprofile/_operating_system_fields.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= fields_for :operating_systems ,@operating_systems do |lib| %> - -
    - <% operating_systems_fields = [] if operating_systems_fields.nil? %> - <% OperatingSystemHelper.operating_system_as_tables(operating_systems_fields).each do |tab| %> - <%= tab.call %> - <% end %> -
    - - -<%= link_to _('New Operating System'), "#", :class=>"button icon-add with-text new-dynamic-table dynamic-operating_systems"%> -<% end %> diff --git a/views/software_communities_plugin_myprofile/_public_software_info.html.erb b/views/software_communities_plugin_myprofile/_public_software_info.html.erb deleted file mode 100644 index 1f3466c..0000000 --- a/views/software_communities_plugin_myprofile/_public_software_info.html.erb +++ /dev/null @@ -1,102 +0,0 @@ -
    - <% if @disabled_public_software_field == true %> - <%= check_box_tag("software[public_software]", "true", @software_info.public_software?, :disabled => "disabled") %> - <%= label_tag _("Public Software"), _("Public software"), :class => "public_software_disabled" %> - <% else %> - <%= check_box_tag("software[public_software]", "true", @software_info.public_software?) %> - <%= label_tag _("Public Software"), _("Public software"), :class => "public_software_enabled" %> - <% end %> -
    -

    <%= _("Public Software") %>

    -
    - <%= label_tag _("Adherent to e-PING ?") %> - - <%= label_tag "e_ping_true", "Yes" %> - <%= radio_button_tag("software[e_ping]", true, @software_info.e_ping)%> - <%= label_tag "e_ping_false", "No"%> - <%= radio_button_tag("software[e_ping]", false, !@software_info.e_ping)%> -
    - -
    - <%= label_tag _("Adherent to e-MAG ?") %> - - <%= label_tag "e_mag_true", "Yes"%> - <%= radio_button_tag("software[e_mag]", true, @software_info.e_mag)%> - <%= label_tag "e_mag_false", "No"%> - <%= radio_button_tag("software[e_mag]", false, !@software_info.e_mag)%> -
    - -
    - <%= label_tag _("Adherent to ICP-Brasil ?") %> - - <%= label_tag "icp_brasil_true", "Yes"%> - <%= radio_button_tag("software[icp_brasil]", true, @software_info.icp_brasil)%> - <%= label_tag "icp_brasil_false", "No"%> - <%= radio_button_tag("software[icp_brasil]", false, !@software_info.icp_brasil)%> -
    - -
    - <%= label_tag _("Adherent to e-ARQ ?") %> - - <%= label_tag "e_arq_true", "Yes"%> - <%= radio_button_tag("software[e_arq]", true, @software_info.e_arq)%> - <%= label_tag "e_arq_false", "No"%> - <%= radio_button_tag("software[e_arq]", false, !@software_info.e_arq)%> -
    - -
    - <%= label_tag _("Internacionalizable ?") %> - - <%= label_tag "intern_true", "Yes" %> - <%= radio_button_tag("software[intern]", true, @software_info.intern)%> - <%= label_tag "intern_false", "No"%> - <%= radio_button_tag("software[intern]", false, !@software_info.intern)%> -
    -
    -
    - -
    -

    <%= _("Operating Platform") %>

    - <%= text_area_tag "software[operating_platform]", @software_info.operating_platform, :cols => 40, :rows => 5%> -
    - -
    -

    <%= _("Features") %>

    - <%= text_area_tag "software[features]", @software_info.features, :maxlength=>"4000", :cols => 40, :rows => 5%> -
    - -
    -

    <%= _("Demonstration url") %>

    - <%= text_field_tag("software[demonstration_url]", @software_info.demonstration_url) %> -
    - -
    -

    <%= _("Libraries") %>

    - - <%= render :partial => 'library_fields', :locals => {:object_name => 'community', :profile => @community, :libraries => @list_libraries } %> -
    - -
    - -
    -

    <%= _("Operating Systems") %>

    - - <%= render :partial => 'operating_system_fields', :locals => {:object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %> -
    -
    - -
    -
    -

    <%= _("Programming languages") %>

    - - <%= render :partial => 'language_fields', :locals => { :object_name => 'community', :profile => @community, :languages => @list_languages } %> -
    - -
    -
    -

    <%= _("Databases") %>

    - - <%= render :partial => 'database_fields', :locals => {:object_name => 'community', :profile => @community, :database => @list_databases } %> -
    - -
    diff --git a/views/software_communities_plugin_myprofile/edit_software.html.erb b/views/software_communities_plugin_myprofile/edit_software.html.erb deleted file mode 100644 index 0b25696..0000000 --- a/views/software_communities_plugin_myprofile/edit_software.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -

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

    - -<% tabs = [] %> - -<%= error_messages_for :software_info, :community %> - -<%= labelled_form_for :community, :html => { :multipart => true, :id => 'edit-form' } do |f| %> - - <% tabs << {:title => _("Main Information"), :id => 'basic-info', - :content => (render :partial => 'main_software_editor_extras', :locals => {:f => f})} %> - - <% tabs << {:title => _("Specifications"), :id => 'especific-info', - :content => (render :partial => 'public_software_info')} %> - - <%= render_tabs(tabs) %> - - <% button_bar do %> - <%= submit_button(:save, _('Save')) %> - <%= submit_button(:save, _('Save and Configure Community')) %> - <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> - <% end %> -<% end %> diff --git a/views/software_communities_plugin_myprofile/new_software.html.erb b/views/software_communities_plugin_myprofile/new_software.html.erb deleted file mode 100644 index ad9795d..0000000 --- a/views/software_communities_plugin_myprofile/new_software.html.erb +++ /dev/null @@ -1,103 +0,0 @@ - - -<%= render :partial => 'profile_editor/first_edit_software_community_extras', :locals => {:class_step_one => "current-step", :class_step_two => "another-step"} %> - -

    <%= _('Creating new software') %>

    - -
    - - <%= _('Enter the basic information about the software.
    - You can add the details after you create it.') %> -
    -
    - -<% 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 @errors.blank? %> -
    -

    <%= _("Can`t create new software: #{@errors.length} errors") %>

    -
      - <% @errors.each do |error| %> -
    • <%= error %>
    • - <% end %> -
    -
    -<% end %> - -
    - <%= labelled_form_for :community, :html => { :multipart => true } do |f| %> - - <%= required_fields_message %> - -
    > - <%= label("name", _('Name'), {:class => 'formlabel mandatory'}) %> - <%= required text_field(:community, :name, :size => 30, :maxlength => 100, :id => 'community_name_id') %> -
    - -
    -
    - -
    > - <%= label("domain", _('Domain'), {:class => "formlabel mandatory"}) %> -
    - - <%= environment.default_hostname %>/ - <%= required text_field(:community, :identifier, :size => 30, :maxlength => 100, :id => 'community-identifier') %> -
    -
    - -
    > - <%= fields_for @software_info do |swf| %> -
    - <%= swf.label("finality" ,_("Finality"), :class=>"formlabel mandatory") %> - <%= required swf.text_area(:finality, :placeholder => _("What is the software for?"), :maxlength => 120) %> -
    - <% end %> -
    - -
    - -
    -
    - <%= f.fields_for :image_builder, @community.image do |i| %> - <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> - <% end %> -
    - -
    > -
    - - <%= render :partial => "license_info_fields", :locals => { - :license_version => "", - :license_id => "", - :another_version=>"", - :another_link=>"" - } %> -
    -
    - - <%= fields_for @software_info do |swf| %> -
    - <%= swf.label "repository_url", _("Link to Repository: "), :class => "formlabel"%> - <%= swf.text_field :repository_link, :class => "improve_input_size", :id => "software-info-repository-link" %> -
    - <% end %> - - <%= hidden_field_tag('back_to', @back_to) %> - - <% button_bar do %> - <%= submit_button(:save, _('Create')) %> - <%= button(:cancel, _('Cancel'), @back_to ) %> - <% end %> - - <% end %> - -
    diff --git a/views/software_editor_extras.rhtml b/views/software_editor_extras.rhtml deleted file mode 100644 index c4a119e..0000000 --- a/views/software_editor_extras.rhtml +++ /dev/null @@ -1,35 +0,0 @@ -

    <%= _('Software Information') %>

    - -
    - <%= _("Adherent to e-PING?") %> - <%= labelled_radio_button(_('Sim'), 'software_info[e_ping]', 'sim', context.profile.software_info.e_ping == 'sim')%> - <%= labelled_radio_button(_('Não'), 'software_info[e_ping]', 'nao', context.profile.software_info.e_ping == 'nao')%> -
    -
    - <%= _("Adherent to e-MAG?") %> - <%= labelled_radio_button(_('Sim'), 'software_info[e_mag]', 'sim', context.profile.software_info.e_mag == 'sim')%> - <%= labelled_radio_button(_('Não'), 'software_info[e_mag]', 'nao', context.profile.software_info.e_mag == 'nao')%> -
    -
    - <%= _("Adherent to ICP-Brasil?") %> - <%= labelled_radio_button(_('Sim'), 'software_info[icp_brasil]', 'sim', context.profile.software_info.icp_brasil == 'sim')%> - <%= labelled_radio_button(_('Não'), 'software_info[icp_brasil]', 'nao', context.profile.software_info.icp_brasil == 'nao')%> -
    -
    - <%= _("Adherent to e-ARQ?") %> - <%= labelled_radio_button(_('Sim'), 'software_info[e_arq]', 'sim', context.profile.software_info.e_arq == 'sim')%> - <%= labelled_radio_button(_('Não'), 'software_info[e_arq]', 'nao', context.profile.software_info.e_arq == 'nao')%> -
    -
    - <%= _("Internacionalizable") %> - <%= labelled_radio_button(_('Sim'), 'software_info[intern]', 'sim', context.profile.software_info.intern == 'sim')%> - <%= labelled_radio_button(_('Não'), 'software_info[intern]', 'nao', context.profile.software_info.intern == 'nao')%> -
    - -
    - <%= label_tag('software_info[operating_platform]', 'Operating Platform:') %> - <%= text_area_tag('software_info[operating_platform]', context.profile.software_info.operating_platform, :size => '40x20') %> -
    -
    - <%= labelled_text_field('Demonstration URL', 'software_info[demonstration_url]', context.profile.software_info.demonstration_url) %> -
    -- libgit2 0.21.2