{#- chirp-ui: Shell actions renderer Renders resolved route-scoped shell actions into topbar-friendly controls. Usage: {% from "chirpui/shell_actions.html" import shell_actions_bar %} {{ shell_actions_bar(shell_actions) }} kind="form" — POST form with optional HTMX (set hx_post, hx_target, … on ShellAction). CSRF: {{ csrf_field() }} when include_csrf is true (Chirp provides csrf_field in globals). -#} {% from "chirpui/button.html" import btn %} {% from "chirpui/dropdown_menu.html" import dropdown_menu %} {% from "chirpui/shimmer_button.html" import shimmer_button %} {% from "chirpui/pulsing_button.html" import pulsing_button %} {% def shell_action(action) %} {% if action.kind == "menu" %} {{ dropdown_menu( btn(action.label, variant=action.variant, size=action.size, type="button", icon=action.icon, disabled=action.disabled), items=action.menu_items, id="chirpui-shell-action-" ~ action.id ) }} {% elif action.kind == "form" %}
{% elif action.href %} {{ btn(action.label, variant=action.variant, size=action.size, href=action.href, icon=action.icon, disabled=action.disabled, data_action=action.action, attrs=action.attrs | default("")) }} {% else %} {{ btn(action.label, variant=action.variant, size=action.size, type="button", icon=action.icon, disabled=action.disabled, data_action=action.action, attrs=action.attrs | default("")) }} {% end %} {% end %} {% def shell_actions_bar(shell_actions, cls="") %} {% if shell_actions and shell_actions.has_items %}