From 25ea168e18c09168fb7280414519137bbe202138 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Mon, 16 Dec 2024 20:58:07 +0100 Subject: [PATCH 01/10] Remove unused document-category.js. --- .../templates/application_projects/project_detail.html | 1 - hypha/static_src/javascript/document-category.js | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 hypha/static_src/javascript/document-category.js diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html index 84d8f2ce25..b62a513bc8 100644 --- a/hypha/apply/projects/templates/application_projects/project_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_detail.html @@ -239,7 +239,6 @@

{% trans "Add communication" %}

{% block extra_js %} - diff --git a/hypha/static_src/javascript/document-category.js b/hypha/static_src/javascript/document-category.js deleted file mode 100644 index 11b7fb6a79..0000000000 --- a/hypha/static_src/javascript/document-category.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Handle the category selection. - * @param {object} category - The category selected. - */ -// eslint-disable-next-line no-unused-vars -function handleCategory(category) { - document.getElementById("id_category").value = category; - document.getElementsByClassName("form__group id_category")[0].hidden = "true"; -} From e16e3826872e861c39d3d40b6163c2059a2b6014 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Mon, 16 Dec 2024 21:54:21 +0100 Subject: [PATCH 02/10] Replaced toggle-payment-block.js with alpine code. --- .../application_projects/includes/invoices.html | 7 ++++--- .../application_projects/project_detail.html | 1 - .../javascript/toggle-payment-block.js | 17 ----------------- hypha/templates/includes/messages.html | 2 +- 4 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 hypha/static_src/javascript/toggle-payment-block.js diff --git a/hypha/apply/projects/templates/application_projects/includes/invoices.html b/hypha/apply/projects/templates/application_projects/includes/invoices.html index 7600633b32..00f74d6301 100644 --- a/hypha/apply/projects/templates/application_projects/includes/invoices.html +++ b/hypha/apply/projects/templates/application_projects/includes/invoices.html @@ -11,7 +11,7 @@ {% endif %} -
+
{% if object.invoices.not_rejected %} @@ -33,10 +33,11 @@ {% if object.invoices.rejected %}

- {% trans "Show rejected" %} + {% trans "Show rejected" as showrejectedtext %}{% trans "Hide rejected" as hiderejectedtext %} + {{ showrejectedtext }}

-
+ diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html index b62a513bc8..eacdf6bb5b 100644 --- a/hypha/apply/projects/templates/application_projects/project_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_detail.html @@ -239,7 +239,6 @@

{% trans "Add communication" %}

