{% comment %} For displaying a list of objects in a chart. Expects: * object_list - A list/QuerySet of objects, each with a num_publications property. * score_attr - The name of the attribute on each object that contains the score for the chart. e.g. 'num_visits' * name_attr - The name of the attribute on each object to be used for its display value. Default is 'name'. * in_card - Boolean, default is False. Is this displayed within a .card element? * use_cite - If True, then wrap the name in tags. Default: False. {% endcomment %} {% load spectator_core %} {% for obj in object_list %}
  • {% with use_cite|default_if_none:False as use_cite %} {% if use_cite %}{% endif %}{% if name_attr %}{{ obj|get_attr:name_attr }}{% else %}{{ obj.name }}{% endif %}{% if use_cite %}{% endif %} ({{ obj|get_attr:score_attr }}) {% endwith %}
  • {% endfor %}