form.save(patch)
str = 'updated'
- elif action == 'ack':
- pass
-
- elif action == 'archive':
- patch.archived = True
- patch.save()
- str = 'archived'
-
- elif action == 'unarchive':
- patch.archived = False
- patch.save()
- str = 'un-archived'
-
- elif action == 'delete':
- patch.delete()
- str = 'un-archived'
-
if len(patches) > 0:
if len(patches) == 1:
form.save()
context.add_message('Patch updated')
- elif action == 'archive':
- patch.archived = True
- patch.save()
- context.add_message('Patch archived')
-
- elif action == 'unarchive':
- patch.archived = False
- patch.save()
- context.add_message('Patch un-archived')
-
- elif action == 'ack':
- pass
-
- elif action == 'delete':
- patch.delete()
-
-
context['patch'] = patch
context['patchform'] = form
context['createbundleform'] = createbundleform
+++ /dev/null
-
-<div class="patchform"
- style="border: thin solid black; padding-left: 0.8em; margin-top: 2em;">
-
- <div class="patchform-properties"
- style="float: left; margin-right: 4em;">
- <h3>Properties</h3>
- <table class="form">
- <tr>
- <th>Change state:</th>
- <td>{{ patchform.state }}</td>
- </tr>
- <tr>
- <th>Delegate to:</td>
- <td>{{ patchform.delegate }}</td>
- </tr>
- <tr>
- <td></td>
- <td>
- <input type="submit" value="Update">
- </td>
- </tr>
- </table>
- </form>
- </div>
-
- <div class="patchform-actions" style="padding-left: 4em;">
- <h3>Actions</h3>
- <table class="form">
- <tr>
- <td>Ack:</td>
- <td>
- <form action="{% url patchwork.views.patch patch=patch.id %}"
- method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="act"/>
- <input type="submit" value="Ack"/>
- </form>
- </td>
- </tr>
- <tr>
- <td>Create bundle:</td>
- <td>
- {% if createbundleform.name.errors %}
- <span class="errors">{{createbundleform.errors}}</span>
- {% endif %}
- <form method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="createbundle"/>
- {{ createbundleform.name }}
- <input value="Create" type="submit"/>
- </form>
- </td>
- </tr>
-{% if bundles %}
- <tr>
- <td>Add to bundle:</td>
- <td>
- <form action="{% url patchwork.views.bundle.setbundle %}" method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="add"/>
- <input type="hidden" name="patch_id" value="{{ patch.id }}"/>
- <select name="name"/>
- {% for bundle in bundles %}
- <option value="{{bundle.id}}">{{bundle.name}}</option>
- {% endfor %}
- </select>
- <input value="Add" type="submit"/>
- </form>
- </td>
- </tr>
-{% endif %}
- <tr>
- <td>Archive:</td>
- <td>
- <form method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="archive"/>
- <input type="submit" value="Archive"/>
- </form>
- </td>
- </tr>
- </table>
- </form>
-
- </div>
-
- <div style="clear: both;">
- </div>
-</div>
-
<div class="patchform patchform-bundle">
<h3>Bundling</h3>
<table class="form">
- <!--
- <tr>
- <td>Ack:</td>
- <td>
- <input type="submit" name="action" value="Ack"/>
- </form>
- </td>
- </tr>
- -->
<tr>
<td>Create bundle:</td>
<td>
<div class="patchform patchform-bundle">
<h3>Bundling</h3>
<table class="form">
- <!--
- <tr>
- <td>Ack:</td>
- <td>
- <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
- method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="act"/>
- <input type="submit" value="Ack"/>
- </form>
- </td>
- </tr>
- -->
<tr>
<td>Create bundle:</td>
<td>
</div>
{% endif %}
-{% if actionsform %}
- <div class="patchform patchform-actions">
- <h3>Actions</h3>
- <table class="form">
- <tr>
- <td>Ack:</td>
- <td>
- <form action="{% url patchwork.views.patch.patch patch_id=patch.id %}"
- method="post">
- {% csrf_token %}
- <input type="hidden" name="action" value="act"/>
- <input type="submit" value="Ack"/>
- </form>
- </td>
- </tr>
- </table>
- </form>
- </div>
-
-{% endif %}
<div style="clear: both;">
</div>
</div>
+++ /dev/null
-
-{% load person %}
-
-{% if patches %}
-<form method="post">
-{% csrf_token %}
-<table class="patchlist">
- <tr>
- {% if patchform %}
- <th/>
- {% endif %}
- <th><a class="colinactive" href="list?person=846&order=patch">Patch</a></th>
- <th><a class="colinactive" href="list?person=846&order=date">Date</a></th>
- <th><a class="colinactive" href="list?person=846&order=submitter">Submitter</a></th>
- <th><a class="colinactive" href="list?person=846&order=state">State</a></th>
- </tr>
- {% for patch in patches %}
- <tr>
- {% if patchform %}
- <td>
- <input type="hidden" name="patch_ids" value="{{ patch.id }}"/>
- <input type="checkbox" name="patch-{{patch.id}}">
- </td>
- {% endif %}
- <td><a href="{% url patchwork.views.patch.patch patch_id=patch.id %}">{{ patch.name }}</a></td>
- <td>{{ patch.date|date:"Y-m-d" }}</td>
- <td>{{ patch.submitter|personify }}</td>
- <td>{{ patch.state }}</td>
- </tr>
- {% endfor %}
-</table>
-
-{% include "patchwork/patch-form.html" %}
-
-{% else %}
- <p>No patches to display</p>
-{% endif %}