mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
FIX coder review
This commit is contained in:
8
app/views/repositories/_last_commit.json.jbuilder
Normal file
8
app/views/repositories/_last_commit.json.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
created_at = Time.at(entry['latest_commit']['created_at'].to_i).strftime("%Y-%m-%d %H:%M")
|
||||||
|
json.commit do
|
||||||
|
json.message entry['latest_commit']['message']
|
||||||
|
json.sha entry['latest_commit']['sha']
|
||||||
|
json.created_at created_at
|
||||||
|
json.time_from_now time_from_now(created_at)
|
||||||
|
json.created_at_unix entry['latest_commit']['created_at']
|
||||||
|
end
|
||||||
@@ -10,3 +10,7 @@ json.content entry['content'].present? && !direct_download ? render_decode64_con
|
|||||||
json.target entry['target']
|
json.target entry['target']
|
||||||
json.download_url entry['download_url']
|
json.download_url entry['download_url']
|
||||||
json.direct_download direct_download
|
json.direct_download direct_download
|
||||||
|
|
||||||
|
if entry['latest_commit']
|
||||||
|
json.partial! 'last_commit', entry: entry
|
||||||
|
end
|
||||||
|
|||||||
@@ -28,13 +28,6 @@ json.array! @entries do |entry|
|
|||||||
end
|
end
|
||||||
|
|
||||||
if entry['latest_commit']
|
if entry['latest_commit']
|
||||||
created_at = Time.at(entry['latest_commit']['created_at'].to_i).strftime("%Y-%m-%d %H:%M")
|
json.partial! 'last_commit', entry: entry
|
||||||
json.commit do
|
|
||||||
json.message entry['latest_commit']['message']
|
|
||||||
json.sha entry['latest_commit']['sha']
|
|
||||||
json.created_at created_at
|
|
||||||
json.time_from_now time_from_now(created_at)
|
|
||||||
json.created_at_unix entry['latest_commit']['created_at']
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user