article.DashboardWidget id = widget.id

  h1.DashboardWidget-title Top Applications
  span.DashboardWidget-intro Apps with consistently high traffic in the last 30 days

  - if widget.loaded?
    - if widget.items.present?
      ol.DashboardWidgetList
        - widget.items.each do |item|
          li class="DashboardWidgetList-item DashboardWidgetList-item--#{item.state}"
            = link_to item.application ? admin_buyers_application_path(item.application) : '#', class: 'DashboardWidgetList-link' do
              span.DashboardWidgetList-position
                => item.position
                span.DashboardWidgetList-change title=item.title
                  => item.change
              => item.name
              ' by
              = item.account_name
    - else
      p
        ' In order to show Top Applications you need to have at least one application sending traffic to the #{friendly_service_name(service)}.
      p
        ' Consider
        => link_to 'making some test calls', edit_admin_service_integration_path(widget.params['service_id'], :anchor => 'staging')
        | from the Integration page to get a feel for what you'd see here.

  - else
    = widget.spinner
