Add links to attachments in new issue email notification (#12293).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11853 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
8bbc6d251e
commit
d678959359
4 files changed
+37
-1
No files matched your search
@@ -12,13 +12,14 @@ h2, h3 { font-size: 1.1em; }
|
|||||||
a, a:link, a:visited { color: #2A5685;}
|
a, a:link, a:visited { color: #2A5685;}
|
||||||
a:hover, a:active { color: #c61a1a; }
|
a:hover, a:active { color: #c61a1a; }
|
||||||
a.wiki-anchor { display: none; }
|
a.wiki-anchor { display: none; }
|
||||||
|
fieldset.attachments {border-width: 1px 0 0 0;}
|
||||||
hr {
|
hr {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
.footer {
|
span.footer {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,3 +13,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= textilizable(issue, :description, :only_path => false) %>
|
<%= textilizable(issue, :description, :only_path => false) %>
|
||||||
|
|
||||||
|
<% if issue.attachments.any? %>
|
||||||
|
<fieldset class="attachments"><legend><%= l(:label_attachment_plural) %></legend>
|
||||||
|
<% issue.attachments.each do |attachment| %>
|
||||||
|
<%= link_to_attachment attachment, :download => true, :only_path => false %>
|
||||||
|
(<%= number_to_human_size(attachment.filesize) %>)<br />
|
||||||
|
<% end %>
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
@@ -11,3 +11,10 @@
|
|||||||
<% end -%>
|
<% end -%>
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
<%= issue.description %>
|
<%= issue.description %>
|
||||||
|
|
||||||
|
<% if issue.attachments.any? -%>
|
||||||
|
---<%= l(:label_attachment_plural).ljust(37, '-') %>
|
||||||
|
<% issue.attachments.each do |attachment| -%>
|
||||||
|
<%= attachment.filename %> (<%= number_to_human_size(attachment.filesize) %>)
|
||||||
|
<% end -%>
|
||||||
|
<% end -%>
|
||||||
@@ -2159,6 +2159,25 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_equal 59, File.size(attachment.diskfile)
|
assert_equal 59, File.size(attachment.diskfile)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_post_create_with_attachment_should_notify_with_attachments
|
||||||
|
ActionMailer::Base.deliveries.clear
|
||||||
|
set_tmp_attachments_directory
|
||||||
|
@request.session[:user_id] = 2
|
||||||
|
|
||||||
|
with_settings :host_name => 'mydomain.foo', :protocol => 'http' do
|
||||||
|
assert_difference 'Issue.count' do
|
||||||
|
post :create, :project_id => 1,
|
||||||
|
:issue => { :tracker_id => '1', :subject => 'With attachment' },
|
||||||
|
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_not_nil ActionMailer::Base.deliveries.last
|
||||||
|
assert_select_email do
|
||||||
|
assert_select 'a[href^=?]', 'http://mydomain.foo/attachments/download', 'testfile.txt'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_post_create_with_failure_should_save_attachments
|
def test_post_create_with_failure_should_save_attachments
|
||||||
set_tmp_attachments_directory
|
set_tmp_attachments_directory
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
|
|||||||
Reference in new issue
Block a user