{% macro title_text(title, text) -%}

{{ title }}

{{ text }}

{%- endmacro %} {% macro radiogroup(radioname, options) -%} {% for opt in options %} {% endfor %} {%- endmacro %} {% macro header_card(title, date, pages, break=True) -%} {% if break %}

{% endif %}

Experimental Protocol: {{ title }}

{{ title_text('Issuer', 'Cryo-EM Facility') }}
{{ title_text('Date', date|pretty_date) }}
{{ title_text('Page', '%s of %s'|format(pages[0], pages[1])) }}
{%- endmacro %} {% macro sj_header_card(title, date, pages, break=True) -%} {% if break %}

{% endif %}

Report: {{ title }}

{{ title_text('Issuer', 'Cryo-EM Center') }}
{{ title_text('Date', date|pretty_date) }}
{{ title_text('Page', '%s of %s'|format(pages[0], pages[1])) }}
{%- endmacro %} {% macro table_card(title, rows) -%}

{{ title }}

{% for row in rows %} {% set n = row|length %} {% set w = 12 // n %} {% set r = w + 12 % n %} {% for value in row[1:] %} {% endfor %} {% endfor %}
{{ row[0] }}{{ value }}
{%- endmacro %} {% macro image_card(title, imgSource, width=100) -%} {% if imgSource %}

{{ title }}

{% endif %} {%- endmacro %} {% macro image2_card(title1, imgSource1, title2, imgSource2) -%}
{% if imgSource1 %}

{{ title1 }}

{% endif %} {% if imgSource2 %}

{{ title2 }}

{% endif %}
{%- endmacro %} {% macro figure(imgSource, caption, width=100) -%} {% if imgSource %}

{{ caption }}

{% endif %} {%- endmacro %} {% macro project(p, show_title) -%} {% if p %} {% set badge_type = 'success' if p.status == 'active' else 'light' %} Project {{ '%02d'|format(p.id) }} {% if show_title %} {% endif %} {% endif %} {%- endmacro %} {% macro session(s) -%} {{ s.shortname }} {%- endmacro %} {% macro session_list(sessions) -%} {% for s in sessions %} {{ session(s) }} {% endfor %} {%- endmacro %} {% macro project_session_list(project, sessions) -%} {% for s in sessions %} {% if s.project == project %} {{ session(s) }} {% endif %} {% endfor %} {%- endmacro %} {% macro resource(r) -%} {{r.name}} {%- endmacro %} {% macro hidden_hour_id() -%} {%- endmacro %} {% macro overlay(overlay_id) -%}

{%- endmacro %} {% macro bins_table(label, bins) -%}
{{ label }}
#
%
{% for label, b, p in bins %}
{{ label }}
{{ b }}
{{ p }}
{% endfor %}
{%- endmacro %} {% macro trow(title, value, label) %} {% set class = label or 'label' %} <{{ class }}>{{ value }} {%- endmacro %} {% macro session_dialog_row(label, id, value, placeholder) %}
{%- endmacro %} {% macro session_dialog_row_content(label) %}
{{ caller() }}
{%- endmacro %} {% macro single_news_card(n) %}
{% endmacro %} {% macro news_cards(label, news, edit) -%} {% if news %}

{{ label }}

{% for n in news %} {{ single_news_card(n) }} {% endfor %}
{% endif %} {%- endmacro %} {% macro news_table(label, news, is_manager) -%} {% if news %}

{{ label }}

{% if is_manager %} {% endif %} {% for n in news %} {% if is_manager %} {% endif %} {% endfor %}
actionsid type title text preview
{{ n['id'] }} {{ n['type'] }} {{ n['title'] }} {{ n['text'] }} {{ single_news_card(n) }}
{% endif %} {%- endmacro %} {% macro news_card_div(label, news, display, is_manager, edit) -%} {% if news %}
{% if display == 'cards' %} {{ news_cards(label, news, edit) }} {% else %} {{ news_table(label, news, is_manager) }} {% endif %}
{% endif %} {%- endmacro %}