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
6d885f9c
Commit
6d885f9c
authored
Feb 08, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more refactoring
parent
9053f8eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+6
-6
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+4
-0
No files found.
app/helpers/blob_helper.rb
View file @
6d885f9c
...
@@ -27,7 +27,7 @@ module BlobHelper
...
@@ -27,7 +27,7 @@ module BlobHelper
elsif
!
current_user
||
(
current_user
&&
can_modify_blob?
(
blob
,
project
,
ref
))
elsif
!
current_user
||
(
current_user
&&
can_modify_blob?
(
blob
,
project
,
ref
))
edit_link_tag
(
edit_text
,
ide_edit_path
(
project
,
ref
,
path
,
options
),
common_classes
)
edit_link_tag
(
edit_text
,
ide_edit_path
(
project
,
ref
,
path
,
options
),
common_classes
)
elsif
current_user
&&
can?
(
current_user
,
:fork_project
,
project
)
elsif
current_user
&&
can?
(
current_user
,
:fork_project
,
project
)
edit_blob_fork
(
common_classes
,
options
,
path
,
project
,
ref
)
edit_blob_fork
(
common_classes
,
edit_blob_path
(
project
,
ref
,
path
,
options
),
project
,
edit_in_new_fork_notice
)
end
end
end
end
...
@@ -56,7 +56,7 @@ module BlobHelper
...
@@ -56,7 +56,7 @@ module BlobHelper
elsif
current_user
&&
can_modify_blob?
(
blob
,
project
,
ref
)
elsif
current_user
&&
can_modify_blob?
(
blob
,
project
,
ref
)
edit_link_tag
(
ide_edit_text
,
ide_edit_path
(
project
,
ref
,
path
,
options
),
common_classes
)
edit_link_tag
(
ide_edit_text
,
ide_edit_path
(
project
,
ref
,
path
,
options
),
common_classes
)
elsif
current_user
&&
can?
(
current_user
,
:fork_project
,
project
)
elsif
current_user
&&
can?
(
current_user
,
:fork_project
,
project
)
edit_blob_fork
(
common_classes
,
options
,
path
,
project
,
ref
)
edit_blob_fork
(
common_classes
,
edit_blob_path
(
project
,
ref
,
path
,
options
),
project
,
edit_in_new_fork_notice
)
end
end
end
end
...
@@ -76,7 +76,7 @@ module BlobHelper
...
@@ -76,7 +76,7 @@ module BlobHelper
elsif
can_modify_blob?
(
blob
,
project
,
ref
)
elsif
can_modify_blob?
(
blob
,
project
,
ref
)
button_tag
label
,
class:
"
#{
common_classes
}
"
,
'data-target'
=>
"#modal-
#{
modal_type
}
-blob"
,
'data-toggle'
=>
'modal'
button_tag
label
,
class:
"
#{
common_classes
}
"
,
'data-target'
=>
"#modal-
#{
modal_type
}
-blob"
,
'data-toggle'
=>
'modal'
elsif
can?
(
current_user
,
:fork_project
,
project
)
elsif
can?
(
current_user
,
:fork_project
,
project
)
edit_blob_fork
(
common_classes
,
options
,
path
,
project
,
ref
)
edit_blob_fork
(
common_classes
,
request
.
fullpath
,
project
,
edit_in_new_fork_notice_action
(
action
),
action
)
end
end
end
end
...
@@ -311,10 +311,10 @@ module BlobHelper
...
@@ -311,10 +311,10 @@ module BlobHelper
blob
if
blob
&
.
readable_text?
blob
if
blob
&
.
readable_text?
end
end
def
edit_blob_fork
(
common_classes
,
options
,
path
,
project
,
ref
)
def
edit_blob_fork
(
common_classes
,
path
,
project
,
notice
,
action
=
'edit'
)
continue_params
=
{
continue_params
=
{
to:
edit_blob_path
(
project
,
ref
,
path
,
options
)
,
to:
path
,
notice:
edit_in_new_fork_
notice
,
notice:
notice
,
notice_now:
edit_in_new_fork_notice_now
notice_now:
edit_in_new_fork_notice_now
}
}
fork_path
=
project_forks_path
(
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
fork_path
=
project_forks_path
(
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
...
...
app/helpers/tree_helper.rb
View file @
6d885f9c
...
@@ -83,6 +83,10 @@ module TreeHelper
...
@@ -83,6 +83,10 @@ module TreeHelper
" A fork of this project has been created that you can make changes in, so you can submit a merge request."
" A fork of this project has been created that you can make changes in, so you can submit a merge request."
end
end
def
edit_in_new_fork_notice_action
(
action
)
edit_in_new_fork_notice
+
" Try to
#{
action
}
this file again."
end
def
commit_in_fork_help
def
commit_in_fork_help
"A new branch will be created in your fork and a new merge request will be started."
"A new branch will be created in your fork and a new merge request will be started."
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