From 41ae8577b743ace7c1854db062081852618bf535 Mon Sep 17 00:00:00 2001 From: rkh Date: Thu, 8 Jul 2010 12:29:53 +0000 Subject: [PATCH] debug flag git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1351 7926756e-e54e-46e6-9721-ed318f58905e --- .../cost_reports/_cost_report_table.rhtml | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/cost_reports/_cost_report_table.rhtml b/app/views/cost_reports/_cost_report_table.rhtml index 756138d079..28e4b2f29e 100644 --- a/app/views/cost_reports/_cost_report_table.rhtml +++ b/app/views/cost_reports/_cost_report_table.rhtml @@ -18,7 +18,7 @@ walker.for_empty_cell { " " } walker.for_cell do |result| - "#{number_to_currency result.real_costs}, #{result.fields.inspect}" + "#{number_to_currency result.real_costs}#{"," << result.fields.inspect if params[:debug]}" end %> @@ -51,18 +51,20 @@ <% end %> -
+<% if params[:debug] %>
+  
   
-  [ Query ]
-  <% query.chain.each do |child| %>
-    - <%= h child.class.inspect %>, <%= h child.type %>
-  <% end %>
+    [ Query ]
+    <% query.chain.each do |child| %>
+      - <%= h child.class.inspect %>, <%= h child.type %>
+    <% end %>
   
-  [ RESULT ]
+    [ RESULT ]
   
-  <% query.result.recursive_each_with_level do |level, result| %>
-    <%= ">>> " * (level+1) %><%= h result.inspect %>,
-       <%= "   " * (level+1) %><%= h result.type.inspect %>,
-       <%= "   " * (level+1) %><%= h result.fields.inspect %>
-  <% end %>
-
\ No newline at end of file + <% query.result.recursive_each_with_level do |level, result| %> + <%= ">>> " * (level+1) %><%= h result.inspect %>, + <%= " " * (level+1) %><%= h result.type.inspect %>, + <%= " " * (level+1) %><%= h result.fields.inspect %> + <% end %> +
+<% end %> \ No newline at end of file