mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
仓库releases文件下载链接构建
This commit is contained in:
@@ -16,6 +16,12 @@ json.user_login user&.login
|
||||
json.image_url user.present? ? url_to_avatar(user) : ""
|
||||
json.attachments do
|
||||
json.array! version.try(:attachments) do |attachment|
|
||||
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
|
||||
# json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
|
||||
json.id attachment.id
|
||||
json.title attachment.title
|
||||
json.filesize number_to_human_size attachment.filesize
|
||||
json.description attachment.description
|
||||
json.is_pdf attachment.is_pdf?
|
||||
json.url "/#{@owner.login}/#{@repository.identifier}/releases/download/#{version&.tag_name}/#{attachment.filename}"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user