xref: /openbmc/openbmc/meta-arm/scripts/report-details.html.jinja (revision bec4ebc22c43c1ff5c3fddb820d44a88bd3aebf0)
1*bec4ebc2SBrad Bishop{% extends "report-base.html.jinja" %}
2*bec4ebc2SBrad Bishop{% block title %}Recipe Report for {{ machine }}{% endblock %}
3*bec4ebc2SBrad Bishop
4*bec4ebc2SBrad Bishop{# Write a tag element using the Upstream-Status to determine the class. #}
5*bec4ebc2SBrad Bishop{% macro make_patch_tag(status) -%}
6*bec4ebc2SBrad Bishop  {% set status = status.split()[0] %}
7*bec4ebc2SBrad Bishop  {% if status in ("Unknown", "Pending") %}
8*bec4ebc2SBrad Bishop    {% set class = "is-danger" %}
9*bec4ebc2SBrad Bishop  {% elif status in ("Backport", "Accepted", "Inappropriate", "Denied") %}
10*bec4ebc2SBrad Bishop    {% set class = "is-success" %}
11*bec4ebc2SBrad Bishop  {% elif status in ("Submitted",) %}
12*bec4ebc2SBrad Bishop    {% set class = "is-info" %}
13*bec4ebc2SBrad Bishop  {% else %}
14*bec4ebc2SBrad Bishop    {% set class = "is-info" %}
15*bec4ebc2SBrad Bishop  {% endif %}
16*bec4ebc2SBrad Bishop  <span class="tag {{ class }}">{{ status }}</span>
17*bec4ebc2SBrad Bishop{%- endmacro %}
18*bec4ebc2SBrad Bishop
19*bec4ebc2SBrad Bishop{% block content %}
20*bec4ebc2SBrad Bishop  <!-- TODO table of contents -->
21*bec4ebc2SBrad Bishop
22*bec4ebc2SBrad Bishop  {% for name, data in data|dictsort if data.needs_update or data.patched %}
23*bec4ebc2SBrad Bishop  <h2 class="title is-4">
24*bec4ebc2SBrad Bishop    {{ data.recipe }} {{ data.fullversion }}
25*bec4ebc2SBrad Bishop    {% if name != data.recipe %}
26*bec4ebc2SBrad Bishop      (provides {{ name }})
27*bec4ebc2SBrad Bishop    {% endif %}
28*bec4ebc2SBrad Bishop    {% if data.needs_update %}<span class="tag is-danger">Upgrade Needed</span>{% endif %}
29*bec4ebc2SBrad Bishop    <a id="recipe-{{ data.recipe }}" class="has-text-grey-lighter">#</a>
30*bec4ebc2SBrad Bishop  </h2>
31*bec4ebc2SBrad Bishop
32*bec4ebc2SBrad Bishop  {% if data.needs_update %}
33*bec4ebc2SBrad Bishop  <p>
34*bec4ebc2SBrad Bishop    Recipe is version {{ data.fullversion }}, latest upstream release is <strong>{{ data.upstream }}</strong>.
35*bec4ebc2SBrad Bishop  </p>
36*bec4ebc2SBrad Bishop  {% endif%}
37*bec4ebc2SBrad Bishop
38*bec4ebc2SBrad Bishop  {% if data.patched %}
39*bec4ebc2SBrad Bishop  <table class="table is-striped is-bordered">
40*bec4ebc2SBrad Bishop    <thead>
41*bec4ebc2SBrad Bishop      <tr>
42*bec4ebc2SBrad Bishop        <th>Patch</th>
43*bec4ebc2SBrad Bishop        <th style="width: 20em">Layer</th>
44*bec4ebc2SBrad Bishop        <th style="width: 10em">Status</th>
45*bec4ebc2SBrad Bishop      </tr>
46*bec4ebc2SBrad Bishop    </thead>
47*bec4ebc2SBrad Bishop    <tbody>
48*bec4ebc2SBrad Bishop      {% for pinfo in data.patches %}
49*bec4ebc2SBrad Bishop      <tr>
50*bec4ebc2SBrad Bishop        <td>
51*bec4ebc2SBrad Bishop          {% if pinfo.url %}<a href="{{pinfo.url}}">{% endif %}
52*bec4ebc2SBrad Bishop          {{ pinfo.name }}
53*bec4ebc2SBrad Bishop          {% if pinfo.url %}</a>{% endif %}
54*bec4ebc2SBrad Bishop        </td>
55*bec4ebc2SBrad Bishop        <td>{{ pinfo.layer }}</td>
56*bec4ebc2SBrad Bishop        <!-- TODO: tooltip with full status? -->
57*bec4ebc2SBrad Bishop        <td class="has-text-centered">{{ make_patch_tag(pinfo.status)}}</td>
58*bec4ebc2SBrad Bishop      </tr>
59*bec4ebc2SBrad Bishop      {% endfor %}
60*bec4ebc2SBrad Bishop    </tbody>
61*bec4ebc2SBrad Bishop  </table>
62*bec4ebc2SBrad Bishop  {% endif %}
63*bec4ebc2SBrad Bishop  {% endfor %}
64*bec4ebc2SBrad Bishop{% endblock %}
65