Wydzielenie funkcji guess_mime z VersionedStorage.page_mime, żeby można było ją łatwo...
[redakcja.git] / platforma / templates / manager / pull_request.html
index 9b23551..a44b1ed 100644 (file)
@@ -55,6 +55,7 @@
                 button.attr('disabled', 'disabled');
                 var id = parseInt(button.attr('title'));
                 var docid = $('h2', button.parents('.pull-request')).html();
                 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() });
                 var revision = $('.pull-request-revision', button.parents('.pull-request')).html();
                 
                 $('.diff').slideUp(function() { $(this).remove() });
@@ -62,7 +63,7 @@
                     .hide()
                     .appendTo($(this).parents('.pull-request'))
                     .slideDown('slow')
                     .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);
                     });
             }
                         button.attr('disabled', null);
                     });
             }
@@ -75,7 +76,7 @@
 {% block maincontent %}
 {% if objects %}
     {% for pullreq in objects %}
 {% 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>
         <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>
             <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>
         <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 %}
     </div>
     {% endfor %}
 {% else %}