.card
  .card-header
    Requests
  .card-body
    - if requests.any?
      .row
        .col
          .progress
            -# haml-lint:disable InlineStyles
            - requests_by_percentage.each do |state, percentage|
              %div{ title: "#{requests_by_state[state]} #{state} requests",
                    class: "progress-bar progress-state-#{state}",
                    'aria-valuemax': '100', 'aria-valuemin': '0', 'aria-valuenow': percentage,
                    role: 'progressbar', style: "width: #{percentage}%" }
            -# haml-lint:enable InlineStyles
          %p
            = link_to('#pulse-requests') do
              = requests_by_state.values.sum
              active requests
      .row
        - requests_by_state.each_key do |state|
          .col.border.text-center
            %p.fa-3x
              %i{ class: "fa #{request_bootstrap_icon(state)} request-state-#{state}" }
            %p
              = pluralize(requests_by_state[state], 'request')
              %br
              in #{state}
    - else
      - if Flipper.enabled?(:request_index, User.session)
        = link_to(projects_requests_path(project)) do
          No requests have been sent to this project.
      - else
        = link_to(project_requests_path(project)) do
          No requests have been sent to this project.
