[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#808285: tracker.debian.org: Subscription keywords management is over-complex



Hi,

On Fri, 18 Dec 2015, Christophe Siraut wrote:
> Keywords management is currently done using extensive javascript and
> ajax requests. As the rest of the application is using Django, we could
> gain reliability and simplicity using Django forms. We should not
> require javascript IMHO, better use it unobstrusively instead.
> 
> This would requires a few core/models simplifications, remove the
> r'^api/' urls, and loose the fancy modal windows, what do you think?

While I certainly love simplicity and better code, I don't think that
it's good idea to drop the ajax + javascript on that page. Switching
back and forth between different pages to change keywords on multiple
packages is not very good UI.

But it certainly needs to be cleaned (some ajax request can be avoided)...
and we need to ensure that the fallback when javascript is disabled do
actually work. I discovered recently while working on the port to
bootstrap 4 that it was not the case for some of the forms... (can't
remember which one right now)

I can elaborate a little bit if you want:
- the list of keyword does not need to be retrieved via ajax, it can be
  hardcoded in the form embedded in the modal dialog (and thus generated
  with a Django form)
- the list of keywords associated to a subscription should be made
  available in a data-keywords attribute (and we should not extract
  it from the place where they are displayed)
- the javascript code is not unit-tested and not very clean/readable

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/


Reply to: