Compare commits

..

4 Commits

Author SHA1 Message Date
jasder 2932866198 Merge branch 'master' of https://git.trustie.net/jasder/forgeplus 2021-03-22 09:50:35 +08:00
jasder 0d8ddc34cc FIX update Changelog 2021-03-22 09:50:24 +08:00
jasder bd46d2dcc7 fix 2021-03-11 14:59:21 +08:00
jasder 6063c7c414 fix 更新api文档 2021-03-11 14:58:44 +08:00
10 changed files with 25 additions and 82 deletions

View File

@ -1,6 +1,17 @@
# Changelog
## [v3.0.0](https://github.com/go-gitea/gitea/releases/tag/v1.13.1) - 2020-12-29
## [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
* BUGFIXES
* Fix pull reqeust的访问权限问题 (#14156) (#14171)

View File

@ -93,26 +93,26 @@ http://localhost:3000/
- 代码库
![](docs/figs/code.png)
![](docs/figs/code.png?raw=true)
- 任务管理
![](docs/figs/issue_manage.png)
![](docs/figs/issue_manage.png?raw=true)
- 任务查看
![](docs/figs/issue_view.png)
![](docs/figs/issue_view.png?raw=true)
- 任务指派
![](docs/figs/issue_assign2.png)
![](docs/figs/issue_assign2.png?raw=true)
- 里程碑
![](docs/figs/milestone.png)
![](docs/figs/milestone.png?raw=true)
### API
- [API](api_document.md)
- [API文档](https://forgeplus.trustie.net/docs/api)
- [API](showdoc.com.cn)
账号forgeplus@admin.com 密码forge123

View File

@ -11,7 +11,7 @@ class ProjectsController < ApplicationController
menu = []
menu.append(menu_hash_by_name("home"))
menu.append(menu_hash_by_name("code"))
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")
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, :project_units)
@projects = paginate scope.includes(:project_category, :project_language, :repository, :project_educoder, :owner)
category_id = params[:category_id]
@total_count =

View File

@ -18,6 +18,7 @@ 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)

View File

@ -1,31 +1,6 @@
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

View File

@ -1,23 +0,0 @@
# == 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

View File

@ -46,6 +46,7 @@ class Projects::CreateService < ApplicationService
{
hidden: !repo_is_public,
user_id: params[:user_id],
website: params[:website],
identifier: params[:repository_name]
}
end

View File

@ -48,15 +48,4 @@ 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

View File

@ -23,6 +23,7 @@ Rails.application.routes.draw do
resources :edu_settings
resources :edu_settings
scope '/api' do
namespace :ci do
resources :languages, only: [:index, :show] do
@ -378,7 +379,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

View File

@ -1,12 +0,0 @@
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