Merge branch 'release-1.12.11'

Conflicts:
	config/initializers/extends.rb
This commit is contained in:
Luka Murn 2018-03-01 14:04:57 +01:00
commit 070450f813
6 changed files with 25 additions and 7 deletions

View file

@ -1 +1 @@
1.12.10
1.12.11

View file

@ -15,6 +15,11 @@ module FileIconsHelper
image_link = 'office/PowerPoint-pptx_20x20x32.png'
end
# Now check for custom mappings or possible overrides
if Extends::FILE_ICON_MAPPINGS[file_ext]
image_link = Extends::FILE_ICON_MAPPINGS[file_ext]
end
if image_link
image_tag image_link
else

View file

@ -20,8 +20,11 @@
<% if wopi_file?(result.asset) %>
<%= wopi_asset_file_name(result.asset) %>
<% else %>
<p><%= truncate(result.asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
<p>
<%= file_extension_icon(result.asset) %>
<%= truncate(result.asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %>
</p>
<% end %>
<% end %>
<%= wopi_result_view_file_button(result) %>

View file

@ -121,8 +121,11 @@
<% else %>
<%= image_tag asset.url(:medium) if asset.is_image? %>
<% end %>
<p><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
<p>
<%= file_extension_icon(asset) %>
<%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %>
</p>
<% end %>
</li>
<% end %>

View file

@ -7,8 +7,11 @@
<% if wopi_file?(asset) %>
<%= wopi_asset_file_name(asset) %>
<% else %>
<p><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
<p>
<%= file_extension_icon(asset) %>
<%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %>
</p>
<% end %>
<% end %>
<%= wopi_asset_view_button(asset) %>

View file

@ -52,4 +52,8 @@ class Extends
OMNIAUTH_PROVIDERS = []
INITIAL_USER_OPTIONS = {}
# Hash used for mapping file extensions to custom icons,
# 'extension' => 'path_to_the_icon'
FILE_ICON_MAPPINGS = {}
end