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() });
.hide()
.appendTo($(this).parents('.pull-request'))
.slideDown('slow')
- .load('/api/documents/' + docid + '/diff?revision=' + revision, null, function() {
+ .load(diffUrl + '?revision=' + revision, null, function() {
button.attr('disabled', null);
});
}
{% block maincontent %}
{% if objects %}
{% for pullreq in objects %}
- <div class="status-{{ pullreq.status }} pull-request" id="request-{{ pullreq.id }}">
+ <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>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 %}