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

{% block scripts %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function() {
    $("#refresh_tools").bind('click',function(e) {
        e.preventDefault();
        $(this).unbind(e);

        $("#refresh_tools")
            .html('<span class="fa fa-spinner fa-pulse"></span> Refreshing...');

        $.get('refresh/', function() {
            window.setTimeout(function() {
                location.reload()
            }, 5000);
        });
    });
});
</script>
{% endblock %}

{% block object-tools %}
{% if not is_popup %}
  <ul class="object-tools">
    <li>
      <a id="refresh_tools" href="#">Refresh Installed Tools</a>
    </li>
  </ul>
{% endif %}
{% endblock %}
