]> git.ipfire.org Git - thirdparty/patchwork.git/commit
filters: Rewrite the submitter autocompletion code
authorDamien Lespiau <damien.lespiau@intel.com>
Sat, 27 Sep 2014 22:44:25 +0000 (23:44 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 5 Nov 2015 03:51:38 +0000 (03:51 +0000)
commit73a4f9a414239bdee5a5d5b4bb490538bebd2c48
treeba2e168b092dc622abd772105cd3d67e5fd01a1f
parent17bca7243d7ec435c0e10f89d946d3e8e88a9397
filters: Rewrite the submitter autocompletion code

We now have a nice(r) autocompletion widget that will popup the list of
options directly underneath the input fild. A few changes are done in
this commit that couldn't be split any further:

- Use jQuery's $.ajax() for the completion query
- Use the application/json content type on the completion answer to
  allow jQuery to directly create an object from it instead of giving
  back a string (because of the text/plain content type)
- Crafted more logical objects in the json answer ie all properties are
  at the same level instead of the default queryset serializer that put
  the object fields in a 'field' sub-object.
- Use selectize.js for the autocompletion widget logic

A slight change in behaviour is that we now don't allow "free form"
submitter search, ie we need a valid completion to search with that
specific person (through its primary key). I didn't remove the backend
logic that allows the "free form" mechanism, but maybe we should.

v2: Squash the unit tests fixes into this patch (Jeremy Kerr)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
patchwork/filters.py
patchwork/templates/patchwork/filters.html
patchwork/tests/test_person.py
patchwork/views/base.py