{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applicat
{% for field in form %}
{% if field.field %}
{% if field.field.multi_input_field %}
- {% include "forms/includes/multi_input_field.html" with is_application=True %}
+ {% include "forms/includes/multi_input_field.html" %}
{% else %}
- {% include "forms/includes/field.html" with is_application=True %}
+ {% include "forms/includes/field.html" %}
{% endif %}
{% else %}
{% if field.group_number > 1 %}
diff --git a/hypha/apply/funds/templates/funds/application_preview.html b/hypha/apply/funds/templates/funds/application_preview.html
index 00c3006305..13cd3b19b6 100644
--- a/hypha/apply/funds/templates/funds/application_preview.html
+++ b/hypha/apply/funds/templates/funds/application_preview.html
@@ -20,9 +20,9 @@
{% for field in form %}
{% if field.field %}
{% if field.field.multi_input_field %}
- {% include "forms/includes/multi_input_field.html" with is_application=True %}
+ {% include "forms/includes/multi_input_field.html" %}
{% else %}
- {% include "forms/includes/field.html" with is_application=True %}
+ {% include "forms/includes/field.html" %}
{% endif %}
{% else %}
{{ field.block }}
@@ -46,4 +46,4 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/hypha/apply/funds/views.py b/hypha/apply/funds/views.py
index bad9fd84cc..8ae1dc2cec 100644
--- a/hypha/apply/funds/views.py
+++ b/hypha/apply/funds/views.py
@@ -63,7 +63,6 @@
)
from hypha.apply.projects.forms import ProjectCreateForm
from hypha.apply.review.models import Review
-from hypha.apply.stream_forms.blocks import GroupToggleBlock
from hypha.apply.todo.options import PROJECT_WAITING_PAF
from hypha.apply.todo.views import add_task_to_user
from hypha.apply.users.decorators import (
@@ -1575,9 +1574,6 @@ def get_form_class(self):
When trying to save as draft, this method will return a version of form
class that doesn't validate required fields while saving.
- The method also disables any group toggle fields in the form, as they
- are not supported on edit forms.
-
Returns:
class: The form class for the view.
"""
@@ -1585,14 +1581,6 @@ class that doesn't validate required fields while saving.
form_fields = self.object.get_form_fields(
draft=is_draft, form_data=self.object.raw_data, user=self.request.user
)
- field_blocks = self.object.get_defined_fields()
- for field_block in field_blocks:
- if (
- isinstance(field_block.block, GroupToggleBlock)
- and not self.object.is_draft
- ):
- # Disable group toggle field as it is not supported on edit forms.
- form_fields[field_block.id].disabled = True
return type(
"WagtailStreamForm", (self.object.submission_form_class,), form_fields
)
diff --git a/hypha/apply/templates/forms/includes/field.html b/hypha/apply/templates/forms/includes/field.html
index 2575e9cd4f..5499b864ac 100644
--- a/hypha/apply/templates/forms/includes/field.html
+++ b/hypha/apply/templates/forms/includes/field.html
@@ -1,13 +1,13 @@
{% load i18n util_tags nh3_tags markdown_tags heroicons %}
{% with widget_type=field|widget_type field_type=field|field_type %}
-
1 %}
+ {% if field.field.group_number > 1 %}
data-hidden="{% if not show_all_group_fields and not field.field.visible %}true{% else %}false{% endif %}"
data-required="{{ field.field.required_when_visible }}"
{% endif %}
diff --git a/hypha/apply/templates/forms/includes/multi_input_field.html b/hypha/apply/templates/forms/includes/multi_input_field.html
index ccf068a53e..49bb838ef2 100644
--- a/hypha/apply/templates/forms/includes/multi_input_field.html
+++ b/hypha/apply/templates/forms/includes/multi_input_field.html
@@ -1,7 +1,7 @@
{% load heroicons %}
1 %} data-hidden="{% if not show_all_group_fields %}true{% else %}false{% endif %}"{% endif %}
+ class="form__item{% if field.help_text %} form__group--wrap{% endif %}{% if field.errors %} form__error{% endif %}{% if not field.initial %} multi-input-field-hidden{% endif %}{% if field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}"
+ {% if field.field.group_number > 1 %} data-hidden="{% if not show_all_group_fields %}true{% else %}false{% endif %}"{% endif %}
data-multi-field-for="{{ field.field.multi_input_id }}"
>
{{ field }}
@@ -11,7 +11,7 @@
{% if field.field.multi_input_add_button %}