summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-16 23:32:09 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-16 23:32:09 -0700
commitb1bdd82992b5133e24154c8692e25e79049cd907 (patch)
tree8fb6f6aad97519c34973776e5d91538edf63e4f1
parent593dfc40df6470089567e0daa1c752507a984b7e (diff)
parentf7ea649f4b409d5561b2bd81e46863a1f0c77e1b (diff)
downloadgitlab-ce-b1bdd82992b5133e24154c8692e25e79049cd907.tar.gz
Merge pull request #4269 from dosire/scrum-view-for-milestone
Scrum view style milestone view.
-rw-r--r--app/assets/javascripts/milestones.js.coffee7
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/views/milestones/_issues.html.haml10
-rw-r--r--app/views/milestones/show.html.haml19
-rw-r--r--features/project/issues/milestones.feature2
-rw-r--r--features/steps/project/project_milestones.rb6
6 files changed, 18 insertions, 28 deletions
diff --git a/app/assets/javascripts/milestones.js.coffee b/app/assets/javascripts/milestones.js.coffee
index 99a52bf4d3f..78a16e91b46 100644
--- a/app/assets/javascripts/milestones.js.coffee
+++ b/app/assets/javascripts/milestones.js.coffee
@@ -1,11 +1,4 @@
$ ->
- $('.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 ->
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 91dd6477b04..ee92d944b03 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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
diff --git a/app/views/milestones/_issues.html.haml b/app/views/milestones/_issues.html.haml
new file mode 100644
index 00000000000..8c42330a65d
--- /dev/null
+++ b/app/views/milestones/_issues.html.haml
@@ -0,0 +1,10 @@
+.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
diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml
index 034c37852f1..9f665206acb 100644
--- a/app/views/milestones/show.html.haml
+++ b/app/views/milestones/show.html.haml
@@ -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
diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature
index 50c090cc6a0..2f38acf14d0 100644
--- a/features/project/issues/milestones.feature
+++ b/features/project/issues/milestones.feature
@@ -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
diff --git a/features/steps/project/project_milestones.rb b/features/steps/project/project_milestones.rb
index fcd590fcab2..ba2a0184d7e 100644
--- a/features/steps/project/project_milestones.rb
+++ b/features/steps/project/project_milestones.rb
@@ -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