• 
      

    Add standard base form templates using our CSS component classes.

    Review Request #10893 — Created Feb. 7, 2020 and submitted — Latest diff uploaded

    Information

    Review Board
    release-4.0.x

    Reviewers

    We have several templates throughout Review Board and Djblets that
    define the structure of a form. This is partly because we used to not
    have a standard. The closest thing was how the Django admin UI defined
    forms, which was heavily model-centric in places.

    In an effort to standardize how forms were used, and to allow Djblets
    components to work in both standard forms and the administration UI, we
    introduced a series of templates in Djblets that defined the
    presentation of forms and non-model-based administration change pages.
    In retrospect, the approach used there wasn't as future-proof as we
    liked, but that's a problem for another day.

    This change defines a new set of templates under templates/forms/ for
    how a fieldset and a field look, making use of our CSS component
    classes. These are effectively ports of the Djblets form templates,
    updated to use our classes.

    We provide overrides for some of the Djblets templates that forward on
    to these templates, along with some additional templates that override
    how to interface with our new administration UI.

    This isn't the final iteration of this. An effort is planned to bridge
    the new admin templates (which are still separate) and the new ones, but
    before that some work is planned for Djblets to create a new set of
    renderer classes for forms that will give consuming projects full
    control of template rendering, removing the need in the future to handle
    all these specialized form templates.

    For now, this change is enough to provide a proper UI for most of the
    remaining pages in the administration UI, particularly (most of the)
    settings pages.

    Tested a few pages that make use of the Djblets templates. Verified that
    we were now using our CSS component classes for forms.


    Commits

    Files