forked from Gitlink/forgeplus
fixed 下载文件类增加xlsx,Makefile可显示
This commit is contained in:
parent
1aab51104f
commit
6350d2e5a9
|
@ -10,7 +10,7 @@ module RepositoriesHelper
|
|||
end
|
||||
|
||||
def download_type(str)
|
||||
default_type = %w(ppt pptx pdf zip 7z rar exe pdb obj idb RData rdata doc docx mpp vsdx dot otf eot ttf woff woff2 mp4 mov wmv flv mpeg avi avchd webm mkv apk)
|
||||
default_type = %w(ppt pptx pdf zip 7z rar exe pdb obj idb RData rdata doc docx mpp vsdx dot otf eot ttf woff woff2 mp4 mov wmv flv mpeg avi avchd webm mkv apk xlsx xls)
|
||||
default_type.include?(str&.downcase) || str.blank?
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ if @project.forge?
|
|||
is_dir = @sub_entries.is_a?(Array)
|
||||
file_name = entry['name']
|
||||
file_type = File.extname(file_name.to_s)[1..-1]
|
||||
direct_download = download_type(file_type)
|
||||
direct_download = file_name.to_s.downcase.include?("Makefile".downcase) || download_type(file_type)
|
||||
image_type = image_type?(file_type)
|
||||
json.name file_name
|
||||
json.sha entry['sha']
|
||||
|
|
Loading…
Reference in New Issue