FIX get latest commit bug
This commit is contained in:
parent
f3d4f437cb
commit
b7e23a62d0
|
@ -1,7 +1,9 @@
|
||||||
json.commit do
|
if latest_commit.blank?
|
||||||
json.message entry['latest_commit']['message']
|
json.nil!
|
||||||
json.sha entry['latest_commit']['sha']
|
else
|
||||||
json.created_at render_format_time_with_unix(entry['latest_commit']['created_at'].to_i)
|
json.message latest_commit['message']
|
||||||
json.time_from_now time_from_now(render_format_time_with_unix(entry['latest_commit']['created_at'].to_i))
|
json.sha latest_commit['sha']
|
||||||
json.created_at_unix entry['latest_commit']['created_at']
|
json.created_at render_format_time_with_unix(latest_commit['created_at'].to_i)
|
||||||
|
json.time_from_now time_from_now(render_format_time_with_unix(latest_commit['created_at'].to_i))
|
||||||
|
json.created_at_unix latest_commit['created_at']
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,12 +15,8 @@ if @project.forge?
|
||||||
json.direct_download direct_download
|
json.direct_download direct_download
|
||||||
json.image_type image_type
|
json.image_type image_type
|
||||||
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
||||||
if entry['latest_commit']
|
json.commit do
|
||||||
if entry['type'] != 'file'
|
json.partial! 'last_commit', latest_commit: entry['latest_commit']
|
||||||
json.partial! 'last_commit', entry: entry
|
|
||||||
else
|
|
||||||
json.commit nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -38,8 +34,11 @@ if @project.educoder?
|
||||||
json.direct_download false
|
json.direct_download false
|
||||||
json.image_type false
|
json.image_type false
|
||||||
json.is_readme_file false
|
json.is_readme_file false
|
||||||
if entry['latest_commit']
|
json.commit do
|
||||||
# json.partial! 'last_commit', entry: entry
|
json.message entry['title']
|
||||||
json.partial! 'repositories/simple_entry', locals: { entry: entry }
|
json.time_from_now entry['time']
|
||||||
|
json.sha nil
|
||||||
|
json.created_at_unix nil
|
||||||
|
json.created_at nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,8 +54,8 @@ if @project.forge?
|
||||||
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
||||||
json.content decode64_content(entry, @owner, @repository, @ref, @path)
|
json.content decode64_content(entry, @owner, @repository, @ref, @path)
|
||||||
json.target entry['target']
|
json.target entry['target']
|
||||||
if entry['latest_commit']
|
json.commit do
|
||||||
json.partial! 'last_commit', entry: entry
|
json.partial! 'last_commit', latest_commit: entry['latest_commit']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue