Allow ConfigForms to use fieldsets.

Review Request #9045 — Created June 29, 2017 and submitted

Information

Djblets
release-0.10.x
886d3f8...

Reviewers

This change updates things so that if a ConfigForm has fieldsets, they'll be
rendered correctly (as opposed to just having all the fields rendered together
as if the fieldsets didn't exist).

This has one small niggle in that if a person defines their own fieldsets, one
of those fieldsets must contain the form_target field. I've added a log
statement to help people figure out what went wrong if they didn't include
this.

Testing done:
- Ran unit tests.
- Used this in conjunction with a Review Board change.

  • Ran unit tests.
  • Used this in conjunction with a Review Board change.
Description From Last Updated

I don't really love duplicating all this. How about introducing a djblets/forms/templates/form_fieldset.html that works as a base for this and …

chipx86chipx86

The class= should probably be within the if {% fieldset.classes %}.

chipx86chipx86

Can you pass the request?

chipx86chipx86

Alphabetical order.

chipx86chipx86

We should use a module-level logger here.

brenniebrennie

form ?

brenniebrennie
chipx86
  1. 
      
  2. djblets/configforms/templates/configforms/config_page_form.html (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    I don't really love duplicating all this. How about introducing a djblets/forms/templates/form_fieldset.html that works as a base for this and the admin one? It could take a extra_fieldset_classes variable that the admin one can pass down for module aligned, along with a template name that can be passed for the field name.

    Similarly, we could have a base for the form_field.html.

    We used to have a lot of copies of these rules, which was painful to clean up, so I'm hoping to keep it as tidy and consistent as possible.

  3. Show all issues

    The class= should probably be within the if {% fieldset.classes %}.

  4. djblets/configforms/views.py (Diff revision 1)
     
     
    Show all issues

    Can you pass the request?

  5. Show all issues

    Alphabetical order.

  6. 
      
david
brennie
  1. 
      
  2. djblets/configforms/views.py (Diff revision 2)
     
     
    Show all issues

    We should use a module-level logger here.

  3. Show all issues

    form ?

  4. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (215bbc2)