fix: educoder sub_entries and commit author
This commit is contained in:
parent
e0c47c2abd
commit
33e17e8439
|
@ -81,6 +81,18 @@ class RepositoriesController < ApplicationController
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
||||||
|
if @sub_entries.blank?
|
||||||
|
@sub_entries = Educoder::Repository::Entries::GetService.call(@project&.project_educoder&.repo_name, file_path_uri)
|
||||||
|
return render_error('该文件暂未开放,敬请期待.') if @sub_entries['status'].to_i === -1
|
||||||
|
tmp_entries = [{
|
||||||
|
"content" => @sub_entries['data']['content'],
|
||||||
|
"type" => "blob"
|
||||||
|
}]
|
||||||
|
@sub_entries = {
|
||||||
|
"trees"=>tmp_entries,
|
||||||
|
"commits" => [{}]
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
|
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
|
||||||
|
|
|
@ -7,11 +7,20 @@ if @project.educoder?
|
||||||
json.timestamp 0
|
json.timestamp 0
|
||||||
json.time_from_now commit[0]['time']
|
json.time_from_now commit[0]['time']
|
||||||
end
|
end
|
||||||
json.author do
|
json.author do
|
||||||
{}
|
json.id nil
|
||||||
# json.partial! '/projects/author', user: render_commit_author(commit['author'])
|
json.login commit[0]['author']['username']
|
||||||
|
json.name commit[0]['author']['username']
|
||||||
|
json.type nil
|
||||||
|
json.image_url commit[0]['author']['image_url']
|
||||||
|
end
|
||||||
|
json.commiter do
|
||||||
|
json.id nil
|
||||||
|
json.login commit[0]['author']['username']
|
||||||
|
json.name commit[0]['author']['username']
|
||||||
|
json.type nil
|
||||||
|
json.image_url commit[0]['author']['image_url']
|
||||||
end
|
end
|
||||||
json.committer {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if @project.forge?
|
if @project.forge?
|
||||||
|
|
Loading…
Reference in New Issue