Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9a95b155
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9a95b155
编写于
3月 11, 2016
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add share project from group lock
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
068fd5de
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
20 addition
and
6 deletion
+20
-6
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-2
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+9
-0
db/migrate/20150930110012_add_group_share_lock.rb
db/migrate/20150930110012_add_group_share_lock.rb
+5
-0
db/schema.rb
db/schema.rb
+4
-3
未找到文件。
app/controllers/groups_controller.rb
浏览文件 @
9a95b155
...
...
@@ -133,7 +133,7 @@ class GroupsController < Groups::ApplicationController
end
def
group_params
params
.
require
(
:group
).
permit
(
:name
,
:description
,
:path
,
:avatar
,
:public
)
params
.
require
(
:group
).
permit
(
:name
,
:description
,
:path
,
:avatar
,
:public
,
:share_with_group_lock
)
end
def
load_events
...
...
app/models/project.rb
浏览文件 @
9a95b155
...
...
@@ -881,8 +881,7 @@ class Project < ActiveRecord::Base
end
def
allowed_to_share_with_group?
# TODO: replace with logic
true
!
namespace
.
share_with_group_lock
end
def
ci_commit
(
sha
)
...
...
app/views/groups/edit.html.haml
浏览文件 @
9a95b155
...
...
@@ -23,6 +23,15 @@
%hr
=
link_to
'Remove avatar'
,
group_avatar_path
(
@group
.
to_param
),
data:
{
confirm:
"Group avatar will be removed. Are you sure?"
},
method: :delete
,
class:
"btn btn-remove btn-sm remove-avatar"
.form-group
%hr
=
f
.
label
:share_with_group_lock
,
class:
'control-label'
do
Share with group lock
.col-sm-10
.checkbox
=
f
.
check_box
:share_with_group_lock
%span
.descr
Prevent sharing a project with another group within this group
.form-actions
=
f
.
submit
'Save group'
,
class:
"btn btn-save"
...
...
db/migrate/20150930110012_add_group_share_lock.rb
0 → 100644
浏览文件 @
9a95b155
class
AddGroupShareLock
<
ActiveRecord
::
Migration
def
change
add_column
:namespaces
,
:share_with_group_lock
,
:boolean
,
default:
false
end
end
db/schema.rb
浏览文件 @
9a95b155
...
...
@@ -576,6 +576,7 @@ ActiveRecord::Schema.define(version: 20160309140734) do
t
.
string
"type"
t
.
string
"description"
,
default:
""
,
null:
false
t
.
string
"avatar"
t
.
boolean
"share_with_group_lock"
,
default:
false
end
add_index
"namespaces"
,
[
"created_at"
,
"id"
],
name:
"index_namespaces_on_created_at_and_id"
,
using: :btree
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录