summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-16 19:55:58 +0100
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-16 19:55:58 +0100
commitb093f50986b6dcd0e4caf33d3c96831155e71db8 (patch)
treeed37394c7b2479a66c494768c9af339b6dc7c29d
parent32f1a7196817b1073327c607905ee40b9140e6df (diff)
downloadgitlab-ce-global-milestones.tar.gz
Some code and doc improvementsglobal-milestones
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/models/global_milestone.rb4
-rw-r--r--app/views/dashboard/milestones/show.html.haml2
-rw-r--r--app/views/groups/milestones/show.html.haml2
-rw-r--r--doc/workflow/milestones.md8
4 files changed, 10 insertions, 6 deletions
diff --git a/app/models/global_milestone.rb b/app/models/global_milestone.rb
index f96e9d41c94..1321ccd963f 100644
--- a/app/models/global_milestone.rb
+++ b/app/models/global_milestone.rb
@@ -94,4 +94,8 @@ class GlobalMilestone
def closed_merge_requests
merge_requests.values_at("closed", "merged", "locked").compact.flatten
end
+
+ def complete?
+ total_items_count == closed_items_count
+ end
end
diff --git a/app/views/dashboard/milestones/show.html.haml b/app/views/dashboard/milestones/show.html.haml
index 580db613ed4..83077a398bd 100644
--- a/app/views/dashboard/milestones/show.html.haml
+++ b/app/views/dashboard/milestones/show.html.haml
@@ -8,7 +8,7 @@
Milestone #{@milestone.title}
%hr
-- if (@milestone.total_items_count == @milestone.closed_items_count) && @milestone.active?
+- if @milestone.complete? && @milestone.active?
.alert.alert-success
%span All issues for this milestone are closed. You may close the milestone now.
diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml
index 716e93f558b..d161259e4aa 100644
--- a/app/views/groups/milestones/show.html.haml
+++ b/app/views/groups/milestones/show.html.haml
@@ -16,7 +16,7 @@
= link_to 'Reopen Milestone', group_milestone_path(@group, @milestone.safe_title, title: @milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-sm btn-grouped btn-reopen"
%hr
-- if (@milestone.total_items_count == @milestone.closed_items_count) && @milestone.active?
+- if @milestone.complete? && @milestone.active?
.alert.alert-success
%span All issues for this milestone are closed. You may close the milestone now.
diff --git a/doc/workflow/milestones.md b/doc/workflow/milestones.md
index 1cd1f0f2fc3..dff36899aec 100644
--- a/doc/workflow/milestones.md
+++ b/doc/workflow/milestones.md
@@ -1,13 +1,13 @@
# Milestones
-Milestone allows you to group issues and set due date for it.
-Milestone is created per project.
+Milestones allow you to organize issues and merge requests into a cohesive group, optionally setting a due date.
+A common use is keeping track of an upcoming software version. Milestones are created per-project.
![milestone form](milestones/form.png)
## Groups and milestones
-You can create milestone with single form for several projects that belongs to the same group.
-On the group milestones page you will be able to see this milestones grouped together by name.
+You can create a milestone for several projects in the same group simultaneously.
+On the group's milestones page, you will be able to see the status of that milestone across all of the selected projects.
![group milestone form](milestones/group_form.png)