From 5b367531103882307c5689d1d80797fe09797718 Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Tue, 19 Sep 2023 15:57:05 +0200
Subject: [PATCH] add new attributes to fellowship dynsel

---
 scipost_django/colleges/forms.py                              | 2 ++
 .../templates/colleges/_hx_fellowship_dynsel_list.html        | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/scipost_django/colleges/forms.py b/scipost_django/colleges/forms.py
index a749a82ec..38e304c71 100644
--- a/scipost_django/colleges/forms.py
+++ b/scipost_django/colleges/forms.py
@@ -109,6 +109,7 @@ class FellowshipDynSelForm(forms.Form):
     action_url_name = forms.CharField()
     action_url_base_kwargs = forms.JSONField(required=False)
     action_target_element_id = forms.CharField()
+    action_target_swap = forms.CharField()
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
@@ -118,6 +119,7 @@ class FellowshipDynSelForm(forms.Form):
             Field("action_url_name", type="hidden"),
             Field("action_url_base_kwargs", type="hidden"),
             Field("action_target_element_id", type="hidden"),
+            Field("action_target_swap", type="hidden"),
         )
 
     def search_results(self):
diff --git a/scipost_django/colleges/templates/colleges/_hx_fellowship_dynsel_list.html b/scipost_django/colleges/templates/colleges/_hx_fellowship_dynsel_list.html
index 85ef7102f..b78b1e56b 100644
--- a/scipost_django/colleges/templates/colleges/_hx_fellowship_dynsel_list.html
+++ b/scipost_django/colleges/templates/colleges/_hx_fellowship_dynsel_list.html
@@ -1,6 +1,6 @@
 {% load colleges_extras %}
 
-<ul class="list list-unstyled">
+<ul class="list list-unstyled dynsel-list">
   {% for fellowship in fellowships|slice:":11" %}
     {% if forloop.counter == 11 %}
       <li>&emsp;...</li>
@@ -9,6 +9,8 @@
 	<a
 	    hx-get="{% fellowship_dynsel_action_url fellowship %}"
 	    hx-target="#{{ action_target_element_id }}"
+      hx-swap="{{ action_target_swap }}"
+      hx-indicator="#{{ action_target_element_id }}-indicator"
 	>
 	  {{ fellowship }}
 	</a>
-- 
GitLab