{#
Copyright (C) 2026 Front Matter.
invenio-pidbox is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
Metrics for a set of records, the same cards invenio-pidbox shows for one
person or organization: absolute counts in the first row, shares of all
works in the second, and a column beside them that the instance chooses
(metrics_column.html): the share with an open license in a ring, or cards
of its own, one per row. Each card
links to the search it counts. The numbers come from a records API in the
browser, so the page renders without waiting for them, and the cards stay
hidden while there are no records.
Included with four variables:
metrics_id the id of the container, unique on the page
metrics_api the records API to count with, e.g. /api/records
metrics_search the search page the cards link to, e.g. /search
metrics_column the first column, as pidbox_metrics_column returns it
And, optionally, two more:
metrics_query the query of the records the cards count, "" for all
metrics_noun what the labels call them: "work", "post" or "award";
by default PIDBOX_METRICS_NOUN
#}
{%- set metrics_query = metrics_query if metrics_query is defined else "" %}
{%- set pidbox_labels = pidbox_metrics_labels(metrics_noun if metrics_noun is defined else none) %}
{%- from "invenio_pidbox/metrics_styles.html" import metrics_styles %}
{{ metrics_styles("#" ~ metrics_id) }}
{%- macro metrics_card(id, label, icon_label) %}