{% extends "base.html" %} {% block content %}

Moderation List

{% for pub in moderations %} {% endfor %}
Publication ID Created Publisher Publication message Models Accept?
{{ pub.id }} {{ pub.created }} {{ pub.publisher }} {{ pub.publication_message }}
{% endblock %} {% block script %} $(document).ready(function($) { $('button').each(function(idx) { $(this).click(function(e) { console.log('moo') var url = '/moderations/' + this.name, isAccepted = this.value === 'accept', pubId = this.name; console.log("Button clicked: " + isAccepted); $.ajax({ url: url, type: 'POST', contentType: 'application/json', data: JSON.stringify({'is_accepted': isAccepted}) }) .done(function(data, textStatus, xhr) { $('#' + pubId + '-row').remove(); }); return false; }); }); }); {% endblock %}