mirror of
https://github.com/redmine/redmine.git
synced 2026-02-10 08:37:37 +01:00
Rename IconsHelper#mype_type_icon to file_type_icon (#43797).
git-svn-id: https://svn.redmine.org/redmine/trunk@24403 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -90,7 +90,7 @@ module IconsHelper
|
||||
sprite_icon(icon_name, **)
|
||||
end
|
||||
|
||||
def mime_type_icon(mime_type, ...)
|
||||
def file_type_icon(mime_type, ...)
|
||||
icon_name = icon_for_mime_type(mime_type)
|
||||
sprite_icon(icon_name, ...)
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<% @attachments.each do |attachment| %>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="icon icon-attachment"><%= mime_type_icon(attachment.content_type_was, attachment.filename_was) %></span>
|
||||
<span class="icon icon-attachment"><%= file_type_icon(attachment.content_type_was, attachment.filename_was) %></span>
|
||||
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
|
||||
</td>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<div id="existing-attachments" style="<%= @issue.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
|
||||
<% @issue.attachments.each do |attachment| %>
|
||||
<span class="existing-attachment">
|
||||
<%= mime_type_icon(attachment.content_type, size: 12) %>
|
||||
<%= file_type_icon(attachment.content_type, size: 12) %>
|
||||
<%= text_field_tag '', attachment.filename, :class => "icon icon-attachment filename", :disabled => true %>
|
||||
<label>
|
||||
<%= check_box_tag 'issue[deleted_attachment_ids][]',
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div id="existing-attachments" style="<%= @page.deleted_attachment_ids.blank? ? 'display:none;' : '' %>">
|
||||
<% @page.attachments.each do |attachment| %>
|
||||
<span class="existing-attachment">
|
||||
<%= mime_type_icon(attachment.content_type, size: 12) %>
|
||||
<%= file_type_icon(attachment.content_type, size: 12) %>
|
||||
<%= text_field_tag '', attachment.filename, :class => "icon icon-attachment filename", :disabled => true %>
|
||||
<label class='inline'>
|
||||
<%= check_box_tag 'wiki_page[deleted_attachment_ids][]',
|
||||
|
||||
@@ -124,14 +124,14 @@ class IconsHelperTest < Redmine::HelperTest
|
||||
assert_match expected, activity_event_type_icon('time-entry')
|
||||
end
|
||||
|
||||
def test_mime_type_icon_should_return_specific_icon_for_known_mime_types
|
||||
def test_file_type_icon_should_return_specific_icon_for_known_mime_types
|
||||
expected = %r{<svg class="s18 icon-svg" aria-hidden="true"><use href="/assets/icons-\w+.svg#icon--text-plain"></use></svg>}
|
||||
assert_match expected, mime_type_icon('text/plain')
|
||||
assert_match expected, file_type_icon('text/plain')
|
||||
end
|
||||
|
||||
def test_mime_type_icon_should_return_generic_file_icon_for_unknown_mime_types
|
||||
def test_file_type_icon_should_return_generic_file_icon_for_unknown_mime_types
|
||||
expected = %r{<svg class="s18 icon-svg" aria-hidden="true"><use href="/assets/icons-\w+.svg#icon--file"></use></svg>}
|
||||
assert_match expected, mime_type_icon('unknown-type/unknown-subtype')
|
||||
assert_match expected, file_type_icon('unknown-type/unknown-subtype')
|
||||
end
|
||||
|
||||
def test_icon_for_mime_type_should_return_specific_icon_for_known_mime_types
|
||||
|
||||
Reference in New Issue
Block a user