From 7683efc6be4a57fe2105916879dc8c50f4024086 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 13:44:25 +0300 Subject: [PATCH] Added ability to close milestone with opened issues. UI for milestone page improved --- .gitignore | 1 + .../stylesheets/gitlab_bootstrap/lists.scss | 9 ++++ app/views/dashboard/projects.html.haml | 2 +- .../projects/milestones/_milestone.html.haml | 3 +- app/views/projects/milestones/show.html.haml | 48 +++++++++---------- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 1210ac3b44a..60e17328880 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ vendor/bundle/* rails_best_practices_output.html doc/code/* .secret +*.log diff --git a/app/assets/stylesheets/gitlab_bootstrap/lists.scss b/app/assets/stylesheets/gitlab_bootstrap/lists.scss index d23323979bc..83066b5beec 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/lists.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/lists.scss @@ -83,4 +83,13 @@ ul.bordered-list { a { color: #777; } } } + + &.top-list { + li:first-child { + padding-top: 0; + h4, h5 { + margin-top: 0; + } + } + } } diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index ab090c42218..8fd0744a63f 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -36,7 +36,7 @@ = label.name .span9 - %ul.bordered-list.my-projects + %ul.bordered-list.my-projects.top-list - @projects.each do |project| %li %h4.project-title diff --git a/app/views/projects/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml index 894fa6c1133..bc3368b765c 100644 --- a/app/views/projects/milestones/_milestone.html.haml +++ b/app/views/projects/milestones/_milestone.html.haml @@ -4,8 +4,7 @@ = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do %i.icon-edit Edit - - if milestone.can_be_closed? - = link_to 'Close', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" + = link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" %h4 = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) - if milestone.expired? and not milestone.closed? diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 7be3ba2f758..8a5c2a938b1 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -1,32 +1,23 @@ = render "projects/issues/head" -.row - .span6 - %h3.page-title - Milestone ##{@milestone.id} - %small - = @milestone.expires_at - .back-link - = link_to project_milestones_path(@project) do - ← To milestones list - .span6 - .pull-right - - unless @milestone.closed? - = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do - %i.icon-plus - New Issue - = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" - - if can?(current_user, :admin_milestone, @project) - = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-small grouped" do - %i.icon-edit - Edit +%h3.page-title + Milestone ##{@milestone.id} + %small + = @milestone.expires_at + .pull-right + - if can?(current_user, :admin_milestone, @project) + = link_to edit_project_milestone_path(@project, @milestone), class: "btn grouped" do + %i.icon-edit + Edit + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove" - - -- if @milestone.can_be_closed? - %hr - %p +- if @milestone.issues.any? && @milestone.can_be_closed? + .alert.alert-success %span All issues for this milestone are closed. You may close milestone now. - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" + +.back-link + = link_to project_milestones_path(@project) do + ← To milestones list + .ui-box.ui-box-show .ui-box-head @@ -69,6 +60,11 @@ Participants %span.badge= @users.count + .pull-right + = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do + %i.icon-plus + New Issue + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn btn-small edit-milestone-link grouped" .tab-content .tab-pane.active#tab-issues