{# Feather's UI foundation: the macros behind static/css/ui.css and /feather-static/ui.js. {% from "components/ui.html" import page_header, empty_state, uploader, lightbox_item, dialog, notice, skeleton %} page_header("Your photos", "Everything you have shared so far") with a caller block for actions; empty_state("photo_camera", "No photos yet", "Share the first one", action_href="/upload", action_text="Add photos"); uploader("photos", multiple=True, accept="image/*"); lightbox_item(url, thumb_url, alt, group="album", caption=...); dialog("share", "Share this album") with a caller block for the body; notice("error", "..."); skeleton("media") while something loads. #} {% from "components/icon.html" import icon %} {% macro page_header(title, subtitle=None, eyebrow=None) %}
{% if eyebrow %}

{{ eyebrow }}

{% endif %}

{{ title }}

{% if subtitle %}

{{ subtitle }}

{% endif %}
{% if caller %}
{{ caller() }}
{% endif %}
{% endmacro %} {% macro empty_state(icon_name, title, text=None, action_href=None, action_text=None) %}
{{ icon(icon_name, size="lg") }}

{{ title }}

{% if text %}

{{ text }}

{% endif %} {% if caller %}{{ caller() }}{% elif action_href and action_text %}{{ action_text }}{% endif %}
{% endmacro %} {% macro uploader(name, multiple=False, accept=None, title="Choose files", hint="or drop them here", submit_on_choose=False) %} {% endmacro %} {% macro lightbox_item(url, thumb_url, alt, group="gallery", caption=None, class="") %} {{ alt }} {% if caption %}{{ caption }}{% endif %} {% endmacro %} {% macro dialog(id, title) %}

{{ title }}

{{ caller() }}
{% endmacro %} {% macro notice(kind, text) %}
{{ icon({"error": "error", "success": "check_circle", "warn": "warning"}.get(kind, "info"), size="sm") }} {{ text }}
{% endmacro %} {% macro skeleton(kind="text", lines=3) %} {% if kind == "media" %} {% else %}{% for _ in range(lines) %}{% endfor %}{% endif %} {% endmacro %}