Kotti / deform_bootstrap

Bootstrap compatible templates for the deform form library. (Merged into deform 2.)
http://pypi.python.org/pypi/deform_bootstrap
34 stars 30 forks source link

readonly elements #59

Closed tisdall closed 11 years ago

tisdall commented 11 years ago

There could be some bootstrap modifications made to the readonly templates. For example the readonly textinput could look like this:

<span id="${field.oid}" class="uneditable-input">${cstruct}</span>

Are you open to a pull request related to this? What are other people's thoughts on doing this?

dnouri commented 11 years ago

Hmm, deform's own readonly templates have no styling that makes elements look like form fields. Maybe I need to understand the use case here?

disko commented 11 years ago

@dnouri while you're of course right with this, I like the idea of having readonly fields within a form rendered as "uneditable" form fields.

FWIW I either have a form with inputs that can be editable or not, or I have a view without [de]form at all. IOW: I use deform with forms only, whereas deform's readonly templates have little to nothing to do with forms.

Others' mileage may vary of course…

tisdall commented 11 years ago

Well, I think it's mostly stylistic. If you just use the default templates than the text doesn't line up with the label when using the default horizontal form layout. It's just not... er.. "bootstrappy" ^_^ The sample I gave is from http://twitter.github.io/bootstrap/base-css.html#forms under "Uneditable inputs".

tisdall commented 11 years ago

@disko I'm using deform with ColanderAlchemy. There's cases where I'd like to display the value for the primary key of the object the person is viewing without letting them view it. The readonly field is the most convenient.

dnouri commented 11 years ago

:+1: