Commit 7683efc6be4a57fe2105916879dc8c50f4024086

Authored by Dmitriy Zaporozhets
1 parent b6d0dd87

Added ability to close milestone with opened issues. UI for milestone page improved

@@ -30,3 +30,4 @@ vendor/bundle/* @@ -30,3 +30,4 @@ vendor/bundle/*
30 rails_best_practices_output.html 30 rails_best_practices_output.html
31 doc/code/* 31 doc/code/*
32 .secret 32 .secret
  33 +*.log
app/assets/stylesheets/gitlab_bootstrap/lists.scss
@@ -83,4 +83,13 @@ ul.bordered-list { @@ -83,4 +83,13 @@ ul.bordered-list {
83 a { color: #777; } 83 a { color: #777; }
84 } 84 }
85 } 85 }
  86 +
  87 + &.top-list {
  88 + li:first-child {
  89 + padding-top: 0;
  90 + h4, h5 {
  91 + margin-top: 0;
  92 + }
  93 + }
  94 + }
86 } 95 }
app/views/dashboard/projects.html.haml
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 = label.name 36 = label.name
37 37
38 .span9 38 .span9
39 - %ul.bordered-list.my-projects 39 + %ul.bordered-list.my-projects.top-list
40 - @projects.each do |project| 40 - @projects.each do |project|
41 %li 41 %li
42 %h4.project-title 42 %h4.project-title
app/views/projects/milestones/_milestone.html.haml
@@ -4,8 +4,7 @@ @@ -4,8 +4,7 @@
4 = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do 4 = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do
5 %i.icon-edit 5 %i.icon-edit
6 Edit 6 Edit
7 - - if milestone.can_be_closed?  
8 - = link_to 'Close', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" 7 + = link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove"
9 %h4 8 %h4
10 = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) 9 = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone)
11 - if milestone.expired? and not milestone.closed? 10 - if milestone.expired? and not milestone.closed?
app/views/projects/milestones/show.html.haml
1 = render "projects/issues/head" 1 = render "projects/issues/head"
2 -.row  
3 - .span6  
4 - %h3.page-title  
5 - Milestone ##{@milestone.id}  
6 - %small  
7 - = @milestone.expires_at  
8 - .back-link  
9 - = link_to project_milestones_path(@project) do  
10 - ← To milestones list  
11 - .span6  
12 - .pull-right  
13 - - unless @milestone.closed?  
14 - = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do  
15 - %i.icon-plus  
16 - New Issue  
17 - = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped"  
18 - - if can?(current_user, :admin_milestone, @project)  
19 - = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-small grouped" do  
20 - %i.icon-edit  
21 - Edit 2 +%h3.page-title
  3 + Milestone ##{@milestone.id}
  4 + %small
  5 + = @milestone.expires_at
  6 + .pull-right
  7 + - if can?(current_user, :admin_milestone, @project)
  8 + = link_to edit_project_milestone_path(@project, @milestone), class: "btn grouped" do
  9 + %i.icon-edit
  10 + Edit
  11 + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove"
22 12
  13 +- if @milestone.issues.any? && @milestone.can_be_closed?
  14 + .alert.alert-success
  15 + %span All issues for this milestone are closed. You may close milestone now.
23 16
  17 +.back-link
  18 + = link_to project_milestones_path(@project) do
  19 + ← To milestones list
24 20
25 -- if @milestone.can_be_closed?  
26 - %hr  
27 - %p  
28 - %span All issues for this milestone are closed. You may close milestone now.  
29 - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove"  
30 21
31 .ui-box.ui-box-show 22 .ui-box.ui-box-show
32 .ui-box-head 23 .ui-box-head
@@ -69,6 +60,11 @@ @@ -69,6 +60,11 @@
69 Participants 60 Participants
70 %span.badge= @users.count 61 %span.badge= @users.count
71 62
  63 + .pull-right
  64 + = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do
  65 + %i.icon-plus
  66 + New Issue
  67 + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn btn-small edit-milestone-link grouped"
72 68
73 .tab-content 69 .tab-content
74 .tab-pane.active#tab-issues 70 .tab-pane.active#tab-issues