OSDN Git Service

Ability to close milestone from milestones -> index
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 16 Apr 2013 18:51:26 +0000 (21:51 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 16 Apr 2013 18:51:26 +0000 (21:51 +0300)
app/views/milestones/_milestone.html.haml
app/views/milestones/update.js.haml [new file with mode: 0644]

index 04b51a5..894fa6c 100644 (file)
@@ -4,6 +4,8 @@
       = 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"
   %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/milestones/update.js.haml b/app/views/milestones/update.js.haml
new file mode 100644 (file)
index 0000000..3ff8491
--- /dev/null
@@ -0,0 +1,2 @@
+:plain
+  $('##{dom_id(@milestone)}').fadeOut();