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/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/determinations/templates/determinations/base_determination_form.html b/hypha/apply/determinations/templates/determinations/base_determination_form.html index 7c3f474456..95b811cc3d 100644 --- a/hypha/apply/determinations/templates/determinations/base_determination_form.html +++ b/hypha/apply/determinations/templates/determinations/base_determination_form.html @@ -30,7 +30,6 @@ action="" method="post" x-data="{ isFormSubmitting: false }" x-on:submit="isFormSubmitting = true"> - {{ form.media }} {% csrf_token %} {% for hidden in form.hidden_fields %} {{ hidden }} @@ -87,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 4bc5f57ed8..3459ef23db 100644 --- a/hypha/apply/funds/templates/funds/application_base.html +++ b/hypha/apply/funds/templates/funds/application_base.html @@ -39,9 +39,7 @@

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

{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applicat {% endblock %} {% block extra_js %} + {{ form.media.js }} - {% if not show_all_group_fields %} {% endif %} 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_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 }} - {% if not show_all_group_fields %} {% endif %} 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/includes/delegated_form_base.html b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html index 33e1c82a04..55a147953f 100644 --- a/hypha/apply/funds/templates/funds/includes/delegated_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/delegated_form_base.html @@ -7,8 +7,7 @@ {% if action %}action="{{ action }}"{% endif %} > {% csrf_token %} - - {{ form.media }} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -42,5 +41,4 @@ {{ value }} -
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 f4c8febfd8..a4b496bb39 100644 --- a/hypha/apply/funds/templates/funds/includes/dialog_form_base.html +++ b/hypha/apply/funds/templates/funds/includes/dialog_form_base.html @@ -10,8 +10,7 @@ enctype="multipart/form-data" > {% csrf_token %} - - {{ form.media }} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} 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 3fd06117a3..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,7 +8,7 @@ hx-post="{{ request.path }}" > {% csrf_token %} - {{ form.media }} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -122,4 +122,4 @@ showClearBtn(true); } }) - \ 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..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,7 +9,7 @@ hx-post="{{ request.path }}" > {% csrf_token %} - {{ form.media }} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} 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/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/invoice_form.html b/hypha/apply/projects/templates/application_projects/invoice_form.html index a35d9af34f..7e9f299d45 100644 --- a/hypha/apply/projects/templates/application_projects/invoice_form.html +++ b/hypha/apply/projects/templates/application_projects/invoice_form.html @@ -33,8 +33,6 @@
{% csrf_token %} - {{ form.media }} - {% for field in form %} {% if field.field %} {% include "forms/includes/field.html" %} @@ -49,3 +47,7 @@
{% endblock %} + +{% block extra_js %} + {{ form.media.js }} +{% endblock %} 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/modals/report_frequency_config.html b/hypha/apply/projects/templates/application_projects/modals/report_frequency_config.html index d2e3b0e017..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,8 +42,7 @@ enctype="multipart/form-data" > {% csrf_token %} - - {{ form.media }} + {{ form.media.js }} {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} 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 %} 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..c110d1731e 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,10 +68,14 @@
{% trans "Proposal attachments" %}
{% endblock %} +{% block extra_css %} + {{ pf_form.media.css }} +{% endblock %} + {% block extra_js %} + {{ pf_form.media.js }} - {% if not show_all_group_fields %} {% endif %} diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html index 84d8f2ce25..cda89d9753 100644 --- a/hypha/apply/projects/templates/application_projects/project_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_detail.html @@ -237,10 +237,13 @@

{% trans "Add communication" %}

