Merge branch 'dev_trustie' of http://gitea.trustie.net/jasder/forgeplus into dev_trustie

This commit is contained in:
sylor_huang@126.com 2020-05-29 18:13:45 +08:00
commit 3616e84548
2 changed files with 4 additions and 4 deletions

View File

@ -5,8 +5,8 @@ module RepositoriesHelper
end
def download_type(str)
default_type = %w(xlsx xls ppt pptx pdf zip 7z rar exe pdb obj idb)
default_type.include?(str)
default_type = %w(xlsx xls ppt pptx pdf zip 7z rar exe pdb obj idb png jpg gif tif psd svg)
default_type.include?(str&.downcase)
end
def render_commit_author(author_json)

View File

@ -13,13 +13,13 @@ json.array! @branches do |branch|
json.time_from_now time_from_now(branch['commit']['timestamp'])
end
user = User.find_by_login branch['commit']['author']['name']
user = User.find_by_login branch['commit']['author']['username']
json.author do
if user
json.login user.login
json.image_url url_to_avatar(user)
else
json.nil
json.nil!
end
end
end