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 diffUrl = button.parents('.pull-request').attr('data-diff-url');
59 var revision = $('.pull-request-revision', button.parents('.pull-request')).html();
61 $('.diff').slideUp(function() { $(this).remove() });
62 $('<div class="diff"></div>')
64 .appendTo($(this).parents('.pull-request'))
66 .load(diffUrl + '?revision=' + revision, null, function() {
67 button.attr('disabled', null);
76 {% block maincontent %}
78 {% for pullreq in objects %}
79 <div class="status-{{ pullreq.status }} pull-request" id="request-{{ pullreq.id }}" data-diff-url="{% url diff_resource pullreq.document %}">
80 <h2>{{ pullreq.document }}</h2>
81 <ul class="request-info">
82 <li>commiter: {{ pullreq.comitter }}</li>
83 <li>revision: <span class="pull-request-revision">{{ pullreq.source_revision }}</span></li>
84 <li>status: {{ pullreq.status }}</li>
85 <li>data: {{ pullreq.timestamp }}</li>
87 <p class="comment">{{ pullreq.comment }}</p>
88 {% ifnotequal pullreq.status 'A' %}
90 <button type="button" class="awesome button green accept-button" title="{{pullreq.id}}">Akceptuj</button>
91 <button type="button" class="awesome button show-diff" title="{{pullreq.id}}">Zmiany</button>
92 <a class="awesome button" href="{% url editor_view pullreq.document %}?user=$prq-{{pullreq.id}}">Zobacz</a>
98 {# <tr><td colspan="6">Brak żądań</td></tr> #}