Compare View
Commits (4)
-
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com>
-
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com>
Showing
11 changed files
Show diff stats
src/noosfero-spb/software_communities/db/migrate/20140528193902_create_license_infos_table.rb
... | ... | @@ -4,6 +4,9 @@ class CreateLicenseInfosTable < ActiveRecord::Migration |
4 | 4 | t.string :version |
5 | 5 | t.string :link |
6 | 6 | end |
7 | + | |
8 | + link = "http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" | |
9 | + execute("INSERT INTO license_infos (version, link) VALUES ('CC-GPL-V2', '#{link}')") | |
7 | 10 | end |
8 | 11 | |
9 | 12 | def self.down | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20140528193956_create_programming_languages_table.rb
... | ... | @@ -3,6 +3,13 @@ class CreateProgrammingLanguagesTable < ActiveRecord::Migration |
3 | 3 | create_table :programming_languages do |t| |
4 | 4 | t.string :name |
5 | 5 | end |
6 | + | |
7 | + file_name = "plugins/software_communities/public/static/languages.txt" | |
8 | + list_file = File.open file_name, "r" | |
9 | + list_file.each_line do |line| | |
10 | + execute("INSERT INTO programming_languages (name) VALUES ('#{line.strip}')") | |
11 | + end | |
12 | + list_file.close | |
6 | 13 | end |
7 | 14 | |
8 | 15 | def self.down | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20140528194044_create_database_descriptions_table.rb
... | ... | @@ -3,6 +3,13 @@ class CreateDatabaseDescriptionsTable < ActiveRecord::Migration |
3 | 3 | create_table :database_descriptions do |t| |
4 | 4 | t.string :name |
5 | 5 | end |
6 | + | |
7 | + file_name = "plugins/software_communities/public/static/databases.txt" | |
8 | + list_file = File.open file_name, "r" | |
9 | + list_file.each_line do |line| | |
10 | + execute("INSERT INTO database_descriptions (name) VALUES ('#{line.strip}')") | |
11 | + end | |
12 | + list_file.close | |
6 | 13 | end |
7 | 14 | |
8 | 15 | def self.down | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20140714133901_create_operating_name_table.rb
... | ... | @@ -3,6 +3,13 @@ class CreateOperatingNameTable < ActiveRecord::Migration |
3 | 3 | create_table :operating_system_names do |t| |
4 | 4 | t.string :name |
5 | 5 | end |
6 | + | |
7 | + file_name = "plugins/software_communities/public/static/operating_systems.txt" | |
8 | + list_file = File.open file_name, "r" | |
9 | + list_file.each_line do |line| | |
10 | + execute("INSERT INTO operating_system_names (name) VALUES ('#{line.strip}')") | |
11 | + end | |
12 | + list_file.close | |
6 | 13 | end |
7 | 14 | |
8 | 15 | def down | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20151124192503_update_namespace_types.rb
... | ... | @@ -3,7 +3,7 @@ class UpdateNamespaceTypes < ActiveRecord::Migration |
3 | 3 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock' WHERE type = 'SoftwareHighlightsBlock'") |
4 | 4 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock' WHERE type = 'SearchCatalogBlock'") |
5 | 5 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::DownloadBlock' WHERE type = 'DownloadBlock'") |
6 | - execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::StatisticsBlock' WHERE type = 'StatisticsBlock'") | |
6 | + execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::StatisticBlock' WHERE type = 'StatisticBlock'") | |
7 | 7 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::RepositoryBlock' WHERE type = 'RepositoryBlock'") |
8 | 8 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock' WHERE type = 'SoftwareTabDataBlock'") |
9 | 9 | execute("UPDATE blocks SET type = 'SoftwareCommunitiesPlugin::SoftwaresBlock' WHERE type = 'SoftwaresBlock'") |
... | ... | @@ -18,7 +18,7 @@ class UpdateNamespaceTypes < ActiveRecord::Migration |
18 | 18 | execute("UPDATE blocks SET type = 'SoftwareHighlightsBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareHighlightsBlock'") |
19 | 19 | execute("UPDATE blocks SET type = 'SearchCatalogBlock' WHERE type = 'SoftwareCommunitiesPlugin::SearchCatalogBlock'") |
20 | 20 | execute("UPDATE blocks SET type = 'DownloadBlock' WHERE type = 'SoftwareCommunitiesPlugin::DownloadBlock'") |
21 | - execute("UPDATE blocks SET type = 'StatisticsBlock' WHERE type = 'SoftwareCommunitiesPlugin::StatisticsBlock'") | |
21 | + execute("UPDATE blocks SET type = 'StatisticBlock' WHERE type = 'SoftwareCommunitiesPlugin::StatisticBlock'") | |
22 | 22 | execute("UPDATE blocks SET type = 'RepositoryBlock' WHERE type = 'SoftwareCommunitiesPlugin::RepositoryBlock'") |
23 | 23 | execute("UPDATE blocks SET type = 'SoftwareTabDataBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwareTabDataBlock'") |
24 | 24 | execute("UPDATE blocks SET type = 'SoftwaresBlock' WHERE type = 'SoftwareCommunitiesPlugin::SoftwaresBlock'") | ... | ... |
src/noosfero-spb/software_communities/db/migrate/20160104170028_changing_software_statistics_from_block_to_software_info.rb
... | ... | @@ -12,13 +12,13 @@ class ChangingSoftwareStatisticsFromBlockToSoftwareInfo < ActiveRecord::Migratio |
12 | 12 | benefited_people += organization_rating["people_benefited"].to_i |
13 | 13 | saved_resources += organization_rating["saved_value"].to_f |
14 | 14 | end |
15 | - execute("UPDATE software_infos SET benefited_people=#{benefited_people}, saved_resources=#{saved_resources} WHERE id=#{software['id']}") | |
15 | + execute("UPDATE software_communities_plugin_software_infos SET benefited_people=#{benefited_people}, saved_resources=#{saved_resources} WHERE id=#{software['id']}") | |
16 | 16 | end |
17 | 17 | end |
18 | 18 | |
19 | 19 | end |
20 | 20 | |
21 | 21 | def down |
22 | - execute("UPDATE software_infos SET benefited_people=0,saved_resources=0") | |
22 | + execute("UPDATE software_communities_plugin_software_infos SET benefited_people=0,saved_resources=0") | |
23 | 23 | end |
24 | 24 | end | ... | ... |
src/noosfero-spb/software_communities/lib/software_communities_plugin/statistic_block.rb
... | ... | @@ -54,7 +54,7 @@ class SoftwareCommunitiesPlugin::StatisticBlock < Block |
54 | 54 | |
55 | 55 | def get_software_statistics |
56 | 56 | statistics = {} |
57 | - software = SoftwareInfo.find_by_community_id(self.owner.id) | |
57 | + software = SoftwareCommunitiesPlugin::SoftwareInfo.find_by_community_id(self.owner.id) | |
58 | 58 | if software.present? |
59 | 59 | statistics[:saved_resources] = software.saved_resources |
60 | 60 | statistics[:benefited_people] = software.benefited_people | ... | ... |
src/noosfero-spb/software_communities/views/blocks/software_communities_plugin/software_highlights.html.erb
0 → 100644
... | ... | @@ -0,0 +1,20 @@ |
1 | +<%= render :file => 'blocks/highlights.html.erb', :locals => { :block => block } %> | |
2 | + | |
3 | +<!-- popover html structure --> | |
4 | +<!-- <a> link to fire popover --> | |
5 | +<a class="toggle-popover">mais informações</a> | |
6 | +<!-- <span> to handle popover options --> | |
7 | +<span class="popover-span" data-toggle="popover" data-placement="top" data-class="highlights-popover">?</span> | |
8 | +<!-- <div> with html content of popover | |
9 | + MUST APPEAR AFTER THE SPAN --> | |
10 | +<div class="popover-content" style="display: none"> | |
11 | + <div class="inner-content"> | |
12 | + <p>Este software foi desenvolvido com recursos públicos, gerenciado por uma instituição | |
13 | + governamental. Sua inclusão neste portal atende aos requisitos do | |
14 | + <a href="https://softwarepublico.gov.br/social/articles/0000/3365/in_spb_01.pdf">art. 14 da IN 01/2011</a>. | |
15 | + </p> | |
16 | + </div> | |
17 | + <div class="see-all"> | |
18 | + <%= link_to _('See all'), {:controller => :search, :action => :software_infos, :only_softwares => softwares} %> | |
19 | + </div> | |
20 | +</div> | ... | ... |
src/noosfero-spb/spb_migrations/db/migrate/20160104182236_remove_softwares_with_nil_community.rb