~sumner/pr-tracker

ba72f1c845a8430b289fb8ac94f039c7c1a205c4 — Alyssa Ross 9 months ago 6f9ccf0
templates: clean up HTML output

The main issue was that the license header from the tree template was
being repeated in the generated HTML every time it was included.  Use
an askama comment to avoid that.

Additionally, reduce the amount of unnecessary whitespace generated a
bit.
2 files changed, 18 insertions(+), 18 deletions(-)

M templates/page.html
M templates/tree.html
M templates/page.html => templates/page.html +13 -13
@@ 5,9 5,9 @@
<html lang="en">
  <head>
    {% match pr_number %}
    {% when Some with (pr_number) %}
    {%- when Some with (pr_number) -%}
    <title>Nixpkgs PR #{{ pr_number }} progress</title>
    {% else %}
    {%- else -%}
    <title>Nixpkgs PR progress tracker</title>
    {% endmatch %}



@@ 169,29 169,29 @@
    {% endmatch %}

    {% match pr_number %}
    {% when Some with (pr_number) %}
    {%- when Some with (pr_number) -%}
    <main>
      <ol>
        <li>
          {% if closed %}
          {%- if closed -%}
          <span class="state-rejected">❌</span>
          {% else %}
          {%- else -%}
          <span class="state-accepted">✅</span>
          {% endif %}
          {%- endif -%}
          PR <a href="https://github.com/NixOS/nixpkgs/pull/{{ pr_number }}">#{{ pr_number }}</a>
          {% if closed %}
          {%- if closed -%}
          closed
          {% endif %}
          {%- endif -%}
        </li>

        {% match tree %}
        {% when Some with (tree) %}
        {{ tree|safe }}
        {% else %}
        {% endmatch %}
        {%- when Some with (tree) -%}
        {{- tree|safe -}}
        {%- else -%}
        {%- endmatch -%}
      </ol>
    </main>
    {% else %}
    {%- else -%}
    {% endmatch %}
    
    <footer>

M templates/tree.html => templates/tree.html +5 -5
@@ 1,13 1,13 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later WITH GPL-3.0-linking-exception -->
<!-- SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is> -->
{# SPDX-License-Identifier: AGPL-3.0-or-later WITH GPL-3.0-linking-exception #}
{#- SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is> -#}

<li>
  {% match accepted %}
  {% when Some with (true) %}
  {%- when Some with (true) -%}
  <span class="state-accepted">✅</span>
  {% when Some with (false) %}
  {%- when Some with (false) -%}
  <span class="state-pending">⚪</span>
  {% when None %}
  {%- when None -%}
  <span class="state-unknown">❓</span>
  {% endmatch %}