Merge branch 'develop' of https://gitlink.org.cn/Trustie/forgeplus into develop

This commit is contained in:
yystopf 2022-12-09 11:45:36 +08:00
commit 204554b34c
5 changed files with 205 additions and 204 deletions

View File

@ -6,7 +6,7 @@ module Admins::ProjectsHelper
if owner.is_a?(User)
link_to(project.owner&.real_name, "/#{project&.owner&.login}", target: '_blank')
elsif owner.is_a?(Organization)
link_to(project.owner&.real_name, "/organize/#{project&.owner&.login}", target: '_blank')
link_to(project.owner&.real_name, "/#{project&.owner&.login}", target: '_blank')
else
""
end

View File

@ -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

View File

@ -27,7 +27,7 @@
<td><%= user.identity %></td>
<td><%= display_text(user.created_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= display_text(user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= link_to user.projects_count, "/users/#{user.login}/projects", target: "_blank" %></td>
<td><%= link_to user.projects_count, "/#{user.login}/projects", target: "_blank" %></td>
<td class="action-container">
<%= link_to '编辑', edit_admins_user_path(user), class: 'action' %>

View File

@ -1,7 +1,7 @@
if @project.forge?
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 != "Makefile".downcase && download_type(file_type)
image_type = image_type?(file_type)
json.name file_name
json.sha entry['sha']

View File

@ -5,6 +5,7 @@ OmniAuth.config.add_camelization 'qq', 'QQ' if config.dig("oauth", "qq")
# OmniAuth.config.add_camelization 'gitee', 'Gitee' if config.dig("oauth", "gitee")
# OmniAuth.config.add_camelization 'wechat', 'Wechat' if config.dig("oauth", "wechat")
OmniAuth.config.logger = Rails.logger
OmniAuth.config.allowed_request_methods = %i[get post]
OmniAuth.config.before_request_phase = nil
OmniAuth.config.before_callback_phase = nil
OmniAuth.config.on_failure = Proc.new { |env|