{% block extra_js %} - \ No newline at end of file + diff --git a/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html b/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html index bf9b9054ae..ad9536e521 100644 --- a/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html +++ b/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html @@ -9,7 +9,6 @@ hx-post="{{ request.path }}" > {% csrf_token %} - {{ form.media }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/invoice_form.html b/hypha/apply/projects/templates/application_projects/invoice_form.html index a35d9af34f..392d083de6 100644 --- a/hypha/apply/projects/templates/application_projects/invoice_form.html +++ b/hypha/apply/projects/templates/application_projects/invoice_form.html @@ -33,7 +33,6 @@
{% csrf_token %} - {{ form.media }} {% for field in form %} {% if field.field %} diff --git a/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html b/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html index d2e3b0e017..34064c7790 100644 --- a/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html +++ b/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html @@ -43,7 +43,6 @@ > {% csrf_token %} - {{ form.media }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/project_approval_form.html b/hypha/apply/projects/templates/application_projects/project_approval_form.html index dc51ca3b3e..7f8661f430 100644 --- a/hypha/apply/projects/templates/application_projects/project_approval_form.html +++ b/hypha/apply/projects/templates/application_projects/project_approval_form.html @@ -19,7 +19,6 @@
{% csrf_token %} - {{ pf_form.media }} {% for field in pf_form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -69,7 +68,12 @@
{% trans "Proposal attachments" %}
{% endblock %} +{% block extra_css %} + {{ pf_form.media.css }} +{% endblock %} + {% block extra_js %} + {{ pf_form.media.js }} diff --git a/hypha/apply/projects/templates/application_projects/project_form.html b/hypha/apply/projects/templates/application_projects/project_form.html index 9544ef411a..55d71623e7 100644 --- a/hypha/apply/projects/templates/application_projects/project_form.html +++ b/hypha/apply/projects/templates/application_projects/project_form.html @@ -37,11 +37,3 @@
{% endblock %} - -{% block extra_css %} - {{ form.media.css }} -{% endblock %} - -{% block extra_js %} - {{ form.media.js }} -{% endblock %} diff --git a/hypha/apply/projects/templates/application_projects/report_form.html b/hypha/apply/projects/templates/application_projects/report_form.html index 9e387d08e6..197aa6d2e9 100644 --- a/hypha/apply/projects/templates/application_projects/report_form.html +++ b/hypha/apply/projects/templates/application_projects/report_form.html @@ -34,7 +34,6 @@ {% csrf_token %} - {{ form.media }} {% for field in form %} {% if field.field %} diff --git a/hypha/apply/review/templates/review/review_edit_form.html b/hypha/apply/review/templates/review/review_edit_form.html index 1e998360b5..41deebbc07 100644 --- a/hypha/apply/review/templates/review/review_edit_form.html +++ b/hypha/apply/review/templates/review/review_edit_form.html @@ -31,7 +31,6 @@ - {{ form.media }} {% csrf_token %} {% for hidden in form.hidden_fields %} diff --git a/hypha/apply/review/templates/review/review_form.html b/hypha/apply/review/templates/review/review_form.html index bb70ed5862..18bf5096a5 100644 --- a/hypha/apply/review/templates/review/review_form.html +++ b/hypha/apply/review/templates/review/review_form.html @@ -41,7 +41,6 @@ {% if not has_submitted_review %} - {{ form.media }} {% csrf_token %} {% for hidden in form.hidden_fields %} diff --git a/hypha/apply/users/templates/users/account.html b/hypha/apply/users/templates/users/account.html index eb51573dfe..e204858e54 100644 --- a/hypha/apply/users/templates/users/account.html +++ b/hypha/apply/users/templates/users/account.html @@ -99,3 +99,12 @@

Manage OAuth

{% endblock %} + +{% block extra_css %} + {{ swappable_form.media.css }} +{% endblock %} + +{% block extra_js %} + {{ swappable_form.media.js }} +{% endblock %} + diff --git a/hypha/apply/users/templates/wagtailusers/users/edit.html b/hypha/apply/users/templates/wagtailusers/users/edit.html index 365e700841..2974e108ac 100644 --- a/hypha/apply/users/templates/wagtailusers/users/edit.html +++ b/hypha/apply/users/templates/wagtailusers/users/edit.html @@ -109,10 +109,8 @@ {% block extra_css %} {{ block.super }} - {{ form.media.css }} {% endblock %} {% block extra_js %} {{ block.super }} {% include "wagtailadmin/pages/_editor_js.html" %} - {{ form.media.js }} {% endblock %} diff --git a/hypha/templates/base.html b/hypha/templates/base.html index a79725cfee..bf699e68f7 100644 --- a/hypha/templates/base.html +++ b/hypha/templates/base.html @@ -26,6 +26,7 @@ + {{ form.media.css }} {% block extra_css %}{% endblock %} @@ -60,10 +61,6 @@ - - - - {% include "includes/head_end.html" %} @@ -129,6 +126,11 @@ {% include "includes/_modal-placeholder.html" %} {% include "includes/_toast-placeholder.html" %} + + + + + {{ form.media.js }} {% block extra_js %}{% endblock %} {% block sentry_sdk %} From 8ce0c48236c2e1a27d727dc521070e16f64e0eee Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Mon, 16 Dec 2024 23:13:29 +0100 Subject: [PATCH 04/10] Merge application-form-links-new-window.js in to application-form.js. --- hypha/apply/funds/templates/funds/application_base.html | 1 - .../funds/templates/funds/applicationsubmission_form.html | 2 +- .../application_projects/project_approval_form.html | 1 - .../javascript/application-form-links-new-window.js | 8 -------- hypha/static_src/javascript/application-form.js | 7 +++++++ 5 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 hypha/static_src/javascript/application-form-links-new-window.js diff --git a/hypha/apply/funds/templates/funds/application_base.html b/hypha/apply/funds/templates/funds/application_base.html index 0baf2606c8..5f357c8d4f 100644 --- a/hypha/apply/funds/templates/funds/application_base.html +++ b/hypha/apply/funds/templates/funds/application_base.html @@ -89,7 +89,6 @@

{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applicat - {% if not show_all_group_fields %} {% endif %} diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_form.html b/hypha/apply/funds/templates/funds/applicationsubmission_form.html index 24d66a6c1b..ed5b5d7a21 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_form.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_form.html @@ -45,10 +45,10 @@ {% endblock %} {% block extra_js %} + - {% if not show_all_group_fields %} {% endif %} diff --git a/hypha/apply/projects/templates/application_projects/project_approval_form.html b/hypha/apply/projects/templates/application_projects/project_approval_form.html index 7f8661f430..c110d1731e 100644 --- a/hypha/apply/projects/templates/application_projects/project_approval_form.html +++ b/hypha/apply/projects/templates/application_projects/project_approval_form.html @@ -76,7 +76,6 @@

{% trans "Proposal attachments" %}
{{ pf_form.media.js }} - {% if not show_all_group_fields %} {% endif %} diff --git a/hypha/static_src/javascript/application-form-links-new-window.js b/hypha/static_src/javascript/application-form-links-new-window.js deleted file mode 100644 index 9bfb21fa9b..0000000000 --- a/hypha/static_src/javascript/application-form-links-new-window.js +++ /dev/null @@ -1,8 +0,0 @@ -(function () { - // Make links on application forms open in a new window/tab. - const links = document.querySelectorAll(".application-form a"); - links.forEach(function (link) { - link.setAttribute("target", "_blank"); - link.setAttribute("rel", "noopener noreferrer"); - }); -})(); diff --git a/hypha/static_src/javascript/application-form.js b/hypha/static_src/javascript/application-form.js index c0d71a45af..04be08912a 100644 --- a/hypha/static_src/javascript/application-form.js +++ b/hypha/static_src/javascript/application-form.js @@ -1,10 +1,17 @@ (function () { const form = document.querySelector(".application-form"); + const links = form.querySelectorAll("a"); const button = form.querySelector("[type=submit]"); const required = form.querySelectorAll("input[required]"); const groups = form.querySelectorAll(".form__group"); const errors = form.querySelectorAll(".form__error"); + // Make links on application forms open in a new window/tab. + links.forEach(function (link) { + link.setAttribute("target", "_blank"); + link.setAttribute("rel", "noopener noreferrer"); + }); + // Set aria-required attribute true for required fields. required.forEach(function (field) { field.setAttribute("aria-required", true); From 93dbd7c952cdbea93afa47acab548437fb8306e0 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Tue, 17 Dec 2024 08:40:08 +0100 Subject: [PATCH 05/10] Load comment_form.media on submission and project detail templates directly. --- .../activity/templates/activity/include/comment_form.html | 1 - .../funds/templates/funds/applicationsubmission_detail.html | 5 +++++ .../templates/application_projects/project_detail.html | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hypha/apply/activity/templates/activity/include/comment_form.html b/hypha/apply/activity/templates/activity/include/comment_form.html index 00b468ee93..e0dd8ed7ab 100644 --- a/hypha/apply/activity/templates/activity/include/comment_form.html +++ b/hypha/apply/activity/templates/activity/include/comment_form.html @@ -10,7 +10,6 @@ > {% csrf_token %} - {{ comment_form.media }} {% for hidden in comment_form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html index 4cf9598e22..d3054a814a 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html @@ -261,7 +261,12 @@

{% trans "Add communication" %}

{% endblock %} +{% block extra_css %} + {{ comment_form.media.css }} +{% endblock %} + {% block extra_js %} + {{ comment_form.media.js }} From e5591c4a35ef65f51c262cc5bcbd87548f19abd3 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Tue, 17 Dec 2024 08:41:51 +0100 Subject: [PATCH 06/10] Remove outdated block extras and move block extra css just above block extra js in templates. --- .../templates/dashboard/contracting_dashboard.html | 5 ----- .../dashboard/templates/dashboard/finance_dashboard.html | 5 ----- .../templates/dashboard/reviewer_dashboard.html | 8 ++++---- .../dashboard/templates/dashboard/staff_dashboard.html | 9 ++++----- .../funds/applicationsubmission_community_detail.html | 5 ----- .../funds/applicationsubmission_reviewer_detail.html | 5 ----- .../funds/templates/funds/base_submissions_table.html | 8 ++++---- .../funds/templates/funds/grouped_application_list.html | 8 ++++---- hypha/apply/funds/templates/funds/rounds.html | 9 +++------ .../templates/application_projects/invoice_list.html | 2 -- .../application_projects/project_approval_detail.html | 8 -------- 11 files changed, 19 insertions(+), 53 deletions(-) diff --git a/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html b/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html index acc94225e9..f425b3fd8b 100644 --- a/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html @@ -34,8 +34,3 @@

{% trans "PAFs for review" %}

{% endif %} {% endblock %} - -{% block extra_js %} - - -{% endblock %} diff --git a/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html b/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html index 411a14c179..ffd2854e5c 100644 --- a/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html @@ -100,8 +100,3 @@

{% trans "PAFs for review" %}

{% endblock %} - -{% block extra_js %} - {{ my_reviewed.filterset.form.media.js }} - -{% endblock %} diff --git a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html index 6de151c199..dd7b7ebcff 100644 --- a/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/reviewer_dashboard.html @@ -2,10 +2,6 @@ {% load render_table from django_tables2 %} {% load i18n static statusbar_tags workflow_tags %} -{% block extra_css %} - {{ filter.form.media.css }} -{% endblock %} - {% block title %}{% trans "Dashboard" %}{% endblock %} {% block content %} @@ -90,6 +86,10 @@

{% endblock %} +{% block extra_css %} + {{ filter.form.media.css }} +{% endblock %} + {% block extra_js %} {{ filter.form.media.js }} diff --git a/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html b/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html index c46645e7bc..a488465e23 100644 --- a/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/staff_dashboard.html @@ -2,10 +2,6 @@ {% load render_table from django_tables2 %} {% load i18n static nh3_tags markdown_tags heroicons %} -{% block extra_css %} - {{ my_reviewed.filterset.form.media.css }} -{% endblock %} - {% block title %}{% trans "Dashboard" %}{% endblock %} {% block content %} @@ -136,9 +132,12 @@

{{ review_heading }}

{% endblock %} +{% block extra_css %} + {{ my_reviewed.filterset.form.media.css }} +{% endblock %} + {% block extra_js %} {{ my_reviewed.filterset.form.media.js }} - {% endblock %} diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_community_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_community_detail.html index 6a2b67cbd2..413add3a1a 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_community_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_community_detail.html @@ -22,8 +22,3 @@
{% trans "Reviews & assignees" %}
{% block related %} {% endblock %} - -{% block extra_js %} - {{ reviewer_form.media.js }} - {{ block.super }} -{% endblock %} diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_reviewer_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_reviewer_detail.html index e4a7d60b7d..3bc8795e13 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_reviewer_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_reviewer_detail.html @@ -29,8 +29,3 @@
{% trans "Reviews & assignees" %}
{% block related %} {% endblock %} - -{% block extra_js %} - {{ reviewer_form.media.js }} - {{ block.super }} -{% endblock %} diff --git a/hypha/apply/funds/templates/funds/base_submissions_table.html b/hypha/apply/funds/templates/funds/base_submissions_table.html index b8f4148611..a14d32980e 100644 --- a/hypha/apply/funds/templates/funds/base_submissions_table.html +++ b/hypha/apply/funds/templates/funds/base_submissions_table.html @@ -2,10 +2,6 @@ {% load static %} {% load render_table from django_tables2 %} -{% block extra_css %} - {{ filter.form.media.css }} -{% endblock %} - {% block content %} {% block table %} {% 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 %} @@ -14,6 +10,10 @@ {% endblock %} {% endblock %} +{% block extra_css %} + {{ filter.form.media.css }} +{% endblock %} + {% block extra_js %} {{ filter.form.media.js }} diff --git a/hypha/apply/funds/templates/funds/grouped_application_list.html b/hypha/apply/funds/templates/funds/grouped_application_list.html index 0a6a68af5f..3ae34da1ef 100644 --- a/hypha/apply/funds/templates/funds/grouped_application_list.html +++ b/hypha/apply/funds/templates/funds/grouped_application_list.html @@ -1,10 +1,6 @@ {% extends "base-apply.html" %} {% load i18n static %} -{% block extra_css %} - {{ filter.form.media.css }} -{% endblock %} - {% block content %} {% adminbar %} @@ -14,6 +10,10 @@
{% endblock %} +{% block extra_css %} + {{ filter.form.media.css }} +{% endblock %} + {% block extra_js %} {{ filter.form.media.js }} diff --git a/hypha/apply/funds/templates/funds/rounds.html b/hypha/apply/funds/templates/funds/rounds.html index df26379bb6..12eab4d8bb 100644 --- a/hypha/apply/funds/templates/funds/rounds.html +++ b/hypha/apply/funds/templates/funds/rounds.html @@ -4,13 +4,7 @@ {% block title %}{% trans "Rounds" %}{% endblock %} -{% block extra_css %} - {{ filter.form.media.css }} -{% endblock %} - - {% block content %} - {% adminbar %} {% slot header %}{% trans "Rounds" %}{% endslot %} {% slot sub_heading %}{% trans "Explore current and past rounds" %}{% endslot %} @@ -20,7 +14,10 @@ {% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term can_export=can_export %} {% render_table table %} +{% endblock %} +{% block extra_css %} + {{ filter.form.media.css }} {% endblock %} {% block extra_js %} diff --git a/hypha/apply/projects/templates/application_projects/invoice_list.html b/hypha/apply/projects/templates/application_projects/invoice_list.html index db86b8796f..12e6985c6c 100644 --- a/hypha/apply/projects/templates/application_projects/invoice_list.html +++ b/hypha/apply/projects/templates/application_projects/invoice_list.html @@ -6,7 +6,6 @@ {% block title %}{% trans "Invoices" %}{% endblock %} {% block content %} - {% adminbar %} {% slot header %}{% trans "All Invoices" %} ({{ table.rows|length }}){% endslot %} {% slot sub_heading %}{% trans "View, search and filter all project invoices" %}{% endslot %} @@ -28,7 +27,6 @@

{% trans "No Invoices available" %}

{% endif %} - {% endblock content %} {% block extra_css %} diff --git a/hypha/apply/projects/templates/application_projects/project_approval_detail.html b/hypha/apply/projects/templates/application_projects/project_approval_detail.html index 08d6cc5ffd..a1cb82f3ed 100644 --- a/hypha/apply/projects/templates/application_projects/project_approval_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_approval_detail.html @@ -3,10 +3,6 @@ {% block title %}{{ object.title }}{% endblock %} -{% block extra_css %} - {{ reviewer_form.media.css }} -{% endblock %} - {% block content %} {% adminbar %} {% slot back_link %} @@ -150,7 +146,3 @@
{% trans "Actions to take" %}
{% endblock content %} - -{% block extra_js %} - {{ block.super }} -{% endblock %} From 701e6ca726623fb2e3d82f80d10a3707ab64895b Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Fri, 20 Dec 2024 09:19:38 +0100 Subject: [PATCH 07/10] Clean up sow form js and css loading. --- .../templates/application_projects/project_sow_form.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hypha/apply/projects/templates/application_projects/project_sow_form.html b/hypha/apply/projects/templates/application_projects/project_sow_form.html index 72ad6b9f4e..72047ba5e4 100644 --- a/hypha/apply/projects/templates/application_projects/project_sow_form.html +++ b/hypha/apply/projects/templates/application_projects/project_sow_form.html @@ -18,7 +18,6 @@
{% csrf_token %} - {{ sow_form.media }} {% for field in sow_form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -65,11 +64,14 @@
{% trans "Proposal attachments" %}
{% endblock %} +{% block extra_css %} + {{ sow_form.media.css }} +{% endblock %} + {% block extra_js %} - + {{ sow_form.media.js }} - {% if not show_all_group_fields %} {% endif %} From 06d02ec0abf6c0def63d7f27f5c5864b1d119676 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Fri, 20 Dec 2024 09:39:30 +0100 Subject: [PATCH 08/10] Make sure to initiate any file upload forms. --- .../funds/templates/funds/includes/delegated_form_base.html | 5 +++-- .../funds/templates/funds/includes/dialog_form_base.html | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hypha/apply/funds/templates/funds/includes/delegated_form_base.html b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html index 107f14f820..881b0a404d 100644 --- a/hypha/apply/funds/templates/funds/includes/delegated_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html @@ -1,4 +1,4 @@ -{% load i18n %} +{% load i18n static %}
- + + diff --git a/hypha/apply/funds/templates/funds/includes/dialog_form_base.html b/hypha/apply/funds/templates/funds/includes/dialog_form_base.html index a39eebdf10..b5d073d373 100644 --- a/hypha/apply/funds/templates/funds/includes/dialog_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/dialog_form_base.html @@ -1,4 +1,4 @@ -{% load i18n %} +{% load i18n static %}
{% trans "Cancel" %} + + From 64f0592704fc9641701446ff2a79c3ac5ebb2ead Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 21 Dec 2024 19:53:14 +0100 Subject: [PATCH 09/10] Rethink how form.media.js is loaded. --- .../templates/determinations/base_determination_form.html | 1 + hypha/apply/funds/templates/funds/application_base.html | 2 +- .../funds/templates/funds/applicationsubmission_form.html | 2 +- .../funds/templates/funds/includes/delegated_form_base.html | 6 ++---- .../funds/templates/funds/includes/dialog_form_base.html | 6 ++---- .../funds/includes/translate_application_form.html | 1 + .../templates/funds/includes/update_reviewer_form.html | 1 + .../templates/application_projects/invoice_form.html | 5 ++++- .../modals/report_frequency_config.html | 2 +- .../templates/application_projects/project_form.html | 5 ++++- .../templates/application_projects/report_form.html | 2 +- hypha/apply/review/templates/review/review_edit_form.html | 2 +- hypha/apply/review/templates/review/review_form.html | 2 +- hypha/apply/users/templates/wagtailusers/users/edit.html | 2 ++ hypha/templates/base.html | 2 +- 15 files changed, 24 insertions(+), 17 deletions(-) diff --git a/hypha/apply/determinations/templates/determinations/base_determination_form.html b/hypha/apply/determinations/templates/determinations/base_determination_form.html index 9c30976016..95b811cc3d 100644 --- a/hypha/apply/determinations/templates/determinations/base_determination_form.html +++ b/hypha/apply/determinations/templates/determinations/base_determination_form.html @@ -86,6 +86,7 @@

{{ value }}

{% endblock %} {% block extra_js %} + {{ form.media.js }} {{ field_blocks_ids|json_script:"block-ids" }} {% endblock %} diff --git a/hypha/apply/funds/templates/funds/application_base.html b/hypha/apply/funds/templates/funds/application_base.html index 5f357c8d4f..3459ef23db 100644 --- a/hypha/apply/funds/templates/funds/application_base.html +++ b/hypha/apply/funds/templates/funds/application_base.html @@ -40,7 +40,6 @@

{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applicat {% endif %}
{% csrf_token %} - {% for field in form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -86,6 +85,7 @@

{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applicat {% endblock %} {% block extra_js %} + {{ form.media.js }} diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_form.html b/hypha/apply/funds/templates/funds/applicationsubmission_form.html index ed5b5d7a21..645d4940b7 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_form.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_form.html @@ -14,7 +14,6 @@
{% csrf_token %} - {% for field in form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -45,6 +44,7 @@ {% endblock %} {% block extra_js %} + {{ form.media.js }} diff --git a/hypha/apply/funds/templates/funds/includes/delegated_form_base.html b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html index 881b0a404d..55a147953f 100644 --- a/hypha/apply/funds/templates/funds/includes/delegated_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html @@ -1,4 +1,4 @@ -{% load i18n static %} +{% load i18n %} {% csrf_token %} - + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -42,5 +42,3 @@
- - diff --git a/hypha/apply/funds/templates/funds/includes/dialog_form_base.html b/hypha/apply/funds/templates/funds/includes/dialog_form_base.html index b5d073d373..a4b496bb39 100644 --- a/hypha/apply/funds/templates/funds/includes/dialog_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/dialog_form_base.html @@ -1,4 +1,4 @@ -{% load i18n static %} +{% load i18n %}
{% csrf_token %} - + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -40,5 +40,3 @@ >{% trans "Cancel" %} - - diff --git a/hypha/apply/funds/templates/funds/includes/translate_application_form.html b/hypha/apply/funds/templates/funds/includes/translate_application_form.html index f7552c8180..b5c9d7cb2f 100644 --- a/hypha/apply/funds/templates/funds/includes/translate_application_form.html +++ b/hypha/apply/funds/templates/funds/includes/translate_application_form.html @@ -8,6 +8,7 @@ hx-post="{{ request.path }}" > {% csrf_token %} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html b/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html index ad9536e521..b7e3ea256c 100644 --- a/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html +++ b/hypha/apply/funds/templates/funds/includes/update_reviewer_form.html @@ -9,6 +9,7 @@ hx-post="{{ request.path }}" > {% csrf_token %} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/invoice_form.html b/hypha/apply/projects/templates/application_projects/invoice_form.html index 392d083de6..7e9f299d45 100644 --- a/hypha/apply/projects/templates/application_projects/invoice_form.html +++ b/hypha/apply/projects/templates/application_projects/invoice_form.html @@ -33,7 +33,6 @@
{% csrf_token %} - {% for field in form %} {% if field.field %} {% include "forms/includes/field.html" %} @@ -48,3 +47,7 @@
{% endblock %} + +{% block extra_js %} + {{ form.media.js }} +{% endblock %} diff --git a/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html b/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html index 34064c7790..d571a8f793 100644 --- a/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html +++ b/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html @@ -42,7 +42,7 @@ enctype="multipart/form-data" > {% csrf_token %} - + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/project_form.html b/hypha/apply/projects/templates/application_projects/project_form.html index 55d71623e7..338932cbcb 100644 --- a/hypha/apply/projects/templates/application_projects/project_form.html +++ b/hypha/apply/projects/templates/application_projects/project_form.html @@ -16,7 +16,6 @@
{% csrf_token %} - {% for field in form %} {% if field.field %} {% include "forms/includes/field.html" %} @@ -37,3 +36,7 @@
{% endblock %} + +{% block extra_js %} + {{ form.media.js }} +{% endblock %} diff --git a/hypha/apply/projects/templates/application_projects/report_form.html b/hypha/apply/projects/templates/application_projects/report_form.html index 197aa6d2e9..c350b2837d 100644 --- a/hypha/apply/projects/templates/application_projects/report_form.html +++ b/hypha/apply/projects/templates/application_projects/report_form.html @@ -34,7 +34,6 @@ {% csrf_token %} - {% for field in form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -77,5 +76,6 @@ {% endblock %} {% block extra_js %} + {{ form.media.js }} {% endblock %} diff --git a/hypha/apply/review/templates/review/review_edit_form.html b/hypha/apply/review/templates/review/review_edit_form.html index 41deebbc07..c287fe968b 100644 --- a/hypha/apply/review/templates/review/review_edit_form.html +++ b/hypha/apply/review/templates/review/review_edit_form.html @@ -32,7 +32,6 @@ {% csrf_token %} - {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -81,5 +80,6 @@

{{ value }}

{% endblock %} {% block extra_js %} + {{ form.media.js }} {% endblock %} diff --git a/hypha/apply/review/templates/review/review_form.html b/hypha/apply/review/templates/review/review_form.html index 18bf5096a5..4c253a516d 100644 --- a/hypha/apply/review/templates/review/review_form.html +++ b/hypha/apply/review/templates/review/review_form.html @@ -42,7 +42,6 @@ {% if not has_submitted_review %} {% csrf_token %} - {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -102,5 +101,6 @@

{{ value }}

{% endblock %} {% block extra_js %} + {{ form.media.js }} {% endblock %} diff --git a/hypha/apply/users/templates/wagtailusers/users/edit.html b/hypha/apply/users/templates/wagtailusers/users/edit.html index 2974e108ac..5a1aa4547b 100644 --- a/hypha/apply/users/templates/wagtailusers/users/edit.html +++ b/hypha/apply/users/templates/wagtailusers/users/edit.html @@ -110,7 +110,9 @@ {{ block.super }} {% endblock %} + {% block extra_js %} {{ block.super }} {% include "wagtailadmin/pages/_editor_js.html" %} + {{ form.media.js }} {% endblock %} diff --git a/hypha/templates/base.html b/hypha/templates/base.html index bf699e68f7..88f40f414b 100644 --- a/hypha/templates/base.html +++ b/hypha/templates/base.html @@ -26,6 +26,7 @@ + {{ form.media.css }} {% block extra_css %}{% endblock %} @@ -130,7 +131,6 @@ - {{ form.media.js }} {% block extra_js %}{% endblock %} {% block sentry_sdk %} From b0d30ac20a5de1b99522dd9dd78637cb4f152845 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Tue, 7 Jan 2025 09:47:07 +0100 Subject: [PATCH 10/10] Fix after rebase regarding. --- hypha/apply/users/templates/users/account.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hypha/apply/users/templates/users/account.html b/hypha/apply/users/templates/users/account.html index e204858e54..eb51573dfe 100644 --- a/hypha/apply/users/templates/users/account.html +++ b/hypha/apply/users/templates/users/account.html @@ -99,12 +99,3 @@

Manage OAuth

{% endblock %} - -{% block extra_css %} - {{ swappable_form.media.css }} -{% endblock %} - -{% block extra_js %} - {{ swappable_form.media.js }} -{% endblock %} -
{% trans "Date submitted" %}