<!DOCTYPE html>

{% from "./macros/scenario.html" import show_scenario %}

<html>

<head>
  <meta charset="utf-8">
  <title>Preacher Test Report</title>

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">
  <style>
    /**
     * Color palette: https://vuetifyjs.com/ja/styles/colors
     */
    body {
      padding: 0em 1em;
    }

    .badge {
      border-radius: 0.5em;
      color: #ffffff;
    }
    .badge.status-SKIPPED {
      background-color: #757575; /* grey darken-1 */
    }
    .badge.status-SUCCESS {
      background-color: #43A047; /* green darken-1 */
    }
    .badge.status-UNSTABLE {
      background-color: #FFB300; /* amber darken-1 */
    }
    .badge.status-FAILURE {
      background-color: #E53935; /* red darken-1 */
    }

    .accordion-title {
      padding: 0.6em 1em;
      color: #0a0a0a;
      font-size: inherit;
    }
    .accordion-content {
      border: none;
      padding-top: 0rem;
      padding-right: 0rem;
      padding-bottom: 0rem;
      background-color: inherit;
    }
    .accordion-content .accordion-title {
      border-right: none;
    }

    .accordion-item.status-SKIPPED {
      background-color: #FAFAFA; /* grey lighten-5 */
    }
    .accordion-item.status-SKIPPED>.accordion-title {
      background-color: #E0E0E0; /* grey lighten-2 */
    }

    .accordion-item.status-SUCCESS {
      background-color: #E8F5E9; /* green lighten-5 */
    }
    .accordion-item.status-SUCCESS>.accordion-title {
      background-color: #81C784; /* green lighten-2 */
    }

    .accordion-item.status-UNSTABLE {
      background-color: #FFF8E1; /* amber lighten-5 */
    }
    .accordion-item.status-UNSTABLE>.accordion-title {
      background-color: #FFD54F; /* amber lighten-2 */
    }

    .accordion-item.status-FAILURE {
      background-color: #FFEBEE; /* red lighten-5 */
    }
    .accordion-item.status-FAILURE>.accordion-title {
      background-color: #E57373; /* red lighten-2 */
    }
  </style>
</head>

<body>

  <h1>Preacher Test Report</h1>

  <ul class="scenarios accordion" data-accordion data-multi-expand="true" data-allow-all-closed="true">
    {% for scenario in scenarios %}
      {{ show_scenario(scenario) }}
    {% endfor %}
  </ul>

</body>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/js/foundation.min.js"></script>
<script>
$(document).foundation()
$('.scenarios').foundation('down', $('.status-UNSTABLE,.status-FAILURE').children('.accordion-content'))
</script>
</html>
