{# The markup the site's pages share. #} {% macro health_banner(skipped_pages) %} {% if skipped_pages %} {% endif %} {% endmacro %} {# What marks an element whose card the page's script recounts. #} {% macro counted_items_attribute(card) %} {{ vocabulary.progress_card_attribute.COUNTED_ITEMS }}='{{ card.counted_items | tojson }}'{% endmacro %} {# A card's progress label, marked for the page's script to rewrite. #} {% macro progress_text(card) %}{{ card.progress_label }}{% endmacro %} {# A card's started and reviewed share labels, marked for the page's script to rewrite. #} {% macro stage_text(card) %}{% for share in card.labelled_stage_shares %}{% if not loop.first %}{{ card.stage_label_separator }}{% endif %}{{ share.label }}{% endfor %}{% endmacro %} {# A card with a heading, its progress and a bar layering the started, reviewed and done shares; a link when url is given. #} {% macro progress_card(card, heading, url=None, description=None, error=None) %} {% if url %}{% else %}
{% endif %}

{{ heading }}

{{ progress_text(card) }}

{% if card.labelled_stage_shares %}

{{ stage_text(card) }}

{% endif %} {% if description %}

{{ description }}

{% endif %} {% if error %}

{{ error }}

{% endif %}
{% for share in card.stage_shares %}
{% endfor %}
{% if url %}
{% else %}
{% endif %} {% endmacro %} {# A page's own progress line: its card's progress and share labels. #} {% macro progress_line(card) %}

{{ progress_text(card) }}{% if card.labelled_stage_shares %}{{ card.stage_label_separator }}{{ stage_text(card) }}{% endif %}

{% endmacro %} {# The scripts that recount every card from GitHub's live pull request states. #} {% macro live_progress_scripts() %} {% endmacro %} {# What a chip held back by a draft pull request carries for the page's script to re-check it. #} {% macro draft_recheck_attributes(chip) %}{% if chip.draft_pull_request %} {{ vocabulary.draft_recheck_attribute.PULL_REQUEST }}="{{ chip.draft_pull_request.api_url }}" {{ vocabulary.draft_recheck_attribute.READY_TITLE }}="{{ chip.tooltip }}"{% endif %}{% endmacro %} {# A chip links to its dependency's card: on this page it scrolls there and highlights it, and on another plan's page it opens that page in a new tab at the card. #} {% macro dependency_chip(chip) %} {%- set is_ready = chip.dependency.is_ready_to_unblock_dependents() %} {%- set identifier = chip.dependency.reference.text %} {%- set chip_class = 'chip' if is_ready else 'chip chip-unmet' %} {%- set chip_title = chip.tooltip if is_ready else chip.tooltip ~ ' (not ready yet — this item is blocked on it)' %} {% if not chip.card_url %}{{ identifier }}{% elif chip.dependency.is_in_another_plan %}{{ identifier }}{% else %}{{ identifier }}{% endif %} {% endmacro %} {# The action group is hidden, marked for the page's script to reveal, when hidden is true. #} {% macro action_button(action, hidden=False) %} {% if action %} {% endif %} {% endmacro %} {# A link to the upstream's prefilled pull request form, or the reason it cannot open yet; the page's script re-evaluates it against the pull request's live draft state and the failed-checks override. #} {% macro promotion_button(promotion) %} {% if promotion %} {%- set attributes %}{{ vocabulary.promotion_attribute.FORM_URL }}="{{ promotion.form_url }}" {{ vocabulary.promotion_attribute.ENABLED_TITLE }}="{{ promotion.enabled_title }}" {{ vocabulary.promotion_attribute.OTHER_BLOCKERS }}="{{ promotion.other_blockers | tojson | forceescape }}"{% if promotion.is_draft %} {{ vocabulary.promotion_attribute.DRAFT }}{% endif %}{% endset %} {% if promotion.url %} {{ promotion.label }} ↗ {% else %} {{ promotion.label }} ↗ {% endif %} {{ promotion.reason }} {% if promotion.checks_failed %} {% endif %} {% endif %} {% endmacro %}