commit加入到项目动态,并显示详情

This commit is contained in:
xxq250 2023-04-17 10:40:58 +08:00
parent 0a693a77b8
commit 5922c8800f
1 changed files with 7 additions and 5 deletions

View File

@ -19,12 +19,14 @@ if trend.trend_type == "Issue"
elsif trend.trend_type == "VersionRelease" elsif trend.trend_type == "VersionRelease"
json.partial! "version_releases/simple_version_release", locals: {version: trend.trend} json.partial! "version_releases/simple_version_release", locals: {version: trend.trend}
elsif trend.trend_type == "CommitLog" elsif trend.trend_type == "CommitLog"
commit_log = trend.trend json.commit_log do
json.user do commit_log = trend.trend
json.partial! 'users/user_simple', locals: {user: commit_log.user} json.user do
json.partial! 'users/user_simple', locals: {user: commit_log.user}
end
json.ref commit_log.ref.to_s.gsub("refs/heads/", "")
json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at
end end
json.ref commit_log.ref.to_s.gsub("refs/heads/", "")
json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at
else else
json.name trend.trend&.title json.name trend.trend&.title
json.created_at format_time(trend.trend&.created_at) json.created_at format_time(trend.trend&.created_at)