##// END OF EJS Templates
Add links to attachments in new issue email notification (#12293)....
Jean-Philippe Lang -
r11623:d67895935976
parent child
Show More
@@ -12,13 +12,14 h2, h3 { font-size: 1.1em; }
12 a, a:link, a:visited { color: #2A5685;}
12 a, a:link, a:visited { color: #2A5685;}
13 a:hover, a:active { color: #c61a1a; }
13 a:hover, a:active { color: #c61a1a; }
14 a.wiki-anchor { display: none; }
14 a.wiki-anchor { display: none; }
15 fieldset.attachments {border-width: 1px 0 0 0;}
15 hr {
16 hr {
16 width: 100%;
17 width: 100%;
17 height: 1px;
18 height: 1px;
18 background: #ccc;
19 background: #ccc;
19 border: 0;
20 border: 0;
20 }
21 }
21 .footer {
22 span.footer {
22 font-size: 0.8em;
23 font-size: 0.8em;
23 font-style: italic;
24 font-style: italic;
24 }
25 }
@@ -13,3 +13,12
13 </ul>
13 </ul>
14
14
15 <%= textilizable(issue, :description, :only_path => false) %>
15 <%= textilizable(issue, :description, :only_path => false) %>
16
17 <% if issue.attachments.any? %>
18 <fieldset class="attachments"><legend><%= l(:label_attachment_plural) %></legend>
19 <% issue.attachments.each do |attachment| %>
20 <%= link_to_attachment attachment, :download => true, :only_path => false %>
21 (<%= number_to_human_size(attachment.filesize) %>)<br />
22 <% end %>
23 </fieldset>
24 <% end %>
@@ -11,3 +11,10
11 <% end -%>
11 <% end -%>
12 ----------------------------------------
12 ----------------------------------------
13 <%= issue.description %>
13 <%= issue.description %>
14
15 <% if issue.attachments.any? -%>
16 ---<%= l(:label_attachment_plural).ljust(37, '-') %>
17 <% issue.attachments.each do |attachment| -%>
18 <%= attachment.filename %> (<%= number_to_human_size(attachment.filesize) %>)
19 <% end -%>
20 <% end -%>
@@ -2159,6 +2159,25 class IssuesControllerTest < ActionController::TestCase
2159 assert_equal 59, File.size(attachment.diskfile)
2159 assert_equal 59, File.size(attachment.diskfile)
2160 end
2160 end
2161
2161
2162 def test_post_create_with_attachment_should_notify_with_attachments
2163 ActionMailer::Base.deliveries.clear
2164 set_tmp_attachments_directory
2165 @request.session[:user_id] = 2
2166
2167 with_settings :host_name => 'mydomain.foo', :protocol => 'http' do
2168 assert_difference 'Issue.count' do
2169 post :create, :project_id => 1,
2170 :issue => { :tracker_id => '1', :subject => 'With attachment' },
2171 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
2172 end
2173 end
2174
2175 assert_not_nil ActionMailer::Base.deliveries.last
2176 assert_select_email do
2177 assert_select 'a[href^=?]', 'http://mydomain.foo/attachments/download', 'testfile.txt'
2178 end
2179 end
2180
2162 def test_post_create_with_failure_should_save_attachments
2181 def test_post_create_with_failure_should_save_attachments
2163 set_tmp_attachments_directory
2182 set_tmp_attachments_directory
2164 @request.session[:user_id] = 2
2183 @request.session[:user_id] = 2
General Comments 0
You need to be logged in to leave comments. Login now