mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
@@ -8,12 +8,13 @@ if @project.forge?
|
||||
json.path entry['path']
|
||||
json.type entry['type']
|
||||
json.size entry['size']
|
||||
json.content entry['content'].present? && !direct_download ? render_decode64_content(entry['content']) : ""
|
||||
|
||||
json.content decode64_content(entry, @owner, @repository, @ref)
|
||||
json.target entry['target']
|
||||
json.download_url entry['download_url']
|
||||
json.direct_download direct_download
|
||||
json.image_type image_type
|
||||
json.is_readme_file is_readme_type?(file_name)
|
||||
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
||||
if entry['latest_commit']
|
||||
if entry['type'] != 'file'
|
||||
json.partial! 'last_commit', entry: entry
|
||||
|
||||
@@ -51,17 +51,8 @@ if @project.forge?
|
||||
json.sha entry['sha']
|
||||
json.type entry['type']
|
||||
json.size entry['size']
|
||||
content =
|
||||
if is_readme_type?(entry['name'])
|
||||
is_readme_file = true
|
||||
content = Gitea::Repository::Entries::GetService.call(@owner, @project.identifier, entry['name'], ref: @ref)['content']
|
||||
readme_render_decode64_content(content, @path)
|
||||
else
|
||||
is_readme_file = false
|
||||
entry['content']
|
||||
end
|
||||
json.is_readme_file is_readme_file
|
||||
json.content content
|
||||
json.is_readme_file is_readme?(entry['type'], entry['name'])
|
||||
json.content decode64_content(entry, @owner, @repository, @ref, @path)
|
||||
json.target entry['target']
|
||||
if entry['latest_commit']
|
||||
json.partial! 'last_commit', entry: entry
|
||||
|
||||
Reference in New Issue
Block a user