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
1451 1451
div.fileover, p.custom-field-filedroplistner.fileover { background-color: var(--oc-violet-0); }
1452 1452
div.attachments img { vertical-align: middle; }
1453
div.attachments span.author { font-size: 0.9em; color: var(--oc-gray-6); }
1453
div.attachments span.author, div.attachments span.content-type { font-size: 0.9em; color: var(--oc-gray-6); }
1454 1454
div.thumbnails {margin:0.6em;}
1455 1455
div.thumbnail {
app/views/layouts/_file.html.erb
8 8
<div class="attachments">
9 9
<p><%= "#{@attachment.description} - " unless @attachment.description.blank? %>
10
   <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
10
   <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span>
11
   <% if @attachment.content_type.present? %>
12
   <span class="content-type">(<%= @attachment.content_type %>)</span>
13
   <% end %></p>
11 14
</div>
12 15
<div class="filecontent-container">
13 16
  <%= yield %>
test/functional/attachments_controller_test.rb
144 144
    assert_equal 'text/html', @response.media_type
145 145
  end
146
  def test_show_should_display_content_type
147
    get(:show, :params => {:id => 4})
148
    assert_response :success
149
    assert_select 'div.attachments span.content-type', :text => '(application/x-ruby)'
150
  end
151

  
152
  def test_show_should_not_display_content_type_if_blank
153
    get(:show, :params => {:id => 22})
154
    assert_response :success
155
    assert_select 'div.attachments span.content-type', 0
156
  end
157

  
146 158
  def test_show_text_file_utf_8
147 159
    set_tmp_attachments_directory
148 160
    a = Attachment.new(:container => Issue.find(1),
(2-2/2)