{% extends "admin/base_site_grid.html" %}

{% block extrahead %}{{block.super}}
<script>

function attachment(cellvalue, options, row)
{
  return cellvalue ?
      '<a class="text-decoration-underline" href="/uploads/' +
      cellvalue + '" target="_blank">.' + cellvalue.split('.').pop().toLowerCase() + '&nbsp;<i class="fa fa-paperclip"></i></a>' :
      '';
}

function objectfmt(cellvalue, options, row)
{
  var role = row['app'] + "/" + row['model']
  return cellvalue + "<a href=\"" + url_prefix + "/detail/" + role
    + "/" + admin_escape(cellvalue) + "/\" onclick='event.stopPropagation()'><span class='ps-2 fa fa-caret-right' role='"
    + role + "'></span></a>";
}
</script>
{% endblock %}