]> git.ozlabs.org Git - patchwork/blob - templates/patchwork/patch.html
tox: Add tox.ini file
[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:project }}</td>
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</th>
60    <td>{{ patch.state.name }}{% if patch.archived %}, archived{% endif %}</td>
61   </tr>
62 {% if patch.commit_ref %}
63   <tr>
64    <th>Commit</th>
65    <td>{{ patch.commit_ref }}</td>
66   </tr>
67 {% endif %}
68 {% if patch.delegate %}
69   <tr>
70    <th>Delegated to:</th>
71    <td>{{ patch.delegate.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:</th>
103       <td>
104        {{ patchform.delegate }}
105        {{ patchform.delegate.errors }}
106       </td>
107      </tr>
108      <tr>
109       <th>Archived:</th>
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     <tr>
131      <td>Create bundle:</td>
132      <td>
133        {% if createbundleform.non_field_errors %}
134        <dd class="errors">{{createbundleform.non_field_errors}}</dd>
135        {% endif %}
136       <form method="post">
137        {% csrf_token %}
138        <input type="hidden" name="action" value="createbundle"/>
139        {% if createbundleform.name.errors %}
140        <dd class="errors">{{createbundleform.name.errors}}</dd>
141        {% endif %}
142         {{ createbundleform.name }}
143        <input value="Create" type="submit"/>
144       </form>
145       </td>
146     </tr>
147 {% if bundles %}
148     <tr>
149      <td>Add to bundle:</td>
150      <td>
151       <form method="post">
152        {% csrf_token %}
153        <input type="hidden" name="action" value="addtobundle"/>
154        <select name="bundle_id"/>
155         {% for bundle in bundles %}
156          <option value="{{bundle.id}}">{{bundle.name}}</option>
157         {% endfor %}
158         </select>
159        <input value="Add" type="submit"/>
160       </form>
161      </td>
162     </tr>
163 {% endif %}
164    </table>
165
166  </div>
167 {% endif %}
168
169  <div style="clear: both;">
170  </div>
171 </div>
172
173 {% if patch.pull_url %}
174 <h2>Pull-request</h2>
175 <a class="patch-pull-url" href="{{patch.pull_url}}"
176  >{{ patch.pull_url }}</a>
177 {% endif %}
178
179 <h2>Comments</h2>
180 {% for comment in patch.comments %}
181 <div class="comment">
182 <div class="meta">{{ comment.submitter|personify:project }} - {{comment.date}}</div>
183 <pre class="content">
184 {{ comment|commentsyntax }}
185 </pre>
186 </div>
187 {% endfor %}
188
189 {% if patch.content %}
190 <h2>Patch</h2>
191 <div class="patch">
192 <pre class="content">
193 {{ patch|patchsyntax }}
194 </pre>
195 </div>
196 {% endif %}
197
198
199 {% endblock %}