{% load i18n %}
{% for identity in list %}
  <p style="border-bottom: gray 1px dashed; padding-bottom:4px;">
    <span class="action">{% include 'users/profile_actions.html' with show_home=1 %}</span>
    <code class="{{ id }}_handler"
          style="cursor:copy"
          onmouseleave="$(this).removeAttr('data-tooltip')"
          onclick="navigator.clipboard.writeText(this.innerText);$(this).data('tooltip','copied');">@{{ identity.handle }}</code>
  </p>
{% empty %}
  <p class="empty">{% trans "nothing so far." %}</p>
{% endfor %}
<p>
  <span class="action">
    <span>
      <a id="download_{{ id }}"
         title="{% trans "export" %}"
         download="neodb_{{ id }}.csv"><i class="fa-solid fa-download"></i></a>
    </span>
  </span>
  {% blocktrans %}You may download the list here.{% endblocktrans %}
</p>
<script>
let csv = "data:text/csv;charset=utf-8,Account address,Show boosts,Notify on new posts,Languages\n"
$('.{{id}}_handler').each(function() {
  csv += $(this).text() + ',true,false,\n'
})
$('#download_{{id}}').attr('href', encodeURI(csv))
</script>
