Inital commit
[patchwork] / templates / patchwork / patch.html
1 {% extends "patchwork/base.html" %}
2
3 {% load syntax %}
4 {% load person %}
5 {% load patch %}
6
7 {% block title %}{{patch.name}} - Patchwork{% 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    <a href="{% url patchwork.views.patch.content patch_id=patch.id %}"
49    >patch</a>
50    </td>
51  </tr>
52  <tr>
53   <th>Permalink</th>
54   <td><a href="{{ patch.get_absolute_url }}">{{ patch.get_absolute_url }}</a>
55  </tr>
56   <tr>
57    <th>State</td>
58    <td>{{ patch.state.name }}{% if patch.archived %}, archived{% endif %}</td>
59   </tr>
60 {% if patch.delegate %}
61   <tr>
62    <th>Delegated to:</td>
63    <td>{{ patch.delegate.get_profile.name }}</td>
64   </tr>
65 {% endif %}
66  <tr>
67   <th>Headers</th>
68   <td><a id="togglepatchheaders"
69    href="javascript:toggle_headers('togglepatchheaders', 'patchheaders')"
70    >show</a>
71    <div id="patchheaders" class="patchheaders" style="display:none;">
72     <pre>{{patch.headers}}</pre>
73    </div>
74   </td>
75  </tr>
76 </table>
77
78 <div class="patchforms">
79
80 {% if patchform %}
81  <div class="patchform patchform-properties">
82   <h3>Patch Properties</h3>
83    <form method="post">
84     <table class="form">
85      <tr>
86       <th>Change state:</th>
87       <td>
88        {{ patchform.state }}
89        {{ patchform.state.errors }}
90       </td>
91      </tr>
92      <tr>
93       <th>Delegate to:</td>
94       <td>
95        {{ patchform.delegate }}
96        {{ patchform.delegate.errors }}
97       </td>
98      </tr>
99      <tr>
100       <th>Archived:</td>
101       <td>
102        {{ patchform.archived }}
103        {{ patchform.archived.errors }}
104       </td>
105      </tr>
106      <tr>
107       <td></td>
108       <td>
109        <input type="submit" value="Update">
110       </td>
111      </tr>
112     </table>
113   </form>
114  </div>
115 {% endif %}
116
117 {% if createbundleform %}
118  <div class="patchform patchform-bundle">
119   <h3>Bundling</h3>
120    <table class="form">
121    <!--
122     <tr>
123      <td>Ack:</td>
124      <td>
125       <form action="{% url patchwork.views.patch patch=patch.id %}"
126        method="post">
127        <input type="hidden" name="action" value="act"/>
128        <input type="submit" value="Ack"/>
129       </form>
130      </td>
131     </tr>
132     -->
133     <tr>
134      <td>Create bundle:</td>
135      <td>
136        {% if createbundleform.non_field_errors %}
137        <dd class="errors">{{createbundleform.non_field_errors}}</dd>
138        {% endif %}
139       <form method="post">
140        <input type="hidden" name="action" value="createbundle"/>
141        {% if createbundleform.name.errors %}
142        <dd class="errors">{{createbundleform.name.errors}}</dd>
143        {% endif %}
144         {{ createbundleform.name }}
145        <input value="Create" type="submit"/>
146       </form>
147       </td>
148     </tr>
149 {% if bundles %}
150     <tr>
151      <td>Add to bundle:</td>
152      <td>
153       <form method="post">
154        <input type="hidden" name="action" value="addtobundle"/>
155        <select name="bundle_id"/>
156         {% for bundle in bundles %}
157          <option value="{{bundle.id}}">{{bundle.name}}</option>
158         {% endfor %}
159         </select>
160        <input value="Add" type="submit"/>
161       </form>
162      </td>
163     </tr>
164 {% endif %}
165    </table>
166   </form>
167
168  </div>
169 {% endif %}
170
171 {% if actionsform %}
172  <div class="patchform patchform-actions">
173   <h3>Actions</h3>
174    <table class="form">
175     <tr>
176      <td>Ack:</td>
177      <td>
178       <form action="{% url patchwork.views.patch patch=patch.id %}"
179        method="post">
180        <input type="hidden" name="action" value="act"/>
181        <input type="submit" value="Ack"/>
182       </form>
183      </td>
184     </tr>
185    </table>
186   </form>
187  </div>
188
189 {% endif %}
190  <div style="clear: both;">
191  </div>
192 </div>
193
194
195
196
197 <h2>Comments</h2>
198 {% for comment in patch.comments %}
199 <div class="comment">
200 <div class="meta">{{ comment.submitter|personify }} - {{comment.date}}</div>
201 <pre class="content">
202 {{ comment|commentsyntax }}
203 </pre>
204 </div>
205 {% endfor %}
206
207 <h2>Patch</h2>
208 <div class="patch">
209 <pre class="content">
210 {{ patch|patchsyntax }}
211 </pre>
212 </div>
213
214 {% endblock %}