add: repo contributors

This commit is contained in:
2021-03-18 16:35:40 +08:00
parent 25186b4e81
commit 6a7ef2a1a7
3 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
total_count = @contributors.size
json.contributors @contributors.each do |contributor|
user = User.find_by(gitea_uid: contributor["id"])
if contributor["login"] == "root"
total_count -= 1
next
end
json.contributions contributor["contributions"]
json.gid contributor["id"]
json.login user.login
json.type user&.type
json.name user.real_name
json.image_url url_to_avatar(user)
end
json.total_count total_count