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
814de769
Commit
814de769
authored
Jul 04, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split Projects:Settings::RepositoryController into CE and EE sections
parent
029ef7a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
12 deletions
+42
-12
app/controllers/ee/projects/settings/repository_controller.rb
...controllers/ee/projects/settings/repository_controller.rb
+40
-0
app/controllers/projects/settings/repository_controller.rb
app/controllers/projects/settings/repository_controller.rb
+2
-12
No files found.
app/controllers/ee/projects/settings/repository_controller.rb
0 → 100644
View file @
814de769
module
EE
module
Projects
module
Settings
module
RepositoryController
extend
ActiveSupport
::
Concern
prepended
do
before_action
:remote_mirror
,
only:
[
:show
]
end
def
show
super
project
.
create_push_rule
unless
project
.
push_rule
@push_rule
=
project
.
push_rule
end
private
def
remote_mirror
@remote_mirror
=
@project
.
remote_mirrors
.
first_or_initialize
end
def
acces_levels_options
super
.
merge
(
selected_merge_access_levels:
@protected_branch
.
merge_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
selected_push_access_levels:
@protected_branch
.
push_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
selected_create_access_levels:
@protected_tag
.
create_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
}
)
end
def
load_gon_index
super
gon
.
push
(
current_project_id:
@project
.
id
)
if
@project
end
end
end
end
end
app/controllers/projects/settings/repository_controller.rb
View file @
814de769
...
...
@@ -2,23 +2,17 @@ module Projects
module
Settings
class
RepositoryController
<
Projects
::
ApplicationController
before_action
:authorize_admin_project!
before_action
:remote_mirror
,
only:
[
:show
]
prepend
::
EE
::
Projects
::
Settings
::
RepositoryController
def
show
@deploy_keys
=
DeployKeysPresenter
.
new
(
@project
,
current_user:
current_user
)
define_protected_refs
project
.
create_push_rule
unless
project
.
push_rule
@push_rule
=
project
.
push_rule
end
private
def
remote_mirror
@remote_mirror
=
@project
.
remote_mirrors
.
first_or_initialize
end
def
define_protected_refs
@protected_branches
=
@project
.
protected_branches
.
order
(
:name
).
page
(
params
[
:page
])
@protected_tags
=
@project
.
protected_tags
.
order
(
:name
).
page
(
params
[
:page
])
...
...
@@ -29,9 +23,6 @@ module Projects
def
access_levels_options
{
selected_merge_access_levels:
@protected_branch
.
merge_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
selected_push_access_levels:
@protected_branch
.
push_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
selected_create_access_levels:
@protected_tag
.
create_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
create_access_levels:
levels_for_dropdown
(
ProtectedTag
::
CreateAccessLevel
),
push_access_levels:
levels_for_dropdown
(
ProtectedBranch
::
PushAccessLevel
),
merge_access_levels:
levels_for_dropdown
(
ProtectedBranch
::
MergeAccessLevel
)
...
...
@@ -57,7 +48,6 @@ module Projects
gon
.
push
(
protectable_tags_for_dropdown
)
gon
.
push
(
protectable_branches_for_dropdown
)
gon
.
push
(
access_levels_options
)
gon
.
push
(
current_project_id:
@project
.
id
)
if
@project
end
end
end
...
...
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