TOMToolkit / tom_base

The base Django project for a Target and Observation Manager
https://tom-toolkit.readthedocs.io
GNU General Public License v3.0
26 stars 47 forks source link

742a htmx for name select choice field #1004

Closed phycodurus closed 3 months ago

phycodurus commented 3 months ago

This PR removes the Submit button and make changing the target name_select ChoiceField update the target fields table:

  1. HTMX attributes were added to the name_select ChoiceField
  2. a GET method was added to the TargetMergeView - if it's an HTMX request triggered by a name_select ChoiceField change, then it updates the table by calling the inclusiontag directly to get it's context and rendering the partial with the new context and return that new HTML. The htmx attributes of the ChoiceField specify (via that hx-target attribute) that the #id_target_merge_fields HTML should be replace.
  3. the #id_target_merge_fields property was assigned to the in the target_fields.html partial.