Commit 960bf10edc3c28529ec7c5c9d9d1c2438bc733b9

Authored by Arthur Esposte
1 parent 52c351de
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Fixing softwares block to be used in communities

lib/repository_block.rb
1 1 class RepositoryBlock < Block
2 2  
3   - attr_accessible :link, :show_name
  3 + attr_accessible :show_name
4 4  
5   - settings_items :link, :type => :string, :default => ''
6 5 settings_items :show_name, :type => :boolean, :default => false
7 6  
8 7 def self.description
... ...
test/unit/repository_block_test.rb
... ... @@ -16,13 +16,4 @@ class RepositoryBlockTest &lt; ActiveSupport::TestCase
16 16 should 'describe itself' do
17 17 assert_not_equal Block.description, RepositoryBlock.description
18 18 end
19   -
20   - should 'have software info to repository it' do
21   -
22   - link = "gitlab.com/teste"
23   -
24   - block = RepositoryBlock.create(:link => link)
25   -
26   - assert_equal block.link, link, "Link should not be empty"
27   - end
28 19 end
... ...
views/blocks/download.html.erb
1   -<div id="download-block">
2   - <div id="download_spb">
3   - <h2> <%= _("Download") %> </h2>
  1 +<% if block.owner.software_info.nil? %>
  2 + <%= _("This community needs a software to use this block") %>
  3 +<% else %>
  4 + <div id="download-block">
  5 + <div id="download_spb">
  6 + <h2> <%= _("Download") %> </h2>
4 7  
5   - <span class="download-name">
6   - <%= link_to block.name, "#" %>
7   - </span>
  8 + <span class="download-name">
  9 + <%= link_to block.name, "#" %>
  10 + </span>
8 11  
9   - <span class="download-system">
10   - <%= _(block.software_description) %>
11   - </span>
12   - </div>
  12 + <span class="download-system">
  13 + <%= _(block.software_description) %>
  14 + </span>
  15 + </div>
13 16  
14   - <p id="download_info">
15   - <span class="req_spb">
16   - <%= link_to _("Minimal Requirements") , block.owner.admin_url, :class => "anchor-link", :target => "_self" %>
17   - </span>
  17 + <p id="download_info">
  18 + <span class="req_spb">
  19 + <%= link_to _("Minimal Requirements") , block.owner.public_profile_url, :class => "anchor-link", :target => "_self" %>
  20 + </span>
18 21  
19   - <span class="nov_spb">
20   - <%= link_to(_("Version News"), block.version_news, :class => "anchor-link", :target => "_self") if !block.version_news.blank? %>
21   - </span>
  22 + <span class="nov_spb">
  23 + <%= link_to(_("Version News"), block.version_news, :class => "anchor-link", :target => "_self") if !block.version_news.blank? %>
  24 + </span>
22 25  
23   - <span class="licensed">
24   - <%= _("Licensed by") %>
25   - <%= link_to block.owner.software_info.license_info.version , block.owner.software_info.license_info.link, :target => "_blank" %>
26   - </span>
27   - </p>
28   -</div>
  26 + <span class="licensed">
  27 + <%= _("Licensed by") %>
  28 + <%= link_to block.owner.software_info.license_info.version , block.owner.software_info.license_info.link, :target => "_blank" %>
  29 + </span>
  30 + </p>
  31 + </div>
  32 +<% end %>
29 33 \ No newline at end of file
... ...
views/blocks/repository.html.erb
1   -<%= link_to _("Repository") , block.link, :id => "bt_repositorio", :target => "_blank" %>
2 1 \ No newline at end of file
  2 +<% if block.owner.software_info.nil? %>
  3 + <%= _("This community needs a software to use this block") %>
  4 +<% else %>
  5 + <%= link_to _("Repository") , block.owner.software_info.repository_link, :id => "bt_repositorio", :target => "_blank" %>
  6 +<% end %>
3 7 \ No newline at end of file
... ...
views/blocks/software_information.html.erb
... ... @@ -2,7 +2,6 @@
2 2  
3 3 <% if block.owner.software_info.nil? %>
4 4 <%= _("This community needs a software to use this block") %>
5   -
6 5 <% else %>
7 6 <table id="software-information-block-table">
8 7 <tr>
... ...
views/box_organizer/_repository_block.html.erb
... ... @@ -1,3 +0,0 @@
1   -<div id='edit-repository-block'>
2   - <%= labelled_form_field _('Link:'), text_field_tag('block[link]', @block.link) %>
3   -</div>