diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-15 01:20:38 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-07-17 16:54:32 +0300 |
commit | df2bb60f90315a77718b9122e9d06f5655750640 (patch) | |
tree | a076cbfdb4f7583cc955af5dbba97a4ecd2205b3 /app/views/projects/milestones | |
parent | c4c41007adf5e3950f8991d4503b699d1e078705 (diff) |
Add support for destroying project milestones
Closes https://github.com/gitlabhq/gitlabhq/issues/1504
Diffstat (limited to 'app/views/projects/milestones')
-rw-r--r-- | app/views/projects/milestones/_milestone.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/milestones/show.html.haml | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/app/views/projects/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml index 14a0580f966..2ce5358fa74 100644 --- a/app/views/projects/milestones/_milestone.html.haml +++ b/app/views/projects/milestones/_milestone.html.haml @@ -5,6 +5,10 @@ %i.fa.fa-pencil-square-o Edit = link_to 'Close Milestone', namespace_project_milestone_path(@project.namespace, @project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-sm btn-close" + = link_to namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-sm btn-remove" do + %i.fa.fa-trash-o + Remove + %h4 = link_to_gfm truncate(milestone.title, length: 100), namespace_project_milestone_path(milestone.project.namespace, 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 5947498e379..7b1681df336 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -19,6 +19,9 @@ = link_to 'Close Milestone', namespace_project_milestone_path(@project.namespace, @project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-close btn-grouped" - else = link_to 'Reopen Milestone', namespace_project_milestone_path(@project.namespace, @project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-reopen btn-grouped" + = link_to namespace_project_milestone_path(@project.namespace, @project, @milestone), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-grouped btn-remove" do + %i.fa.fa-trash-o + Remove %hr - if @milestone.issues.any? && @milestone.can_be_closed? |