From 2eb516f3b8ee2e14a014eabc1b9cbff1af640be1 Mon Sep 17 00:00:00 2001 From: Tom O'Dwyer Date: Fri, 6 Sep 2024 15:59:29 +0100 Subject: [PATCH 1/3] Replace inline styles with Tailwind classes --- airlock/templates/_includes/header.html | 22 +++++++++++++---- airlock/templates/activity.html | 2 +- .../file_browser/file_content/csv.html | 2 +- .../file_browser/request/filegroup.html | 24 ++++++++----------- .../file_browser/request/request.html | 2 +- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/airlock/templates/_includes/header.html b/airlock/templates/_includes/header.html index 9c540143..786ff43f 100644 --- a/airlock/templates/_includes/header.html +++ b/airlock/templates/_includes/header.html @@ -67,17 +67,29 @@
-

TEST MODE ONLY

+

TEST MODE ONLY

{% for username, token in dev_users.items %}
+ action="{% url 'login' %}" + method="POST" + > {% csrf_token %} - +
{% endfor %}
diff --git a/airlock/templates/activity.html b/airlock/templates/activity.html index 2b8da77c..4a1e5ff1 100644 --- a/airlock/templates/activity.html +++ b/airlock/templates/activity.html @@ -8,7 +8,7 @@ {% if activity %}

Loading table data...

- + diff --git a/airlock/templates/file_browser/file_content/csv.html b/airlock/templates/file_browser/file_content/csv.html index 8492cf51..0c5427ab 100644 --- a/airlock/templates/file_browser/file_content/csv.html +++ b/airlock/templates/file_browser/file_content/csv.html @@ -17,7 +17,7 @@
{% if use_datatables %}

Loading table data...

-
+ {% else %} {% endif %} diff --git a/airlock/templates/file_browser/request/filegroup.html b/airlock/templates/file_browser/request/filegroup.html index ea50d8d6..e891f3e7 100644 --- a/airlock/templates/file_browser/request/filegroup.html +++ b/airlock/templates/file_browser/request/filegroup.html @@ -15,25 +15,21 @@ {% #card title=group.title container=True class="group_modal" %}
-
+ {% csrf_token %} -
-
- - {% form_textarea field=group.c2_edit_form.context resize=True hint_below=True show_placeholder=True placeholder="Describe the data to be released in this group of files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} -
-
- {% form_textarea field=group.c2_edit_form.controls resize=True hint_below=True show_placeholder=True placeholder="Describe the disclosure controls that have been applied to these files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} -
-
+ {% form_textarea field=group.c2_edit_form.context show_placeholder=True resize=True placeholder="Describe the data to be released in this group of files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} + {% form_textarea field=group.c2_edit_form.controls resize=True show_placeholder=True placeholder="Describe the disclosure controls that have been applied to these files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} {% if not group.c2_readonly %} -
- {% #button type="submit" variant="success" id="edit-group-button" disabled=group.c2_readonly %}Save{% /button %} -
+ {% #button type="submit" variant="success" id="edit-group-button" class="w-min" disabled=group.c2_readonly %}Save{% /button %} {% endif %} -
+
{% #list_group %} {% for comment, comment_class in group.comments %} diff --git a/airlock/templates/file_browser/request/request.html b/airlock/templates/file_browser/request/request.html index d3951f8e..d2387cf4 100644 --- a/airlock/templates/file_browser/request/request.html +++ b/airlock/templates/file_browser/request/request.html @@ -18,7 +18,7 @@
Please confirm that you have read the OpenSAFELY documentation on data release. In particular note that: -
+

All outputs from the NHS England OpenSAFELY COVID-19 service must be aggregated data with small number suppression applied. The service operates as From db1354ad1fee5ae6396209ed983e316b0dee3a4e Mon Sep 17 00:00:00 2001 From: Tom O'Dwyer Date: Fri, 6 Sep 2024 16:05:09 +0100 Subject: [PATCH 2/3] Fix inline styles in forms --- airlock/forms.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/airlock/forms.py b/airlock/forms.py index 5eb99183..f5e800ec 100644 --- a/airlock/forms.py +++ b/airlock/forms.py @@ -130,13 +130,13 @@ class GroupEditForm(forms.Form): help_text=mark_safe( """

- Please describe the contents of these outputs to help reviewers. This includes: -
    -
  • Variable descriptions
  • -
  • A description and count of the underlying population for each output if it is not included in the output.
  • -
  • Specify population size and degrees of freedom for all regression outputs.
  • -
  • Relationship to other data/tables which through combination may introduce secondary disclosive risks.
  • -
+

Please describe the contents of these outputs to help reviewers. This includes:

+
    +
  • Variable descriptions
  • +
  • A description and count of the underlying population for each output if it is not included in the output.
  • +
  • Specify population size and degrees of freedom for all regression outputs.
  • +
  • Relationship to other data/tables which through combination may introduce secondary disclosive risks.
  • +
""" ), @@ -146,11 +146,11 @@ class GroupEditForm(forms.Form): help_text=mark_safe( """
- Please describe the statistical disclosure controls you have applied to these outputs. This includes: -
    -
  • The threshold used for low number suppression.
  • -
  • The rounding approach used.
  • -
+

Please describe the statistical disclosure controls you have applied to these outputs. This includes:

+
    +
  • The threshold used for low number suppression.
  • +
  • The rounding approach used.
  • +
""" ), From c9cec01b8a103966a16d3656f60205ede072293e Mon Sep 17 00:00:00 2001 From: Tom O'Dwyer Date: Mon, 9 Sep 2024 14:38:15 +0100 Subject: [PATCH 3/3] Fix missing hint_below prop --- airlock/templates/file_browser/request/filegroup.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airlock/templates/file_browser/request/filegroup.html b/airlock/templates/file_browser/request/filegroup.html index e891f3e7..29261b1e 100644 --- a/airlock/templates/file_browser/request/filegroup.html +++ b/airlock/templates/file_browser/request/filegroup.html @@ -22,8 +22,8 @@ method="POST" > {% csrf_token %} - {% form_textarea field=group.c2_edit_form.context show_placeholder=True resize=True placeholder="Describe the data to be released in this group of files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} - {% form_textarea field=group.c2_edit_form.controls resize=True show_placeholder=True placeholder="Describe the disclosure controls that have been applied to these files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} + {% form_textarea field=group.c2_edit_form.context resize=True hint_below=True show_placeholder=True placeholder="Describe the data to be released in this group of files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} + {% form_textarea field=group.c2_edit_form.controls resize=True hint_below=True show_placeholder=True placeholder="Describe the disclosure controls that have been applied to these files" class="w-full max-w-lg mx-auto" rows=6 disabled=group.c2_readonly readonly=group.c2_readonly %} {% if not group.c2_readonly %} {% #button type="submit" variant="success" id="edit-group-button" class="w-min" disabled=group.c2_readonly %}Save{% /button %} {% endif %}