Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
yystopf 2021-12-13 16:40:14 +08:00
commit 82bae9159b
2 changed files with 20 additions and 9 deletions

View File

@ -17,9 +17,9 @@ class ProjectsController < ApplicationController
menu.append(menu_hash_by_name("code")) if @project.has_menu_permission("code")
menu.append(menu_hash_by_name("issues")) if @project.has_menu_permission("issues")
menu.append(menu_hash_by_name("pulls")) if @project.has_menu_permission("pulls") && @project.forge?
menu.append(menu_hash_by_name("wiki")) if @project.has_menu_permission("wiki") && @project.forge?
menu.append(menu_hash_by_name("devops")) if @project.has_menu_permission("devops") && @project.forge?
menu.append(menu_hash_by_name("versions")) if @project.has_menu_permission("versions")
menu.append(menu_hash_by_name("wiki")) if @project.has_menu_permission("wiki") && @project.forge?
menu.append(menu_hash_by_name("resources")) if @project.has_menu_permission("resources") && @project.forge?
menu.append(menu_hash_by_name("activity"))
menu.append(menu_hash_by_name("settings")) if (current_user.admin? || @project.manager?(current_user)) && @project.forge?

View File

@ -3,15 +3,26 @@ owner_common = $redis_cache.hgetall("v2-owner-common:#{project_common["owner_id"
json.id item[0]
json.score item[1]
json.name project_common["name"]
json.identifier project_common["identifier"]
json.description project_common["description"]
json.owner do
json.id project_common["owner_id"]
json.type owner_common["type"]
json.name owner_common["name"]
json.login owner_common["login"]
json.avatar_url owner_common["avatar_url"]
if project_common['identifier'].include?("/")
json.identifier project_common["identifier"].split('/')[1]
json.owner do
json.id nil
json.type 'User'
json.name project_common["identifier"].split('/')[0]
json.login project_common["identifier"].split('/')[0]
json.avatar_url User::Avatar.get_letter_avatar_url(project_common["identifier"].split('/')[0])
end
else
json.identifier project_common["identifier"]
json.owner do
json.id project_common["owner_id"]
json.type owner_common["type"]
json.name owner_common["name"]
json.login owner_common["login"]
json.avatar_url owner_common["avatar_url"]
end
end
json.description project_common["description"]
json.visits project_common["visits"]
json.forks project_common["forks"]
json.watchers project_common["watchers"]