FIX coder review forr branches view

This commit is contained in:
Jasder 2020-06-03 11:20:11 +08:00
parent 34984d12cb
commit 9f9cec34b6
1 changed files with 3 additions and 11 deletions

View File

@ -7,19 +7,11 @@ json.array! @branches do |branch|
json.zip_url render_zip_url(@project, branch['name']) json.zip_url render_zip_url(@project, branch['name'])
json.tar_url render_tar_url(@project, branch['name']) json.tar_url render_tar_url(@project, branch['name'])
json.last_commit do json.last_commit do
json.id branch['commit']['id'] json.sha branch['commit']['id']
json.message branch['commit']['message'] json.message branch['commit']['message']
json.timestamp render_unix_time(branch['commit']['timestamp']) json.timestamp render_unix_time(branch['commit']['timestamp'])
json.time_from_now time_from_now(branch['commit']['timestamp']) json.time_from_now time_from_now(branch['commit']['timestamp'])
end json.author branch['commit']['author']
json.committer branch['commit']['committer']
user = find_user_by_login_or_mail(branch['commit']['author']['name'])
json.author do
if user
json.login user.login
json.image_url url_to_avatar(user)
else
json.nil!
end
end end
end end