1 {% extends 'base.html' %}
3 {% block bodyid %}management{% endblock %}
6 <link rel="stylesheet" href="{{ STATIC_URL }}css/managment.css" type="text/css" />
7 <link rel="stylesheet" href="{{ STATIC_URL }}css/pygments.css" type="text/css" />
8 <script type="text/javascript">
13 function refreshRow(id) {
14 var row = $('#request-' +id);
17 url: '{% url pullrequest_list %}/'+id,
20 success: function(data) {
21 row.removeClass('status-N');
22 row.removeClass('status-R');
23 row.removeClass('status-A');
24 row.addClass('status-'+ data.status);
26 $('.column-doc', row).html(data.document);
27 $('.column-status', row).html(data.status);
29 alert('Merge accepted.');
35 $('.accept-button').click(function()
37 var id = parseInt($(this).attr('title'));
40 url: '{% url pullrequest_list %}/'+id,
41 data: {action: 'accept'},
44 success: function(data) {
51 $('.show-diff').click(function() {
54 if (button.attr('disabled') != 'disabled') {
55 button.attr('disabled', 'disabled');
56 var id = parseInt(button.attr('title'));
57 var docid = $('h2', button.parents('.pull-request')).html();
58 var revision = $('.pull-request-revision', button.parents('.pull-request')).html();
60 $('.diff').slideUp(function() { $(this).remove() });
61 $('<div class="diff"></div>')
63 .appendTo($(this).parents('.pull-request'))
65 .load('/api/documents/' + docid + '/diff?revision=' + revision, null, function() {
66 button.attr('disabled', null);
75 {% block maincontent %}
77 {% for pullreq in objects %}
78 <div class="status-{{ pullreq.status }} pull-request" id="request-{{ pullreq.id }}">
79 <h2>{{ pullreq.document }}</h2>
80 <ul class="request-info">
81 <li>commiter: {{ pullreq.comitter }}</li>
82 <li>revision: <span class="pull-request-revision">{{ pullreq.source_revision }}</span></li>
83 <li>status: {{ pullreq.status }}</li>
84 <li>data: {{ pullreq.timestamp }}</li>
86 <p class="comment">{{ pullreq.comment }}</p>
88 <button type="button" class="awesome button green accept-button" title="{{pullreq.id}}">Akceptuj</button>
89 <button type="button" class="awesome button show-diff" title="{{pullreq.id}}">Zmiany</button>
90 <a class="awesome button" href="{% url editor_view pullreq.document %}?user=$prq-{{pullreq.id}}">Zobacz</a>
95 {# <tr><td colspan="6">Brak żądań</td></tr> #}