New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tabbed forms #60

Merged
merged 14 commits into from Jul 25, 2013

Conversation

Projects
None yet
6 participants
@nightmarebadger
Contributor

nightmarebadger commented Jul 25, 2013

Added option to add tabs to forms, using colander.Mapping() (each Mapping appears in a new tab on the form).

Form validation is changed so all forms with errors are highlighted, and the first tab with errors is automatically selected. Also fixed some problems with radio widgets using integers as ID's, fixing two problems in selenium tests on the way.

Added basic info about adding tabbed forms into the README.

Show outdated Hide outdated README.rst
Show outdated Hide outdated README.rst
Changed according to comments on pull request & extras:
Changed 'Default' tab to 'Basic', updated README with
another example, changed function name to Kotti standards
, field with the first error on forms in now focused.

disko added a commit that referenced this pull request Jul 25, 2013

@disko disko merged commit f51d175 into Kotti:master Jul 25, 2013

@kstrauser

This comment has been minimized.

Show comment
Hide comment
@kstrauser

kstrauser Sep 6, 2013

What would be a good approach for making this configurable? We don't want to use tabs for each mapping and were surprised to see them popping up all over our UI. I was thinking of an approach like setting tabbed_mappings = True on a colander.Schema to enable this behavior, but what would be the right place for storing that configuration information?

kstrauser commented Sep 6, 2013

What would be a good approach for making this configurable? We don't want to use tabs for each mapping and were surprised to see them popping up all over our UI. I was thinking of an approach like setting tabbed_mappings = True on a colander.Schema to enable this behavior, but what would be the right place for storing that configuration information?

@dairiki

This comment has been minimized.

Show comment
Hide comment
@dairiki

dairiki Sep 6, 2013

Contributor

FWIW, I agree that the tabbed forms should be configurable. And they should be disabled by default, since it does result in a shocking change of appearance.

I think the option (if one is really needed) belongs on deform.widget.FormWidget. Really a new option is not needed — one can just point FormWidget.template to a tabbed (or non-tabbed) version of the form template.

Contributor

dairiki commented Sep 6, 2013

FWIW, I agree that the tabbed forms should be configurable. And they should be disabled by default, since it does result in a shocking change of appearance.

I think the option (if one is really needed) belongs on deform.widget.FormWidget. Really a new option is not needed — one can just point FormWidget.template to a tabbed (or non-tabbed) version of the form template.

@dnouri

This comment has been minimized.

Show comment
Hide comment
@dnouri

dnouri Sep 12, 2013

Member

Thanks for your comments. It looks like we made a wrong decision when we decided to make the tabbed forms the unconfigurable default.

I agree with @dairiki's suggestion of setting FormWidget.template explicitly when the tabbed forms appearance is desired.

cc @nightmarebadger

Member

dnouri commented Sep 12, 2013

Thanks for your comments. It looks like we made a wrong decision when we decided to make the tabbed forms the unconfigurable default.

I agree with @dairiki's suggestion of setting FormWidget.template explicitly when the tabbed forms appearance is desired.

cc @nightmarebadger

@kstrauser

This comment has been minimized.

Show comment
Hide comment
@kstrauser

kstrauser Sep 13, 2013

@dnouri Just to be clear, I really like the tabbed forms and think they're a great option when appropriate. We were just surprised at the fairly large change in a patch release.

kstrauser commented Sep 13, 2013

@dnouri Just to be clear, I really like the tabbed forms and think they're a great option when appropriate. We were just surprised at the fairly large change in a patch release.

@dairiki

This comment has been minimized.

Show comment
Hide comment
@dairiki

dairiki Sep 13, 2013

Contributor

Apologies if I sounded a little harsh. I totally agree with @kstrauser that the tabbed layout is a great option to have.

Contributor

dairiki commented Sep 13, 2013

Apologies if I sounded a little harsh. I totally agree with @kstrauser that the tabbed layout is a great option to have.

@dnouri

This comment has been minimized.

