+++ /dev/null
-{% extends 'base.html' %}
-
-{% block bodyid %}management{% endblock %}
-
-{% block extrahead %}
-<link rel="stylesheet" href="{{ STATIC_URL }}css/managment.css" type="text/css" />
-<link rel="stylesheet" href="{{ STATIC_URL }}css/pygments.css" type="text/css" />
-<script type="text/javascript">
-
-
- $(function() {
-
- function refreshRow(id) {
- var row = $('#request-' +id);
-
- $.ajax({
- url: '{% url pullrequest_list %}/'+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: '{% url pullrequest_list %}/'+id,
- data: {action: 'accept'},
- dataType: 'json',
- type: 'PUT',
- success: function(data) {
- refreshRow(id);
- }
- });
-
- });
-
- $('.show-diff').click(function() {
- var button = $(this);
-
- if (button.attr('disabled') != 'disabled') {
- button.attr('disabled', 'disabled');
- var id = parseInt(button.attr('title'));
- var docid = $('h2', button.parents('.pull-request')).html();
- var diffUrl = button.parents('.pull-request').attr('data-diff-url');
- var revision = $('.pull-request-revision', button.parents('.pull-request')).html();
-
- $('.diff').slideUp(function() { $(this).remove() });
- $('<div class="diff"></div>')
- .hide()
- .appendTo($(this).parents('.pull-request'))
- .slideDown('slow')
- .load(diffUrl + '?revision=' + revision, null, function() {
- button.attr('disabled', null);
- });
- }
- });
-
- });
-</script>
-{% endblock %}
-
-{% block maincontent %}
-{% if objects %}
- {% for pullreq in objects %}
- <div class="status-{{ pullreq.status }} pull-request" id="request-{{ pullreq.id }}" data-diff-url="{% url diff_resource pullreq.document %}">
- <h2>{{ pullreq.document }}</h2>
- <ul class="request-info">
- <li>commiter: {{ pullreq.comitter }}</li>
- <li>revision: <span class="pull-request-revision">{{ pullreq.source_revision }}</span></li>
- <li>status: {{ pullreq.status }}</li>
- <li>data: {{ pullreq.timestamp }}</li>
- </ul>
- <p class="comment">{{ pullreq.comment }}</p>
- {% ifnotequal pullreq.status 'A' %}
- <p class="buttons">
- <button type="button" class="awesome button green accept-button" title="{{pullreq.id}}">Akceptuj</button>
- <button type="button" class="awesome button show-diff" title="{{pullreq.id}}">Zmiany</button>
- <a class="awesome button" href="{% url editor_view pullreq.document %}?user=$prq-{{pullreq.id}}">Zobacz</a>
- </p>
- {% endifnotequal %}
- </div>
- {% endfor %}
-{% else %}
- {# <tr><td colspan="6">Brak żądań</td></tr> #}
-{% endif %}
-{# </table> #}
-
-{% endblock %}