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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
3099d143
Commit
3099d143
authored
Jun 14, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce CE/EE difference in app/views/projects/protected_tags/_protected_tag.html.haml
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
7f0431dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
app/models/concerns/protected_ref_access.rb
app/models/concerns/protected_ref_access.rb
+5
-0
app/views/projects/protected_tags/_protected_tag.html.haml
app/views/projects/protected_tags/_protected_tag.html.haml
+3
-1
app/views/projects/protected_tags/_protected_tag_create_access_levels.haml
...s/protected_tags/_protected_tag_create_access_levels.haml
+8
-0
app/views/projects/protected_tags/_update_protected_tag.haml
app/views/projects/protected_tags/_update_protected_tag.haml
+0
-5
No files found.
app/models/concerns/protected_ref_access.rb
View file @
3099d143
...
@@ -17,6 +17,11 @@ module ProtectedRefAccess
...
@@ -17,6 +17,11 @@ module ProtectedRefAccess
scope
:master
,
->
{
maintainer
}
# @deprecated
scope
:master
,
->
{
maintainer
}
# @deprecated
scope
:maintainer
,
->
{
where
(
access_level:
Gitlab
::
Access
::
MAINTAINER
)
}
scope
:maintainer
,
->
{
where
(
access_level:
Gitlab
::
Access
::
MAINTAINER
)
}
scope
:developer
,
->
{
where
(
access_level:
Gitlab
::
Access
::
DEVELOPER
)
}
scope
:developer
,
->
{
where
(
access_level:
Gitlab
::
Access
::
DEVELOPER
)
}
scope
:by_user
,
->
(
user
)
{
where
(
user_id:
user
)
}
scope
:by_group
,
->
(
group
)
{
where
(
group_id:
group
)
}
scope
:for_role
,
->
{
where
(
user_id:
nil
,
group_id:
nil
)
}
scope
:for_user
,
->
{
where
.
not
(
user_id:
nil
)
}
scope
:for_group
,
->
{
where
.
not
(
group_id:
nil
)
}
validates
:access_level
,
presence:
true
,
if: :role?
,
inclusion:
{
validates
:access_level
,
presence:
true
,
if: :role?
,
inclusion:
{
in:
ALLOWED_ACCESS_LEVELS
in:
ALLOWED_ACCESS_LEVELS
...
...
app/views/projects/protected_tags/_protected_tag.html.haml
View file @
3099d143
=
render
layout:
'projects/protected_tags/shared/protected_tag'
,
locals:
{
protected_tag:
protected_tag
}
do
=
render
layout:
'projects/protected_tags/shared/protected_tag'
,
locals:
{
protected_tag:
protected_tag
}
do
=
render
partial:
'projects/protected_tags/update_protected_tag'
,
locals:
{
protected_tag:
protected_tag
}
%td
=
render
'projects/protected_tags/protected_tag_create_access_levels'
,
protected_tag:
protected_tag
,
create_access_level:
protected_tag
.
create_access_levels
.
for_role
.
first
=
render_if_exists
'projects/protected_tags/protected_tag_extra_create_access_levels'
,
protected_tag:
protected_tag
app/views/projects/protected_tags/_protected_tag_create_access_levels.haml
0 → 100644
View file @
3099d143
-
protected_tag
=
local_assigns
.
fetch
(
:protected_tag
)
-
create_access_level
=
local_assigns
.
fetch
(
:create_access_level
)
-
dropdown_label
=
create_access_level
&
.
humanize
||
'Select'
=
hidden_field_tag
"allowed_to_create_
#{
protected_tag
.
id
}
"
,
create_access_level
&
.
access_level
=
dropdown_tag
(
dropdown_label
,
options:
{
toggle_class:
'js-allowed-to-create'
,
dropdown_class:
'dropdown-menu-selectable capitalize-header js-allowed-to-create-container'
,
data:
{
field_name:
"allowed_to_create_
#{
protected_tag
.
id
}
"
,
access_level_id:
create_access_level
&
.
id
}})
app/views/projects/protected_tags/_update_protected_tag.haml
deleted
100644 → 0
View file @
7f0431dd
%td
=
hidden_field_tag
"allowed_to_create_
#{
protected_tag
.
id
}
"
,
protected_tag
.
create_access_levels
.
first
.
access_level
=
dropdown_tag
(
(
protected_tag
.
create_access_levels
.
first
.
humanize
||
'Select'
)
,
options:
{
toggle_class:
'js-allowed-to-create'
,
dropdown_class:
'dropdown-menu-selectable capitalize-header js-allowed-to-create-container'
,
data:
{
field_name:
"allowed_to_create_
#{
protected_tag
.
id
}
"
,
access_level_id:
protected_tag
.
create_access_levels
.
first
.
id
}})
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