Commit ac306a5b691c8341cf28d9b7273060e3e31f44c5
Committed by
Braulio Bhavamitra
1 parent
2f07775b
Exists in
master
and in
29 other branches
Add download icon
Showing
6 changed files
with
11 additions
and
13 deletions
Show diff stats
app/views/file_presenter/_generic.html.erb
1 | -<span class="download-link"> | ||
2 | - <span>Download</span> | ||
3 | - <strong><%= link_to generic.filename, [Noosfero.root, generic.public_filename].join %></strong> | ||
4 | -</span> | ||
5 | - | ||
6 | <div class="uploaded-file-description <%= 'empty' if generic.abstract.blank? %>"> | 1 | <div class="uploaded-file-description <%= 'empty' if generic.abstract.blank? %>"> |
7 | <%= generic.abstract %> | 2 | <%= generic.abstract %> |
8 | </div> | 3 | </div> |
9 | 4 | ||
5 | +<%= button(:download, _('Download'), [Noosfero.root, generic.public_filename].join, class:'download-link', option:'primary', size:'lg') %> |
public/designs/icons/awesome/style.scss
@@ -140,6 +140,9 @@ $fa-font-path: "fonts"; | @@ -140,6 +140,9 @@ $fa-font-path: "fonts"; | ||
140 | .icon-down:before { | 140 | .icon-down:before { |
141 | @extend .fa-arrow-down:before; | 141 | @extend .fa-arrow-down:before; |
142 | } | 142 | } |
143 | +.icon-download:before { | ||
144 | + @extend .fa-download:before; | ||
145 | +} | ||
143 | 146 | ||
144 | .icon-spread:before { | 147 | .icon-spread:before { |
145 | @extend .fa-share:before; | 148 | @extend .fa-share:before; |
public/designs/icons/tango/style.css
@@ -28,6 +28,7 @@ | @@ -28,6 +28,7 @@ | ||
28 | .icon-more { background-image: url(Tango/16x16/actions/add.png) } | 28 | .icon-more { background-image: url(Tango/16x16/actions/add.png) } |
29 | .icon-up { background-image: url(Tango/16x16/actions/go-up.png) } | 29 | .icon-up { background-image: url(Tango/16x16/actions/go-up.png) } |
30 | .icon-down { background-image: url(Tango/16x16/actions/go-down.png) } | 30 | .icon-down { background-image: url(Tango/16x16/actions/go-down.png) } |
31 | +.icon-download { background-image: url(Tango/16x16/actions/bottom.png) } | ||
31 | .icon-left { background-image: url(Tango/16x16/actions/go-previous.png) } | 32 | .icon-left { background-image: url(Tango/16x16/actions/go-previous.png) } |
32 | .icon-right { background-image: url(Tango/16x16/actions/go-next.png) } | 33 | .icon-right { background-image: url(Tango/16x16/actions/go-next.png) } |
33 | .icon-up-disabled { background-image: url(Tango/16x16/actions/go-up.png); opacity: 0.25; filter:alpha(opacity=25); } | 34 | .icon-up-disabled { background-image: url(Tango/16x16/actions/go-up.png); opacity: 0.25; filter:alpha(opacity=25); } |
public/stylesheets/application.css
@@ -4019,10 +4019,6 @@ div#article-parent { | @@ -4019,10 +4019,6 @@ div#article-parent { | ||
4019 | text-align: right; | 4019 | text-align: right; |
4020 | font-style: italic; | 4020 | font-style: italic; |
4021 | } | 4021 | } |
4022 | -.article-body-uploaded-file { | ||
4023 | - text-align: center; | ||
4024 | -} | ||
4025 | - | ||
4026 | /* ==> public/stylesheets/controller_events.css <== */ | 4022 | /* ==> public/stylesheets/controller_events.css <== */ |
4027 | #agenda { | 4023 | #agenda { |
4028 | position: relative; | 4024 | position: relative; |
test/unit/article_block_test.rb
@@ -64,7 +64,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | @@ -64,7 +64,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | ||
64 | end | 64 | end |
65 | person.boxes.first.blocks << block | 65 | person.boxes.first.blocks << block |
66 | block.save! | 66 | block.save! |
67 | - | 67 | + |
68 | block.reload | 68 | block.reload |
69 | assert_equal [a],block.available_articles | 69 | assert_equal [a],block.available_articles |
70 | end | 70 | end |
@@ -80,7 +80,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | @@ -80,7 +80,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | ||
80 | block = create(ArticleBlock, :article => a) | 80 | block = create(ArticleBlock, :article => a) |
81 | env.boxes.first.blocks << block | 81 | env.boxes.first.blocks << block |
82 | block.save! | 82 | block.save! |
83 | - | 83 | + |
84 | block.reload | 84 | block.reload |
85 | assert_equal [a],block.available_articles | 85 | assert_equal [a],block.available_articles |
86 | end | 86 | end |
@@ -140,7 +140,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | @@ -140,7 +140,7 @@ class ArticleBlockTest < ActiveSupport::TestCase | ||
140 | block.article = file | 140 | block.article = file |
141 | block.save! | 141 | block.save! |
142 | 142 | ||
143 | - assert_tag_in_string instance_eval(&block.content), :tag => 'a', :content => 'test.txt' | 143 | + assert_tag_in_string instance_eval(&block.content), :tag => 'a', :content => _('Download') |
144 | end | 144 | end |
145 | 145 | ||
146 | protected | 146 | protected |
test/unit/blog_helper_test.rb
@@ -7,6 +7,8 @@ class BlogHelperTest < ActionView::TestCase | @@ -7,6 +7,8 @@ class BlogHelperTest < ActionView::TestCase | ||
7 | include ActionView::Helpers::AssetTagHelper | 7 | include ActionView::Helpers::AssetTagHelper |
8 | include ApplicationHelper | 8 | include ApplicationHelper |
9 | 9 | ||
10 | + helper ApplicationHelper | ||
11 | + | ||
10 | def setup | 12 | def setup |
11 | stubs(:show_date).returns('') | 13 | stubs(:show_date).returns('') |
12 | @environment = Environment.default | 14 | @environment = Environment.default |
@@ -103,7 +105,7 @@ class BlogHelperTest < ActionView::TestCase | @@ -103,7 +105,7 @@ class BlogHelperTest < ActionView::TestCase | ||
103 | result = display_post(file) | 105 | result = display_post(file) |
104 | assert_tag_in_string result, :tag => 'a', | 106 | assert_tag_in_string result, :tag => 'a', |
105 | :attributes => { :href => file.public_filename }, | 107 | :attributes => { :href => file.public_filename }, |
106 | - :content => file.filename | 108 | + :content => _('Download') |
107 | end | 109 | end |
108 | 110 | ||
109 | should 'display image if post is an image' do | 111 | should 'display image if post is an image' do |