Markup fixes and jQuery lib upgrades #16

wants to merge 14 commits into

6 participants


Several fixes to make deform's templates validate as correct HTML (e.g. removed non-LI elements from ULs; removed custom attributes; fixed nesting of structural widgets where LIs where omitted). To make some of this work I had to upgrade to jQuery 1.5 and thus upgraded depending libs, too.

hellp added some commits Apr 1, 2011
@hellp hellp Move INPUTs out of UL. Only LIs allowed here. e4be502
@hellp hellp Fix: trailing commas break IE7 (and even IE8?). 374d6f5
@hellp hellp LEGEND must be the first child of FIELDSET (at least in HTML5). b31bacc
@hellp hellp Don't use omit-tag on LI elements; rather use a .hidden class.
If you assume to be in a list you must not simply remove the tag as
that results in invalid HTML, e.g. UL > INPUT.
@hellp hellp Make SequenceWidget 'structural' and give it a FIELDSET.
This make SequenceWidget and MappingWidget behave more consistent.
And: it's already stated in the docstring of Widget: "the default
mapping and sequence widgets are in this category ['structural']".
And: "Renders a sequence into a set of fields."

Plus: we get rid of the invalid LABEL element pointing to the widget's
DIV -- which is not valid HTML.
@hellp hellp Refactor to valid HTML and upgrade to latest jQuery + libs.
Instead of using custom (non-valid) attributes (e.g. prototype) and
a (non-valid) SPAN inside a sequence's UL to hold min/max variables,
we use HTML5 data-* attributes now.

For easy access to them (and for the hotness' sake) upgrade to
jQuery 1.5.2 and a more recent jQuery UI.
@hellp hellp Cosmetics. 9dd2d99
@hellp hellp Upgrade to latest jquery.form that supports jQuery 1.5 and fix IFRAME…
… behavior.

See source comment for details.
@hellp hellp Fix missing "." in selector. 19fc836
@hellp hellp Fix tests. Adapt selenium locators to new sequence markup. b0c845c
@hellp hellp Pull another INPUT out of an UL. a6afb95
@hellp hellp Refactor error markup.
Use separate DIV for the global form error message instead of just
another LI.

Use less classes.
@hellp hellp Fix markup of readonly sequences. 7201f85
@hellp hellp Fix markup of readonly mappings. d2967c0
Pylons Project member

This set of patches appears to cause one test failure in the deformdemo tests:

FAIL: test_submit_success (__main__.RedirectingAjaxFormTests)
Traceback (most recent call last):
  File "deformdemo/", line 2369, in test_submit_success

Possibly due to JQuery differences? I didn't investigate. Hoping you can advise.

Pylons Project member

mark for myself to review

Pylons Project member

@ergo did you ever get a chance to review this? Is it still relevant?

Pylons Project member

Yep we need this there if it can be...
Can some take on this ? I cannot at the moment ... @mcdonc ? @sontek ?

Pylons Project member

@kiorky It doesn't merge cleanly, so I couldn't test it but its upgrading to older versions of jquery anyways so not sure if its worth it at this point even though it would have been great

Pylons Project member

Does anyone could help on this ? @hellp ?

Pylons Project member

Bleh, it's my fault that this never got applied. I didn't try hard enough to evaluate it when it was submitted. The templates have changed so much in the meantime that it's probably hopeless to try to apply the patches. It might be worthwhile for us to go through the diff by-eye to see if there's anything we can salvage from it.

Pylons Project member

We're moving to bootstrap templates and most of these issues will be fixed by the move. There are a couple that we might need to revisit, but that would be better after we merge bootstrap.

@cguardia cguardia closed this Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment