{# small building blocks shared by the pages #} {% macro page_head(name, title, sub='') %}
{{ icon(name) }}

{{ title }}

{% if sub %}

{{ sub }}

{% endif %}
{% if caller %}
{{ caller() }}
{% endif %}
{% endmacro %} {% macro role_pill(role) %}{{ icon('shield' if role == 'admin' else 'user') }}{{ role|capitalize }}{% endmacro %} {% macro empty(name, text) %}
{{ icon(name) }}

{{ text }}

{% endmacro %} {% macro college_badge(c, size=28, cls='') %} {# A college's logo: the one uploaded for it if there is one, otherwise fetched automatically from its website. Falls back to a plain cap icon. #} {% set src = logo_url(c) %} {% if src %}{% endif %} {{ icon('cap') }} {% endmacro %} {% macro logo_field(custom_src='') %} {# The College Logo field: shows the logo fetched from the College URL, with an upload to use instead when it can't be found. Needs the form to be multipart and an input#collegeUrl on the page. #}

Fetched automatically from the College URL above. If it can't be found, upload your own image instead.

{% if custom_src %} {% endif %}

PNG, JPG, GIF or WebP, up to 2 MB.

{% endmacro %} {% macro rich_editor(name, value='', required=False, placeholder='') %} {# A small rich-text editor: bold/italic/underline, bullet/numbered lists, indent, alignment. Posts sanitized-on-save HTML through a hidden field named `name`. #}
{{ value|rich }}
{% endmacro %} {% macro college_meta(c) %} {% if c.location or c.timezone or c.url %}
{% if c.location %}{{ icon('map-pin') }}{{ c.location }}{% endif %} {% if c.timezone %}{{ icon('clock') }}{{ c.timezone }}{% endif %} {% if c.url %}{{ icon('link') }}Visit site{% endif %}
{% endif %} {% endmacro %}