]> git.ozlabs.org Git - patchwork/blob - templates/patchwork/patch.html
Add support for git-pull requests
[patchwork] / templates / patchwork / patch.html
1 {% extends "base.html" %}
2
3 {% load syntax %}
4 {% load person %}
5 {% load patch %}
6
7 {% block title %}{{patch.name}}{% endblock %}
8 {% block heading %}{{patch.name}}{%endblock%}
9
10 {% block body %}
11 <script language="JavaScript" type="text/javascript">
12 function toggle_headers(link_id, headers_id)
13 {
14     var link = document.getElementById(link_id)
15     var headers = document.getElementById(headers_id)
16
17     var hidden = headers.style['display'] == 'none';
18
19     if (hidden) {
20         link.innerHTML = 'hide';
21         headers.style['display'] = 'block';
22     } else {
23         link.innerHTML = 'show';
24         headers.style['display'] = 'none';
25     }
26
27 }
28 </script>
29
30 <table class="patchmeta">
31  <tr>
32   <th>Submitter</th>
33   <td>{{ patch.submitter|personify }}</td></tr>
34  </tr>
35  <tr>
36   <th>Date</th>
37   <td>{{ patch.date }}</td>
38  </tr>
39  <tr>
40   <th>Message ID</th>
41   <td>{{ patch.msgid }}</td>
42  </tr>
43  <tr>
44   <th>Download</th>
45   <td>
46    <a href="{% url patchwork.views.patch.mbox patch_id=patch.id %}"
47    >mbox</a>
48 {% if patch.content %}|
49    <a href="{% url patchwork.views.patch.content patch_id=patch.id %}"
50    >patch</a>
51 {% endif %}
52    </td>
53  </tr>
54  <tr>
55   <th>Permalink</th>
56   <td><a href="{{ patch.get_absolute_url }}">{{ patch.get_absolute_url }}</a>
57  </tr>
58   <tr>
59    <th>State</td>
60    <td>{{ patch.state.name }}{% if patch.archived %}, archived{% endif %}</td>
61   </tr>
62 {% if patch.commit_ref %}
63   <tr>
64    <th>Commit</td>
65    <td>{{ patch.commit_ref }}</td>
66   </tr>
67 {% endif %}
68 {% if patch.delegate %}
69   <tr>
70    <th>Delegated to:</td>
71    <td>{{ patch.delegate.get_profile.name }}</td>
72   </tr>
73 {% endif %}
74  <tr>
75   <th>Headers</th>
76   <td><a id="togglepatchheaders"
77    href="javascript:toggle_headers('togglepatchheaders', 'patchheaders')"
78    >show</a>
79    <div id="patchheaders" class="patchheaders" style="display:none;">
80     <pre>{{patch.headers}}</pre>
81    </div>
82   </td>
83  </tr>
84 </table>
85
86 <div class="patchforms">
87
88 {% if patchform %}
89  <div class="patchform patchform-properties">
90   <h3>Patch Properties</h3>
91    <form method="post">
92     {% csrf_token %}
93     <table class="form">
94      <tr>
95       <th>Change state:</th>
96       <td>
97        {{ patchform.state }}
98        {{ patchform.state.errors }}
99       </td>
100      </tr>
101      <tr>
102       <th>Delegate to:</td>
103       <td>
104        {{ patchform.delegate }}
105        {{ patchform.delegate.errors }}
106       </td>
107      </tr>
108      <tr>
109       <th>Archived:</td>
110       <td>
111        {{ patchform.archived }}
112        {{ patchform.archived.errors }}
113       </td>
114      </tr>
115      <tr>
116       <td></td>
117       <td>
118        <input type="submit" value="Update">
119       </td>
120      </tr>
121     </table>
122   </form>
123  </div>
124 {% endif %}
125
126 {% if createbundleform %}
127  <div class="patchform patchform-bundle">
128   <h3>Bundling</h3>
129    <table class="form">
130    <!--
131     <tr>
132      <td>Ack:</td>
133      <td>
134       <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
135        method="post">
136        {% csrf_token %}
137        <input type="hidden" name="action" value="act"/>
138        <input type="submit" value="Ack"/>
139       </form>
140      </td>
141     </tr>
142     -->
143     <tr>
144      <td>Create bundle:</td>
145      <td>
146        {% if createbundleform.non_field_errors %}
147        <dd class="errors">{{createbundleform.non_field_errors}}</dd>
148        {% endif %}
149       <form method="post">
150        {% csrf_token %}
151        <input type="hidden" name="action" value="createbundle"/>
152        {% if createbundleform.name.errors %}
153        <dd class="errors">{{createbundleform.name.errors}}</dd>
154        {% endif %}
155         {{ createbundleform.name }}
156        <input value="Create" type="submit"/>
157       </form>
158       </td>
159     </tr>
160 {% if bundles %}
161     <tr>
162      <td>Add to bundle:</td>
163      <td>
164       <form method="post">
165        {% csrf_token %}
166        <input type="hidden" name="action" value="addtobundle"/>
167        <select name="bundle_id"/>
168         {% for bundle in bundles %}
169          <option value="{{bundle.id}}">{{bundle.name}}</option>
170         {% endfor %}
171         </select>
172        <input value="Add" type="submit"/>
173       </form>
174      </td>
175     </tr>
176 {% endif %}
177    </table>
178   </form>
179
180  </div>
181 {% endif %}
182
183 {% if actionsform %}
184  <div class="patchform patchform-actions">
185   <h3>Actions</h3>
186    <table class="form">
187     <tr>
188      <td>Ack:</td>
189      <td>
190       <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
191        method="post">
192        {% csrf_token %}
193        <input type="hidden" name="action" value="act"/>
194        <input type="submit" value="Ack"/>
195       </form>
196      </td>
197     </tr>
198    </table>
199   </form>
200  </div>
201
202 {% endif %}
203  <div style="clear: both;">
204  </div>
205 </div>
206
207 {% if patch.pull_url %}
208 <h2>Pull-request</h2>
209 <a class="patch-pull-url" href="{{patch.pull_url}}"
210  >{{ patch.pull_url }}</a>
211 {% endif %}
212
213 <h2>Comments</h2>
214 {% for comment in patch.comments %}
215 <div class="comment">
216 <div class="meta">{{ comment.submitter|personify }} - {{comment.date}}</div>
217 <pre class="content">
218 {{ comment|commentsyntax }}
219 </pre>
220 </div>
221 {% endfor %}
222
223 {% if patch.content %}
224 <h2>Patch</h2>
225 <div class="patch">
226 <pre class="content">
227 {{ patch|patchsyntax }}
228 </pre>
229 </div>
230 {% endif %}
231
232
233 {% endblock %}