Project

General

Profile

Feature #32240 » 32240_add_download_button.patch

Yuichi HARADA, 2019-11-07 06:06

View differences:

app/helpers/application_helper.rb
when 'Issue'
object.visible? && html ? link_to_issue(object) : "##{object.id}"
when 'Attachment'
html ? link_to_attachment(object) : object.filename
if html
content_tag(:span,
link_to_attachment(object) +
link_to_attachment(
object,
:class => ['icon-only', 'icon-download'], :title => l(:button_download), :download => true
)
)
else
object.filename
end
when 'CustomValue', 'CustomFieldValue'
if object.custom_field
f = object.custom_field.format.formatted_custom_value(self, object, html)
public/stylesheets/application.css
table.list td.id { width: 2%; text-align: center;}
table.list td.name, table.list td.description, table.list td.subject, table.list td.comments, table.list td.roles, table.list td.attachments, table.list td.text, table.list td.short_description {text-align: left;}
table.list td.attachments a {display:block;}
table.list td.attachments span {display:block;}
table.list td.tick {width:15%}
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
table.list .checkbox input {padding:0px; height: initial;}
test/functional/issues_controller_test.rb
assert_select 'td.attachments'
assert_select 'tr#issue-2' do
assert_select 'td.attachments' do
assert_select 'a', :text => 'source.rb'
assert_select 'a', :text => 'picture.jpg'
assert_select 'span:nth-of-type(1)' do
assert_select 'a[href=?]', '/attachments/4', :text => 'source.rb'
assert_select 'a[href=?].icon-download', '/attachments/download/4/source.rb'
end
assert_select 'span:nth-of-type(2)' do
assert_select 'a[href=?]', '/attachments/10', :text => 'picture.jpg'
assert_select 'a[href=?].icon-download', '/attachments/download/10/picture.jpg'
end
end
end
end
(3-3/6)