Paired-With: Randall Hansen

Signed-off-by: Pieter van de Bruggen <[email protected]>
---
Local-branch: tickets/next/6989
 app/views/reports/_report.html.haml      |    7 ++---
 public/javascripts/application.js        |   12 ++++++++-
 public/javascripts/jquery-tabify.min.js  |    1 -
 public/stylesheets/application.css       |   32 +++++++++++++++++++++++++-
 public/stylesheets/sass/application.scss |   37 +++++++++++++++++++++++++++++-
 5 files changed, 80 insertions(+), 9 deletions(-)
 delete mode 100644 public/javascripts/jquery-tabify.min.js

diff --git a/app/views/reports/_report.html.haml 
b/app/views/reports/_report.html.haml
index 910de8e..527a537 100644
--- a/app/views/reports/_report.html.haml
+++ b/app/views/reports/_report.html.haml
@@ -13,9 +13,8 @@
   %ul#report-tabs
     - Registry.each_callback :core, :report_view_widgets do |name, widget|
       - panels << capture_haml do
-        %div(id="#{user_facing[name].downcase}")
+        %div.panel(id="#{user_facing[name].downcase}")
           = widget.call self, report
-      %li
-        %a{ :href => "##{user_facing[name].downcase}" }
-          = user_facing[name]
+      %li(id="#{user_facing[name].downcase}-tab")
+        = user_facing[name]
   = panels
diff --git a/public/javascripts/application.js 
b/public/javascripts/application.js
index 1f69daf..9dd6428 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -104,8 +104,16 @@ jQuery(document).ready(function(J) {
   });
   init_expandable_list();
 
-  J('.reports_show_action #report-tabs li:first').addClass("active");
-  J('.reports_show_action #report-tabs').tabify();
+  J('.reports_show_action #report-tabs').show();
+  J('.reports_show_action .panel').addClass('tabbed');
+  J('.reports_show_action #report-tabs li').click(function() {
+    panelID = this.id.replace(/-tab$/, '');
+    J('.reports_show_action #report-tabs li').removeClass('active');
+    J('.reports_show_action .panel').hide();
+    J(this).addClass('active');
+    J('#' + panelID).show();
+  });
+  J('.reports_show_action #report-tabs li:first').click();
 });
 
 function init_expandable_list() {
diff --git a/public/javascripts/jquery-tabify.min.js 
b/public/javascripts/jquery-tabify.min.js
deleted file mode 100644
index 7be2f09..0000000
--- a/public/javascripts/jquery-tabify.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(a){a.fn.extend({tabify:function(e){function 
c(b){hash=a(b).find("a").attr("href");return 
hash=hash.substring(0,hash.length-4)}function 
f(b){a(b).addClass("active");a(c(b)).show();a(b).siblings("li").each(function(){a(this).removeClass("active");a(c(this)).hide()})}return
 this.each(function(){function 
b(){location.hash&&a(d).find("a[href="+location.hash+"]").length>0&&f(a(d).find("a[href="+location.hash+"]").parent())}var
 d=this,g={ul:a(d)};a(this).find("li a").each(function(){a(this).attr("href", 
a(this).attr("href")+"-tab")});location.hash&&b();setInterval(b,100);a(this).find("li").each(function(){a(this).hasClass("active")?a(c(this)).show():a(c(this)).hide()});e&&e(g)})}})})(jQuery);
\ No newline at end of file
diff --git a/public/stylesheets/application.css 
b/public/stylesheets/application.css
index 7745a5a..c1b1952 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -373,8 +373,38 @@ body {
         right: 0; }
       body .section#flash img {
         vertical-align: top; }
+  body.reports_show_action #report-tabs {
+    display: none;
+    font-size: 14px;
+    font-weight: bold;
+    float: left;
+    margin: 0;
+    padding: 0; }
+    body.reports_show_action #report-tabs li {
+      -webkit-border-radius: 0.35em 0.35em 0 0;
+      -moz-border-radius: 0.35em 0.35em 0 0;
+      border-radius: 0.35em 0.35em 0 0;
+      background: #CCC;
+      list-style: none;
+      float: left;
+      border: solid 1px #CCC;
+      padding: 4px 1em;
+      margin-right: 4px;
+      cursor: pointer;
+      color: white;
+      vertical-align: middle; }
+      body.reports_show_action #report-tabs li.active {
+        border-bottom-color: white;
+        background-color: white;
+        color: #2C66A8; }
+  body.reports_show_action .panel.tabbed {
+    border: solid 1px #CCC;
+    background-color: white;
+    padding: 1em;
+    margin-top: 27px;
+    margin-bottom: 1em; }
   body.reports_show_action .section {
-    margin-left: 1em; }
+    margin: 0; }
   body.reports_show_action h4 {
     color: #444; }
   body.reports_show_action table.inspector td.key {
diff --git a/public/stylesheets/sass/application.scss 
b/public/stylesheets/sass/application.scss
index 5ffadf8..c62b983 100644
--- a/public/stylesheets/sass/application.scss
+++ b/public/stylesheets/sass/application.scss
@@ -524,8 +524,43 @@ body {
   }
 
   &.reports_show_action {
+    #report-tabs {
+      display: none;
+      font-size: 14px;
+      font-weight: bold;
+      float: left;
+      margin: 0;
+      padding: 0;
+
+      li {
+        @include rounded_top;
+        background: #CCC;
+        list-style: none;
+        float: left;
+        border: solid 1px #CCC;
+        padding: 4px 1em;
+        margin-right: 4px;
+        cursor: pointer;
+        color: white;
+
+        &.active {
+          border-bottom-color: white;
+          background-color: white;
+          color: #2C66A8;
+        }
+      }
+    }
+
+    .panel.tabbed {
+      border: solid 1px #CCC;
+      background-color: white;
+      padding: 1em;
+      margin-top: 27px;
+      margin-bottom: 1em;
+    }
+
     .section {
-      margin-left: 1em;
+      margin: 0;
     }
 
     h4 {
-- 
1.7.4.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