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
726914c2
Commit
726914c2
authored
May 12, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce complexity of TreeHelper#lock_file_link
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
23629867
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+10
-6
No files found.
app/helpers/tree_helper.rb
View file @
726914c2
...
@@ -139,12 +139,16 @@ module TreeHelper
...
@@ -139,12 +139,16 @@ module TreeHelper
end
end
end
end
else
else
if
can?
(
current_user
,
:push_code
,
project
)
_lock_link
(
current_user:
current_user
,
project:
project
,
html_options:
{})
html_options
[
:data
]
=
{
state: :lock
}
end
enabled_lock_link
(
"Lock"
,
''
,
html_options
)
end
else
disabled_lock_link
(
"Lock"
,
"You do not have permission to lock this"
,
html_options
)
def
_lock_link
(
current_user:
current_user
,
project:
project
,
html_options:
{})
end
if
can?
(
current_user
,
:push_code
,
project
)
html_options
[
:data
]
=
{
state: :lock
}
enabled_lock_link
(
"Lock"
,
''
,
html_options
)
else
disabled_lock_link
(
"Lock"
,
"You do not have permission to lock this"
,
html_options
)
end
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