forked from Gitlink/forgeplus
Compare commits
10 Commits
master
...
trustie_se
| Author | SHA1 | Date |
|---|---|---|
|
|
0f67944911 | |
|
|
8b656fd409 | |
|
|
815b364428 | |
|
|
18ae3853d7 | |
|
|
ce18cc380a | |
|
|
cbc6f4e7d1 | |
|
|
aa23762b2f | |
|
|
5c864acb64 | |
|
|
8bbfea2079 | |
|
|
8c2a543e61 |
13
CHANGELOG.md
13
CHANGELOG.md
|
|
@ -1,17 +1,6 @@
|
|||
# Changelog
|
||||
|
||||
## [v3.0.1](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2021-03-19
|
||||
|
||||
* BUGFIXES
|
||||
* Fix pull reqeust模块中用户头像显示问题
|
||||
* Fix 解决issue模块中,指派用户的问题
|
||||
* Fix 解决合并请求失败的后显示message信息不正确
|
||||
* Fix 代码目录页面,readme文件提供单独的api
|
||||
|
||||
* ENHANCEMENTS
|
||||
* 重构项目详情页面
|
||||
|
||||
## [v3.0.0](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2020-12-29
|
||||
## [v3.0.0](https://github.com/go-gitea/gitea/releases/tag/v1.13.1) - 2020-12-29
|
||||
|
||||
* BUGFIXES
|
||||
* Fix pull reqeust的访问权限问题 (#14156) (#14171)
|
||||
|
|
|
|||
12
README.md
12
README.md
|
|
@ -93,26 +93,26 @@ http://localhost:3000/
|
|||
|
||||
- 代码库
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
- 任务管理
|
||||

|
||||

|
||||
|
||||
- 任务查看
|
||||
|
||||

|
||||

|
||||
|
||||
- 任务指派
|
||||
|
||||

|
||||

|
||||
|
||||
- 里程碑
|
||||
|
||||

|
||||

|
||||
|
||||
### API
|
||||
- [API文档](https://forgeplus.trustie.net/docs/api)
|
||||
- [API](api_document.md)
|
||||
- [API](showdoc.com.cn)
|
||||
账号:forgeplus@admin.com 密码:forge123
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class ProjectsController < ApplicationController
|
|||
menu = []
|
||||
|
||||
menu.append(menu_hash_by_name("home"))
|
||||
menu.append(menu_hash_by_name("code")) if @project.has_menu_permission("code")
|
||||
menu.append(menu_hash_by_name("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")
|
||||
menu.append(menu_hash_by_name("devops")) if @project.has_menu_permission("devops")
|
||||
|
|
@ -26,7 +26,7 @@ class ProjectsController < ApplicationController
|
|||
scope = Projects::ListQuery.call(params)
|
||||
|
||||
# @projects = kaminari_paginate(scope)
|
||||
@projects = paginate scope.includes(:project_category, :project_language, :repository, :project_educoder, :owner)
|
||||
@projects = paginate scope.includes(:project_category, :project_language, :repository, :project_educoder, :owner, :project_units)
|
||||
|
||||
category_id = params[:category_id]
|
||||
@total_count =
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
# 新版项目详情
|
||||
def detail
|
||||
return render_not_found unless @project.has_menu_permission("code")
|
||||
@user = current_user
|
||||
@result = Repositories::DetailService.call(@owner, @repository, @user)
|
||||
@project_fork_id = @project.try(:forked_from_project_id)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,31 @@
|
|||
class SettingsController < ApplicationController
|
||||
def show
|
||||
@old_projects_url = nil
|
||||
@old_projects_url = nil
|
||||
@old_projects_url = "https://www.trustie.net/users/#{current_user.try(:login)}/projects" if User.current.logged?
|
||||
|
||||
@add = Site.add.select(:id, :name, :url, :key)
|
||||
@personal =
|
||||
if User.current.logged?
|
||||
arr =[]
|
||||
Site.personal.select(:id, :name, :url, :key).to_a.map(&:serializable_hash).each do |site|
|
||||
hash = {}
|
||||
site.each {|k, v|
|
||||
hash.merge!("#{k}": v.to_s.include?("current_user") ? v.split('current_user').join(current_user&.login) : v)
|
||||
}
|
||||
arr << hash
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
@common = []
|
||||
Site.common.select(:id, :name, :url, :key).to_a.map(&:serializable_hash).each do |site|
|
||||
next if site["url"].to_s.include?("current_user") && !User.current.logged?
|
||||
hash = {}
|
||||
site.each {|k, v|
|
||||
hash.merge!("#{k}": v.to_s.include?("current_user") ? v.split('current_user').join(current_user&.login) : v)
|
||||
}
|
||||
@common << hash
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: sites
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255)
|
||||
# url :string(255)
|
||||
# key :string(255)
|
||||
# site_type :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class Site < ApplicationRecord
|
||||
# add: 添加类链接
|
||||
# personal: 个人名下类链接,
|
||||
# common: 普通链接
|
||||
enum site_type: { add: 0, personal: 1, common: 2 }
|
||||
|
||||
def self.set_default
|
||||
|
||||
end
|
||||
end
|
||||
|
|
@ -46,7 +46,6 @@ class Projects::CreateService < ApplicationService
|
|||
{
|
||||
hidden: !repo_is_public,
|
||||
user_id: params[:user_id],
|
||||
website: params[:website],
|
||||
identifier: params[:repository_name]
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,4 +48,15 @@ json.setting do
|
|||
json.old_projects_url @old_projects_url
|
||||
|
||||
|
||||
json.add do
|
||||
json.array! @add, :name, :url, :key
|
||||
end
|
||||
|
||||
json.personal do
|
||||
json.array! @personal
|
||||
end
|
||||
|
||||
json.common do
|
||||
json.array! @common
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ Rails.application.routes.draw do
|
|||
|
||||
resources :edu_settings
|
||||
|
||||
resources :edu_settings
|
||||
scope '/api' do
|
||||
namespace :ci do
|
||||
resources :languages, only: [:index, :show] do
|
||||
|
|
@ -379,7 +378,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resource :repositories, path: '/', only: [:show, :create, :edit] do
|
||||
resource :repositories, path: '/', only: [:show, :create, :edit] do
|
||||
member do
|
||||
get :files
|
||||
get :detail
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
class CreateSites < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :sites do |t|
|
||||
t.string :name, comment: "中文名称"
|
||||
t.string :url, comment: "具体链接"
|
||||
t.string :key, comment: "标识"
|
||||
t.integer :site_type, comment: "分类,按照分类编排链接"
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue