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
| 1 | class RepositoryBlock < Block | 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 | settings_items :show_name, :type => :boolean, :default => false | 5 | settings_items :show_name, :type => :boolean, :default => false |
| 7 | 6 | ||
| 8 | def self.description | 7 | def self.description |
test/unit/repository_block_test.rb
| @@ -16,13 +16,4 @@ class RepositoryBlockTest < ActiveSupport::TestCase | @@ -16,13 +16,4 @@ class RepositoryBlockTest < ActiveSupport::TestCase | ||
| 16 | should 'describe itself' do | 16 | should 'describe itself' do |
| 17 | assert_not_equal Block.description, RepositoryBlock.description | 17 | assert_not_equal Block.description, RepositoryBlock.description |
| 18 | end | 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 | end | 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 | \ No newline at end of file | 33 | \ No newline at end of file |
views/blocks/repository.html.erb
| 1 | -<%= link_to _("Repository") , block.link, :id => "bt_repositorio", :target => "_blank" %> | ||
| 2 | \ No newline at end of file | 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 | \ No newline at end of file | 7 | \ No newline at end of file |
views/blocks/software_information.html.erb
| @@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
| 2 | 2 | ||
| 3 | <% if block.owner.software_info.nil? %> | 3 | <% if block.owner.software_info.nil? %> |
| 4 | <%= _("This community needs a software to use this block") %> | 4 | <%= _("This community needs a software to use this block") %> |
| 5 | - | ||
| 6 | <% else %> | 5 | <% else %> |
| 7 | <table id="software-information-block-table"> | 6 | <table id="software-information-block-table"> |
| 8 | <tr> | 7 | <tr> |
views/box_organizer/_repository_block.html.erb