Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9a95b155
Commit
9a95b155
authored
Mar 11, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add share project from group lock
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
068fd5de
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
6 deletions
+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
No files found.
app/controllers/groups_controller.rb
View file @
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
View file @
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
View file @
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
View file @
9a95b155
class
AddGroupShareLock
<
ActiveRecord
::
Migration
def
change
add_column
:namespaces
,
:share_with_group_lock
,
:boolean
,
default:
false
end
end
db/schema.rb
View file @
9a95b155
...
...
@@ -568,14 +568,15 @@ ActiveRecord::Schema.define(version: 20160309140734) do
add_index
"milestones"
,
[
"title"
],
name:
"index_milestones_on_title"
,
using: :btree
create_table
"namespaces"
,
force: :cascade
do
|
t
|
t
.
string
"name"
,
null:
false
t
.
string
"path"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
string
"path"
,
null:
false
t
.
integer
"owner_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"type"
t
.
string
"description"
,
default:
""
,
null:
false
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment