Skip to content

Commit db9c1fa

Browse files
committed
Remove old submissions table, removed old table batch actions, update invoice batch action to use htmx
1 parent 2483330 commit db9c1fa

31 files changed

+123
-807
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default [
2626
...globals.commonjs,
2727
jQuery: true,
2828
Alpine: true,
29+
htmx: true,
2930
},
3031
},
3132

hypha/apply/determinations/templates/determinations/batch_determination_form.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
{% endblock %}
3131

3232
{% block form_buttons %}
33-
<button data-fancybox data-src="#batch-send-determination" class="button button--submit button--top-space button--primary js-batch-determine-send" type="button">{% trans "Send" %}</button>
34-
{% include "determinations/includes/batch_determination_confirmation.html" with count=submissions.count %}
35-
<input type="submit" value="Submit" name="submit" class="is-hidden" />
33+
<button class="button button--submit button--top-space button--primary" type="submit" onclick="return confirm('{% blocktrans %}This determination message will be emailed to applicants and cannot be undone. Do you wish to contiune?{% endblocktrans %}')">
34+
{% trans "Send" %}
35+
</button>
3636
{% endblock %}
3737

3838
{% block show_submission %}

hypha/apply/determinations/templates/determinations/includes/batch_determination_confirmation.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

hypha/apply/funds/forms.py

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from .permissions import can_change_external_reviewers
2323
from .utils import model_form_initial, render_icon
2424
from .widgets import MetaTermSelect2Widget, Select2MultiCheckboxesWidget
25-
from .workflow import get_action_mapping
2625

2726

2827
class ApplicationSubmissionModelForm(forms.ModelForm):
@@ -76,34 +75,6 @@ def __init__(self, *args, **kwargs):
7675
action_field.choices = choices
7776

7877

79-
class BatchProgressSubmissionForm(forms.Form):
80-
action = forms.ChoiceField(label=_("Take action"))
81-
submissions = forms.CharField(
82-
widget=forms.HiddenInput(attrs={"class": "js-submissions-id"})
83-
)
84-
85-
def __init__(self, *args, round=None, **kwargs):
86-
self.user = kwargs.pop("user")
87-
super().__init__(*args, **kwargs)
88-
workflow = round and round.workflow
89-
self.action_mapping = get_action_mapping(workflow)
90-
choices = [
91-
(action, detail["display"])
92-
for action, detail in self.action_mapping.items()
93-
]
94-
self.fields["action"].choices = choices
95-
96-
def clean_submissions(self):
97-
value = self.cleaned_data["submissions"]
98-
submission_ids = [int(submission) for submission in value.split(",")]
99-
return ApplicationSubmission.objects.filter(id__in=submission_ids)
100-
101-
def clean_action(self):
102-
value = self.cleaned_data["action"]
103-
action = self.action_mapping[value]["transitions"]
104-
return action
105-
106-
10778
class UpdateSubmissionLeadForm(ApplicationSubmissionModelForm):
10879
class Meta:
10980
model = ApplicationSubmission
@@ -116,59 +87,6 @@ def __init__(self, *args, **kwargs):
11687
lead_field.queryset = lead_field.queryset.exclude(id=self.instance.lead.id)
11788

11889

119-
class BatchUpdateSubmissionLeadForm(forms.Form):
120-
lead = forms.ChoiceField(label=_("Lead"))
121-
submissions = forms.CharField(
122-
widget=forms.HiddenInput(attrs={"class": "js-submissions-id"})
123-
)
124-
125-
def __init__(self, *args, round=None, **kwargs):
126-
self.user = kwargs.pop("user")
127-
super().__init__(*args, **kwargs)
128-
self.fields["lead"].choices = [
129-
(staff.id, staff) for staff in User.objects.staff()
130-
]
131-
132-
def clean_lead(self):
133-
value = self.cleaned_data["lead"]
134-
return User.objects.get(id=value)
135-
136-
def clean_submissions(self):
137-
value = self.cleaned_data["submissions"]
138-
submission_ids = [int(submission) for submission in value.split(",")]
139-
return ApplicationSubmission.objects.filter(id__in=submission_ids)
140-
141-
142-
class BatchDeleteSubmissionForm(forms.Form):
143-
submissions = forms.CharField(
144-
widget=forms.HiddenInput(attrs={"class": "js-submissions-id"})
145-
)
146-
147-
def __init__(self, *args, round=None, **kwargs):
148-
self.user = kwargs.pop("user")
149-
super().__init__(*args, **kwargs)
150-
151-
def clean_submissions(self):
152-
value = self.cleaned_data["submissions"]
153-
submission_ids = [int(submission) for submission in value.split(",")]
154-
return ApplicationSubmission.objects.filter(id__in=submission_ids)
155-
156-
157-
class BatchArchiveSubmissionForm(forms.Form):
158-
submissions = forms.CharField(
159-
widget=forms.HiddenInput(attrs={"class": "js-submissions-id"})
160-
)
161-
162-
def __init__(self, *args, round=None, **kwargs):
163-
self.user = kwargs.pop("user")
164-
super().__init__(*args, **kwargs)
165-
166-
def clean_submissions(self):
167-
value = self.cleaned_data["submissions"]
168-
submission_ids = [int(submission) for submission in value.split(",")]
169-
return ApplicationSubmission.objects.filter(id__in=submission_ids)
170-
171-
17290
class UpdateReviewersForm(ApplicationSubmissionModelForm):
17391
reviewer_reviewers = forms.ModelMultipleChoiceField(
17492
queryset=User.objects.reviewers().only("pk", "full_name"),

hypha/apply/funds/templates/funds/base_submissions_table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
{% block content %}
1111
{% block table %}
12-
{% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action use_batch_actions=True filter_classes="filters-open" can_export=can_export %}
12+
{% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action filter_classes="filters-open" can_export=can_export %}
1313

1414
{% render_table table %}
1515
{% endblock %}

hypha/apply/funds/templates/funds/includes/batch_archive_submission_form.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

hypha/apply/funds/templates/funds/includes/batch_delete_submission_form.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

hypha/apply/funds/templates/funds/includes/batch_progress_form.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

hypha/apply/funds/templates/funds/includes/batch_update_lead_form.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

hypha/apply/funds/templates/funds/includes/batch_update_reviewer_form.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)