Sha256: 031cdc0338ea9f9ec670e379cbebd51226770c69c6de82ae1539f2f24ce2896e

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

- profile_name = @profile.options[:profile_name]
- page_title(profile_name)
- require_js "builder"

%a{:href=>"#edit", :id => "edit"} edit profile
%div#chart-builder-slider
  = haml :builder_form

- if @profile.options[:percentiles]
  - percentiles = @profile.options[:percentiles]
- else
  - percentiles = []

- if percentiles.length > 0
  - percentiles_js = "'#{percentiles.join(',') }'"
- else
  - percentiles_js = ''

:javascript
  window.addEvent('domready', function() {
    var builder = new ChartBuilder('chart-builder', {
      hosts:       ['#{@profile.options[:hosts].join("','")   }'],
      metrics:     ['#{@profile.options[:metrics].join("','") }'],
      percentiles: [#{percentiles_js}]

    });

    $('chart-builder-slider').fade('hide').setStyle('height', '0');

    $('edit').addEvent('click', function(e) {
      e.stop();
      $('chart-builder-slider').setStyle('height', 'auto').fade('in');
      e.target.destroy();
    });
  });

%div#profile
  %h2#name= profile_name
  %div#graphs

  %div#bottom_nav
    %a{:href => link_to("/profiles")} ← Back to profiles



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
visage-app-2.1.0 lib/visage-app/views/profile.haml