mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
14
app/views/api/v1/projects/_simple_gitea_file.jbuilder
Normal file
14
app/views/api/v1/projects/_simple_gitea_file.jbuilder
Normal 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"]
|
||||
10
app/views/api/v1/projects/commits/files.json.jbuilder
Normal file
10
app/views/api/v1/projects/commits/files.json.jbuilder
Normal 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
|
||||
@@ -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']
|
||||
12
app/views/api/v1/projects/compare/files.json.jbuilder
Normal file
12
app/views/api/v1/projects/compare/files.json.jbuilder
Normal 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
|
||||
10
app/views/api/v1/projects/pulls/pulls/files.json.jbuilder
Normal file
10
app/views/api/v1/projects/pulls/pulls/files.json.jbuilder
Normal 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
|
||||
Reference in New Issue
Block a user