This change implements a simple algorithm to convert "registry names" into
human readable names, allowing plugins to augment the :report_view_widgets
without unnecessary fatalities.

Reviewed-By: Daniel Pittman

Signed-off-by: Pieter van de Bruggen <[email protected]>
---
Local-branch: tickets/next/7537
 app/views/reports/_report.html.haml |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/app/views/reports/_report.html.haml 
b/app/views/reports/_report.html.haml
index 527a537..d6d641c 100644
--- a/app/views/reports/_report.html.haml
+++ b/app/views/reports/_report.html.haml
@@ -8,7 +8,9 @@
       %li= link_to 'Destroy', report, :confirm => 'Are you sure?', :method => 
:delete, :class => "delete button"
 
 .item
-  - user_facing = { '600_resource_statuses' => 'Events', '700_log' => 'Log', 
'800_metrics' => 'Metrics' }
+  - user_facing = Hash.new do |hash, key|
+    - hash[key] = key[/[a-z].*/i].gsub('_', ' ').gsub(/\b\w/) { |m| m.upcase }
+  - user_facing.update '600_resource_statuses' => 'Events'
   - panels = []
   %ul#report-tabs
     - Registry.each_callback :core, :report_view_widgets do |name, widget|
-- 
1.7.5.1

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