Compare commits

..

10 Commits

Author SHA1 Message Date
jasder 0f67944911 FIX code bug 2021-03-23 15:58:12 +08:00
jasder 8b656fd409 FIX bug 2021-03-23 15:47:01 +08:00
jasder 815b364428 ADD common url with setting api 2021-03-23 15:42:56 +08:00
jasder 18ae3853d7 FIX update setting api 2021-03-23 11:42:22 +08:00
jasder ce18cc380a Merge branch 'develop' into trustie_server 2021-03-22 21:02:17 +08:00
jasder cbc6f4e7d1 fix bug 2021-03-22 20:53:39 +08:00
jasder aa23762b2f FIX update setting api for nav bar url 2021-03-22 18:02:12 +08:00
vilet.yy 5c864acb64 fix: create repo not use website 2021-03-22 15:50:08 +08:00
vilet.yy 8bbfea2079 fix 2021-03-22 11:18:04 +08:00
vilet.yy 8c2a543e61 fix: project code change to default 2021-03-22 11:16:35 +08:00
10 changed files with 82 additions and 25 deletions

View File

@ -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)

View File

@ -93,26 +93,26 @@ http://localhost:3000/
- 代码库
![](docs/figs/code.png?raw=true)
![](docs/figs/code.png)
- 任务管理
![](docs/figs/issue_manage.png?raw=true)
![](docs/figs/issue_manage.png)
- 任务查看
![](docs/figs/issue_view.png?raw=true)
![](docs/figs/issue_view.png)
- 任务指派
![](docs/figs/issue_assign2.png?raw=true)
![](docs/figs/issue_assign2.png)
- 里程碑
![](docs/figs/milestone.png?raw=true)
![](docs/figs/milestone.png)
### API
- [API文档](https://forgeplus.trustie.net/docs/api)
- [API](api_document.md)
- [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")) 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 =

View File

@ -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)

View File

@ -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

23
app/models/site.rb Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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