- content_for :sublayout_title, "Top Applications"

- content_for :stylesheets do
  = stylesheet_link_tag 'vendor/c3'
  = stylesheet_link_tag 'provider/stats/base'
  = stylesheet_link_tag 'provider/stats/selector'
  = stylesheet_link_tag '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/ui-lightness/jquery-ui.css'

  - content_for :javascripts do
    = render_js_module_loader

.Stats
  .StatsMenu-container
  .StatsSelector-container
  .StatsChart-container#chart
  .StatsCSVLink-container
  .StatsHelpText-container

p.Stats-message--notice
  = timezone_information

javascript:
  System.import('stats/provider/stats_top_apps').then(function(module){
    module.statsTopApps(#{json @service.id},
            {
              chartContainer: '#chart',
              menuContainer: '.StatsMenu-container',
              selectorContainer: '.StatsSelector-container',
              csvLinkContainer: '.StatsCSVLink-container',
              helpTextContainer: '.StatsHelpText-container'
            }
    );
  });
