<div py:def="offer_to_delete(item)" class="little_action_panel" py:if="item.id">
<a href="../delete/">Delete this item</a>
</div>
+
</html>
<table class="metadata_table">
<tr><th>Invitation Code:</th><td><input type="text" id="code" name="code" size="30" value="${code}"/></td></tr>
</table>
-<p><input type="submit" value="Continue"/> <a style="margin-left: 12px;" href="../">or go back</a></p>
+<p><input type="submit" value="Continue"/> ${go_back_link()}</p>
</form>
<div class="gap"/>
</body>
<p>If you choose to join this course, it will be added to your "My
Courses" list.</p>
<form action="." method="POST">
- <p><input type="submit" value="Yes, join this course"/> <a style="margin-left: 12px;" href="../">or go back</a></p>
+ <p><input type="submit" value="Yes, join this course"/> ${go_back_link()}</p>
</form>
</body>
${field_row(form.department)}
<!-- <tr><th>Department</th><td>${Markup(form.department)} ${errorlist(form.department)}</td></tr> -->
</table>
- <p><input type="submit" value="Continue"/></p>
+ <p><input type="submit" value="Continue"/> ${go_back_link()}</p>
</form>
<div class="gap"/>
<div py:if="instance.id">
<p><input type="checkbox" name="confirm_delete" id="confirm_delete"/>
<label for="confirm_delete">Yes, I want to delete this course site and all of its contents.</label>
</p>
- <p><input type="submit" value="Delete this course"/></p>
+ <p><input type="submit" value="Delete this course"/> ${go_back_link()}</p>
</form>
</div>
</body>
<td>${instance}</td>
</tr>
</table>
- <p><input type="submit" value="Delete"/></p>
- <p><a href="../">Cancel</a></p>
+ <p><input type="submit" value="Delete"/>${go_back_link('../')}</p>
</form>
</body>
</html>
<h1>${title}</h1>
<form action="." method="POST">
<table class="metadata_table">${Markup(form.as_table())}</table>
- <p><input type="submit" value="Save changes"/></p>
- <p><a href="../">Cancel changes</a></p>
- <p><a href="delete">Delete this record</a></p>
+ <p><input type="submit" value="Save changes"/> ${go_back_link()}</p>
+ <p py:if="instance is not None"><a href="delete">Delete this record</a></p>
</form>
</body>
</html>
<h2>${title}</h2>
<form method="POST" action=".">
<input type="text" id="query" name="query" value="${query}"
- style="font-size: larger; width: 600;"/>
+ style="font-size: larger; width: 600px;"/>
<input type="submit" value="Search"/>
+ ${go_back_link()}
+
</form>
<table class="pagetable" py:if="request.method == 'POST'">
<tr><th>File</th><td><input type="file" name="file"/></td></tr>
</table>
${item_metadata_formset()}
- <p><input type="submit" value="Upload file and Create item"/></p>
+ <p><input type="submit" value="Upload file and Create item"/>
+ ${go_back_link()}
+ </p>
</form>
</div>
<p>
<input py:if="not is_edit" type="submit" value="Add heading"/>
<input py:if="is_edit" type="submit" value="Update heading"/>
+ ${go_back_link()}
</p>
</form>
<p>
<input py:if="not is_edit" type="submit" value="Add URL"/>
<input py:if="is_edit" type="submit" value="Update URL"/>
+ ${go_back_link('../meta')}
</p>
</form>
</body>
<p>
<form action="." method="POST">
<input type="submit" name="yes" value="Yes, delete it" style="padding: 4 12; margin-right: 24;"/>
- <input type="submit" name="no" value="Cancel"/>
+ ${go_back_link()}
</form>
</p>
</body>
</tr>
<tr>
<th/>
- <td><input type="submit" value="Move item"/></td>
+ <td><input type="submit" value="Move item"/>
+ ${go_back_link()}
+ </td>
</tr>
</tbody>
</table>
</div>
</body>
</py:match>
+
+ <span py:def="go_back_link(url=None, msg=_('or Cancel'))" py:with="url=url or request.META.get('HTTP_REFERER', '../')">
+ <a style="margin-left: 12px;" href="${url}">${msg}</a>
+ </span>
+
</html>
</tr>
<tr>
<th/>
- <td><input type="submit" value="${step==3 and _('Check out another item') or _('Continue')}"/></td>
+ <td><input type="submit" value="${step==3 and _('Check out another item') or _('Continue')}"/> ${go_back_link()}</td>
</tr>
<tr py:if="step==3">
<th/>
</tr>
<tr>
<th/>
- <td><input type="submit" value="${False and _('Check out another item') or _('Continue')}"/></td>
+ <td><input type="submit" value="${False and _('Check out another item') or _('Continue')}"/> ${go_back_link()}</td>
</tr>
</table>
</div>