{% extends 'admin/master.html' %}

{% block head %}
<script type='text/javascript' src='//code.jquery.com/jquery-2.0.2.js'></script>

<script>


function get_bugreport(callback) {
    $.ajax({
        url:'/admin/bugreport.json',
        type:'GET',
        dataType: 'json',
        success: callback
        });
}
function populate_bugreport(data) {
    $.each(data, function(i, value) {
        $('#report').append(value);
        $('#report').append('<br>');
    });
    $('#report').change();
}


$(document).ready(function() {
    get_bugreport(populate_bugreport);
    
    $('#update').click(function() {
        $('#report').empty();
        get_bugreport(populate_bugreport);
    });
});
</script>
{% endblock %}

{% block body %}
{{ super() }}

<h1 class="page-header">{{ admin_view.view_title }}</h1>

  <button id="update" type="submit" class="btn btn-default">Update</button>
  <div id="report" name="report"></div>


{% endblock body %}
