{# Tables and views as a grid of cards, one per table. Shared by the homepage and the database page. {% call catalog_cards.list() %} {{ catalog_cards.card(item, show_database=True, count_text="1,204") }} {% endcall %} item is a dictionary: url, name, type ("table" or "view") and optionally title, private, hidden, description, database, color, count, columns (the ones shown to start with), more_columns (the rest, shown by the "+N more" button, which needs catalog-cards.js on the page), matched_columns, column_count, has_fts and linked_tables (names of tables in the same database, which needs database). count_text is the row count as it should be shown, e.g. "1,204" or ">10,000". Import it "with context": the linked tables use urls. #} {% macro list() -%}
{{ item.description }}
{% endif %} {% if item.columns %}{%- for column in item.columns %}{% if column in (item.matched_columns or []) %}{{ column }}{% else %}{{ column }}{% endif %}{% if not loop.last %}, {% endif %}{% endfor -%} {%- if item.more_columns %}{% for column in item.more_columns %}, {{ column }}{% endfor %} {%- elif item.column_count and item.column_count > item.columns|length %} +{{ item.column_count - item.columns|length }} more{% endif -%}
{% endif %} {% if show_database or item.has_fts or item.linked_tables or (item.title and item.title != item.name) %} {% endif %}