Commit 960bf10edc3c28529ec7c5c9d9d1c2438bc733b9
1 parent
52c351de
Exists in
master
and in
5 other branches
Fixing softwares block to be used in communities
Showing
6 changed files
with
33 additions
and
39 deletions
Show diff stats
lib/repository_block.rb
test/unit/repository_block_test.rb
| ... | ... | @@ -16,13 +16,4 @@ class RepositoryBlockTest < 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
views/box_organizer/_repository_block.html.erb