Commit f66454be authored by Douwe Maan's avatar Douwe Maan

Add indication to merge request list item that MR cannot be merged automatically

parent 792f2bbe
...@@ -124,6 +124,24 @@ ul.content-list { ...@@ -124,6 +124,24 @@ ul.content-list {
padding: 10px 14px; padding: 10px 14px;
} }
} }
ul.controls {
list-style: none;
li {
float: left;
padding-right: 10px;
.author_link {
display: inline-block;
.avatar-inline {
margin-left: 0;
margin-right: 0;
}
}
}
}
} }
} }
......
...@@ -484,4 +484,8 @@ class MergeRequest < ActiveRecord::Base ...@@ -484,4 +484,8 @@ class MergeRequest < ActiveRecord::Base
source_project.ci_commit(last_commit.id) source_project.ci_commit(last_commit.id)
end end
end end
def broken?
self.commits.blank? || branch_missing? || cannot_be_merged?
end
end end
...@@ -6,23 +6,26 @@ ...@@ -6,23 +6,26 @@
.issue-title .issue-title
%span.issue-title-text %span.issue-title-text
= link_to_gfm issue.title, issue_path(issue), class: "row_title" = link_to_gfm issue.title, issue_path(issue), class: "row_title"
.pull-right.light %ul.controls.light
- if issue.closed? - if issue.closed?
%span %li
CLOSED CLOSED
- if issue.assignee - if issue.assignee
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name") %li
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
- note_count = issue.notes.user.count - note_count = issue.notes.user.count
- if note_count > 0 - if note_count > 0
&nbsp; %li
= link_to issue_path(issue) + "#notes" do = link_to issue_path(issue) + "#notes" do
= icon('comments') = icon('comments')
= note_count = note_count
- else - else
&nbsp; %li
= link_to issue_path(issue) + "#notes", class: "issue-no-comments" do = link_to issue_path(issue) + "#notes", class: "issue-no-comments" do
= icon('comments') = icon('comments')
= 0 = notes_count
.issue-info .issue-info
#{issue.to_reference} &middot; #{issue.to_reference} &middot;
......
...@@ -3,31 +3,40 @@ ...@@ -3,31 +3,40 @@
.merge-request-title .merge-request-title
%span.merge-request-title-text %span.merge-request-title-text
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title" = link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
.pull-right.light %ul.controls.light
- if ci_commit
= render_ci_status(ci_commit)
- if merge_request.merged? - if merge_request.merged?
%span %li
= icon('check') = icon('check')
MERGED MERGED
- elsif merge_request.closed? - elsif merge_request.closed?
%span %li
= icon('ban') = icon('ban')
CLOSED CLOSED
- note_count = merge_request.mr_and_commit_notes.user.count
- if ci_commit
%li
= render_ci_status(ci_commit)
- if merge_request.open? && merge_request.broken?
%li
= link_to merge_request_path(merge_request), class: "has_tooltip", title: "Cannot be merged automatically", data: {container: 'body'} do
= icon('exclamation-triangle')
- if merge_request.assignee - if merge_request.assignee
&nbsp; %li
= link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name") = link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name")
- note_count = merge_request.mr_and_commit_notes.user.count
- if note_count > 0 - if note_count > 0
&nbsp; %li
= link_to merge_request_path(merge_request) + "#notes" do = link_to merge_request_path(merge_request) + "#notes" do
= icon('comments') = icon('comments')
= note_count = note_count
- else - else
&nbsp; %li
= link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do = link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do
= icon('comments') = icon('comments')
= 0 = note_count
.merge-request-info .merge-request-info
\##{merge_request.iid} &middot; \##{merge_request.iid} &middot;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment