report-details.html.jinja 1.9 KB

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