]> git.ipfire.org Git - thirdparty/patchwork.git/commit
views: Move and refactor patch-forms
authorRaxel Gutierrez <raxel@google.com>
Mon, 23 Aug 2021 18:28:31 +0000 (18:28 +0000)
committerStephen Finucane <stephen@that.guru>
Fri, 1 Nov 2024 15:47:20 +0000 (15:47 +0000)
commit17726d72f701dd09b65ffef6a306ef63f863a534
tree1a417897d3cdce01eae1e96a9427c16fd5f13b70
parent0cea2e4a9f418b2da7d8ca2a0236563ae737415c
views: Move and refactor patch-forms

Move patch forms in patch-list and detail page to a new template file
patch-forms.html and move them to the top of the patch-list page to
improve their discoverability.

Refactor forms.py, __init__.py, patch.py, and test_bundles.py files so
that the shared bundle form in patch-forms.html works for both the
patch-list and patch-detail pages. In particular, the changes normalize
the behavior of the error and update messages of the patch forms and
updates tests to reflect the changes. Overall, these changes make patch
forms ready for change and more synchronized in their behavior. More
specifically:

- Previously patch forms changes were separated between the patch-detail
  and patch-list pages. Thus, desired changes to the patch forms
  required changes to patch-list.html, submission.html, and forms.py.
  So, the most important benefit to this change is that forms.py and
  patch-forms.html become the two places to adjust the forms to handle
  form validation and functionality as well as UI changes.

- Previously the patch forms in patch-list.html handled error and
  update messages through views in patch.py, whereas the patch forms in
  submission.html handled the messages with forms.py. Now, with a single
  patch forms component in patch-forms.html, forms.py is set to handle
  the messages and handle form validation for both pages.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Address merge conflicts]
patchwork/forms.py
patchwork/templates/patchwork/partials/patch-forms.html [new file with mode: 0644]
patchwork/templates/patchwork/partials/patch-list.html
patchwork/templates/patchwork/submission.html
patchwork/tests/views/test_bundles.py
patchwork/views/__init__.py
patchwork/views/patch.py