修改个人主页

This commit is contained in:
sylor_huang@126.com
2020-06-03 18:23:53 +08:00
parent e8e3a45227
commit c977b9350c
14 changed files with 148 additions and 82 deletions

View File

@@ -1,40 +1,4 @@
json.total_count @total_count
json.projects @projects do |project|
user = project.owner
next if user.blank?
json.id project.id
json.repo_id project&.repository.id
json.identifier project.identifier
json.name project.name
json.description Nokogiri::HTML(project.description).text
json.visits project.visits
json.praises_count project.praises_count.to_i
json.forked_count project.forked_count.to_i
json.is_public project.is_public
json.mirror_url project.repository&.mirror_url
json.last_update_time render_unix_time(project.updated_on)
json.time_ago time_from_now(project.updated_on)
json.forked_from_project_id project.forked_from_project_id
json.author do
json.name user.try(:show_real_name)
json.login user.login
json.image_url url_to_avatar(project.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
json.language do
if project.project_language.blank?
json.nil!
else
json.id project.project_language.id
json.name project.project_language.name
end
end
json.partial! "/projects/project_detail", project: project
end