{% macro button(label, href=none, variant='primary', button_type='button', disabled=false) -%} {% if href %} {{ label }} {% else %} {% endif %} {%- endmacro %} {% macro feedback(message, kind='error', id=none, focus=false) -%} {% if message %}
{{ message }}
{% endif %} {%- endmacro %} {% macro status_badge(label, count=none, href=none, title=none) -%} {%- set display_label = label|status_label -%} {%- set change_variant = label|status_badge_variant -%} {%- set variant = change_variant -%} {% if href %}{% if count is not none %}{{ count }} {% endif %}{{ display_label }}{% else %}{% if count is not none %}{{ count }} {% endif %}{{ display_label }}{% endif %} {%- endmacro %} {% macro form_field(label, name, id, type='text', autocomplete=none, required=false, value=none, help_text=none, error=none, disabled=false, error_id=none, control='input', password_toggle=false, min_value=none, max_length=none, shield=true, semantic_type=none, key_source=false) -%}
{% if control == 'textarea' %} {% else %} {% endif %} {% if password_toggle and type == 'password' %} {% endif %} {% if help_text %}

{{ help_text }}

{% endif %} {% if error %}{% endif %}
{%- endmacro %} {#- A labelled single-choice list. The native select works without JavaScript; select.js turns it into the styled refrncr Select. `options` holds (value, label) pairs or mappings with value, label and optional code, badge and disabled. `searchable` forces the search field on or off; by default it appears from 10 options. `noun` names the options in the search count. -#} {% macro select_field(label, name, id, options, selected=none, placeholder=none, help_text=none, error=none, error_id=none, described_by=none, required=false, disabled=false, compact=false, searchable=none, noun=none) -%} {%- set describers = [] -%} {%- if help_text %}{% set _ = describers.append(id ~ '-help') %}{% endif -%} {%- if error %}{% set _ = describers.append(id ~ '-error') %}{% elif error_id %}{% set _ = describers.append(error_id) %}{% endif -%} {%- if described_by %}{% set _ = describers.append(described_by) %}{% endif -%}
{% if help_text %}

{{ help_text }}

{% endif %} {% if error %}{% endif %}
{%- endmacro %} {% macro breadcrumbs(items) -%} {%- endmacro %} {% macro content_metadata(count, updated, version_number=none, deleted_count=0, status=none, record_label='records', secondary_count=none, secondary_label='', draft_in_progress=false, mapping_source=none, mapping_usage=none) -%} {% from 'components/mapping_usage.html' import usage_link %}

{% if version_number is not none %}V{{ version_number }}{% if status %}{{ status_badge(status) }}{% endif %}{% endif %}{{ count }} {{ record_label|pluralize(count) }}{% if secondary_count is not none %}{{ secondary_count }} {{ secondary_label|pluralize(secondary_count) }}{% endif %} {% if draft_in_progress %}{{ status_badge('Draft in progress') }}{% endif %} {% if mapping_source %}Source: {{ mapping_source.name }} V{{ mapping_source.number }}{% endif %} {% if mapping_usage and mapping_usage.total %}{{ usage_link(mapping_usage) }}{% endif %} {% if deleted_count %}{{ deleted_count }} marked for deletion{% endif %} Updated

{%- endmacro %} {% macro readonly_field(label, value, technical=false) -%}

{{ label }}: {% if technical %}{{ value }}{% else %}{{ value }}{% endif %}

{%- endmacro %}