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
31c37c6c
Commit
31c37c6c
authored
Sep 02, 2016
by
Katarzyna Kobierska
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add #closed_without_source_project?
parent
09cded29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
app/models/merge_request.rb
app/models/merge_request.rb
+5
-1
app/views/projects/merge_requests/_discussion.html.haml
app/views/projects/merge_requests/_discussion.html.haml
+1
-1
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+17
-14
No files found.
app/models/merge_request.rb
View file @
31c37c6c
...
...
@@ -313,7 +313,11 @@ class MergeRequest < ActiveRecord::Base
end
def
closed_without_fork?
closed?
&&
(
forked_source_project_missing?
||
!
source_project
)
closed?
&&
forked_source_project_missing?
end
def
closed_without_source_project?
closed?
&&
!
source_project
end
def
forked_source_project_missing?
...
...
app/views/projects/merge_requests/_discussion.html.haml
View file @
31c37c6c
...
...
@@ -2,7 +2,7 @@
-
if
can?
(
current_user
,
:update_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
=
link_to
'Close merge request'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-nr btn-comment btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
,
data:
{
original_text:
"Close merge request"
,
alternative_text:
"Comment & close merge request"
}
-
if
@merge_request
.
closed
?
-
unless
@merge_request
.
open?
||
@merge_request
.
closed_without_fork
?
=
link_to
'Reopen merge request'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-nr btn-comment btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
,
data:
{
original_text:
"Reopen merge request"
,
alternative_text:
"Comment & reopen merge request"
}
%comment-and-resolve-btn
{
"inline-template"
=>
true
,
":discussion-id"
=>
""
}
%button
.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button
{
"v-if"
=>
"showButton"
,
type:
"submit"
,
data:
{
namespace_path:
"#{@merge_request.project.namespace.path}"
,
project_path:
"#{@merge_request.project.path}"
}
}
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
31c37c6c
...
...
@@ -29,6 +29,7 @@
%ul
.dropdown-menu.dropdown-menu-align-right
%li
=
link_to
"Email Patches"
,
merge_request_path
(
@merge_request
,
format: :patch
)
%li
=
link_to
"Plain Diff"
,
merge_request_path
(
@merge_request
,
format: :diff
)
-
unless
@merge_request
.
closed_without_fork?
.normal
%span
Request to merge
%span
.label-branch
=
source_branch_with_namespace
(
@merge_request
)
...
...
@@ -38,6 +39,7 @@
-
if
@merge_request
.
open?
&&
@merge_request
.
diverged_from_target_branch?
%span
(
#{
pluralize
(
@merge_request
.
diverged_commits_count
,
'commit'
)
}
behind)
-
unless
@merge_request
.
closed_without_source_project?
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/widget/show.html.haml"
...
...
@@ -53,6 +55,7 @@
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
Discussion
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
count
-
unless
@merge_request
.
closed_without_source_project?
%li
.commits-tab
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
...
...
Alain Takoudjou
@alain.takoudjou
mentioned in commit
e6f515ec
·
May 03, 2017
mentioned in commit
e6f515ec
mentioned in commit e6f515ecbed85b204e8f7bc9934b0bf208a0ea4c
Toggle commit list
Alain Takoudjou
@alain.takoudjou
mentioned in commit
b6c85997
·
May 03, 2017
mentioned in commit
b6c85997
mentioned in commit b6c859974307b71a82544cb137196b1bcd7ef7ef
Toggle commit list
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