aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/report-details.html.jinja
blob: a656c26175fab1b3441ce4ae57331ef567f707eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% extends "report-base.html.jinja" %}
{% block title %}Recipe Report for {{ machine }}{% endblock %}

{# Write a tag element using the Upstream-Status to determine the class. #}
{% macro make_patch_tag(status) -%}
  {% set status = status.split()[0] %}
  {% if status in ("Unknown", "Pending") %}
    {% set class = "is-danger" %}
  {% elif status in ("Backport", "Accepted", "Inappropriate", "Denied") %}
    {% set class = "is-success" %}
  {% elif status in ("Submitted",) %}
    {% set class = "is-info" %}
  {% else %}
    {% set class = "is-info" %}
  {% endif %}
  <span class="tag {{ class }}">{{ status }}</span>
{%- endmacro %}

{% block content %}
  <!-- TODO table of contents -->

  {% for name, data in data|dictsort if data.needs_update or data.patched %}
  <h2 class="title is-4">
    {{ data.recipe }} {{ data.fullversion }}
    {% if name != data.recipe %}
      (provides {{ name }})
    {% endif %}
    {% if data.needs_update %}<span class="tag is-danger">Upgrade Needed</span>{% endif %}
    <a id="recipe-{{ data.recipe }}" class="has-text-grey-lighter">#</a>
  </h2>

  {% if data.needs_update %}
  <p>
    Recipe is version {{ data.fullversion }}, latest upstream release is <strong>{{ data.upstream }}</strong>.
  </p>
  {% endif%}

  {% if data.patched %}
  <table class="table is-striped is-bordered">
    <thead>
      <tr>
        <th>Patch</th>
        <th style="width: 20em">Layer</th>
        <th style="width: 10em">Status</th>
      </tr>
    </thead>
    <tbody>
      {% for pinfo in data.patches %}
      <tr>
        <td>
          {% if pinfo.url %}<a href="{{pinfo.url}}">{% endif %}
          {{ pinfo.name }}
          {% if pinfo.url %}</a>{% endif %}
        </td>
        <td>{{ pinfo.layer }}</td>
        <!-- TODO: tooltip with full status? -->
        <td class="has-text-centered">{{ make_patch_tag(pinfo.status)}}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
  {% endif %}
  {% endfor %}
{% endblock %}