mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增:forks特殊显示逻辑
This commit is contained in:
@@ -22,6 +22,12 @@ class RepositoriesController < ApplicationController
|
||||
def detail
|
||||
@user = current_user
|
||||
@result = Repositories::DetailService.call(@owner, @repository, @user)
|
||||
cache_total_forks = $redis_cache.get("ProjectSpecialForks:#{@project.id}")
|
||||
if cache_total_forks.present?
|
||||
@project_forked_count = @project.forked_count.to_i
|
||||
else
|
||||
@project_forked_count = cache_total_forks.to_i
|
||||
end
|
||||
@project_fork_id = @project.try(:forked_from_project_id)
|
||||
if @project_fork_id.present?
|
||||
@fork_project = Project.find_by(id: @project_fork_id)
|
||||
@@ -322,7 +328,7 @@ class RepositoriesController < ApplicationController
|
||||
def get_latest_commit
|
||||
latest_commit = @project.educoder? ? nil : project_commits
|
||||
@latest_commit = latest_commit.present? ? latest_commit[:body][0] : nil
|
||||
cache_total_commits = $redis_cache.get("ProjectSpecialCommit:#{project.id}")
|
||||
cache_total_commits = $redis_cache.get("ProjectSpecialCommit:#{@project.id}")
|
||||
if cache_total_commits.present?
|
||||
@commits_count = cache_total_commits.to_i
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user