From 273632d68aee5f928e9b8271a4d6326e4716ee2e Mon Sep 17 00:00:00 2001 From: CJ Green <44074998+okaycj@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:50:42 -0400 Subject: [PATCH] Study Details Configuration Views (#1244) * Add js2py package for js validation * html format changes * Experiment runner config url * Update study edit forms * Add exp runner edit button to detail view * Add runner config edit html * Update css * Move study type field to drop down * Add external runner config * Remove study type mixin * populate latest commit sha * Get other field form data * Fix field names, add style to forms * Add preview link to study details, fix view names * Rename study views There are two view named "Study details". The original view is renamed to "Study" and all urls have been updated. Additionally, Clicking save on Study Ad moves you to the new Study Details view. * Add header text to Study Ad * Update version of djlint I updated the version of djlint as it was causing me to have to re-format text on each commit. * Move study type field to bottom of form. * Update preview summary help text * Update study type field label and help text. * Update study type name field In addition to updating the study type field, I am removing the configuration field. Forms have replaced the need for this field. * Add header copy to study details * Update rep url help text * Update study create workflow * Disable study type on study edit form * Clean up study views * Fix Study type name issues * Update Scheduled field to be choice field * Update tests * Add runner view tests * Fix issue with Scheduling Other field There was a small bug with other field on the external details view. The other box wouldn't show up when other was selected * Add test for after effects for updating metadata * Change study ad link icon * Remove language from modal that doesn't make sense * Fix cancel button on study details * Cancel button goes to study view * Add rebuilt/rejected warning to study details * Generator field will always have default code * Fixed commit url * Add help text to commit sha field * Added formatted link to help text * Fix db migration conflict * Copy changes * Update warning message on study details * Update copy on study type --- .pre-commit-config.yaml | 2 +- accounts/templates/accounts/2fa-setup.html | 14 +- .../templates/accounts/account-update.html | 94 ++--- .../accounts/participant_detail.html | 110 ++---- .../templates/accounts/participant_list.html | 8 +- .../accounts/researcher-registration.html | 8 +- ...otify_researcher_of_study_permissions.html | 2 +- ...notify_researcher_of_study_permissions.txt | 2 +- accounts/tests/test_accounts.py | 2 +- exp/templates/exp/_navigation.html | 8 +- exp/tests/test_runner_forms.py | 118 +++++++ exp/tests/test_runner_views.py | 153 +++++++++ exp/tests/test_study_forms.py | 112 ------ exp/tests/test_study_views.py | 179 +--------- exp/urls.py | 20 +- exp/views/mixins.py | 100 +----- exp/views/responses.py | 2 +- exp/views/study.py | 320 ++++++++++++------ poetry.lock | 57 +++- pyproject.toml | 1 + scss/study-fields.scss | 18 +- studies/forms.py | 278 +++++++++------ .../0093_remove_studytype_configuration.py | 54 +++ studies/models.py | 14 +- studies/tasks.py | 4 +- .../emails/notify_admins_of_study_action.html | 10 +- .../emails/notify_admins_of_study_action.txt | 10 +- ...tify_researchers_of_approval_decision.html | 2 +- ...otify_researchers_of_approval_decision.txt | 2 +- .../notify_researchers_of_build_failure.html | 2 +- .../notify_researchers_of_build_failure.txt | 2 +- .../notify_researchers_of_deployment.html | 2 +- .../notify_researchers_of_deployment.txt | 2 +- .../studies/_all_json_and_csv_data.html | 4 +- studies/templates/studies/_data_options.html | 2 +- studies/templates/studies/_image_display.html | 4 +- studies/templates/studies/_study_fields.html | 51 +-- studies/templates/studies/_study_type.html | 100 ------ .../studies/experiment_runner/base.html | 59 ++++ .../studies/experiment_runner/efp_edit.html | 72 ++++ .../experiment_runner/external_edit.html | 17 + studies/templates/studies/lab_create.html | 6 +- studies/templates/studies/lab_list.html | 18 +- .../templates/studies/lab_member_list.html | 58 ++-- studies/templates/studies/lab_update.html | 8 +- .../templates/studies/options/recipients.html | 4 +- .../templates/studies/study_attachments.html | 8 +- .../{study_form.html => study_create.html} | 11 +- studies/templates/studies/study_detail.html | 16 +- .../study_detail/_manage_researchers.html | 22 +- .../studies/study_detail/_modal.html | 4 +- .../studies/study_detail/_study_logs.html | 4 +- .../studies/study_detail/_study_status.html | 6 +- studies/templates/studies/study_edit.html | 134 ++++---- studies/templates/studies/study_list.html | 10 +- .../studies/study_participant_analytics.html | 194 +++-------- .../studies/study_participant_contact.html | 28 +- .../templates/studies/study_responses.html | 52 +-- .../study_responses_consent_ruling.html | 114 ++----- web/static/custom_bootstrap5.css | 6 +- web/static/js/ace-editor.js | 8 + web/static/js/efp-runner.js | 143 ++++++++ web/static/js/external-runner.js | 53 +++ web/static/js/study-edit.js | 25 +- web/static/js/study-fields.js | 165 +-------- web/templates/404.html | 2 +- web/templates/registration/login.html | 38 +-- .../registration/password_change_form.html | 4 +- .../registration/password_reset_confirm.html | 18 +- .../registration/password_reset_form.html | 8 +- web/templates/web/_footer.html | 6 +- web/templates/web/_studies-by-age-group.html | 8 +- web/templates/web/base.html | 18 +- web/templates/web/child-add.html | 10 +- web/templates/web/child-update.html | 14 +- .../web/demographic-data-update.html | 8 +- web/templates/web/faq.html | 92 ++--- web/templates/web/garden/home.html | 6 +- web/templates/web/garden/participate.html | 12 +- web/templates/web/home.html | 10 +- web/templates/web/lab-studies-list.html | 4 +- .../web/participant-email-preferences.html | 10 +- web/templates/web/participant-signup.html | 8 +- web/templates/web/privacy.html | 36 +- web/templates/web/publications.html | 4 +- web/templates/web/resources.html | 3 +- .../web/scientists/staff-alumni.html | 4 +- .../scientists/undergrade-student-alumni.html | 24 +- web/templates/web/studies-history.html | 4 +- web/templates/web/studies-list.html | 2 +- web/templates/web/study-detail.html | 12 +- web/views.py | 20 +- 92 files changed, 1715 insertions(+), 1788 deletions(-) create mode 100644 exp/tests/test_runner_forms.py create mode 100644 exp/tests/test_runner_views.py create mode 100644 studies/migrations/0093_remove_studytype_configuration.py delete mode 100644 studies/templates/studies/_study_type.html create mode 100644 studies/templates/studies/experiment_runner/base.html create mode 100644 studies/templates/studies/experiment_runner/efp_edit.html create mode 100644 studies/templates/studies/experiment_runner/external_edit.html rename studies/templates/studies/{study_form.html => study_create.html} (74%) create mode 100644 web/static/js/ace-editor.js create mode 100644 web/static/js/efp-runner.js create mode 100644 web/static/js/external-runner.js diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c3cd31ff..4d1350127 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: black - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.19.16 + rev: v1.32.1 hooks: - id: djlint-django args: ['--profile', 'django', '--lint', '--reformat', '--quiet'] diff --git a/accounts/templates/accounts/2fa-setup.html b/accounts/templates/accounts/2fa-setup.html index a8a874ef5..4e79c7018 100644 --- a/accounts/templates/accounts/2fa-setup.html +++ b/accounts/templates/accounts/2fa-setup.html @@ -30,15 +30,15 @@

QR Code

{% csrf_token %} {% bootstrap_form form %} {% form_buttons %} - {% bootstrap_button "Test Code" button_type="submit" button_class=btn_primary_classes %} - {% endform_buttons %} - - - - -
{{ svg_qr_code | safe }}
+ {% bootstrap_button "Test Code" button_type="submit" button_class=btn_primary_classes %} + {% endform_buttons %} + + + +
{{ svg_qr_code | safe }}
+ {% endblock content %} diff --git a/accounts/templates/accounts/account-update.html b/accounts/templates/accounts/account-update.html index be554853d..e74940dfa 100644 --- a/accounts/templates/accounts/account-update.html +++ b/accounts/templates/accounts/account-update.html @@ -17,60 +17,60 @@

{% trans "Account Information" %}

{% csrf_token %} {% bootstrap_form update_account_form %} {% form_buttons %} - {% bootstrap_button "Save" name="form-handle" value="update-account" %} - {% endform_buttons %} - - + {% bootstrap_button "Save" name="form-handle" value="update-account" %} + {% endform_buttons %} + - {# Change password card #} -
-
-

{% trans "Change Your Password" %}

+
+ {# Change password card #} +
+
+

{% trans "Change Your Password" %}

+
+ {% csrf_token %} + {% bootstrap_form change_password_form %} + {% form_buttons %} + {% bootstrap_button "Save" name="form-handle" value="change-password" %} + {% endform_buttons %} +
+
+
+ {% if request.user.is_researcher %} + {# 2FA card #} +
+
+

{% trans "Manage Two-Factor Authentication" %}

+ {% if otp %} + {# If we have OTP, enable setup completion in the case where it's not yet activated, and allow reset with verified OTP if it is. #}
+ {% if otp.activated %} + {# enable reset of OTP #} +

+ {% trans "If you'd like, you can turn two-factor authentication off here. Just enter your one-time password here, hit submit, and it'll get deleted for you!" %} +

+ {% else %} +
{{ otp.get_svg_qr_code | safe }}
+

+ {% trans "It looks like you were in the middle of setting up two factor authentication, but didn't complete the process. You can capture the QR code here, verify with a one-time password, and finish the process." %} +

+ {% endif %} {% csrf_token %} - {% bootstrap_form change_password_form %} + {% bootstrap_form otp_check_form %} {% form_buttons %} - {% bootstrap_button "Save" name="form-handle" value="change-password" %} - {% endform_buttons %} -
-
-
- {% if request.user.is_researcher %} - {# 2FA card #} -
-
-

{% trans "Manage Two-Factor Authentication" %}

- {% if otp %} - {# If we have OTP, enable setup completion in the case where it's not yet activated, and allow reset with verified OTP if it is. #} -
- {% if otp.activated %} - {# enable reset of OTP #} -

- {% trans "If you'd like, you can turn two-factor authentication off here. Just enter your one-time password here, hit submit, and it'll get deleted for you!" %} -

- {% else %} -
{{ otp.get_svg_qr_code | safe }}
-

- {% trans "It looks like you were in the middle of setting up two factor authentication, but didn't complete the process. You can capture the QR code here, verify with a one-time password, and finish the process." %} -

- {% endif %} - {% csrf_token %} - {% bootstrap_form otp_check_form %} - {% form_buttons %} - {% if otp.activated %} - {% bootstrap_button "Submit" name="form-handle" value="deactivate-otp" %} - {% else %} - {% bootstrap_button "Submit" name="form-handle" value="activate-otp" %} - {% endif %} - {% endform_buttons %} -
+ {% if otp.activated %} + {% bootstrap_button "Submit" name="form-handle" value="deactivate-otp" %} {% else %} - {# if we don't have OTP, link to 2FA setup directly. #} - {% trans "Set up Two-Factor Authentication" %} + {% bootstrap_button "Submit" name="form-handle" value="activate-otp" %} {% endif %} -
-
+ {% endform_buttons %} + + {% else %} + {# if we don't have OTP, link to 2FA setup directly. #} + {% trans "Set up Two-Factor Authentication" %} {% endif %}
+{% endif %} + + {% endblock content %} diff --git a/accounts/templates/accounts/participant_detail.html b/accounts/templates/accounts/participant_detail.html index e750a57bb..0b3be0b83 100644 --- a/accounts/templates/accounts/participant_detail.html +++ b/accounts/templates/accounts/participant_detail.html @@ -89,89 +89,47 @@ {% trans "Number of Guardians" %}: - - {{ demographics.number_of_guardians|default:"No Response" }} - + {{ demographics.number_of_guardians|default:"No Response" }} - - {% trans "Explanation for Guardians:" %} - - - {{ demographics.number_of_guardians_explanation|default:"No Response" }} - + {% trans "Explanation for Guardians:" %} + {{ demographics.number_of_guardians_explanation|default:"No Response" }} - - {% trans "Race" %}: - - - {{ demographics.us_race_ethnicity_identification|default:"No Response" }} - + {% trans "Race" %}: + {{ demographics.us_race_ethnicity_identification|default:"No Response" }} - - Age: - - - {{ demographics.age|default:"No Response" }} - + Age: + {{ demographics.age|default:"No Response" }} - - Gender: - - - {{ demographics.gender|default:"No Response" }} - + Gender: + {{ demographics.gender|default:"No Response" }} - - Education Level: - - - {{ demographics.education_level|default:"No Response" }} - + Education Level: + {{ demographics.education_level|default:"No Response" }} - - Spouse's Education Level: - - - {{ demographics.spouse_education_level|default:"No Response" }} - + Spouse's Education Level: + {{ demographics.spouse_education_level|default:"No Response" }} - - Annual Income: - - - {{ demographics.annual_income|default:"No Response" }} - + Annual Income: + {{ demographics.annual_income|default:"No Response" }} - - Children's Books at Home: - - - {{ demographics.number_of_books|default:"No Response" }} - + Children's Books at Home: + {{ demographics.number_of_books|default:"No Response" }} - - Additional Comments: - - - {{ demographics.additional_comments|default:"No Response" }} - + Additional Comments: + {{ demographics.additional_comments|default:"No Response" }} - - Lookit Referrer: - - - {{ demographics.lookit_referrer|default:"No Response" }} - + Lookit Referrer: + {{ demographics.lookit_referrer|default:"No Response" }} @@ -201,12 +159,8 @@ {% bs_icon "chevron-down" %} - - Response - - - Child - + Response + Child Completion Status - {{ study.study.name }} - - - {{ study.response.uuid }} - - - {{ study.response.child.given_name }} + {{ study.study.name }} + {{ study.response.uuid }} + {{ study.response.child.given_name }} {% if study.completed %} Completed @@ -254,17 +204,13 @@ In Progress {% endif %} - - {{ study.created |date:"n/d/Y"|default:"N/A" }} - + {{ study.created |date:"n/d/Y"|default:"N/A" }} {% endfor %} {% include "studies/_paginator.html" with page=studies request=request %} {% else %} -

- {{ user.nickname }} has not participated in any studies yet! -

+

{{ user.nickname }} has not participated in any studies yet!

{% endif %} {% endblock content %} diff --git a/accounts/templates/accounts/participant_list.html b/accounts/templates/accounts/participant_list.html index a8b14ae22..39652129a 100644 --- a/accounts/templates/accounts/participant_list.html +++ b/accounts/templates/accounts/participant_list.html @@ -16,9 +16,9 @@ placeholder="Filter by nickname or user global ID" size="50" type="text" - value="{{ match }}"/> - - + value="{{ match }}" /> + + @@ -49,7 +49,7 @@ {% for user in object_list %} {% url 'exp:participant-detail' user.id as url_participant_detail %} - {% empty %} diff --git a/studies/templates/studies/study_form.html b/studies/templates/studies/study_create.html similarity index 74% rename from studies/templates/studies/study_form.html rename to studies/templates/studies/study_create.html index 72028e329..2d80b0994 100644 --- a/studies/templates/studies/study_form.html +++ b/studies/templates/studies/study_create.html @@ -32,14 +32,13 @@

Create Study

{% csrf_token %} {% include "studies/_study_fields.html" with form=form %} - {% include "studies/_study_type.html" with types=types create=1 %} {% form_buttons %} - {% bootstrap_button "Cancel" button_class=btn_secondary_classes href=url_cancel %} - {% bootstrap_button bs_icon_plus|add:"Create Study" button_class=btn_primary_classes button_type="submit" id="create-study-button" %} - {% endform_buttons %} - - + {% bootstrap_button "Cancel" button_class=btn_secondary_classes href=url_cancel %} + {% bootstrap_button bs_icon_plus|add:"Create Study" button_class=btn_primary_classes button_type="submit" id="create-study-button" %} + {% endform_buttons %} + + {% endblock content %} diff --git a/studies/templates/studies/study_detail.html b/studies/templates/studies/study_detail.html index b18e225c4..c3ca8a7f9 100644 --- a/studies/templates/studies/study_detail.html +++ b/studies/templates/studies/study_detail.html @@ -82,14 +82,14 @@ class="form-control" id="study-preview-link" value="{% url 'exp:preview-detail' uuid=study.uuid %}" - aria-describedby="copy-link-button"/> + aria-describedby="copy-link-button" /> copy preview link + width="13" /> {% else %} @@ -109,14 +109,14 @@ class="form-control" id="private-study-link" value="{% url 'web:study-detail' study.uuid %}" - aria-describedby="copy-link-button"/> + aria-describedby="copy-link-button" /> copy study link + width="13" /> {% else %} @@ -130,7 +130,7 @@ method="post" style="display:none"> {% csrf_token %} - +
{% if "read_study__responses(is_preview=True)" in study_perms %} @@ -139,7 +139,9 @@ {% endif %} {% if can_edit_study_details %} {% bs_icon "pencil-square" %} Edit Study + href="{% url 'exp:study-edit' pk=study.id %}">{% bs_icon "megaphone-fill" %}Study Ad and Recruitment + {% bs_icon "pencil-square" %}Study Details {% endif %} {% if "read_study__responses" in study_perms or "read_study__responses(is_preview=True)" in study_perms %} {% bs_icon "clipboard-check-fill" %} Clone Study + onclick="cloneStudy()">{% bs_icon "clipboard-check-fill" %} Clone Study {% endif %}
diff --git a/studies/templates/studies/study_detail/_manage_researchers.html b/studies/templates/studies/study_detail/_manage_researchers.html index 65d9db94f..2ce035063 100644 --- a/studies/templates/studies/study_detail/_manage_researchers.html +++ b/studies/templates/studies/study_detail/_manage_researchers.html @@ -7,19 +7,17 @@
- +
+ value="{{ search_query }}" /> + aria-label="Search researchers">{% bs_icon "search" %}
{% if users_result %} @@ -31,13 +29,11 @@

Results

{% csrf_token %} - + + class="{% button_primary_classes %} btn-sm">{% bs_icon "plus" %}
@@ -70,19 +66,17 @@

Researchers

data-params="{csrfmiddlewaretoken:'{{ csrf_token }}'}" data-id="{{ researcher.user.get_short_name }}" data-pk="{{ researcher.user.id }}" - data-title="Select researcher permissions"> {{ researcher.current_group }} + data-title="Select researcher permissions">{{ researcher.current_group }}
{% csrf_token %} - + + class="btn btn-danger btn-sm">{% bs_icon "dash" %}
{% else %} diff --git a/studies/templates/studies/study_detail/_modal.html b/studies/templates/studies/study_detail/_modal.html index b8a035a8f..81866f2a3 100644 --- a/studies/templates/studies/study_detail/_modal.html +++ b/studies/templates/studies/study_detail/_modal.html @@ -26,7 +26,7 @@
Videos
{% csrf_token %}
- +
Download response

Include with response download:

{% include "studies/_data_options.html" with data_options=data_options %}

- +

{% bootstrap_button "Download response" button_type="submit" button_class=btn_primary_classes name="download-individual-data" %} @@ -241,30 +233,20 @@
Download response
id="response-summary-{{ forloop.counter }}" style="display:none">
-
- Response details -
+
Response details
+ {% if user.nickname %} {{ user.nickname }} diff --git a/accounts/templates/accounts/researcher-registration.html b/accounts/templates/accounts/researcher-registration.html index 55c6e2dd8..1406b8478 100644 --- a/accounts/templates/accounts/researcher-registration.html +++ b/accounts/templates/accounts/researcher-registration.html @@ -21,9 +21,9 @@ .

{% form_buttons %} - {% bootstrap_button bs_icon_plus|add:"Create Account" %} - {% endform_buttons %} - - + {% bootstrap_button bs_icon_plus|add:"Create Account" %} + {% endform_buttons %} + + {% endblock content %} diff --git a/accounts/templates/emails/notify_researcher_of_study_permissions.html b/accounts/templates/emails/notify_researcher_of_study_permissions.html index 1fd0bd31c..f3094b2ef 100644 --- a/accounts/templates/emails/notify_researcher_of_study_permissions.html +++ b/accounts/templates/emails/notify_researcher_of_study_permissions.html @@ -1,7 +1,7 @@

Dear {{ researcher_name }},

You have been given {{ permission }} permissions to collaborate on {{ study_name }}.

- Here is a link to start collaborating. + Here is a link to start collaborating.

Best, diff --git a/accounts/templates/emails/notify_researcher_of_study_permissions.txt b/accounts/templates/emails/notify_researcher_of_study_permissions.txt index 3e9638791..bb371b309 100644 --- a/accounts/templates/emails/notify_researcher_of_study_permissions.txt +++ b/accounts/templates/emails/notify_researcher_of_study_permissions.txt @@ -2,7 +2,7 @@ Dear {{ researcher_name }}, You have been given {{ permission }} permissions to collaborate on {{ study_name }}. -Here is a link to start collaborating: {{ base_url }}{% url 'exp:study-detail' study_id %}. +Here is a link to start collaborating: {{ base_url }}{% url 'exp:study' study_id %}. Best, {{ lab_name }} Admin diff --git a/accounts/tests/test_accounts.py b/accounts/tests/test_accounts.py index 58d06dffc..0dffe071d 100644 --- a/accounts/tests/test_accounts.py +++ b/accounts/tests/test_accounts.py @@ -106,7 +106,7 @@ def setUp(self): reverse("exp:participant-detail", kwargs={"pk": self.participant.pk}), reverse("exp:study-participant-analytics"), reverse("exp:study-create"), - reverse("exp:study-detail", kwargs={"pk": self.study.pk}), + reverse("exp:study", kwargs={"pk": self.study.pk}), reverse("exp:study-participant-contact", kwargs={"pk": self.study.pk}), reverse("exp:study-edit", kwargs={"pk": self.study.pk}), reverse("exp:study-responses-list", kwargs={"pk": self.study.pk}), diff --git a/exp/templates/exp/_navigation.html b/exp/templates/exp/_navigation.html index 7b7351de6..84bc53482 100644 --- a/exp/templates/exp/_navigation.html +++ b/exp/templates/exp/_navigation.html @@ -13,9 +13,7 @@ id="navbarDropdown" role="button" data-bs-toggle="dropdown" - aria-expanded="false"> - Help - + aria-expanded="false">Help

@@ -123,9 +106,7 @@ title="" id="id_max_age_years"> {% for x, y in form.fields.max_age_years.choices %} - + {% endfor %} @@ -140,10 +121,7 @@ name="max_age_months" title=""> {% for x, y in form.fields.max_age_months.choices %} - + {% endfor %} @@ -158,9 +136,7 @@ name="max_age_days" title=""> {% for x, y in form.fields.max_age_days.choices %} - + {% endfor %} @@ -181,17 +157,4 @@ {% bootstrap_field form.must_not_have_participated label_class="form-label fw-bold" wrapper_class="mb-4" %} {% bootstrap_field form.criteria_expression label_class="form-label fw-bold" wrapper_class="mb-4" %}
-
-
- -

- Now it's time for the actual study! For internal studies, you will add a protocol configuration or generator. For external studies, you will paste in your study or scheduling link. If you don't see what you expect, check the "External" and "Scheduled" checkboxes at the top of this form! -

-
-
-
{% bootstrap_field form.structure label_class="form-label fw-bold" %}
-{% bootstrap_field form.use_generator label_class="form-label" wrapper_class="form-group" %} -
{{ form.generator.help_text|safe }}
-
- {% bootstrap_field form.generator show_help=False label_class="form-label fw-bold" %} -
+{% bootstrap_field form.study_type label_class="form-label fw-bold" wrapper_class="mb-4" %} diff --git a/studies/templates/studies/_study_type.html b/studies/templates/studies/_study_type.html deleted file mode 100644 index ad9919e5a..000000000 --- a/studies/templates/studies/_study_type.html +++ /dev/null @@ -1,100 +0,0 @@ -{% load exp_extras %} -{% load web_extras %} -{% load django_bootstrap5 %} -{% load bootstrap_icons %} -{% load static %} -{% button_secondary_classes as btn_secondary_classes %} - -
-
-
- {% for study_type in study_types %} -
- {% for field in study_type.configuration.metadata.fields %} - {% with field.name as key %} - {% with field.value as value %} - {% with key_help_text|get_key:key|default:"" as help_text %} - {% if field.input_type == "checkbox" %} -
- - -
- {% elif field.input_type == "radio" %} -
- - {% for option in field.options %} -
- -
- {% if option == "Other" %} - {% if study %} - {% with "other_"|add:field.name as other_field %} - {% with study.metadata|get_key:other_field|default:'' as other_value %} - - {% endwith %} - {% endwith %} - {% else %} - - {% endif %} - {% endif %} - {% endfor %} -
{{ help_text }}
-
- {% else %} - - {% endif %} - {% if key == "last_known_player_sha" %} -
-
-

- About this version -
- {% bootstrap_button "Check for updates" button_class=btn_secondary_classes id="update-button" %} -
-

-
-
-
-
-
-

Update info

-
-
-
- {% endif %} - {% endwith %} - {% endwith %} - {% endwith %} - {% endfor %} -
- {% endfor %} -
-
-
diff --git a/studies/templates/studies/experiment_runner/base.html b/studies/templates/studies/experiment_runner/base.html new file mode 100644 index 000000000..a9d4a0fdc --- /dev/null +++ b/studies/templates/studies/experiment_runner/base.html @@ -0,0 +1,59 @@ +{% extends "exp/base.html" %} +{% load django_bootstrap5 %} +{% load bootstrap_icons %} +{% load web_extras %} +{% load static %} +{% block title %} + Edit | {{ study.name }} +{% endblock title %} +{% block breadcrumb %} + {% breadcrumb %} + {% url 'exp:study-list' %} Manage Studies + {% url 'exp:study' pk=study.id %} {{ study.name }} + Edit +{% endbreadcrumb %} +{% endblock breadcrumb %} +{% block content %} + {% url 'exp:study' pk=study.pk as url_study_detail %} + {% button_secondary_classes as btn_secondary_classes %} + {% button_primary_classes as btn_primary_classes %} + {% url 'exp:preview-detail' uuid=study.uuid as url_preview_detail %} + {% bs_icon "play-circle" as bs_icon_play_circle %} + {% bootstrap_form_errors form %} +
+
+
+

+ Study Details +
+ {% bootstrap_button bs_icon_play_circle|add:"Preview Study" href=url_preview_detail button_class=btn_secondary_classes %} +
+

+
+
+

+ We have split the study forms into two views for easier navigation. + You can update eligibility and other recruiting information on + the Study Ad + and Recruitment page. +

+ {% block header %} + {% endblock header %} +
+ {% csrf_token %} + {% block form %} + {% endblock form %} + {% if save_confirmation or study.built %} +

+ Changes to any of these values may cause your study to be rejected or need to be built again. +

+ {% endif %} + {% form_buttons %} + {% bootstrap_button "Cancel" button_class=btn_secondary_classes href=url_study_detail %} + {% bootstrap_button "Save Changes" button_class=btn_primary_classes type="submit" %} + {% endform_buttons %} +
+
+
+
+{% endblock content %} diff --git a/studies/templates/studies/experiment_runner/efp_edit.html b/studies/templates/studies/experiment_runner/efp_edit.html new file mode 100644 index 000000000..bf78096bf --- /dev/null +++ b/studies/templates/studies/experiment_runner/efp_edit.html @@ -0,0 +1,72 @@ +{% extends "studies/experiment_runner/base.html" %} +{% load django_bootstrap5 %} +{% load web_extras %} +{% load static %} +{% block head %} + {{ block.super }} + {% comment %} ace editor fix cannot be defered {% endcomment %} + + {% comment %} {% endcomment %} + + {{ form.media }} +{% endblock head %} +{% block header %} +

+ You have created a Lookit/Ember Frameplayer study. If you need to change study types, + please create a new study instead. +

+{% endblock header %} +{% block form %} + {% bootstrap_form form %} +
+
+

+ About this version +
+ {% button_secondary_classes as btn_secondary_classes %} + {% bootstrap_button "Check for updates" button_class=btn_secondary_classes id="update-button" %} +
+

+
+
+

+ Your study will use commit : +

+
+
+
Date
+
+
+
+
Author
+
+
+
+
Message
+
+
+
+
Files changed
+
+
+
+
+
+
+
+

Update info

+
+
+

+ Since the version you are using, there have been updates to the master branch of https://github.com/lookit/ember-lookit-frameplayer. +

+
+
+
Date
+
Description
+
Commit Sha
+
+
+
+
+{% endblock form %} diff --git a/studies/templates/studies/experiment_runner/external_edit.html b/studies/templates/studies/experiment_runner/external_edit.html new file mode 100644 index 000000000..65aad0b9c --- /dev/null +++ b/studies/templates/studies/experiment_runner/external_edit.html @@ -0,0 +1,17 @@ +{% extends "studies/experiment_runner/base.html" %} +{% load django_bootstrap5 %} +{% load static %} +{% load web_extras %} +{% block head %} + {{ block.super }} + +{% endblock head %} +{% block header %} +

+ You have created an External study. If you need to change study types, + please create a new study instead. +

+{% endblock header %} +{% block form %} + {% bootstrap_form form %} +{% endblock form %} diff --git a/studies/templates/studies/lab_create.html b/studies/templates/studies/lab_create.html index e0a537ba4..b5584a121 100644 --- a/studies/templates/studies/lab_create.html +++ b/studies/templates/studies/lab_create.html @@ -16,7 +16,7 @@ {% csrf_token %} {% bootstrap_form form %} {% form_buttons %} - {% bootstrap_button "Submit" %} - {% endform_buttons %} - + {% bootstrap_button "Submit" %} + {% endform_buttons %} + {% endblock content %} diff --git a/studies/templates/studies/lab_list.html b/studies/templates/studies/lab_list.html index 5642e2d01..b0766996f 100644 --- a/studies/templates/studies/lab_list.html +++ b/studies/templates/studies/lab_list.html @@ -19,30 +19,24 @@ placeholder="Filter by name, PI, or institution" size="50" type="text" - value="{{ match }}"/> - - + value="{{ match }}" /> + +
diff --git a/studies/templates/studies/lab_member_list.html b/studies/templates/studies/lab_member_list.html index 7c2c4578f..fa24491de 100644 --- a/studies/templates/studies/lab_member_list.html +++ b/studies/templates/studies/lab_member_list.html @@ -20,9 +20,9 @@ placeholder="Filter by researcher name" size="50" type="text" - value="{{ match }}"/> - - + value="{{ match }}" /> + +
Researcher Name
@@ -46,48 +46,30 @@ {% form_buttons %} - {% bootstrap_button "Submit" %} - {% endform_buttons %} - -
- {% endif %} -
+ {% bootstrap_button "Submit" %} + {% endform_buttons %} + + + {% endif %} - {% empty %} -
No researchers found!
- {% endfor %} - {% include "studies/_paginator.html" with page=lab_members_qs %} + +{% empty %} +
No researchers found!
+{% endfor %} +{% include "studies/_paginator.html" with page=lab_members_qs %} {% endblock content %} diff --git a/studies/templates/studies/lab_update.html b/studies/templates/studies/lab_update.html index e9f65f3a5..25bb698f1 100644 --- a/studies/templates/studies/lab_update.html +++ b/studies/templates/studies/lab_update.html @@ -20,8 +20,8 @@ {% csrf_token %} {% bootstrap_form form %} {% form_buttons %} - {% bootstrap_button "Discard Changes" href=url_lab_edit button_class=btn_secondary_classes %} - {% bootstrap_button "Save" type="submit" button_class=btn_primary_classes %} - {% endform_buttons %} - + {% bootstrap_button "Discard Changes" href=url_lab_edit button_class=btn_secondary_classes %} + {% bootstrap_button "Save" type="submit" button_class=btn_primary_classes %} + {% endform_buttons %} + {% endblock content %} diff --git a/studies/templates/studies/options/recipients.html b/studies/templates/studies/options/recipients.html index 7a987cdfa..c586c2651 100644 --- a/studies/templates/studies/options/recipients.html +++ b/studies/templates/studies/options/recipients.html @@ -5,7 +5,5 @@ {% if person.email_new_studies %}data-new-studies{% endif %} {% if person.email_study_updates %}data-study-updates{% endif %} {% if person.email_response_questions %}data-response-questions{% endif %} - data-transactional-message> - {{ person.slug }} - + data-transactional-message>{{ person.slug }} {% endwith %} diff --git a/studies/templates/studies/study_attachments.html b/studies/templates/studies/study_attachments.html index 259b4bc0a..273b5de53 100644 --- a/studies/templates/studies/study_attachments.html +++ b/studies/templates/studies/study_attachments.html @@ -11,7 +11,7 @@ {% block breadcrumb %} {% breadcrumb %} {% url 'exp:study-list' %} Manage Studies - {% url 'exp:study-detail' pk=study.id %} {{ study.name }} + {% url 'exp:study' pk=study.id %} {{ study.name }} Videos {% endbreadcrumb %} {% endblock breadcrumb %} @@ -45,8 +45,8 @@ name="match" placeholder="Filter video name" type="text" - value="{{ match }}"/> - + value="{{ match }}" /> +
@@ -85,7 +85,7 @@
{{ video.created_at|date:"n/j/Y g:i A"|default:"N/A" }} Download + class="{% button_primary_classes %} btn-sm">Download
- - + + {% for pair in response.summary %} - - + + {% endfor %} @@ -275,8 +257,6 @@
{% else %} -
- No responses with confirmed consent. -
+
No responses with confirmed consent.
{% endif %} {% endblock content %} diff --git a/studies/templates/studies/study_responses_consent_ruling.html b/studies/templates/studies/study_responses_consent_ruling.html index 707e3e8f2..e5ce5d507 100644 --- a/studies/templates/studies/study_responses_consent_ruling.html +++ b/studies/templates/studies/study_responses_consent_ruling.html @@ -12,7 +12,7 @@ {% comment %} When we upgrade to django 2.x, please convert to json_script. Please see: https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#json-script - {% endcomment %} +{% endcomment %} {{ response_key_value_store | safe }} @@ -20,7 +20,7 @@ {% block breadcrumb %} {% breadcrumb %} {% url 'exp:study-list' %} Manage Studies - {% url 'exp:study-detail' pk=study.id %} {{ study.name }} + {% url 'exp:study' pk=study.id %} {{ study.name }} Consent Manager {% endbreadcrumb %} {% endblock breadcrumb %} @@ -38,15 +38,9 @@ name="response-status-filters" class="form-select w-auto" aria-label="Filter by repsonse status"> - - - + + +
 Responses*
@@ -63,7 +57,7 @@ overflow-y: scroll"> {% for response in loaded_responses %}
  • @@ -82,9 +76,7 @@ type="button" id="consentJudgementDropdown" data-bs-toggle="dropdown" - aria-expanded="false"> - {{ response.current_ruling }} - + aria-expanded="false">{{ response.current_ruling }} - +
  • Response Details
    - Name - - Value - NameValue
    - {{ pair.name }} - - {{ pair.value }} - {{ pair.name }}{{ pair.value }}