Paired-With: Matt Robinson <[email protected]>
Signed-off-by: Jesse Wolfe <[email protected]>
---
Local-branch: ticket/next/5174-part2
 app/controllers/reports_controller.rb |    6 ++++++
 app/views/reports/_report.html.haml   |    4 +++-
 config/routes.rb                      |    1 +
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/app/controllers/reports_controller.rb 
b/app/controllers/reports_controller.rb
index 9da508b..c18dc8b 100644
--- a/app/controllers/reports_controller.rb
+++ b/app/controllers/reports_controller.rb
@@ -42,6 +42,12 @@ class ReportsController < InheritedResources::Base
     end
   end
 
+  def make_baseline
+    report = Report.find( params[:id] )
+    report.baseline!
+    redirect_to report
+  end
+
   private
 
   def collection
diff --git a/app/views/reports/_report.html.haml 
b/app/views/reports/_report.html.haml
index e321350..665515c 100644
--- a/app/views/reports/_report.html.haml
+++ b/app/views/reports/_report.html.haml
@@ -8,7 +8,9 @@
       %span.alt for
       = link_to report.node.name, report.node
   %ul.actions
-    %li= link_to 'Destroy', @report, :confirm => 'Are you sure?', :method => 
:delete, :class => "delete button"
+    - if report.kind == "inspect" and ! report.baseline?
+      %li= link_to "Make Baseline", {:id => report, :action => 
"make_baseline"}, :method => :put, :confirm => 'Are you sure?', :class => 
"button"
+    %li= link_to 'Destroy', report, :confirm => 'Are you sure?', :method => 
:delete, :class => "delete button"
 
 .item
   - if report.resource_statuses.present?
diff --git a/config/routes.rb b/config/routes.rb
index 678f3d7..5237640 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -28,6 +28,7 @@ ActionController::Routing::Routes.draw do |map|
     :member => {
       :diff => :get,
       :diff_summary => :get,
+      :make_baseline => :put,
     }
 
   map.upload "reports/upload", :controller => :reports, :action => "upload", 
:conditions => { :method => :post }
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to