FIX merge dev_trustie branch

This commit is contained in:
Jasder
2020-10-04 12:05:53 +08:00
10 changed files with 118 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
json.array! @projects do |project|
owner = project.owner
json.id project.id
json.repo_id project&.repository&.id
json.identifier project.identifier
json.name project.name
json.visits project.visits
json.author do
json.name owner.try(:show_real_name)
json.login owner.login
json.image_url url_to_avatar(owner)
end
json.category do
if project.project_category.blank?
json.nil!
else
json.id project.project_category.id
json.name project.project_category.name
end
end
end

View File

@@ -7,7 +7,7 @@ json.sha entry['sha']
json.path entry['path']
json.type entry['type']
json.size entry['size']
json.content entry['content'].present? && !direct_download ? render_decode64_content(entry['content']).force_encoding('UTF-8') : ""
json.content entry['content'].present? && !direct_download ? render_decode64_content(entry['content']) : ""
json.target entry['target']
json.download_url entry['download_url']
json.direct_download direct_download