Browse Source

Merge branch 'develop' into trustie_server

tags/v3.0.3
jasder 5 years ago
parent
commit
8ce7fd95cb
2 changed files with 10 additions and 7 deletions
  1. +2
    -2
      app/views/pull_requests/_commit.json.jbuilder
  2. +8
    -5
      app/views/repositories/commits.json.jbuilder

+ 2
- 2
app/views/pull_requests/_commit.json.jbuilder View File

@@ -1,10 +1,10 @@
json.author do
author = User.find_by(login: commit['Author']['Name'])
author = User.find_by(mail: commit['Author']['Email'])
json.partial! 'repositories/commit_author', locals: { user: author, name: commit['Committer']['Name'] }
end

json.committer do
author = User.find_by(login: commit['Committer']['Name'])
author = User.find_by(mail: commit['Committer']['Email'])
json.partial! 'repositories/commit_author', locals: { user: author, name: commit['Committer']['Name'] }
end
json.timestamp render_unix_time(commit['Committer']['When'])


+ 8
- 5
app/views/repositories/commits.json.jbuilder View File

@@ -5,12 +5,15 @@ else
json.total_count @hash_commit[:total_count]
json.commits do
json.array! @hash_commit[:body] do |commit|
json.commit1 commit
commiter = commit['committer']
if commiter.present?
commit_user_id = commiter['id']
forge_user = User.simple_select.find_by(gitea_uid: commit_user_id)
end

forge_user =
if commiter.present?
User.simple_select.find_by(mail: commiter['email'])
else
User.simple_select.find_by(mail: commit['commit']['committer']['email'])
end
json.sha commit['sha']
json.message commit['commit']['message']
json.timestamp render_unix_time(commit['commit']['author']['date'])


Loading…
Cancel
Save