diff --git a/.eslintrc.js b/.eslintrc.js index 143db2401a0f5b17cabd500a8874b22f086d7260..6731d86136e327a5bd9e2a773c057b9419502f3b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,9 +7,9 @@ module.exports = { }, "extends": "eslint:recommended", "globals": { - "$": "readonly", "$$": "readonly", "django": "readonly", + "bootstrap": "readonly", "FullCalendar": "readonly", "Datepicker": "readonly" } diff --git a/castellum/contacts/static/js/availability.js b/castellum/contacts/static/js/availability.js index 4824dcd0c41d802e521e213bc401287c64f6da44..d959208dc96cc772be9558bc5044805440e83dd4 100644 --- a/castellum/contacts/static/js/availability.js +++ b/castellum/contacts/static/js/availability.js @@ -30,7 +30,7 @@ availability.querySelectorAll('select').forEach(function(select) { var label = document.createElement('label'); label.className = 'd-block mb-0'; - label.innerHTML = '' + + label.innerHTML = '' + ''; label.querySelector('span').textContent = django.gettext('All day'); select.before(label); @@ -43,7 +43,7 @@ $$.on(availability, 'change', 'select', function() { // hours --> day - var wholeDay = this.closest('.form-group').querySelector('[data-js="toggle-day"]'); + var wholeDay = this.closest('.col-6').querySelector('[data-js="toggle-day"]'); setCheckbox(this, wholeDay); // hours --> week @@ -52,7 +52,7 @@ $$.on(availability, 'change', '[data-js="toggle-day"]', function() { // day --> hours - var select = this.closest('.form-group').querySelector('select'); + var select = this.closest('.col-6').querySelector('select'); select.querySelectorAll('option').forEach(option => { option.selected = this.checked; }); @@ -76,7 +76,7 @@ // set initial state of day checkboxes document.querySelectorAll('[data-js="toggle-day"]').forEach(function(wholeDay) { - var select = wholeDay.closest('.form-group').querySelector('select'); + var select = wholeDay.closest('.col-6').querySelector('select'); setCheckbox(select, wholeDay); }); diff --git a/castellum/contacts/templates/contacts/__contact_form_self.html b/castellum/contacts/templates/contacts/__contact_form_self.html index 529aca97dd799fb0d4b7e4bfcf756e22086dcf90..c343cfd024b2793407c4aed376f0b35725e2256f 100644 --- a/castellum/contacts/templates/contacts/__contact_form_self.html +++ b/castellum/contacts/templates/contacts/__contact_form_self.html @@ -1,7 +1,7 @@ -{% load bootstrap4 %} +{% load bootstrap5 %} {% bootstrap_field form.email %} -
+
{% bootstrap_field form.phone_number %}
@@ -9,7 +9,7 @@ {% bootstrap_field form.phone_number_alternative %}
-
+
{% bootstrap_field form.address.street %}
@@ -17,7 +17,7 @@ {% bootstrap_field form.address.house_number %}
-
+
{% bootstrap_field form.address.zip_code %}
diff --git a/castellum/contacts/templates/contacts/__contact_form_top.html b/castellum/contacts/templates/contacts/__contact_form_top.html index 3224c1ba3d0871a3aa378fad26a53393d39abd4c..ea0e6150deb0e41d36c28997276f57fc6dcbd18f 100644 --- a/castellum/contacts/templates/contacts/__contact_form_top.html +++ b/castellum/contacts/templates/contacts/__contact_form_top.html @@ -1,6 +1,6 @@ -{% load bootstrap4 %} +{% load bootstrap5 %} -
+
{% bootstrap_field form.title %}
diff --git a/castellum/contacts/templates/contacts/contact_form.html b/castellum/contacts/templates/contacts/contact_form.html index 5971fcf355fecb5fe8d9a75db2d5090492a0b2f5..713db468c9bcdc83817e9d3a1af0086f520d228e 100644 --- a/castellum/contacts/templates/contacts/contact_form.html +++ b/castellum/contacts/templates/contacts/contact_form.html @@ -1,5 +1,5 @@ {% extends base_template|default:"subjects/base.html" %} -{% load static i18n bootstrap4 %} +{% load static i18n bootstrap5 %} {% block title %} {% if object %} diff --git a/castellum/execution/templates/execution/participation_appointments.html b/castellum/execution/templates/execution/participation_appointments.html index a28766e14656f341cf6e4fe0bcdd8cd2c3b40989..055b46bb25bcc64ad0896e6dae55a33174e45aa3 100644 --- a/castellum/execution/templates/execution/participation_appointments.html +++ b/castellum/execution/templates/execution/participation_appointments.html @@ -1,5 +1,5 @@ {% extends "execution/participation_base.html" %} -{% load i18n auth bootstrap4 utils %} +{% load i18n auth bootstrap5 utils %} {% block content %}
@@ -9,10 +9,10 @@ {% if appointment %}
-
+ {% csrf_token %} - {% bootstrap_field form.show_up show_label=False %} - + {% bootstrap_field form.show_up show_label=False form_group_class='me-2' %} +
{% else %} diff --git a/castellum/execution/templates/execution/participation_appointments_form.html b/castellum/execution/templates/execution/participation_appointments_form.html index f18546e07441015bb7ac90376f358fd0f73b2e6a..2672e43eafc59f8faac155d67ad268fa16616f31 100644 --- a/castellum/execution/templates/execution/participation_appointments_form.html +++ b/castellum/execution/templates/execution/participation_appointments_form.html @@ -1,5 +1,5 @@ {% extends "execution/participation_base.html" %} -{% load i18n static bootstrap4 utils %} +{% load i18n static bootstrap5 utils %} {% block content %} {% if study.session_instructions %} @@ -23,7 +23,7 @@
{% for entry in form.appointments %} -
+
{% bootstrap_field entry.field form_group_class="" %} {% if entry.invitation_url == 'not-invited' %}

diff --git a/castellum/execution/templates/execution/participation_news.html b/castellum/execution/templates/execution/participation_news.html index b1cd24bde8c0217d7ad46c067bfaf0b0ee5c6760..e67d1b1117b82e906238f3090bceb29ebeb37248 100644 --- a/castellum/execution/templates/execution/participation_news.html +++ b/castellum/execution/templates/execution/participation_news.html @@ -1,5 +1,5 @@ {% extends "execution/participation_base.html" %} -{% load i18n bootstrap4 %} +{% load i18n bootstrap5 %} {% block content %}

diff --git a/castellum/execution/templates/execution/study_detail.html b/castellum/execution/templates/execution/study_detail.html index 547633aa4c78b4e8351aa362aa7d1e40a22939de..1ff5ff0c26b3544560bb54e16d81275c6daa2b6c 100644 --- a/castellum/execution/templates/execution/study_detail.html +++ b/castellum/execution/templates/execution/study_detail.html @@ -6,19 +6,19 @@ {% for participation, can_access in list %}
  • {% if can_access %} -
    +
    {{ participation.subject.contact.full_name }} {% if session_count > 0 %} - + {{ participation.appointment_count }}/{{ session_count }} {% endif %} {% if participation.appointment_today %} - {% translate 'today' %} + {% translate 'today' %} {% endif %} {% if participation.subject.blocked %} - {{ participation.subject|verbose_name:'blocked' }} + {{ participation.subject|verbose_name:'blocked' }} {% endif %} {% with summary=participation.subject|showup_summary %} @@ -29,7 +29,7 @@
    {% else %}
    -
    +
    {% translate 'access denied' %}
    diff --git a/castellum/execution/templates/execution/study_news_mail.html b/castellum/execution/templates/execution/study_news_mail.html index 877890c4b9f82918ecd3a868fdb42174b5efdf53..f47f1a6ed54425e3775b28149766190c6fa7df47 100644 --- a/castellum/execution/templates/execution/study_news_mail.html +++ b/castellum/execution/templates/execution/study_news_mail.html @@ -1,5 +1,5 @@ {% extends "execution/study_base.html" %} -{% load i18n bootstrap4 humanize utils %} +{% load i18n bootstrap5 humanize utils %} {% block content %}

    {% translate 'This form allows you to send a message to all subjects who indicated interest in study news. You cannot attach a document to the email, but you can include a link.' %}

    diff --git a/castellum/execution/templates/execution/study_resolve.html b/castellum/execution/templates/execution/study_resolve.html index d39ac547ba2f0956ffab3d71cb38c74a0dafae44..2a4ecc3e880aeaeb72b1bb5e95153051840c4460 100644 --- a/castellum/execution/templates/execution/study_resolve.html +++ b/castellum/execution/templates/execution/study_resolve.html @@ -1,5 +1,5 @@ {% extends "execution/study_base.html" %} -{% load i18n bootstrap4 %} +{% load i18n bootstrap5 %} {% block content %} diff --git a/castellum/recruitment/static/js/contact.js b/castellum/recruitment/static/js/contact.js index 6ab78d13e1571e2122ba8e0152cab83741ed40b8..b3f6d0fed28d922119378351fd6748ff114078ef 100644 --- a/castellum/recruitment/static/js/contact.js +++ b/castellum/recruitment/static/js/contact.js @@ -2,7 +2,7 @@ var setVisibility = function() { var status = document.querySelector('[name="status"]'); var followupInput = document.querySelector('[name="followup_date"]'); - var followup = followupInput.closest('.form-row'); + var followup = followupInput.closest('.row.g-3'); if (status.value === '4') { followup.hidden = false; @@ -38,6 +38,8 @@ }); if (document.querySelector('#appointments .is-invalid')) { - $('#appointments-tab').tab('show'); + var el = document.querySelector('#appointments-tab'); + var tab = new bootstrap.Tab(el); + tab.show(); } })(); diff --git a/castellum/recruitment/static/js/filters.js b/castellum/recruitment/static/js/filters.js index f1082e2581c544297383800153249ec84db4174d..d916e2a9f693e7efefe9482a6e2aaf569f55c45b 100644 --- a/castellum/recruitment/static/js/filters.js +++ b/castellum/recruitment/static/js/filters.js @@ -7,7 +7,7 @@ var template = document.getElementById('template-' + pk); if (template) { var formrow = document.createElement('div'); - formrow.className = 'form-row mb-3'; + formrow.className = 'row g-3 mb-3'; formrow.innerHTML = template.innerHTML.replace(/{prefix}/g, 'form-' + totalForms.value); container.append(formrow); totalForms.value = parseInt(totalForms.value, 10) + 1; @@ -16,7 +16,7 @@ }); $$.on(document, 'click', '[data-js="filter-delete"]', function() { - var formrow = this.closest('.form-row'); + var formrow = this.closest('.row.g-3'); var index = Array.prototype.indexOf.call(formrow.parentElement.children, formrow); formrow.querySelector('[name^="form-' + index + '-value"]').remove(); diff --git a/castellum/recruitment/templates/recruitment/__recruitment_list.html b/castellum/recruitment/templates/recruitment/__recruitment_list.html index 494d77137d5933e7c1e4c4154e3afebf133b817f..f088b92a14dde4ce1e50c880a22edbe7bec5c17c 100644 --- a/castellum/recruitment/templates/recruitment/__recruitment_list.html +++ b/castellum/recruitment/templates/recruitment/__recruitment_list.html @@ -7,13 +7,13 @@ {% if participation.status == participation.FOLLOWUP_APPOINTED %}
    - + {% for desc, bucket in buckets %} -
    {{ bucket }}
    +
    {{ bucket }}
    {% endfor %} -
    {{ participation|display:'status' }}
    +
    {{ participation|display:'status' }}
    -
    +
    {% if participation.followup_date|is_today %} {% if participation.followup_time %} @@ -42,15 +42,15 @@ {% elif participation.status_open and participation.last_contacted_elsewhere.date > last_agreeable_contact_time %}
    - + {% for desc, bucket in buckets %} -
    {{ bucket }}
    +
    {{ bucket }}
    {% endfor %} {% if participation.status != participation.NOT_CONTACTED %} -
    {{ participation|display:'status' }}
    +
    {{ participation|display:'status' }}
    {% endif %}
    -
    +
    {% translate 'recently contacted in another recruitment' %}
    @@ -58,13 +58,13 @@ {% elif participation.status == participation.NOT_REACHED or participation.status == participation.AWAITING_RESPONSE %}
    - + {% for desc, bucket in buckets %} -
    {{ bucket }}
    +
    {{ bucket }}
    {% endfor %} -
    {{ participation|display:'status' }}
    +
    {{ participation|display:'status' }}
    -
    +
    {% blocktranslate count attempts=participation.attempts %} {{ attempts }} attempt @@ -78,17 +78,17 @@ {% else %}
    - + {% for desc, bucket in buckets %} -
    {{ bucket }}
    +
    {{ bucket }}
    {% endfor %} {% if participation.status == participation.INVITED and session_count > 0 %} -
    +
    {{ participation.appointment_count }}/{{ session_count }}
    {% if participation.subject.blocked %} - {{ participation.subject|verbose_name:'blocked' }} + {{ participation.subject|verbose_name:'blocked' }} {% endif %} {% endif %}
    @@ -105,8 +105,8 @@
    {% else %}
    - -
    + +
    {% translate 'access denied' %}
    diff --git a/castellum/recruitment/templates/recruitment/age_widget.html b/castellum/recruitment/templates/recruitment/age_widget.html index f3e2a4af1c817ad99c04b1b5346e57d82c20789a..e63396400ee488a86a74b35bca3de68833113ef6 100644 --- a/castellum/recruitment/templates/recruitment/age_widget.html +++ b/castellum/recruitment/templates/recruitment/age_widget.html @@ -1,4 +1,4 @@ -
    +
    {% for widget in widget.subwidgets %}
    {% include widget.template_name %} diff --git a/castellum/recruitment/templates/recruitment/attributes_form.html b/castellum/recruitment/templates/recruitment/attributes_form.html index 42d10693dfa8a830e55fa33b13402648ca07c718..e479af9916bf5d6cde46cae4fde3e36323d81033 100644 --- a/castellum/recruitment/templates/recruitment/attributes_form.html +++ b/castellum/recruitment/templates/recruitment/attributes_form.html @@ -1,5 +1,5 @@ {% extends base_template|default:"recruitment/base.html" %} -{% load static i18n bootstrap4 %} +{% load static i18n bootstrap5 %} {% block title %}{% translate "Edit attributes" %} · {{ block.super }}{% endblock %} @@ -9,7 +9,7 @@ {% csrf_token %} {% for field, answer_declined in uncategorized %} -
    +
    {% bootstrap_field field form_group_class="" %}
    @@ -22,7 +22,7 @@
    {{ category }} {% for field, answer_declined in fields %} -
    +
    {% bootstrap_field field form_group_class="" %}
    diff --git a/castellum/recruitment/templates/recruitment/cleanup.html b/castellum/recruitment/templates/recruitment/cleanup.html index b959691ea65365328da2162eacf4a1e68c89ca50..e8b18ebdf77fe0033046c448c423c1b517511143 100644 --- a/castellum/recruitment/templates/recruitment/cleanup.html +++ b/castellum/recruitment/templates/recruitment/cleanup.html @@ -1,5 +1,5 @@ {% extends "recruitment/recruitment_base.html" %} -{% load i18n bootstrap4 %} +{% load i18n bootstrap5 %} {% block title %}{% translate "Recruitment" %} · {{ study }} · {{ block.super }}{% endblock %} diff --git a/castellum/recruitment/templates/recruitment/contact.html b/castellum/recruitment/templates/recruitment/contact.html index a746d7395a2d38f02ad2e275014bfd632e0dd4ac..e7697885786e3609c68f8c86d513350b261e7b44 100644 --- a/castellum/recruitment/templates/recruitment/contact.html +++ b/castellum/recruitment/templates/recruitment/contact.html @@ -1,5 +1,5 @@ {% extends "recruitment/base.html" %} -{% load i18n static bootstrap4 utils auth appointments %} +{% load i18n static bootstrap5 utils auth appointments %} {% block title %}{% translate "Recruitment" %} · {{ study }} · {{ block.super }}{% endblock %} @@ -9,7 +9,7 @@ {{ subject.contact.full_name }} - {{ object|display:'status' }} + {{ object|display:'status' }}
    {% endblock %} @@ -40,14 +40,14 @@ {% if view.subtab == 'open' %} -