{%- set modal_id = ui.util.id() -%} {%- set form_id = ui.util.id() -%} {{ ui.confirm_modal(_('Are you sure you want to revoke these tokens?'), id=modal_id, form_id=form_id) }} {%- call ui.util.call(ui.form, method="POST", hx={"post":h.url_for("user.api_tokens_revoke", id=user.name), "trigger": "submit", "swap": "none"}, attrs={"id": form_id}) -%} {%- endcall %}
{%- call ui.util.call(ui.table, striped=true) -%} {%- call ui.util.call(ui.table_head) -%} {%- call ui.util.call(ui.table_row) -%} {%- block head_cells %} {{ ui.table_cell(_('Token'), header=true) }} {{ ui.table_cell(_('Created'), header=true) }} {{ ui.table_cell(_('Last access'), header=true) }} {%- endblock %} {%- endcall %} {%- endcall %} {%- call ui.util.call(ui.table_body) -%} {%- for token in tokens %} {%- call ui.util.call(ui.table_row, attrs={"id": "token-" ~ token.id}) -%} {%- block token_cells scoped %} {%- call ui.util.call(ui.table_cell) -%} {{ ui.checkbox(name="token", label=token.name, value=token.id, attrs={"form": form_id}) }} {%- endcall %} {{ ui.table_cell(ui.datetime(token.created_at, with_hours=true)) }} {{ ui.table_cell(ui.datetime(token.last_access, with_hours=true, empty=_("Never"))) }} {%- endblock %} {%- endcall %} {%- endfor %} {%- endcall %} {%- endcall %} {%- call ui.util.call(ui.form_actions) -%} {{ ui.modal_handle(_('Revoke tokens'), id=modal_id) }} {%- endcall %}