{% macro print_readout(readout, detail_view_name, locale=None) %}
  <details class="h2" open="open">
    <summary class="with-mode-selectors">
      <a id="{{ readout.slug }}">{{ readout.title }}</a>
    </summary>
    <ul class="readout-modes" data-slug="{{ readout.slug }}">
      {% for key, name in readout.modes %}
        <li class="mode{% if loop.first %} active{% endif %}" data-url="{{ url('dashboards.wiki_rows', readout.slug)|urlparams(max=10, mode=key, locale=locale) }}">
          <a href="#">{{ name }}</a>
        </li>
      {% endfor %}
    </ul>
    <table class="documents" id="{{ readout.slug }}-table">
      {{ readout.render(max_rows=10)|safe }}
    </table>
    <div class="table-footer">
      <a href="{{ url(detail_view_name, readout.slug) }}">{{ readout.details_link_text }}</a>
    </div>
  </details>
{% endmacro %}
