Skip to content

Commit

Permalink
Add instructions for context and controls
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Sep 6, 2024
1 parent c722892 commit 5fcc1bd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
33 changes: 31 additions & 2 deletions airlock/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django import forms
from django.forms.formsets import BaseFormSet, formset_factory
from django.utils.safestring import mark_safe

from airlock.enums import RequestFileType, Visibility
from airlock.models import FileGroup
Expand Down Expand Up @@ -124,8 +125,36 @@ def clean(self):


class GroupEditForm(forms.Form):
context = forms.CharField(required=False)
controls = forms.CharField(required=False)
context = forms.CharField(
required=False,
help_text=mark_safe(
"""
<div class="c2-help">
Please describe the contents of these outputs to help reviewers. This includes:
<ul style="margin-top: 0;">
<li>Variable descriptions</li>
<li>A description and count of the underlying population for each output if it is not included in the output.</li>
<li>Specify population size and degrees of freedom for all regression outputs.</li>
<li>Relationship to other data/tables which through combination may introduce secondary disclosive risks.</li>
</ul>
</div>
"""
),
)
controls = forms.CharField(
required=False,
help_text=mark_safe(
"""
<div class="c2-help">
Please describe the statistical disclosure controls you have applied to these outputs. This includes:
<ul>
<li>The threshold used for low number suppression.</li>
<li>The rounding approach used.</li>
</ul>
</div>
"""
),
)

@classmethod
def from_filegroup(cls, filegroup: FileGroup, *args, **kwargs):
Expand Down
11 changes: 9 additions & 2 deletions airlock/templates/file_browser/request/filegroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@
.comments .comment_blinded {
background-color: darkgrey;
}

.c2-help {
line-height: 1.6;
font-size: small;
}

</style>
{% #card title=group.title container=True class="group_modal" %}
<div data-testid="c3">
<form action="{{ group.c2_edit_url }}" method="POST" aria-label="group-edit-form">
{% csrf_token %}
<div style="display: flex; flex-direction: row; width: 100%; flex-wrap: wrap; gap: 1rem;">
<div style="display: flex: flex-direction: column; flex-basis: 100%; flex: 1;">
{% 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.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 %}
</div>
<div style="display: flex: flex-direction: column; flex-basis: 100%; flex: 1; gap: 1rem;">
{% 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.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 %}
</div>
</div>
{% if not group.c2_readonly %}
Expand Down

0 comments on commit 5fcc1bd

Please sign in to comment.