fix: educoder sub_entries and commit author
This commit is contained in:
parent
e0c47c2abd
commit
33e17e8439
|
@ -81,6 +81,18 @@ class RepositoriesController < ApplicationController
|
|||
}
|
||||
else
|
||||
@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
|
||||
else
|
||||
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
|
||||
|
|
|
@ -8,10 +8,19 @@ if @project.educoder?
|
|||
json.time_from_now commit[0]['time']
|
||||
end
|
||||
json.author do
|
||||
{}
|
||||
# json.partial! '/projects/author', user: render_commit_author(commit['author'])
|
||||
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
|
||||
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
|
||||
json.committer {}
|
||||
end
|
||||
|
||||
if @project.forge?
|
||||
|
|
Loading…
Reference in New Issue