{% macro breadcrumbs(section, extra) %} {%- if section['path'] or extra -%}
{%- endif -%} {% endmacro %} {% macro username(un) -%} {% if un.startswith('group:') -%} {{ un['group:'|length:] }} {%- else -%} {{ un }} {%- endif %} {%- endmacro %} {% macro sandbox_resource_type(typename) -%} {{ typename }} {%- endmacro %} {% macro sandbox_resource(rnum) -%} #{{ rnum }} {%- endmacro %} {% macro textdiff(a, b) -%}
{{ a|diffformat(b) }}
{%- endmacro %}
{% macro when(timestamp) -%}
{% if not timestamp %}
{%- trans %}Never{% endtrans -%}
{%- else -%}
{{ timestamp|timedeltaformat }}
{%- endif -%}
{%- endmacro %}
{% macro volatile_labels(volatile, compact=True) -%}
{% if volatile -%}
{%- with (msg, details, icon, label) = {
'new': (
gettext('Just created'),
gettext('Has not been calculated since creation / update'),
'glyphicon glyphicon-plus',
'default'),
'error': (
gettext('Update error'),
gettext('Last attempt to update failed'),
'glyphicon glyphicon-warning-sign',
'danger'),
'postponed': (
gettext('Postponed'),
gettext('Waiting for related volatiles to update'),
'glyphicon glyphicon-hourglass',
'info'),
'same': (
gettext('Same value'),
gettext('Newly calculated value is the same as the previous one'),
'glyphicon glyphicon-ok',
'success'),
'modified': (
gettext('Modified'),
gettext('Newly calculated value differs from the previous one'),
'glyphicon glyphicon-ok',
'primary'),
}[volatile['last_status']] -%}
{% if compact -%}
{% if volatile['locked'] -%}
{%- endif %}
{% if volatile['etime'] is in_the_past -%}
{%- endif %}
{%- else -%}
{{ msg }}
{% if volatile['locked'] -%}
{#
#}
{% trans %}Updating{% endtrans %}
{% endif %}
{% if volatile['etime'] is in_the_past -%}
{#
#} {% trans %}Expired{% endtrans %}
{%- endif %}
{%- endif %}
{%- endwith -%}
{%- endif %}
{%- endmacro %}
{% macro pager(page, is_last_page, is_first_page, endpoint, params) -%}
{% if not (is_last_page and is_first_page) -%}
{%- endif %}
{%- endmacro %}