Merge branch 'pre_trustie_server' into trustie_server

This commit is contained in:
2024-11-16 14:36:37 +08:00
15 changed files with 150 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
json.filename file["filename"]
json.old_name file["old_name"]
json.index file["index"]
json.type file["type"]
json.is_bin file["is_bin"]
json.is_created file["is_created"]
json.is_deleted file["is_deleted"]
json.is_lfs_file file["is_lfs_file"]
json.is_renamed file["is_renamed"]
json.is_submodule file["is_submodule"]
json.additions file["additions"]
json.deletions file["deletions"]
json.changes file["changes"]
json.sha file["sha"]

View File

@@ -0,0 +1,10 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object
else
json.file_nums @result_object[:total_data].to_i
json.total_addition @result_object[:data]["total_addition"]
json.total_deletion @result_object[:data]["total_deletion"]
json.files @result_object[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end

View File

@@ -0,0 +1,12 @@
json.author do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.committer do
json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] }
end
json.timestamp render_unix_time(commit['Committer']['When'])
json.time_from_now time_from_now(commit['Committer']['When'])
json.created_at render_format_time_with_date(commit['Committer']['When'])
json.message commit['CommitMessage']
json.sha commit['Sha']

View File

@@ -0,0 +1,12 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @compare_result['Diff']
else
json.file_nums @compare_result[:total_data].to_i
json.total_addition @compare_result[:data]["total_addition"]
json.total_deletion @compare_result[:data]["total_deletion"]
json.files @compare_result[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end
json.status @merge_status
json.message @merge_message

View File

@@ -0,0 +1,10 @@
if params[:filepath].present?
json.partial! "api/v1/projects/simple_gitea_diff_detail", diff: @result_object
else
json.file_nums @result_object[:total_data].to_i
json.total_addition @result_object[:data]["total_addition"]
json.total_deletion @result_object[:data]["total_deletion"]
json.files @result_object[:data]["files"] do |file|
json.partial! "api/v1/projects/simple_gitea_file", file: file
end
end