{% from 'components/icons.html' import history_icon %} {% from 'components/side_panel.html' import form_side_panel %} {% from 'components.html' import status_badge %} {% macro new_concept(key, label='Create draft') -%}
{%- endmacro %} {% macro versions_action(key) -%} {{ history_icon() }}Versions {%- endmacro %} {% macro current_version_action(key, has_current) -%} {% if has_current %} View current version {% endif %} {%- endmacro %} {% macro discard_action(key, ui, panel_id='concept-discard-panel') -%} {% if ui.discard_unavailable %}
Discard draft

{{ ui.discard_unavailable }}

{% else %} Discard draft {% endif %} {%- endmacro %} {% macro discard_panel(panel_id='concept-discard-panel') -%} {% from 'components/side_panel.html' import side_panel %} {% call side_panel(panel_id, 'Discard draft', panel_id ~ '-title', description='Permanently remove unpublished changes. Current, Scheduled and history remain unchanged.', eyebrow_slot=true) %}
{% endcall %} {%- endmacro %} {% macro concept_actions(key, ui, can_review=false, can_discard=true) -%} {% if can_discard %}
⋯
{% if can_discard %}{{ discard_action(key, ui) }}{% endif %}
{% endif %} {%- endmacro %} {% macro banner(key, ui, actions=true, publication_panel=false, show_current=true, include_discard_panel=false) -%} {% if ui %}

{{ status_badge('Stale' if ui.stale else 'Draft') }} You’re working on a draft

{% if ui.baseline %}Based on Version {{ ui.baseline.version.number }}{% else %}No published version yet{% endif %} · {% if ui.stale %}Stale — the basis version was cancelled. Your changes are preserved. Publication is blocked.{% if ui.has_current %} You can discard this Draft to return to Current.{% endif %}{% elif ui.has_changes %}Changes in progress{% else %}No changes yet{% endif %}

{% if ui.baseline %}Changes are not visible in any published version until you publish them.{% else %}Nothing is published yet. Publishing creates Version 1.{% endif %}

{% if show_current %}{{ current_version_action(key, ui.has_current) }}{% endif %} {% if caller is defined %}{{ caller() }}{% endif %} {% if actions and ui.may_publish %}Review & publish{% endif %} {% if actions %}{{ concept_actions(key, ui, ui.can_review, true) }}{% endif %}
{% if actions and include_discard_panel %}{{ discard_panel() }}{% endif %} {% if actions and ui.may_publish and publication_panel %}{{ form_side_panel('concept-publication-panel') }}{% endif %} {% endif %} {%- endmacro %}