Merge branch 'dev_trustie' of http://gitea.trustie.net/jasder/forgeplus into dev_trustie

This commit is contained in:
Jasder 2020-06-29 09:01:30 +08:00
commit 4dcdea33aa
5 changed files with 8 additions and 3 deletions

View File

@ -20,6 +20,7 @@ class UsersController < ApplicationController
user_projects = User.current.logged? && (User.current.admin? || User.current.login == @user.login) ? @user.projects : @user.projects.visible
@projects_common_count = user_projects.common.size
@projects_mirrior_count = user_projects.mirror.size
@projects_sync_mirrior_count = user_projects.sync_mirror.size
end
def watch_users

View File

@ -3,7 +3,8 @@ module ProjectsHelper
def render_zh_project_type(project_type)
case project_type
when 'common' then "开源托管项目"
when 'mirror', 'sync_mirror' then "开源镜像项目"
when 'sync_mirror' then "镜像托管项目"
when 'mirror' then "开源镜像项目"
end
end

View File

@ -5,7 +5,7 @@ module RepositoriesHelper
end
def download_type(str)
default_type = %w(xlsx xls ppt pptx pdf zip 7z rar exe pdb obj idb png jpg gif tif psd svg)
default_type = %w(xlsx xls ppt pptx pdf zip 7z rar exe pdb obj idb png jpg gif tif psd svg RData rdata)
default_type.include?(str&.downcase)
end

View File

@ -44,6 +44,8 @@ class Projects::ListMyQuery < ApplicationQuery
projects = projects.common
elsif params[:project_type].to_s === "mirror"
projects = projects.mirror
elsif params[:project_type].to_s === "sync_mirror"
projects = projects.sync_mirror
end
q = projects.ransack(name_or_identifier_cont: params[:search])

View File

@ -13,4 +13,5 @@ json.watching_count @user.follow_count #关注数
json.undo_events @undo_events
json.user_composes_count @user_composes_count
json.common_projects_count @projects_common_count
json.mirror_projects_count @projects_mirrior_count
json.mirror_projects_count @projects_mirrior_count
json.sync_mirror_projects_count @projects_sync_mirrior_count