Repository: ietf-tools/datatracker

Issue:
Setting a state for all positions at once
### Description

It would be nice to set (some?) states for all positions at the same time. I understand for "special elections" you need to tweak individual setting, but I think for the common case of "nominations are closed, feedback is open" the current scheme is a bit error-prone


### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:
Currently the state of each position is shown on one page, and the ability to affect it is on another. The UI should be reworked to make it so that you can edit it where you see it, and to work on blocks of positions similar to how you can work on blocks of selected nominees.

Resolving patch:
diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py
--- a/ietf/nomcom/views.py
+++ b/ietf/nomcom/views.py
@@ -1106,6 +1106,41 @@ def edit_template(request, year, template_id):
 def list_positions(request, year):
     nomcom = get_nomcom_by_year(year)
     positions = nomcom.position_set.order_by('-is_open')
+    if request.method == 'POST':
+        if nomcom.group.state_id != 'active':
+            messages.warning(request, "This nomcom is not active. Request administrative assistance if Position state needs to change.")
+        else:
+            action = request.POST.get('action')
+            positions_to_modify = request.POST.getlist('selected')
+            if positions_to_modify:
+                positions = positions.filter(id__in=positions_to_modify)
+                if action == "set_iesg":
+                    positions.update(is_iesg_position=True)
+                    messages.success(request,'The selected positions have been set as IESG Positions')
+                elif action == "unset_iesg":
+                    positions.update(is_iesg_position=False)
+                    messages.success(request,'The selected positions have been set as NOT IESG Positions')
+                elif action == "set_open":
+                    positions.update(is_open=True)
+                    messages.success(request,'The selected positions have been set as Open')
+                elif action == "unset_open":
+                    positions.update(is_open=False)
+                    messages.success(request,'The selected positions have been set as NOT Open')
+                elif action == "set_accept_nom":
+                    positions.update(accepting_nominations=True)
+                    messages.success(request,'The selected positions have been set as Accepting Nominations')
+                elif action == "unset_accept_nom":
+                    positions.update(accepting_nominations=False)
+                    messages.success(request,'The selected positions have been set as NOT Accepting Nominations')
+                elif action == "set_accept_fb":
+                    positions.update(accepting_feedback=True)
+                    messages.success(request,'The selected positions have been set as Accepting Feedback')
+                elif action == "unset_accept_fb":
+                    positions.update(accepting_feedback=False)
+                    messages.success(request,'The selected positions have been set as NOT Accepting Feedback')
+                positions = nomcom.position_set.order_by('-is_open')
+            else:
+                messages.warning(request, "Please select some positions to work with")
 
     return render(request, 'nomcom/list_positions.html',
                               {'positions': positions,


Test patch: