]> git.ozlabs.org Git - patchwork/blobdiff - templates/patchwork/patch.html
Django 1.5 compatibility fixes
[patchwork] / templates / patchwork / patch.html
index 7c249ecb2c623ce34ef0bf3b166729b85f41299d..813622b18ef4270cec89dac51c0bae3670dd2355 100644 (file)
@@ -43,10 +43,12 @@ function toggle_headers(link_id, headers_id)
  <tr>
   <th>Download</th>
   <td>
-   <a href="{% url patchwork.views.patch.mbox patch_id=patch.id %}"
-   >mbox</a> |
-   <a href="{% url patchwork.views.patch.content patch_id=patch.id %}"
+   <a href="{% url 'patchwork.views.patch.mbox' patch_id=patch.id %}"
+   >mbox</a>
+{% if patch.content %}|
+   <a href="{% url 'patchwork.views.patch.content' patch_id=patch.id %}"
    >patch</a>
+{% endif %}
    </td>
  </tr>
  <tr>
@@ -87,6 +89,7 @@ function toggle_headers(link_id, headers_id)
  <div class="patchform patchform-properties">
   <h3>Patch Properties</h3>
    <form method="post">
+    {% csrf_token %}
     <table class="form">
      <tr>
       <th>Change state:</th>
@@ -124,18 +127,6 @@ function toggle_headers(link_id, headers_id)
  <div class="patchform patchform-bundle">
   <h3>Bundling</h3>
    <table class="form">
-   <!--
-    <tr>
-     <td>Ack:</td>
-     <td>
-      <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
-       method="post">
-       <input type="hidden" name="action" value="act"/>
-       <input type="submit" value="Ack"/>
-      </form>
-     </td>
-    </tr>
-    -->
     <tr>
      <td>Create bundle:</td>
      <td>
@@ -143,6 +134,7 @@ function toggle_headers(link_id, headers_id)
        <dd class="errors">{{createbundleform.non_field_errors}}</dd>
        {% endif %}
       <form method="post">
+       {% csrf_token %}
        <input type="hidden" name="action" value="createbundle"/>
        {% if createbundleform.name.errors %}
        <dd class="errors">{{createbundleform.name.errors}}</dd>
@@ -157,6 +149,7 @@ function toggle_headers(link_id, headers_id)
      <td>Add to bundle:</td>
      <td>
       <form method="post">
+       {% csrf_token %}
        <input type="hidden" name="action" value="addtobundle"/>
        <select name="bundle_id"/>
         {% for bundle in bundles %}
@@ -174,31 +167,15 @@ function toggle_headers(link_id, headers_id)
  </div>
 {% endif %}
 
-{% if actionsform %}
- <div class="patchform patchform-actions">
-  <h3>Actions</h3>
-   <table class="form">
-    <tr>
-     <td>Ack:</td>
-     <td>
-      <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
-       method="post">
-       <input type="hidden" name="action" value="act"/>
-       <input type="submit" value="Ack"/>
-      </form>
-     </td>
-    </tr>
-   </table>
-  </form>
- </div>
-
-{% endif %}
  <div style="clear: both;">
  </div>
 </div>
 
-
-
+{% if patch.pull_url %}
+<h2>Pull-request</h2>
+<a class="patch-pull-url" href="{{patch.pull_url}}"
+ >{{ patch.pull_url }}</a>
+{% endif %}
 
 <h2>Comments</h2>
 {% for comment in patch.comments %}
@@ -210,11 +187,14 @@ function toggle_headers(link_id, headers_id)
 </div>
 {% endfor %}
 
+{% if patch.content %}
 <h2>Patch</h2>
 <div class="patch">
 <pre class="content">
 {{ patch|patchsyntax }}
 </pre>
 </div>
+{% endif %}
+
 
 {% endblock %}