{#- One inline section (a card). Rendered inside the edit page and returned alone by the ".../list" endpoint, so it only depends on `ctx`. -#} {%- set iid = ctx.identity -%} {%- set p = ctx.pagination -%} {%- set il = ctx.inline_cls -%} {%- set list_url = ctx.base_url ~ "/list" -%} {%- set current_url = list_url ~ "?page=" ~ p.page ~ "&search=" ~ (ctx.search | urlencode) -%} {%- set extra_cols = (1 if ctx.sortable else 0) + (1 if ctx.can_delete else 0) + (1 if ctx.can_edit else 0) -%}

{% if ctx.icon %}{% endif %} {{ ctx.label }} {{ p.count }} {% if ctx.sortable %} sortable {% endif %}

{% if ctx.search_enabled %} {% endif %} {% if ctx.can_create %} {% endif %}
{% if ctx.sortable %}{% endif %} {% if ctx.can_delete %} {% endif %} {% for col in ctx.display_columns %} {% endfor %} {% if ctx.can_edit %}{% endif %} {% for row in p.rows %} {% set row_pk = il.encode_pk(row) %} {% if ctx.sortable %} {% endif %} {% if ctx.can_delete %} {% endif %} {% for col in ctx.display_columns %} {% endfor %} {% if ctx.can_edit %} {% endif %} {% else %} {% endfor %}
{{ ctx.column_labels[col] }}
{{ il.get_display_value(row, col) }}
{% if ctx.search %} No results for “{{ ctx.search }}” {% else %} No {{ ctx.label }} yet{% if ctx.can_create %} — click Add to create one{% endif %}. {% endif %}