Add share project from group lock
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
068fd5de8a
commit
9a95b15552
5 changed files with 20 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
5
db/migrate/20150930110012_add_group_share_lock.rb
Normal file
5
db/migrate/20150930110012_add_group_share_lock.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddGroupShareLock < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :namespaces, :share_with_group_lock, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue