diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb index fa202cf4677c00f74ed8ea11c45c50d67192162b..ac28f000152e730d23f84782b41af4892da7eb8a 100644 --- a/app/controllers/milestones_controller.rb +++ b/app/controllers/milestones_controller.rb @@ -32,6 +32,7 @@ class MilestonesController < ProjectResourceController def show @issues = @milestone.issues @users = @milestone.participants + @merge_requests = @milestone.merge_requests respond_to do |format| format.html diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 06c0943143bf250248eeedc5622e7f14b798d063..b924dc5fb8044a6b27d0dc89ff1f190cbf7c0f55 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -3,6 +3,7 @@ class Milestone < ActiveRecord::Base belongs_to :project has_many :issues + has_many :merge_requests validates :title, presence: true validates :project, presence: true diff --git a/app/views/merge_requests/show/_mr_box.html.haml b/app/views/merge_requests/show/_mr_box.html.haml index 89c3110bddfe8b43c99f92afe4a2a934fe3518e0..26636435a0603dcdfbcb36f34f4f4ab5d323f1d1 100644 --- a/app/views/merge_requests/show/_mr_box.html.haml +++ b/app/views/merge_requests/show/_mr_box.html.haml @@ -14,9 +14,13 @@ %strong.author= link_to_merge_request_author(@merge_request) - if @merge_request.assignee - %cite.cgray and currently assigned to + %cite.cgray , currently assigned to = image_tag gravatar_icon(@merge_request.assignee_email), width: 16, class: "lil_av" %strong.author= link_to_merge_request_assignee(@merge_request) + - if @merge_request.milestone + - milestone = @merge_request.milestone + %cite.cgray and attached to milestone + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) - if @merge_request.closed diff --git a/app/views/milestones/_milestone.html.haml b/app/views/milestones/_milestone.html.haml index 205b864f80fda44dd577ee17ac1a02ae0b4be7f6..3ccd93608a1e47f498b80a1f031303d05ff18b2b 100644 --- a/app/views/milestones/_milestone.html.haml +++ b/app/views/milestones/_milestone.html.haml @@ -4,6 +4,10 @@ %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues' - if milestone.issues.count > 0 = link_to 'Browse Issues', project_issues_path(milestone.project, milestone_id: milestone.id), class: "btn small grouped" + - if milestone.merge_requests.any? + %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'Merge Requests' + - if milestone.merge_requests.count > 0 + = link_to 'Browse Merge Requests', project_merge_requests_path(milestone.project, milestone_id: milestone.id), class: "btn small grouped" - if can? current_user, :admin_milestone, milestone.project = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), class: "btn small edit-milestone-link grouped" %h4 diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index c113c81f33cd6b10cca21fc0e7707e45db27b996..ad4580d462e85391df3f4bd879cd7ab4739a1d45 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -60,6 +60,22 @@ = link_to_gfm truncate(issue.title, length: 60), [@project, issue] %br + .span6 + %table.milestone-merge_requests-filter + %thead + %th + %ul.nav.nav-pills + %li.active= link_to('Open Merge Requests', '#') + %li=link_to('All Merge Requests', '#') + - @merge_requests.each do |merge_request| + %tr{data: {closed: merge_request.closed}} + %td + = link_to [@project, merge_request] do + %span.badge.badge-info ##{merge_request.id} + – + = link_to_gfm truncate(merge_request.title, length: 60), [@project, merge_request] + %br + .span6 %table %thead