{% endblock content %} +{% block extra_css %} + {{ comment_form.media.css }} +{% endblock %} + {% block extra_js %} + {{ comment_form.media.js }} - - + {{ sow_form.media.js }} - {% if not show_all_group_fields %} {% endif %} diff --git a/hypha/apply/projects/templates/application_projects/report_form.html b/hypha/apply/projects/templates/application_projects/report_form.html index 9e387d08e6..c350b2837d 100644 --- a/hypha/apply/projects/templates/application_projects/report_form.html +++ b/hypha/apply/projects/templates/application_projects/report_form.html @@ -34,8 +34,6 @@ {% csrf_token %} - {{ form.media }} - {% for field in form %} {% if field.field %} {% if field.field.multi_input_field %} @@ -78,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 1e998360b5..c287fe968b 100644 --- a/hypha/apply/review/templates/review/review_edit_form.html +++ b/hypha/apply/review/templates/review/review_edit_form.html @@ -31,9 +31,7 @@
- {{ form.media }} {% csrf_token %} - {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -82,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 bb70ed5862..4c253a516d 100644 --- a/hypha/apply/review/templates/review/review_form.html +++ b/hypha/apply/review/templates/review/review_form.html @@ -41,9 +41,7 @@ {% if not has_submitted_review %} - {{ form.media }} {% csrf_token %} - {% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} @@ -103,5 +101,6 @@

{{ value }}

{% endblock %} {% block extra_js %} + {{ form.media.js }} {% endblock %} diff --git a/hypha/apply/users/templates/users/account.html b/hypha/apply/users/templates/users/account.html index e868edc222..702375137a 100644 --- a/hypha/apply/users/templates/users/account.html +++ b/hypha/apply/users/templates/users/account.html @@ -91,7 +91,6 @@

{% trans "Two-Factor Authentication (2FA)" %}

{% if swappable_form %}

{% trans "Become" %}:

- {{ swappable_form.media }} {% csrf_token %} {% for field in swappable_form %} {% include "forms/includes/field.html" %} @@ -113,3 +112,12 @@

{% trans "Become" %}:

{% endif %} {% 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..5a1aa4547b 100644 --- a/hypha/apply/users/templates/wagtailusers/users/edit.html +++ b/hypha/apply/users/templates/wagtailusers/users/edit.html @@ -109,8 +109,8 @@ {% block extra_css %} {{ block.super }} - {{ form.media.css }} {% endblock %} + {% block extra_js %} {{ block.super }} {% include "wagtailadmin/pages/_editor_js.html" %} 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); 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"; -} diff --git a/hypha/static_src/javascript/toggle-payment-block.js b/hypha/static_src/javascript/toggle-payment-block.js deleted file mode 100644 index 4e881bbb86..0000000000 --- a/hypha/static_src/javascript/toggle-payment-block.js +++ /dev/null @@ -1,17 +0,0 @@ -(function ($) { - /** - * Toggle payment block - */ - function togglePaymentBlock() { - $(".js-payment-block-rejected-link").click(function (e) { - e.preventDefault(); - - this.innerHTML = - this.innerHTML === "Show rejected" ? "Hide rejected" : "Show rejected"; - - $(".js-payment-block-rejected-table").toggleClass("is-hidden"); - }); - } - - togglePaymentBlock(); -})(jQuery); diff --git a/hypha/templates/base.html b/hypha/templates/base.html index 2c65790383..5adc66e7ea 100644 --- a/hypha/templates/base.html +++ b/hypha/templates/base.html @@ -26,6 +26,8 @@ + + {{ form.media.css }} {% block extra_css %}{% endblock %} @@ -60,10 +62,6 @@ - - - - {% include "includes/head_end.html" %} @@ -125,6 +123,10 @@ {% include "includes/_modal-placeholder.html" %} {% include "includes/_toast-placeholder.html" %} + + + + {% block extra_js %}{% endblock %} {% block sentry_sdk %} diff --git a/hypha/templates/includes/messages.html b/hypha/templates/includes/messages.html index 215580d0d6..3efbe4b3c0 100644 --- a/hypha/templates/includes/messages.html +++ b/hypha/templates/includes/messages.html @@ -9,7 +9,7 @@ > {% heroicon_outline "check" stroke_width=2 class="inline-block me-1 w-4 h-4" aria_hidden=true %}

{{ message }}

-
{% trans "Date submitted" %}