<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Platform Database Validation Results</title>
    <style type="text/css">
      html {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
          "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
          "Helvetica Neue", sans-serif;
        background-color: #16161a;
        color: #ccc;
      }
      h1,
      h2 {
        background-color: #002b49;
        padding: 0.5rem;
        font-weight: 400;
      }
      h1 {
        color: white;
      }
      h2 {
        color: #ddd;
      }
      a {
        color: #00c1de;
        text-decoration: none;
      }
      a:hover {
        opacity: 0.5;
      }
      table {
        border-collapse: collapse;
        text-align: center;
      }
      td {
        padding: 0.3rem 1rem 0.3rem 1rem;
        font-weight: 300;
      }
      th {
        font-weight: 400;
      }
      thead {
        font-size: 1.1rem;
      }
      tbody {
        font-size: 0.9rem;
      }
      tbody tr:nth-child(odd) {
        background-color: #1c1c1c;
      }
      ul {
        list-style-type: circle;
      }
      .link_info {
        color: #666;
        margin: 0.5rem;
      }
    </style>
  </head>
  <body>
    <h1>Project's 3rd party IP report</h1>
    <p><i>{{ render_time }}</i></p>
    <h2>Summary</h2>
    <table>
      <thead>
        <tr>
          <th>Licence compliance</th>
          <th>Details</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><span style="color: {% if project.compliance %}#00c246{% else %}red{% endif %};">{% if project.compliance %}Compliant{% else %}Not compliant{% endif %}</span></td>
          <td>{% if project.compliance_details %}{{ project.compliance_details }}{% else %}N/A{% endif %}</td>
        </tr>
      </tbody>
    </table>
    <h2>Package licences</h2>
    <table id="third_party_ip">
      <tr>
      <th>Compliance</th>
      <th>Name</th>
      <th>Is a dependency?</th>
      <th>URL</th>
      <th>Licence</th>
      <th>Details</th>
      </tr>
{%- for name,package in packages|dictsort %}
        <tr>
        <td style="text-align:center">
            {%- if package.is_compliant == True -%}
                ✅
            {%- else -%}
                ❌
            {%- endif -%}
        </td>
        <td style="text-align:center">
           {{ package.name }}
        </td>
        <td style="text-align:center">
            {%- if package.is_dependency == True -%}
                Y
            {%- else -%}
                N
            {%- endif -%}
        </td>
        <td style="text-align:center">
           {{ package.url }}
        </td>
        <td style="text-align:center">
            <span style="color: {% if package.mark_as_problematic %}{% if package.is_compliant %}#ffdf28{% else %}red{% endif %}{% endif %};">{{ package.licence }}</span>

        </td>
        <td style="text-align:center">
           {{ package.licence_compliance_details }}
        </td>
      </tr>
{%- endfor %}
    </table>
  </body>
</html>
