background-color: white;
}
-a.colinactive, a.colactive {
+a.col-inactive, a.col-active {
color: black;
text-decoration: none;
}
-a.colinactive:hover {
+a.col-inactive:hover {
color: red;
}
div.filters {
}
-div.patchforms {
+div.patch-forms {
margin-top: 1em;
}
/* list order manipulation */
-table.patchlist tr.draghover {
+table.patch-list tr.draghover {
background: #e8e8e8 !important;
}
}
/* checks forms */
-/* TODO(stephenfin): Merge this with 'div.patchform' rules */
+/* TODO(stephenfin): Merge this with 'div.patch-form' rules */
.checks {
border: 1px solid gray;
margin: 0.5em 1em;
}
/* forms that appear for a patch */
-div.patchform {
+div.patch-form {
border: thin solid #080808;
padding-left: 0.6em;
padding-right: 0.6em;
margin: 0.5em 5em 0.5em 10px;
}
-div.patchform h3 {
+div.patch-form h3 {
margin-top: 0em;
margin-left: -0.6em;
margin-right: -0.6em;
font-size: 100%;
}
-div.patchform ul {
+div.patch-form ul {
list-style-type: none;
padding-left: 0.2em;
margin-top: 0em;
{
var rows, form;
- form = $("#reorderform");
- rows = $("#patchlist").get(0).tBodies[0].rows;
+ form = $("#reorder-form");
+ rows = $("#patch-list").get(0).tBodies[0].rows;
if (rows.length < 1)
return;
$("#reorder\\-cancel").css("display", "inline");
/* show help text */
- $("#reorderhelp").text('Drag & drop rows to reorder');
+ $("#reorder-help").text('Drag & drop rows to reorder');
/* enable drag & drop on the patches list */
- $("#patchlist").tableDnD({
+ $("#patch-list").tableDnD({
onDragClass: 'dragging',
onDragStart: function() { dragging = true; },
onDrop: function() { dragging = false; }
});
/* replace zebra striping with hover */
- $("#patchlist tbody tr").css("background", "inherit");
- $("#patchlist tbody tr").hover(drag_hover_in, drag_hover_out);
+ $("#patch-list tbody tr").css("background", "inherit");
+ $("#patch-list tbody tr").hover(drag_hover_in, drag_hover_out);
}
editing_order = !editing_order;
{% include "patchwork/partials/pagination.html" %}
{% if order.editable %}
-<table class="patchlist">
+<table class="patch-list">
<tr>
- <td class="patchlistreorder">
- <form method="post" id="reorderform">
+ <td class="patch-list-reorder">
+ <form method="post" id="reorder-form">
{% csrf_token %}
- <input type="hidden" name="form" value="reorderform"/>
+ <input type="hidden" name="form" value="reorder-form"/>
<input type="hidden" name="order_start" value="0"/>
- <span id="reorderhelp"></span>
+ <span id="reorder-help"></span>
<input id="reorder-cancel" type="button" value="Cancel" onClick="order_cancel_click(this)"/>
<input id="reorder-change" type="button" value="Change order" onClick="order_button_click(this)"/>
</form>
{% if page.paginator.long_page and user.is_authenticated %}
<div class="floaty">
- <a title="jump to form" href="#patchforms">
+ <a title="jump to form" href="#patch-forms">
<span style="font-size: 120%">▾</span>
</a>
</div>
<script type="text/javascript">
$(document).ready(function() {
- $('#patchlist').stickyTableHeaders();
+ $('#patch-list').stickyTableHeaders();
- $('#patchlist').checkboxes('range', true);
+ $('#patch-list').checkboxes('range', true);
$('#check-all').change(function(e) {
if(this.checked) {
- $('#patchlist > tbody').checkboxes('check');
+ $('#patch-list > tbody').checkboxes('check');
} else {
- $('#patchlist > tbody').checkboxes('uncheck');
+ $('#patch-list > tbody').checkboxes('uncheck');
}
e.preventDefault();
});
<form method="post">
{% csrf_token %}
- <input type="hidden" name="form" value="patchlistform"/>
+ <input type="hidden" name="form" value="patch-list-form"/>
<input type="hidden" name="project" value="{{project.id}}"/>
- <table id="patchlist" class="table table-hover table-extra-condensed table-striped pw-list" data-toggle="checkboxes" data-range="true">
+ <table id="patch-list" class="table table-hover table-extra-condensed table-striped pw-list" data-toggle="checkboxes" data-range="true">
<thead>
<tr>
{% if user.is_authenticated %}
<th>
{% if not order.editable %}
{% if order.name == "name" %}
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
</a>
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
Patch
</a>
{% else %}
- <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
+ <a class="col-inactive" href="{% listurl order="name" %}">Patch</a>
{% endif %}
{% else %}
- <span class="colinactive">Patch</span>
+ <span class="col-inactive">Patch</span>
{% endif %}
</th>
<th>
- <span class="colinactive">Series</span>
+ <span class="col-inactive">Series</span>
</th>
<th>
<th>
{% if not order.editable %}
{% if order.name == "date" %}
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
</a>
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
Date
</a>
{% else %}
- <a class="colinactive" href="{% listurl order="date" %}">Date</a>
+ <a class="col-inactive" href="{% listurl order="date" %}">Date</a>
{% endif %}
{% else %}
- <span class="colinactive">Date</span>
+ <span class="col-inactive">Date</span>
{% endif %}
</th>
<th>
{% if not order.editable %}
{% if order.name == "submitter" %}
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
</a>
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
Submitter
</a>
{% else %}
- <a class="colinactive" href="{% listurl order="submitter" %}">
+ <a class="col-inactive" href="{% listurl order="submitter" %}">
Submitter
</a>
{% endif %}
{% else %}
- <span class="colinactive">Submitter</span>
+ <span class="col-inactive">Submitter</span>
{% endif %}
</th>
<th>
{% if not order.editable %}
{% if order.name == "delegate" %}
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
</a>
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
Delegate
</a>
{% else %}
- <a class="colinactive" href="{% listurl order="delegate" %}">Delegate</a>
+ <a class="col-inactive" href="{% listurl order="delegate" %}">Delegate</a>
{% endif %}
{% else %}
- <span class="colinactive">Delegate</span>
+ <span class="col-inactive">Delegate</span>
{% endif %}
</th>
<th>
{% if not order.editable %}
{% if order.name == "state" %}
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
</a>
- <a class="colactive" href="{% listurl order=order.reversed_name %}">
+ <a class="col-active" href="{% listurl order=order.reversed_name %}">
State
</a>
{% else %}
- <a class="colinactive" href="{% listurl order="state" %}">State</a>
+ <a class="col-inactive" href="{% listurl order="state" %}">State</a>
{% endif %}
{% else %}
- <span class="colinactive">State</span>
+ <span class="col-inactive">State</span>
{% endif %}
</th>
<tbody>
{% for patch in page.object_list %}
- <tr id="patch_row:{{patch.id}}">
+ <tr id="patch-row:{{patch.id}}">
{% if user.is_authenticated %}
- <td style="text-align: center;">
+ <td id="select-patch:{{patch.id}}" style="text-align: center;">
<input type="checkbox" name="patch_id:{{patch.id}}"/>
</td>
{% endif %}
</button>
</td>
{% endif %}
- <td>
+ <td id="patch-name:{{patch.id}}">
<a href="{% url 'patch-detail' project_id=project.linkname msgid=patch.encoded_msgid %}">
{{ patch.name|default:"[no subject]"|truncatechars:100 }}
</a>
</td>
- <td>
+ <td id="patch-series:{{patch.id}}">
{% if patch.series %}
<a href="?series={{patch.series.id}}">
{{ patch.series|truncatechars:100 }}
</a>
{% endif %}
</td>
- <td class="text-nowrap">{{ patch|patch_tags }}</td>
- <td class="text-nowrap">{{ patch|patch_checks }}</td>
- <td class="text-nowrap">{{ patch.date|date:"Y-m-d" }}</td>
- <td>{{ patch.submitter|personify:project }}</td>
- <td>{{ patch.delegate.username }}</td>
- <td>{{ patch.state }}</td>
+ <td id="patch-tags:{{patch.id}}" class="text-nowrap">{{ patch|patch_tags }}</td>
+ <td id="patch-checks:{{patch.id}}" class="text-nowrap">{{ patch|patch_checks }}</td>
+ <td id="patch-date:{{patch.id}}" class="text-nowrap">{{ patch.date|date:"Y-m-d" }}</td>
+ <td id="patch-submitter:{{patch.id}}">{{ patch.submitter|personify:project }}</td>
+ <td id="patch-delegate:{{patch.id}}">{{ patch.delegate.username }}</td>
+ <td id="patch-state:{{patch.id}}">{{ patch.state }}</td>
</tr>
{% empty %}
<tr>
{% if page.paginator.count %}
{% include "patchwork/partials/pagination.html" %}
- <div class="patchforms" id="patchforms">
+ <div class="patch-forms" id="patch-forms">
-{% if patchform %}
- <div class="patchform patchform-properties">
+{% if patch_form %}
+ <div class="patch-form patch-form-properties">
<h3>Properties</h3>
<table class="form">
<tr>
<th>Change state:</th>
<td>
- {{ patchform.state }}
- {{ patchform.state.errors }}
+ {{ patch_form.state }}
+ {{ patch_form.state.errors }}
</td>
</tr>
<tr>
<th>Delegate to:</th>
<td>
- {{ patchform.delegate }}
- {{ patchform.delegate.errors }}
+ {{ patch_form.delegate }}
+ {{ patch_form.delegate.errors }}
</td>
</tr>
<tr>
<th>Archive:</th>
<td>
- {{ patchform.archived }}
- {{ patchform.archived.errors }}
+ {{ patch_form.archived }}
+ {{ patch_form.archived.errors }}
</td>
</tr>
<tr>
<td></td>
<td>
- <input type="submit" name="action" value="{{patchform.action}}"/>
+ <input type="submit" name="action" value="{{patch_form.action}}"/>
</td>
</tr>
</table>
{% endif %}
{% if user.is_authenticated %}
- <div class="patchform patchform-bundle">
+ <div class="patch-form patch-form-bundle">
<h3>Bundling</h3>
<table class="form">
<tr>
{% endif %}
</table>
-<div class="patchforms">
-{% if patchform %}
- <div class="patchform patchform-properties">
+<div class="patch-forms">
+{% if patch_form %}
+ <div class="patch-form patch-form-properties">
<h3>Patch Properties</h3>
<form method="post">
{% csrf_token %}
<tr>
<th>Change state:</th>
<td>
- {{ patchform.state }}
- {{ patchform.state.errors }}
+ {{ patch_form.state }}
+ {{ patch_form.state.errors }}
</td>
</tr>
<tr>
<th>Delegate to:</th>
<td>
- {{ patchform.delegate }}
- {{ patchform.delegate.errors }}
+ {{ patch_form.delegate }}
+ {{ patch_form.delegate.errors }}
</td>
</tr>
<tr>
<th>Archived:</th>
<td>
- {{ patchform.archived }}
- {{ patchform.archived.errors }}
+ {{ patch_form.archived }}
+ {{ patch_form.archived.errors }}
</td>
</tr>
<tr>
</div>
{% endif %}
-{% if createbundleform %}
- <div class="patchform patchform-bundle">
+{% if create_bundle_form %}
+ <div class="patch-form patch-form-bundle">
<h3>Bundling</h3>
<table class="form">
<tr>
<td>Create bundle:</td>
<td>
-{% if createbundleform.non_field_errors %}
- <dd class="errors">{{createbundleform.non_field_errors}}</dd>
+{% if create_bundle_form.non_field_errors %}
+ <dd class="errors">{{create_bundle_form.non_field_errors}}</dd>
{% endif %}
<form method="post">
{% csrf_token %}
<input type="hidden" name="action" value="createbundle"/>
-{% if createbundleform.name.errors %}
- <dd class="errors">{{createbundleform.name.errors}}</dd>
+{% if create_bundle_form.name.errors %}
+ <dd class="errors">{{create_bundle_form.name.errors}}</dd>
{% endif %}
- {{ createbundleform.name }}
+ {{ create_bundle_form.name }}
<input value="Create" type="submit"/>
</form>
</td>
self.assertEqual(bundle.public, not self.bundle.public)
# check other forms for errors
- formname = 'patchform'
+ formname = 'patch_form'
if formname not in response.context:
return
form = response.context[formname]
def test_create_empty_bundle(self):
newbundlename = 'testbundle-new'
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'bundle_name': newbundlename,
'action': 'Create',
'project': self.project.id,
patch = self.patches[0]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'bundle_name': newbundlename,
'action': 'Create',
'project': self.project.id,
n_bundles = Bundle.objects.count()
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'bundle_name': '',
'action': 'Create',
'project': self.project.id,
patch = self.patches[0]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'bundle_name': newbundlename,
'action': 'Create',
'project': self.project.id,
def test_add_to_empty_bundle(self):
patch = self.patches[0]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'action': 'Add',
'project': self.project.id,
'bundle_id': self.bundle.id,
self.bundle.append_patch(self.patches[0])
patch = self.patches[1]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'action': 'Add',
'project': self.project.id,
'bundle_id': self.bundle.id,
patch = self.patches[0]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'action': 'Add',
'project': self.project.id,
'bundle_id': self.bundle.id,
patch = self.patches[0]
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'action': 'Add',
'project': self.project.id,
'bundle_id': self.bundle.id,
# need to define our querystring explicity to enforce ordering
params = {
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'bundle_name': newbundlename,
'action': 'Create',
'project': self.project.id,
slice_ids = neworder_ids[start:end]
params = {
- 'form': 'reorderform',
+ 'form': 'reorder-form',
'order_start': firstpatch.id,
'neworder': slice_ids,
}
create_patch(submitter=person, project=self.project, date=date)
def _extract_patch_ids(self, response):
- id_re = re.compile(r'<tr id="patch_row:(\d+)"')
+ id_re = re.compile(r'<tr id="patch-row:(\d+)"')
ids = [
int(m.group(1)) for m in id_re.finditer(response.content.decode())
]
class PatchUpdateTest(TestCase):
- properties_form_id = 'patchform-properties'
+ properties_form_id = 'patch-form-properties'
def setUp(self):
self.project = create_project()
self.base_data = {
'action': 'Update',
'project': str(self.project.id),
- 'form': 'patchlistform',
+ 'form': 'patch-list-form',
'archived': '*',
'delegate': '*',
'state': '*',
self.assertEqual(new_states, orig_states)
if django.VERSION >= (4, 1):
self.assertFormError(
- response.context['patchform'],
+ response.context['patch_form'],
'state',
'Select a valid choice. That choice is not one '
'of the available choices.',
else:
self.assertFormError(
response,
- 'patchform',
+ 'patch_form',
'state',
'Select a valid choice. That choice is not one '
'of the available choices.',
# we only pass the post data to the MultiplePatchForm if that was
# the actual form submitted
data_tmp = None
- if data and data.get('form', '') == 'patchlistform':
+ if data and data.get('form', '') == 'patch-list-form':
data_tmp = data
properties_form = MultiplePatchForm(project, data=data_tmp)
- if request.method == 'POST' and data.get('form') == 'patchlistform':
+ if request.method == 'POST' and data.get('form') == 'patch-list-form':
action = data.get('action', '').lower()
# special case: the user may have hit enter in the 'create bundle'
context.update(
{
'page': paginator.current_page,
- 'patchform': properties_form,
+ 'patch_form': properties_form,
'project': project,
'order': order,
}
if (
request.method == 'POST'
- and request.POST.get('form') == 'reorderform'
+ and request.POST.get('form') == 'reorder-form'
):
order = get_object_or_404(
BundlePatch,
context = {'project': patch.project}
form = None
- createbundleform = None
+ create_bundle_form = None
if editable:
form = PatchForm(instance=patch)
if request.user.is_authenticated:
- createbundleform = CreateBundleForm()
+ create_bundle_form = CreateBundleForm()
if request.method == 'POST':
action = request.POST.get('action', None)
if action == 'createbundle':
bundle = Bundle(owner=request.user, project=project)
- createbundleform = CreateBundleForm(
+ create_bundle_form = CreateBundleForm(
instance=bundle, data=request.POST
)
- if createbundleform.is_valid():
- createbundleform.save()
+ if create_bundle_form.is_valid():
+ create_bundle_form.save()
bundle.append_patch(patch)
bundle.save()
- createbundleform = CreateBundleForm()
+ create_bundle_form = CreateBundleForm()
messages.success(request, 'Bundle %s created' % bundle.name)
elif action == 'addtobundle':
bundle = get_object_or_404(
)
context['submission'] = patch
context['editable'] = editable
- context['patchform'] = form
- context['createbundleform'] = createbundleform
+ context['patch_form'] = form
+ context['create_bundle_form'] = create_bundle_form
context['project'] = patch.project
context['related_same_project'] = related_same_project
context['related_different_project'] = related_different_project