Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Study Details Configuration Views #1244

Merged
merged 45 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d7099bc
Add js2py package for js validation
okaycj Jul 26, 2023
7f70360
html format changes
okaycj Jul 26, 2023
c444af7
Experiment runner config url
okaycj Jul 26, 2023
3f435a3
Update study edit forms
okaycj Jul 26, 2023
12b5a21
Add exp runner edit button to detail view
okaycj Jul 26, 2023
c17ebb9
Add runner config edit html
okaycj Jul 26, 2023
c6a4163
Update css
okaycj Jul 26, 2023
85180ac
Move study type field to drop down
okaycj Jul 26, 2023
522b81b
Add external runner config
okaycj Aug 2, 2023
0d73214
Remove study type mixin
okaycj Aug 3, 2023
d1a3a6a
populate latest commit sha
okaycj Aug 3, 2023
4af047e
Get other field form data
okaycj Aug 3, 2023
38a4b8f
Fix field names, add style to forms
okaycj Aug 3, 2023
bd21df8
Add preview link to study details, fix view names
okaycj Aug 4, 2023
64eff19
Rename study views
okaycj Aug 5, 2023
0197bf7
Add header text to Study Ad
okaycj Aug 5, 2023
24ae09e
Update version of djlint
okaycj Aug 5, 2023
973d0fa
Move study type field to bottom of form.
okaycj Aug 5, 2023
1fcaf89
Update preview summary help text
okaycj Aug 5, 2023
1d362d5
Update study type field label and help text.
okaycj Aug 5, 2023
2dce2e4
Update study type name field
okaycj Aug 5, 2023
d9cfba8
Add header copy to study details
okaycj Aug 6, 2023
d78a868
Update rep url help text
okaycj Aug 6, 2023
5b0fd3c
Update study create workflow
okaycj Aug 6, 2023
de26bdc
Disable study type on study edit form
okaycj Aug 6, 2023
1e59c93
Clean up study views
okaycj Aug 6, 2023
6eed096
Fix Study type name issues
okaycj Aug 6, 2023
3810df0
Update Scheduled field to be choice field
okaycj Aug 7, 2023
827643f
Update tests
okaycj Aug 7, 2023
00719b0
Add runner view tests
okaycj Aug 8, 2023
6ae077f
Fix issue with Scheduling Other field
okaycj Aug 8, 2023
87dc6c6
Add test for after effects for updating metadata
okaycj Aug 9, 2023
e8f112e
Change study ad link icon
okaycj Aug 10, 2023
18aab1f
Remove language from modal that doesn't make sense
okaycj Aug 10, 2023
77e7d5a
Fix cancel button on study details
okaycj Aug 10, 2023
615853f
Cancel button goes to study view
okaycj Aug 10, 2023
5734847
Add rebuilt/rejected warning to study details
okaycj Aug 10, 2023
8a0ce79
Generator field will always have default code
okaycj Aug 10, 2023
0a82c08
Fixed commit url
okaycj Aug 10, 2023
bacce78
Add help text to commit sha field
okaycj Aug 10, 2023
c954fd1
Added formatted link to help text
okaycj Aug 21, 2023
ddc99fd
Fix db migration conflict
okaycj Aug 22, 2023
64b83ef
Copy changes
okaycj Aug 22, 2023
f80be0a
Update warning message on study details
okaycj Aug 23, 2023
26acd80
Update copy on study type
okaycj Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
14 changes: 7 additions & 7 deletions accounts/templates/accounts/2fa-setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ <h3 class="card-title">QR Code</h3>
{% csrf_token %}
{% bootstrap_form form %}
{% form_buttons %}
{% bootstrap_button "Test Code" button_type="submit" button_class=btn_primary_classes %}
{% endform_buttons %}
</form>
</li>
</ol>
</div>
<div class="col d-flex me-4 justify-content-center pt-5">{{ svg_qr_code | safe }}</div>
{% bootstrap_button "Test Code" button_type="submit" button_class=btn_primary_classes %}
{% endform_buttons %}
</form>
</li>
</ol>
</div>
<div class="col d-flex me-4 justify-content-center pt-5">{{ svg_qr_code | safe }}</div>
</div>
</div>
</div>
</div>
{% endblock content %}
94 changes: 47 additions & 47 deletions accounts/templates/accounts/account-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,60 @@ <h1 class="card-title">{% trans "Account Information" %}</h1>
{% csrf_token %}
{% bootstrap_form update_account_form %}
{% form_buttons %}
{% bootstrap_button "Save" name="form-handle" value="update-account" %}
{% endform_buttons %}
</form>
</div>
{% bootstrap_button "Save" name="form-handle" value="update-account" %}
{% endform_buttons %}
</form>
</div>
{# Change password card #}
<div class="card mb-4">
<div class="card-body">
<h1 class="card-title">{% trans "Change Your Password" %}</h1>
</div>
{# Change password card #}
<div class="card mb-4">
<div class="card-body">
<h1 class="card-title">{% trans "Change Your Password" %}</h1>
<form method="post">
{% csrf_token %}
{% bootstrap_form change_password_form %}
{% form_buttons %}
{% bootstrap_button "Save" name="form-handle" value="change-password" %}
{% endform_buttons %}
</form>
</div>
</div>
{% if request.user.is_researcher %}
{# 2FA card #}
<div class="card mb-4">
<div class="card-body">
<h1 class="card-title">{% trans "Manage Two-Factor Authentication" %}</h1>
{% 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. #}
<form method="post">
{% if otp.activated %}
{# enable reset of OTP #}
<p>
{% 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!" %}
</p>
{% else %}
<div class="col-md-4">{{ otp.get_svg_qr_code | safe }}</div>
<p>
{% 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." %}
</p>
{% 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 %}
</form>
</div>
</div>
{% if request.user.is_researcher %}
{# 2FA card #}
<div class="card mb-4">
<div class="card-body">
<h1 class="card-title">{% trans "Manage Two-Factor Authentication" %}</h1>
{% 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. #}
<form method="post">
{% if otp.activated %}
{# enable reset of OTP #}
<p>
{% 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!" %}
</p>
{% else %}
<div class="col-md-4">{{ otp.get_svg_qr_code | safe }}</div>
<p>
{% 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." %}
</p>
{% 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 %}
</form>
{% if otp.activated %}
{% bootstrap_button "Submit" name="form-handle" value="deactivate-otp" %}
{% else %}
{# if we don't have OTP, link to 2FA setup directly. #}
<a href="{% url "accounts:2fa-setup" %}">{% trans "Set up Two-Factor Authentication" %}</a>
{% bootstrap_button "Submit" name="form-handle" value="activate-otp" %}
{% endif %}
</div>
</div>
{% endform_buttons %}
</form>
{% else %}
{# if we don't have OTP, link to 2FA setup directly. #}
<a href="{% url "accounts:2fa-setup" %}">{% trans "Set up Two-Factor Authentication" %}</a>
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
{% endblock content %}
110 changes: 28 additions & 82 deletions accounts/templates/accounts/participant_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,89 +89,47 @@
</tr>
<tr>
<th scope="row">{% trans "Number of Guardians" %}:</th>
<td>
{{ demographics.number_of_guardians|default:"No Response" }}
</td>
<td>{{ demographics.number_of_guardians|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
{% trans "Explanation for Guardians:" %}
</th>
<td>
{{ demographics.number_of_guardians_explanation|default:"No Response" }}
</td>
<th scope="row">{% trans "Explanation for Guardians:" %}</th>
<td>{{ demographics.number_of_guardians_explanation|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
{% trans "Race" %}:
</th>
<td>
{{ demographics.us_race_ethnicity_identification|default:"No Response" }}
</td>
<th scope="row">{% trans "Race" %}:</th>
<td>{{ demographics.us_race_ethnicity_identification|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Age:
</th>
<td>
{{ demographics.age|default:"No Response" }}
</td>
<th scope="row">Age:</th>
<td>{{ demographics.age|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Gender:
</th>
<td>
{{ demographics.gender|default:"No Response" }}
</td>
<th scope="row">Gender:</th>
<td>{{ demographics.gender|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Education Level:
</th>
<td>
{{ demographics.education_level|default:"No Response" }}
</td>
<th scope="row">Education Level:</th>
<td>{{ demographics.education_level|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Spouse's Education Level:
</th>
<td>
{{ demographics.spouse_education_level|default:"No Response" }}
</td>
<th scope="row">Spouse's Education Level:</th>
<td>{{ demographics.spouse_education_level|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Annual Income:
</th>
<td>
{{ demographics.annual_income|default:"No Response" }}
</td>
<th scope="row">Annual Income:</th>
<td>{{ demographics.annual_income|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Children's Books at Home:
</th>
<td>
{{ demographics.number_of_books|default:"No Response" }}
</td>
<th scope="row">Children's Books at Home:</th>
<td>{{ demographics.number_of_books|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Additional Comments:
</th>
<td>
{{ demographics.additional_comments|default:"No Response" }}
</td>
<th scope="row">Additional Comments:</th>
<td>{{ demographics.additional_comments|default:"No Response" }}</td>
</tr>
<tr>
<th scope="row">
Lookit Referrer:
</th>
<td>
{{ demographics.lookit_referrer|default:"No Response" }}
</td>
<th scope="row">Lookit Referrer:</th>
<td>{{ demographics.lookit_referrer|default:"No Response" }}</td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -201,12 +159,8 @@
{% bs_icon "chevron-down" %}
</a>
</th>
<th scope="col">
Response
</th>
<th scope="col">
Child
</th>
<th scope="col">Response</th>
<th scope="col">Child</th>
<th scope="col">
Completion Status
<a class="text-decoration-none"
Expand Down Expand Up @@ -239,32 +193,24 @@
{% for study in studies %}
<tr>
<td>
<a href="{% url 'exp:study-detail' study.study.id %}">{{ study.study.name }}</a>
</td>
<td>
{{ study.response.uuid }}
</td>
<td>
{{ study.response.child.given_name }}
<a href="{% url 'exp:study' study.study.id %}">{{ study.study.name }}</a>
</td>
<td>{{ study.response.uuid }}</td>
<td>{{ study.response.child.given_name }}</td>
<td>
{% if study.completed %}
Completed
{% else %}
In Progress
{% endif %}
</td>
<td>
{{ study.created |date:"n/d/Y"|default:"N/A" }}
</td>
<td>{{ study.created |date:"n/d/Y"|default:"N/A" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include "studies/_paginator.html" with page=studies request=request %}
{% else %}
<p class="fst-italic">
{{ user.nickname }} has not participated in any studies yet!
</p>
<p class="fst-italic">{{ user.nickname }} has not participated in any studies yet!</p>
{% endif %}
{% endblock content %}
8 changes: 4 additions & 4 deletions accounts/templates/accounts/participant_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
placeholder="Filter by nickname or user global ID"
size="50"
type="text"
value="{{ match }}"/>
<input type="hidden" name="sort" value="{{ sort }}"/>
<input type="hidden" name="page" value="1"/>
value="{{ match }}" />
<input type="hidden" name="sort" value="{{ sort }}" />
<input type="hidden" name="page" value="1" />
</form>
<table class="table" aria-describedby="Study participant list">
<thead>
Expand Down Expand Up @@ -49,7 +49,7 @@
{% for user in object_list %}
{% url 'exp:participant-detail' user.id as url_participant_detail %}
<tr>
<td >
<td>
<a href={{ url_participant_detail }}>
{% if user.nickname %}
{{ user.nickname }}
Expand Down
8 changes: 4 additions & 4 deletions accounts/templates/accounts/researcher-registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
.
</p>
{% form_buttons %}
{% bootstrap_button bs_icon_plus|add:"Create Account" %}
{% endform_buttons %}
</form>
</div>
{% bootstrap_button bs_icon_plus|add:"Create Account" %}
{% endform_buttons %}
</form>
</div>
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p>Dear {{ researcher_name }},</p>
<p>You have been given {{ permission }} permissions to collaborate on {{ study_name }}.</p>
<p>
Here is a link to <a href="{{ base_url }}{% url 'exp:study-detail' study_id %}">start collaborating</a>.
Here is a link to <a href="{{ base_url }}{% url 'exp:study' study_id %}">start collaborating</a>.
</p>
<p>
Best,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion accounts/tests/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand Down
8 changes: 2 additions & 6 deletions exp/templates/exp/_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
id="navbarDropdown"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false">
Help
</a>
aria-expanded="false">Help</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<div>
<a class="dropdown-item"
Expand All @@ -31,9 +29,7 @@
id="navbarDropdown"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false">
{{ request.user.identicon_small_html }} {{ request.user.get_short_name }}
</a>
aria-expanded="false">{{ request.user.identicon_small_html }} {{ request.user.get_short_name }}</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% dropdown_item request 'accounts:manage-account' 'Manage Account' %}
{% dropdown_item request 'exp:lab-list' 'Manage Labs' %}
Expand Down
Loading