mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-29 00:14:41 +08:00
Merge pull request #3196 from aignatov-bio/ai-sci-5484-update-images-extensions
Fix upercase file extensions [SCI-5484]
This commit is contained in:
commit
8509d86c48
2 changed files with 4 additions and 4 deletions
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
module FileIconsHelper
|
module FileIconsHelper
|
||||||
def wopi_file?(asset)
|
def wopi_file?(asset)
|
||||||
file_ext = asset.file_name.split('.').last
|
file_ext = asset.file_name.split('.').last.downcase
|
||||||
%w(csv ods xls xlsb xlsm xlsx odp pot potm potx pps ppsm
|
%w(csv ods xls xlsb xlsm xlsx odp pot potm potx pps ppsm
|
||||||
ppsx ppt pptm pptx doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
ppsx ppt pptm pptx doc docm docx dot dotm dotx odt rtf).include?(file_ext)
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_fa_icon_class(asset)
|
def file_fa_icon_class(asset)
|
||||||
file_ext = asset.file_name.split('.').last
|
file_ext = asset.file_name.split('.').last.downcase
|
||||||
|
|
||||||
if Extends::FILE_FA_ICON_MAPPINGS[file_ext] # Check for custom mappings or possible overrides
|
if Extends::FILE_FA_ICON_MAPPINGS[file_ext] # Check for custom mappings or possible overrides
|
||||||
Extends::FILE_FA_ICON_MAPPINGS[file_ext]
|
Extends::FILE_FA_ICON_MAPPINGS[file_ext]
|
||||||
|
@ -31,7 +31,7 @@ module FileIconsHelper
|
||||||
|
|
||||||
# For showing next to file
|
# For showing next to file
|
||||||
def file_extension_icon(asset, report = false)
|
def file_extension_icon(asset, report = false)
|
||||||
file_ext = asset.file_name.split('.').last
|
file_ext = asset.file_name.split('.').last.downcase
|
||||||
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
if Constants::FILE_TEXT_FORMATS.include?(file_ext)
|
||||||
image_link = 'icon_small/docx_file.svg'
|
image_link = 'icon_small/docx_file.svg'
|
||||||
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
elsif Constants::FILE_TABLE_FORMATS.include?(file_ext)
|
||||||
|
|
|
@ -308,7 +308,7 @@ class Constants
|
||||||
PREVIEWABLE_FILE_TYPES = TEXT_EXTRACT_FILE_TYPES
|
PREVIEWABLE_FILE_TYPES = TEXT_EXTRACT_FILE_TYPES
|
||||||
|
|
||||||
WHITELISTED_IMAGE_TYPES = [
|
WHITELISTED_IMAGE_TYPES = [
|
||||||
'gif', 'jpeg', 'pjpeg', 'png', 'x-png', 'svg+xml', 'bmp', 'tiff'
|
'gif', 'jpeg', 'pjpeg', 'png', 'x-png', 'svg+xml', 'bmp', 'tiff', 'jpg'
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
WHITELISTED_IMAGE_TYPES_EDITABLE = %w(
|
WHITELISTED_IMAGE_TYPES_EDITABLE = %w(
|
||||||
|
|
Loading…
Add table
Reference in a new issue