Paired-with: Nick Lewis <[email protected]>
Signed-off-by: Paul Berry <[email protected]>
---
Local-branch: ticket/next/5880
 app/controllers/reports_controller.rb    |    4 --
 app/views/reports/_report.html.haml      |    2 +-
 app/views/reports/diff.html.haml         |   59 +++++++++++++++++++-----------
 app/views/reports/diff_summary.html.haml |   38 -------------------
 config/routes.rb                         |    1 -
 5 files changed, 39 insertions(+), 65 deletions(-)
 delete mode 100644 app/views/reports/diff_summary.html.haml

diff --git a/app/controllers/reports_controller.rb 
b/app/controllers/reports_controller.rb
index fb9a5e9..355fc07 100644
--- a/app/controllers/reports_controller.rb
+++ b/app/controllers/reports_controller.rb
@@ -41,10 +41,6 @@ class ReportsController < InheritedResources::Base
     @my_report = Report.find(params[:id])
     @baseline_report = Report.find(params[:baseline_id])
     @diff = @baseline_report.diff(@my_report)
-  end
-
-  def diff_summary
-    diff
     @resource_statuses = {:failure => [], :pass => []}
     @diff.each do |resource, differences|
       if ! differences.empty?
diff --git a/app/views/reports/_report.html.haml 
b/app/views/reports/_report.html.haml
index 84798be..335d8a9 100644
--- a/app/views/reports/_report.html.haml
+++ b/app/views/reports/_report.html.haml
@@ -11,7 +11,7 @@
   - if report.kind == "inspect"
     .section
       %h3= "Compare with baseline:"
-      - form_tag({:id => report, :action => "diff_summary"}, :method => :get) 
do
+      - form_tag({:id => report, :action => "diff"}, :method => :get) do
         %p= select_tag( "baseline_id", options_from_collection_for_select( 
Report.baselines, :id, :long_name ) ) + submit_tag("compare")
   - if report.resource_statuses.present?
     .section
diff --git a/app/views/reports/diff.html.haml b/app/views/reports/diff.html.haml
index 6e250a4..b98389b 100644
--- a/app/views/reports/diff.html.haml
+++ b/app/views/reports/diff.html.haml
@@ -1,21 +1,38 @@
-.header
-  %h2
-    = render 'report_title', :report => @my_report
-    compared against 
-    = render 'report_title', :report => @baseline_report
-%table.inspector
-  %thead
-    %tr
-      %th Resource
-      %th Property
-      %th Expected
-      %th Actual
-  %tbody
-    - @diff.each do |resource, properties_hash|
-      - properties_hash.each do |property, expected_actual|
-        - expected, actual = expected_actual
-        %tr
-          %td{:id => h(resource)}= h resource
-          %td= h property
-          %td= h expected
-          %td= h actual
+#sidebar= render 'shared/node_manager_sidebar'
+#main
+  .header
+    %h2
+      Comparing
+      = render 'report_title', :report => @my_report
+      %br
+      against baseline
+      = render 'report_title', :report => @baseline_report
+  .item
+    %h4
+      = pluralize(@resource_statuses[:failure].length, 'Mismatch')
+      - if @resource_statuses[:failure].present?
+        %a{ :href => '#', :class => 'expand-all' } (expand all)
+    - if @resource_statuses[:failure].present?
+      %dl#baseline-diff-report
+        - @resource_statuses[:failure].each do |resource|
+          %dt{:class => cycle( 'odd', 'even' )}
+            = link_to h(resource), {}, {:class => 'expandable-link 
collapsed-link'}
+          %dd.expandable.collapsed
+            %table
+              %tr
+                %th Property
+                %th Actual
+                %th Baseline
+              - @diff[ resource ].each do |property, expected_actual|
+                %tr
+                  - baseline, actual = expected_actual
+                  %td= h property
+                  %td= h actual
+                  %td= h baseline
+    %h4= pluralize(@resource_statuses[:pass].length, 'Match')
+    - if @resource_statuses[:pass].present?
+      %dl#baseline-diff-report
+        - @resource_statuses[:pass].each do |resource|
+          %dt{:class => cycle( 'odd', 'even' )}
+            %span{:class => 'non-expandable-bullet'}
+              = h(resource)
diff --git a/app/views/reports/diff_summary.html.haml 
b/app/views/reports/diff_summary.html.haml
deleted file mode 100644
index b98389b..0000000
--- a/app/views/reports/diff_summary.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-#sidebar= render 'shared/node_manager_sidebar'
-#main
-  .header
-    %h2
-      Comparing
-      = render 'report_title', :report => @my_report
-      %br
-      against baseline
-      = render 'report_title', :report => @baseline_report
-  .item
-    %h4
-      = pluralize(@resource_statuses[:failure].length, 'Mismatch')
-      - if @resource_statuses[:failure].present?
-        %a{ :href => '#', :class => 'expand-all' } (expand all)
-    - if @resource_statuses[:failure].present?
-      %dl#baseline-diff-report
-        - @resource_statuses[:failure].each do |resource|
-          %dt{:class => cycle( 'odd', 'even' )}
-            = link_to h(resource), {}, {:class => 'expandable-link 
collapsed-link'}
-          %dd.expandable.collapsed
-            %table
-              %tr
-                %th Property
-                %th Actual
-                %th Baseline
-              - @diff[ resource ].each do |property, expected_actual|
-                %tr
-                  - baseline, actual = expected_actual
-                  %td= h property
-                  %td= h actual
-                  %td= h baseline
-    %h4= pluralize(@resource_statuses[:pass].length, 'Match')
-    - if @resource_statuses[:pass].present?
-      %dl#baseline-diff-report
-        - @resource_statuses[:pass].each do |resource|
-          %dt{:class => cycle( 'odd', 'even' )}
-            %span{:class => 'non-expandable-bullet'}
-              = h(resource)
diff --git a/config/routes.rb b/config/routes.rb
index 3a2bac5..896702b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -23,7 +23,6 @@ ActionController::Routing::Routes.draw do |map|
   map.resources :reports,
     :member => {
       :diff => :get,
-      :diff_summary => :get,
       :make_baseline => :put,
     },
     :collection => {
-- 
1.7.2

-- 
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