Updated the lists of office online file extensions

Extended the list of file extensions that receive office online icons and 'open in' text.
This commit is contained in:
Nbernot 2017-02-14 16:44:03 +01:00 committed by GitHub
parent 226d5d8247
commit 97584aabb3

View file

@ -1,17 +1,17 @@
module FileIconsHelper
def wopi_file?(asset)
file_ext = asset.file_file_name.split('.').last
%w(doc docx xls xlsx ppt pptx).include?(file_ext)
%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)
end
# For showing next to file
def file_extension_icon(asset)
file_ext = asset.file_file_name.split('.').last
if %w(doc docx).include?(file_ext)
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
image_link = 'office/Word-docx_20x20x32.png'
elsif %w(xls xlsx).include?(file_ext)
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
image_link = 'office/Excel-xlsx_20x20x32.png'
elsif %w(ppt pptx).include?(file_ext)
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
image_link = 'office/PowerPoint-pptx_20x20x32.png'
end
@ -25,11 +25,11 @@ module FileIconsHelper
# For showing in view/edit buttons (WOPI)
def file_application_icon(asset)
file_ext = asset.file_file_name.split('.').last
if %w(doc docx).include?(file_ext)
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
image_link = 'office/Word-color_16x16x32.png'
elsif %w(xls xlsx).include?(file_ext)
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
image_link = 'office/Excel-color_16x16x32.png'
elsif %w(ppt pptx).include?(file_ext)
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
image_link = 'office/PowerPoint-Color_16x16x32.png'
end
@ -43,11 +43,11 @@ module FileIconsHelper
# Shows correct WOPI application text (Word Online/Excel ..)
def wopi_button_text(asset, action)
file_ext = asset.file_file_name.split('.').last
if %w(doc docx).include?(file_ext)
if %w(doc docm docx dot dotm dotx odt rtf).include?(file_ext)
app = 'Word Online'
elsif %w(xls xlsx).include?(file_ext)
elsif %w(csv ods xls xlsb xlsm xlsx).include?(file_ext)
app = 'Excel Online'
elsif %w(ppt pptx).include?(file_ext)
elsif %w(odp pot potm potx pps ppsm ppsx ppt pptm pptx).include?(file_ext)
app = 'PowerPoint Online'
end