{# Archive widgets shared across entity templates. #} {% macro archive_button(entity_type, entity_id, is_archived, next_url) %} {%- if is_archived -%}
{%- else -%} {%- endif -%} {% endmacro %} {% macro archived_chip(is_archived) %} {%- if is_archived -%}Archived{%- endif -%} {% endmacro %} {# Show/Hide archived toggle for list pages. `current_url` is the path the link targets (without an `?archived=` query) and `extra_qs` lets callers preserve other query params (e.g. status filter). #} {% macro show_archived_toggle(show_archived, current_url, extra_qs='') %} {%- if show_archived -%} Hide archived {%- else -%} {%- set sep = '&' if extra_qs else '' -%} Show archived {%- endif -%} {% endmacro %}