- Characteristics -
+Characteristics
- Characteristic - | -- # Children - | +Characteristic | +# Children |
---|---|---|---|
- {{ characteristic }} - | -- {{ child_count }} - | +{{ characteristic }} | +{{ child_count }} |
From d7099bcfd2b56f488f39831a2949a1d82b0836d6 Mon Sep 17 00:00:00 2001 From: CJ Green <44074998+okaycj@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:42:06 -0400 Subject: [PATCH 01/45] Add js2py package for js validation --- poetry.lock | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 3 ++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6967b451a..703270614 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1279,6 +1279,22 @@ files = [ {file = "jmespath-0.10.0.tar.gz", hash = "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"}, ] +[[package]] +name = "js2py" +version = "0.74" +description = "JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python." +optional = false +python-versions = "*" +files = [ + {file = "Js2Py-0.74-py3-none-any.whl", hash = "sha256:40a508a79e2f8d624e3f2e604f90a1e6f46ac75b416d7f4745939ff4a2e95e09"}, + {file = "Js2Py-0.74.tar.gz", hash = "sha256:39f3a6aa8469180efba3c8677271df27c31332fd1b471df1af2af58b87b8972f"}, +] + +[package.dependencies] +pyjsparser = ">=2.5.1" +six = ">=1.10" +tzlocal = ">=1.2" + [[package]] name = "jsbeautifier" version = "1.14.9" @@ -1829,6 +1845,17 @@ files = [ {file = "pyinstrument_cext-0.2.4.tar.gz", hash = "sha256:79b29797209eebd441a8596accfa8b617445d9252fbf7ce75d3a4a0eb46cb877"}, ] +[[package]] +name = "pyjsparser" +version = "2.7.1" +description = "Fast javascript parser (based on esprima.js)" +optional = false +python-versions = "*" +files = [ + {file = "pyjsparser-2.7.1-py2-none-any.whl", hash = "sha256:2b12842df98d83f65934e0772fa4a5d8b123b3bc79f1af1789172ac70265dd21"}, + {file = "pyjsparser-2.7.1.tar.gz", hash = "sha256:be60da6b778cc5a5296a69d8e7d614f1f870faf94e1b1b6ac591f2ad5d729579"}, +] + [[package]] name = "pyotp" version = "2.6.0" @@ -2381,6 +2408,34 @@ files = [ {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, ] +[[package]] +name = "tzdata" +version = "2023.3" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"}, + {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, +] + +[[package]] +name = "tzlocal" +version = "5.0.1" +description = "tzinfo object for the local timezone" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tzlocal-5.0.1-py3-none-any.whl", hash = "sha256:f3596e180296aaf2dbd97d124fe76ae3a0e3d32b258447de7b939b3fd4be992f"}, + {file = "tzlocal-5.0.1.tar.gz", hash = "sha256:46eb99ad4bdb71f3f72b7d24f4267753e240944ecfc16f25d2719ba89827a803"}, +] + +[package.dependencies] +tzdata = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +devenv = ["black", "check-manifest", "flake8", "pyroma", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"] + [[package]] name = "urllib3" version = "1.26.15" @@ -2544,4 +2599,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = ">=3.9 <3.10" -content-hash = "34bb0d988941235be5529d96ff77ff553a9f66a6663436fbd513d1c857843782" +content-hash = "0dd763f1c9e62a1a717214b9ec5a4103730aa8bd18bca787662d4415f9061a9c" diff --git a/pyproject.toml b/pyproject.toml index 44e49c749..838405ccd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ transitions = "0.9.0" uWSGI = "2.0.19.1" pillow = "9.4.0" django-bootstrap-icons = "0.8.2" +js2py = "^0.74" [tool.poetry.group.dev.dependencies] coverage = "^7.2" @@ -63,7 +64,7 @@ beautifulsoup4 = "^4.10.0" black = "22.3.0" pre-commit = "2.18.1" libsass = "^0.22.0" -djlint = "1.32.1" +djlint = "^1.32.1" [build-system] requires = ["poetry-core>=1.0.0"] From 7f70360a354f2876768e1202f0b148d8d237d05d Mon Sep 17 00:00:00 2001 From: CJ Green <44074998+okaycj@users.noreply.github.com> Date: Wed, 26 Jul 2023 12:43:02 -0400 Subject: [PATCH 02/45] html format changes --- accounts/templates/accounts/participant_list.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/templates/accounts/participant_list.html b/accounts/templates/accounts/participant_list.html index a8b14ae22..afffbb466 100644 --- a/accounts/templates/accounts/participant_list.html +++ b/accounts/templates/accounts/participant_list.html @@ -17,8 +17,8 @@ size="50" type="text" value="{{ match }}"/> - - + +
- {{ 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 afffbb466..39652129a 100644 --- a/accounts/templates/accounts/participant_list.html +++ b/accounts/templates/accounts/participant_list.html @@ -16,7 +16,7 @@ placeholder="Filter by nickname or user global ID" size="50" type="text" - value="{{ match }}"/> + value="{{ match }}" /> 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/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 @@ -67,9 +65,7 @@ name="min_age_months" title=""> {% for x, y in form.fields.min_age_months.choices %} - + {% endfor %} @@ -84,9 +80,7 @@ name="min_age_days" title=""> {% for x, y in form.fields.min_age_days.choices %} - + {% endfor %} @@ -114,9 +108,7 @@ title="" id="id_max_age_years"> {% for x, y in form.fields.max_age_years.choices %} - + {% endfor %} @@ -131,9 +123,7 @@ name="max_age_months" title=""> {% for x, y in form.fields.max_age_months.choices %} - + {% endfor %} @@ -148,9 +138,7 @@ name="max_age_days" title=""> {% for x, y in form.fields.max_age_days.choices %} - + {% endfor %} diff --git a/studies/templates/studies/_study_type.html b/studies/templates/studies/_study_type.html index ad9919e5a..cd003f54a 100644 --- a/studies/templates/studies/_study_type.html +++ b/studies/templates/studies/_study_type.html @@ -19,7 +19,7 @@ data-previous='{% if not create %}{{ study.metadata|get_key:key|default:"" }}{% endif %}'> + {% if study and study.metadata|get_key:key %}checked{% endif %} /> {% elif field.input_type == "radio" %} @@ -35,7 +35,7 @@ + {% if study and study.metadata|get_key:key == option %}checked{% endif %} /> {{ option }} @@ -46,11 +46,11 @@ + value="{{ other_value }}" /> {% endwith %} {% endwith %} {% else %} - + {% endif %} {% endif %} {% endfor %} @@ -65,7 +65,7 @@ title="{{ help_text }}" name="{{ key }}" type="{{ field.input_type }}" - value="{% if study_type.id == currentType and not create %}{{ study.metadata|get_key:key|default:'' }}{% else %}{{ value | default:'' }}{% endif %}"/> + value="{% if study_type.id == currentType and not create %}{{ study.metadata|get_key:key|default:'' }}{% else %}{{ value | default:'' }}{% endif %}" />Declarations:
{{ log.extra.declarations.issues_description }}
{% endif %} diff --git a/studies/templates/studies/study_detail/_study_status.html b/studies/templates/studies/study_detail/_study_status.html index ab521860b..f4f138b54 100644 --- a/studies/templates/studies/study_detail/_study_status.html +++ b/studies/templates/studies/study_detail/_study_status.html @@ -17,9 +17,7 @@ type="button" id="changeStudyState" data-bs-toggle="dropdown" - aria-expanded="false"> - Change State - + aria-expanded="false">Change State