Re: Newforms styling suggestion

2007-04-02 Thread Tai Lee
> I think we might have discussed this before, but the discussion > fizzled out. What would you want to style -- the form HTML tag itself? > The ? The table row (in case of as_table())? > > Adrian i'd like to see the data type classes from oldforms re-applied to the form elements in new forms. e.

Re: Newforms styling suggestion

2007-02-16 Thread sime
OK here's my new patch, adds a css='bla' option to your field definitions, also class='bla error' when there's an error, and class='bla required' when the field is required (thanks waylan for the idea on those last two points) -- http://code.djangoproject.com/ticket/3515 On Feb 16, 10:12 am, "Bri

Re: Newforms styling suggestion

2007-02-16 Thread sime
Hey Wayne - I just submitted something similar - check it out http://code.djangoproject.com/ticket/3515 On Feb 17, 6:57 am, "waylan" <[EMAIL PROTECTED]> wrote: > FYI: I opened a ticket (#3512) and uploaded three separate patches. > Personally, after working out all three, I think I prefer the thi

Re: Newforms styling suggestion

2007-02-16 Thread sime
On Feb 16, 10:12 am, "Brian Morton" <[EMAIL PROTECTED]> wrote: > I don't know if this has been suggested yet, but has anyone considered an > enhancement to newforms to optionally allow a field to have a different > class if it has an error? It would be helpful for things like making error > field

Re: Newforms styling suggestion

2007-02-16 Thread jfagnani
On Feb 16, 1:07 pm, "waylan" <[EMAIL PROTECTED]> wrote: > On Feb 16, 3:28 pm, "jfagnani" <[EMAIL PROTECTED]> wrote: > > > (I think I lost an earlier reply, so hopefully this isn't a dupe) > > > I think it's important to add the classes to the fields themselves, as > > well as the , , and elemen

Re: Newforms styling suggestion

2007-02-16 Thread James Bennett
On 2/16/07, jfagnani <[EMAIL PROTECTED]> wrote: > It'd also be nice if fields had an 'error' property, so that you could > do some things in the template like {% if field.error %} You can do this in the template as {% if form.fieldname.errors %} ...special stuff here to highlight the field... {{

Re: Newforms styling suggestion

2007-02-16 Thread waylan
On Feb 16, 3:28 pm, "jfagnani" <[EMAIL PROTECTED]> wrote: > (I think I lost an earlier reply, so hopefully this isn't a dupe) > > I think it's important to add the classes to the fields themselves, as > well as the , , and elements. IMHO that addes no additional value. If you want the styling

Re: Newforms styling suggestion

2007-02-16 Thread waylan
FYI: I opened a ticket (#3512) and uploaded three separate patches. Personally, after working out all three, I think I prefer the third one. If we get some consensus on that, I'll see if I can find the time to address tests and docs, of if anyone else gets to it first... http://code.djangoproject

Re: Newforms styling suggestion

2007-02-16 Thread jfagnani
(I think I lost an earlier reply, so hopefully this isn't a dupe) I think it's important to add the classes to the fields themselves, as well as the , , and elements. For complex, non-linear forms, I place fields in the template via {{ form.field }}, not with the as_ methods. I think the field

Re: Newforms styling suggestion

2007-02-16 Thread [EMAIL PROTECTED]
I think it makes sense to add them to _html_output as a list of classes (passed into the form object at creation) and have the default as_ methods make use of them. Developers wishing to create their own as_ methods can take advantage of them if they wish, or not. As for the class names, I find

Re: Newforms styling suggestion

2007-02-16 Thread waylan
I started to write a patch for this and have a few questions. First, I was adding the classes 'error' and 'required'. I think those are appropriate names. If anyone feels different speak now. I am adding the class to the , , and elements for each field as that seems to be the general consensus.

Re: Newforms styling suggestion

2007-02-16 Thread [EMAIL PROTECTED]
I intended to say something like this. And yes, and additional class, not a different one. A required field one would be helpful as well. On Feb 16, 4:57 am, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Marc Fargas Esteve wrote: > > You could set the additional class to the container so you can u

Re: Newforms styling suggestion

2007-02-16 Thread Ceph
If an "error" class is going to be added, we might as well take the leap and add a "required" class, too. On Feb 15, 7:12 pm, "Brian Morton" <[EMAIL PROTECTED]> wrote: > I don't know if this has been suggested yet, but has anyone considered an > enhancement to newforms to optionally allow a field

Re: Newforms styling suggestion

2007-02-16 Thread Marc Fargas Esteve
By container we should mean the most top element so it should be the or that has the label and the input below it ;) On 2/16/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Marc Fargas Esteve wrote: > > You could set the additional class to the container so you can use > > simple CSS selector

Re: Newforms styling suggestion

2007-02-16 Thread Ivan Sagalaev
Marc Fargas Esteve wrote: > You could set the additional class to the container so you can use > simple CSS selectors to apply different styles to any element from the > container and inside it. Setting the class on the label or the input > field would not allow to modify the container. +1 (if by

Re: Newforms styling suggestion

2007-02-16 Thread Marc Fargas Esteve
You could set the additional class to the container so you can use simple CSS selectors to apply different styles to any element from the container and inside it. Setting the class on the label or the input field would not allow to modify the container. My 0.02, Marc On 2/16/07, Waylan Limberg <

Re: Newforms styling suggestion

2007-02-15 Thread Waylan Limberg
On Thu, 15 Feb 2007 20:58:27 -0500, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 2/15/07, Brian Morton <[EMAIL PROTECTED]> wrote: >> I don't know if this has been suggested yet, but has anyone considered >> an >> enhancement to newforms to optionally allow a field to have a different >>

Re: Newforms styling suggestion

2007-02-15 Thread Adrian Holovaty
On 2/15/07, Brian Morton <[EMAIL PROTECTED]> wrote: > I don't know if this has been suggested yet, but has anyone considered an > enhancement to newforms to optionally allow a field to have a different > class if it has an error? It would be helpful for things like making error > fields highlight

Newforms styling suggestion

2007-02-15 Thread Brian Morton
I don't know if this has been suggested yet, but has anyone considered an enhancement to newforms to optionally allow a field to have a different class if it has an error? It would be helpful for things like making error fields highlighted red, etc. Just a thought. --~--~-~--~~--