Commit b1bdd829 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #4269 from dosire/scrum-view-for-milestone

Scrum view style milestone view.
parents 593dfc40 f7ea649f
$ ->
$('.milestone-issue-filter li[data-closed]').addClass('hide')
$('.milestone-issue-filter ul.nav li a').click ->
$('.milestone-issue-filter li').toggleClass('active')
$('.milestone-issue-filter li[data-closed]').toggleClass('hide')
false
$('.milestone-merge-requests-filter li[data-closed]').addClass('hide')
$('.milestone-merge-requests-filter ul.nav li a').click ->
......
......@@ -28,6 +28,8 @@ class Issue < ActiveRecord::Base
scope :cared, ->(user) { where(assignee_id: user) }
scope :authored, ->(user) { where(author_id: user) }
scope :open_for, ->(user) { opened.assigned(user) }
scope :assigned, -> { where("assignee_id IS NOT NULL") }
scope :unassigned, -> { where("assignee_id IS NULL") }
state_machine :state, initial: :opened do
event :close do
......
.span6
.ui-box.milestone-issue-filter
%h5.title= title
%ul.well-list
- issues.each do |issue|
%li{data: {closed: issue.closed?}}
= link_to [@project, issue] do
%span.badge.badge-info ##{issue.id}
&ndash;
= link_to_gfm truncate(issue.title, length: 60), [@project, issue]
\ No newline at end of file
......@@ -56,20 +56,11 @@
.row
.span6
.ui-box.milestone-issue-filter
.title
%ul.nav.nav-pills
%li.active= link_to('Open Issues', '#')
%li=link_to('All Issues', '#')
%ul.well-list
- @issues.each do |issue|
%li{data: {closed: issue.closed?}}
= link_to [@project, issue] do
%span.badge.badge-info ##{issue.id}
&ndash;
= link_to_gfm truncate(issue.title, length: 60), [@project, issue]
= render(partial: 'issues', locals: {title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned})
= render(partial: 'issues', locals: {title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned})
.row
.span6
.ui-box.milestone-merge-requests-filter
.title
......@@ -84,6 +75,8 @@
&ndash;
= link_to_gfm truncate(merge_request.title, length: 60), [@project, merge_request]
= render(:partial => 'issues', locals: {title: 'Completed Issues (closed)', issues: @issues.closed})
%hr
%h6 Participants:
%div
......
......@@ -22,5 +22,3 @@ Feature: Project Milestones
Given the milestone has open and closed issues
And I click link "v2.2"
Then I should see 3 issues
When I click link "All Issues"
Then I should see 4 issues
......@@ -51,11 +51,5 @@ class ProjectMilestones < Spinach::FeatureSteps
Then "I should see 3 issues" do
page.should have_selector('.milestone-issue-filter .well-list li', count: 4)
page.should have_selector('.milestone-issue-filter .well-list li.hide', count: 1)
end
Then "I should see 4 issues" do
page.should have_selector('.milestone-issue-filter .well-list li', count: 4)
page.should_not have_selector('.milestone-issue-filter .well-list li.hide')
end
end
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