Project

General

Profile

Feature #44460 » 0001-Display-the-MIME-type-on-the-attachment-preview-page.patch

Go MAEDA, 2026-09-17 07:05

View differences:

app/assets/stylesheets/application.css
div.fileover, p.custom-field-filedroplistner.fileover { background-color: var(--oc-violet-0); }
div.attachments img { vertical-align: middle; }
div.attachments span.author { font-size: 0.9em; color: var(--oc-gray-6); }
div.attachments span.author, div.attachments span.content-type { font-size: 0.9em; color: var(--oc-gray-6); }
div.thumbnails {margin:0.6em;}
div.thumbnail {
app/views/layouts/_file.html.erb
<div class="attachments">
<p><%= "#{@attachment.description} - " unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span>
<% if @attachment.content_type.present? %>
<span class="content-type">(<%= @attachment.content_type %>)</span>
<% end %></p>
</div>
<div class="filecontent-container">
<%= yield %>
test/functional/attachments_controller_test.rb
assert_equal 'text/html', @response.media_type
end
def test_show_should_display_content_type
get(:show, :params => {:id => 4})
assert_response :success
assert_select 'div.attachments span.content-type', :text => '(application/x-ruby)'
end
def test_show_should_not_display_content_type_if_blank
get(:show, :params => {:id => 22})
assert_response :success
assert_select 'div.attachments span.content-type', 0
end
def test_show_text_file_utf_8
set_tmp_attachments_directory
a = Attachment.new(:container => Issue.find(1),
(2-2/7)