Show comment
Hide comment
@dnouri

dnouri Sep 13, 2013

Member

No offense taken. Your feedback was most constructive.

Member

dnouri commented Sep 13, 2013

No offense taken. Your feedback was most constructive.

@nightmarebadger nightmarebadger deleted the nightmarebadger:tabbed_forms branch Sep 28, 2013

@nightmarebadger nightmarebadger restored the nightmarebadger:tabbed_forms branch Sep 28, 2013

@J20S

This comment has been minimized.

Show comment
Hide comment
@J20S

J20S Oct 13, 2015

Hi guys,
I really love the tabbed form and thanks for providing this great function.

Recently I've been trying to internationalize my webapp by following the deform doc (http://deform.readthedocs.org/en/latest/i18n.html). However, after changing from the default renderer to the customised ZPT renderer where you can see in the link, I lose the tabbed forms. All the contents are now displayed in a vertical manner. Any hints on how to get this problem fixed?

Any help will be greatly appreciated!

Cheers,
James

J20S commented Oct 13, 2015

Hi guys,
I really love the tabbed form and thanks for providing this great function.

Recently I've been trying to internationalize my webapp by following the deform doc (http://deform.readthedocs.org/en/latest/i18n.html). However, after changing from the default renderer to the customised ZPT renderer where you can see in the link, I lose the tabbed forms. All the contents are now displayed in a vertical manner. Any hints on how to get this problem fixed?

Any help will be greatly appreciated!

Cheers,
James

@J20S

This comment has been minimized.

Show comment
Hide comment
@J20S

J20S commented Oct 13, 2015

@disko

This comment has been minimized.

Show comment
Hide comment
@disko

disko Oct 14, 2015

Member

@J20S Tabbed forms don't exist in Deform, they're a feature of deform_bootstrap. You need to add the deform_bootstrap template dir to your custom renderer.

Please also note, that deform_bootstrap is no longer maintained. It has basically been merged into deform 2, without the tabs feature though (IIRC).

Member

disko commented Oct 14, 2015

@J20S Tabbed forms don't exist in Deform, they're a feature of deform_bootstrap. You need to add the deform_bootstrap template dir to your custom renderer.

Please also note, that deform_bootstrap is no longer maintained. It has basically been merged into deform 2, without the tabs feature though (IIRC).

@J20S

This comment has been minimized.

Show comment
Hide comment
@J20S

J20S Oct 14, 2015

@disko Thanks for your comment and it worked!!
Just so that everyone else knows, if you want to internationalize your webapp and do not want to lose the tabbed forms supported by bootstrap_deform. Make sure you create a customised ZPT renderer in the following way:

deform_template_dir = resource_filename('deform', 'templates/')
deform_boostrap_template_dir = resource_filename('deform_bootstrap', 'templates/')
def translator(term):
return get_localizer(get_current_request()).translate(term)
zpt_renderer = deform.ZPTRendererFactory(
[deform_boostrap_template_dir,deform_template_dir],
translator=translator)
form = deform.Form(schema, buttons=(_('Submit'),), renderer=zpt_renderer)

Please note, the order of the template directories does matter. Make sure deform_bootstrap template directory is before the deform template directory.

J20S commented Oct 14, 2015

@disko Thanks for your comment and it worked!!
Just so that everyone else knows, if you want to internationalize your webapp and do not want to lose the tabbed forms supported by bootstrap_deform. Make sure you create a customised ZPT renderer in the following way:

deform_template_dir = resource_filename('deform', 'templates/')
deform_boostrap_template_dir = resource_filename('deform_bootstrap', 'templates/')
def translator(term):
return get_localizer(get_current_request()).translate(term)
zpt_renderer = deform.ZPTRendererFactory(
[deform_boostrap_template_dir,deform_template_dir],
translator=translator)
form = deform.Form(schema, buttons=(_('Submit'),), renderer=zpt_renderer)

Please note, the order of the template directories does matter. Make sure deform_bootstrap template directory is before the deform template directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment