]> git.ozlabs.org Git - patchwork/blob - templates/patchwork/patch-form.html
templates: Add CSRF (cross-site request forgery) values to form posts
[patchwork] / templates / patchwork / patch-form.html
1
2 <div class="patchform"
3   style="border: thin solid black; padding-left: 0.8em; margin-top: 2em;">
4
5  <div class="patchform-properties"
6   style="float: left; margin-right: 4em;">
7   <h3>Properties</h3>
8     <table class="form">
9      <tr>
10       <th>Change state:</th>
11       <td>{{ patchform.state }}</td>
12      </tr>
13      <tr>
14       <th>Delegate to:</td>
15       <td>{{ patchform.delegate }}</td>
16      </tr>
17      <tr>
18       <td></td>
19       <td>
20        <input type="submit" value="Update">
21       </td>
22      </tr>
23     </table>
24   </form>
25  </div>
26
27  <div class="patchform-actions" style="padding-left: 4em;">
28   <h3>Actions</h3>
29    <table class="form">
30     <tr>
31      <td>Ack:</td>
32      <td>
33       <form action="{% url patchwork.views.patch patch=patch.id %}"
34        method="post">
35        {% csrf_token %}
36        <input type="hidden" name="action" value="act"/>
37        <input type="submit" value="Ack"/>
38       </form>
39      </td>
40     </tr>
41     <tr>
42      <td>Create bundle:</td>
43      <td>
44        {% if createbundleform.name.errors %}
45        <span class="errors">{{createbundleform.errors}}</span>
46        {% endif %}
47       <form method="post">
48        {% csrf_token %}
49        <input type="hidden" name="action" value="createbundle"/>
50         {{ createbundleform.name }}
51        <input value="Create" type="submit"/>
52       </form>
53       </td>
54     </tr>
55 {% if bundles %}
56     <tr>
57      <td>Add to bundle:</td>
58      <td>
59       <form action="{% url patchwork.views.bundle.setbundle %}" method="post">
60        {% csrf_token %}
61        <input type="hidden" name="action" value="add"/>
62        <input type="hidden" name="patch_id" value="{{ patch.id }}"/>
63        <select name="name"/>
64         {% for bundle in bundles %}
65          <option value="{{bundle.id}}">{{bundle.name}}</option>
66         {% endfor %}
67         </select>
68        <input value="Add" type="submit"/>
69       </form>
70      </td>
71     </tr>
72 {% endif %}
73     <tr>
74      <td>Archive:</td>
75      <td>
76       <form method="post">
77        {% csrf_token %}
78        <input type="hidden" name="action" value="archive"/>
79        <input type="submit" value="Archive"/>
80       </form>
81      </td>
82     </tr>
83    </table>
84   </form>
85
86  </div>
87
88  <div style="clear: both;">
89  </div>
90 </div>
91