- content_for :sublayout_title, "Response codes"

- content_for :stylesheets do
  = stylesheet_link_tag 'vendor/c3'
  = stylesheet_link_tag 'provider/stats/base'
  = stylesheet_link_tag 'provider/stats/response_codes'
  = 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
  .StatsChart-container#chart
  .StatsChart-noDataMessageContainer.StatsMessages
    h3.StatsMessages-title You do not seem to have any statistics on your API traffic by Response Codes.

    h4 This could be because:

    ul.StatsMessages-list
      li Your API has not had any traffic in the selected time period.
      li You are not reporting the Response Codes of your API traffic to 3scale.
      li If you have previously had traffic and reported Response Codes you may select a different time period using the selector above.

    h4 To learn how to report the Response Codes of your API traffic to 3scale please consult:

    ul.StatsMessages-list
      li The 3scale
        #{link_to('API ActiveDocs documentation', provider_admin_api_docs_path(anchor: '/service_management_api'), target:'_blank')}
        for our Service Management API methods where the Response Codes
        can be sent.
      li Our HowTo tutorial on
        #{link_to('Response Codes Tracking', I18n.t('api.integrations.proxy.documentation_response_codes_tracking_url'), target:'_blank')}
        on the 3scale support portal


p.timezone
  = timezone_information

- if @logs_enabled
  #request-logs.StatsRequestLogs
    h2 Request logs

javascript:
  System.import('stats/provider/stats_response_codes').then(function(module){
    module.statsResponseCodes(#{json @service.id},
            {
              chartContainer: '#chart',
              noDataMessageContainer: '.StatsChart-noDataMessageContainer',
              logsEnabled: #{json @logs_enabled},
              logsContainer: '#request-logs'
            }
    );
  });
