+{% extends 'base.html' %}
+
+{% block extrahead %}
+<link rel="stylesheet" href="{{ STATIC_URL }}css/managment.css" type="text/css" />
+<script type="text/javascript">
+
+
+ $(function() {
+
+ function refreshRow(id) {
+ var row = $('#request-' +id);
+
+ $.ajax({
+ url: "http://localhost:8000/api/pull-requests/" + id,
+ dataType: 'json',
+ type: 'GET',
+ success: function(data) {
+ row.removeClass('status-N');
+ row.removeClass('status-R');
+ row.removeClass('status-A');
+ row.addClass('status-'+ data.status);
+
+ $('.column-doc', row).html(data.document);
+ $('.column-status', row).html(data.status);
+
+ alert('Merge accepted.');
+ }
+ });
+
+ }
+
+ $('.accept-button').click(function()
+ {
+ var id = parseInt($(this).attr('title'));
+
+
+ $.ajax({
+ url: "http://localhost:8000/api/pull-requests/" + id,
+ data: {action: 'accept'},
+ dataType: 'json',
+ type: 'PUT',
+ success: function(data) {
+ refreshRow(id);
+ }
+ });
+
+ });
+
+ });
+</script>
+{% endblock %}
+
+{% block maincontent %}
+<table class="request-report" cellspacing="0">
+ <tr>
+ <th>Utwór</th><th>Użytkownik</th><th>Komentarz</th><th>Stan</th>
+ <th>Akcje</th>
+ </tr>