Allow ConfigForms to use fieldsets.

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

david
Djblets
release-0.10.x
886d3f8...
djblets

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.
  • 0
  • 0
  • 6
  • 0
  • 6
Description From Last Updated
chipx86
  1. 
      
  2. djblets/configforms/templates/configforms/config_page_form.html (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    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. The class= should probably be within the if {% fieldset.classes %}.

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

    Can you pass the request?

  5. Alphabetical order.

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

    We should use a module-level logger here.

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (215bbc2)
Loading...