Skip to content

Commit

Permalink
Merge 4.0-rc1 into develop (#827)
Browse files Browse the repository at this point in the history
* fix: improve working of validate_proposal.py

* fix: minor fix for order of get_form_errors

* feat: remove containerItems & reordering

* feat: make stepper do validation

* feat: allow for custom errors from checker

* feat: get_checker_errors for SessionsChecker

* style: formatting

* fix: ensure get_cheker_errors outputs iterable

* fix: bugs on fetc_form_base.html

* feat: make stepper bubbles collapse and refine css working

* fix: make errors block submitting

* fix: improve collapsible logic and stepperitem css classes

* style: style

* feat: rename TranslatedConsentForm

* feat: add fields to proposal and make migration

* feat: modify study model and migration

* feat: make KnowledgeSecurityForm

* feat: update StudyEndForm

* feat: add KnowledgeSecurityView

* feat: implement pdf_diff_logic for new questions

* feat: update auto_review & tests

* fix: woops, some ugly string stuff

* fix: rename KnowledgeSecurityChecker

* style: steez

* fix: update the diff template

* fix: make sure StudyDesign also deletes study types

* fix: small bug on task_create

* Fix/tst stepper template error (#709)

* fix: Completely remove stepper block from proposal_form.html

Should have been named "sidebar", but it does nothing either way

* fix: Don't render stepper if not provided by view

* feat: dumb css implementation on compare_documents.html

* fix: update a lot of translations

* fix: rename TranslatedConsentFormsView to TranslatedConsentView

* fix: remove stressful from soft_validation_fields

* fix: improvements to the StudyEndForm

* style: blck

* fix: update link on index.html

* style: djlint

* fix: rename is_available to is_expanded

* fix: self.current_item_ancestors init's as empty list

* feat: add active css class in Stepper.item_is_current_check()

* feat: add validation to FundingForm

* style: style

* fix: tests

* fix: add test_pdf.pdf for tests

* fix: simplify diff css and put in own diff.css file

* fix: use Session.repeats too for Session.net_duration()

* fix: reinsert diff-ignore

* style: back to black

* fix: update docstring

* fix: simplyfy ModelFormItem.build_css_classes()

* fix: indentation TasksOverviewSection

* fix: save proposal in AutoReviewTests

* fix: rename self.choice_fields attribute of StudyEndForm

* fix: change default view for compare_documents to split

* fix: make compare_documents extend fetc_base

* fix: improve styling on compare_documents.html

* style: djlint

* feat: Add legal_basis attribute to Study + migration

* feat: create PersonalDataForm

* feat: implement the personal_data page

* fix: translations

* fix: back in black

* fix: undo self.repeats in Session.net_duration()

* fix: typo

* fix: replace th with td on row.verbose_name in diff

* fix: implement get property methods for study_types, to not have to delete them

* style: style

* fix: correct title variable proposal_confirmation.html

* fix: last fixes

* fix: return empty list if study has no sessions

* Fix errors for StudyEndForm (#723)

* feat: Load debug settings if DEBUG is True

* fix: Revalidate form after fields get deleted

* style: The tinyest of black changes

* fix: reimplement check_wmo (woops, forgot about this)

* fix: ensure hierarchy gets validated

* fix: big woops on silly bug anonymous legal basis

* fix: make time to create session/task more angry

* fix: center text on warning no session/task

* feat: really hacky solution for hiding ugly, duplicate warning

* style: black phillip

* fix: remove unused template

* fix: ensure depends_on_value also clears dependant radio inputs

* fix: wmo_application frontend logic

* fix: translation issue on session_start.html

* fix: implement get_study_types in study_end to avoid server error

* feat: make StudyEnd and actual ModelForm using custom template

* style: style

* fix: ensure check_field_required also can clear radio fields

* fix: add supervisor to _soft_validation_fields

* fix: validation bugs on ResearcherForm

* feat: always add self.user to applicants and overwrite hidden applicants

* style: black beauty

* Second Attachments PR (#716)

* feat: Import code from old branch to avoid merge

* wip: Working on attachments in new branch

* fix: Mishmash of migrations

* wip: Various fixes for attachments

* feat: Attachment renderable templates & updates

* feat: Change var name and minor changes

* feat: Verbose name for Attachment.upload

* feat: Attachment views

* feat: Attachment form template

* wip: Minor changes

* feat: Add author field to Attachment

* feat: Classmethod to initialize kind from an attachment

* feat: Provide manager object to children

* feat: Download view for attachments

* feat: Break out BaseAttachFormView to make attachment edit view

* fix: Move classes around to prevent circular imports

* wip: Remove attachments manager for now

* feat: Initialize stepper outside of context-getting

* wip: Start managing attachments by Checkers

* feat: Make sure slots know what they're attaching to

* fix: Minor fixes and comment updates

* cleanup: Remove old code and simplify object getting

* feat: Just fill in study slots by hand for now

* feat: Detach functionality for Attachments

* feat: Get Attachment subclasses without kind

* feat: Make slots less dependent on kinds

* feat: Detach view and links, editing flag for AttachFormView

* feat: Extra/optional attachments with DMP example

* feat: New desiredness flags

* feat: New add_slot method

* feat: Template enhancements and cleanup

* style: Black

* style: djlint

* fix: add cdh_files to gitignore

* fix: remove weird is_supervisor from UserOrGroupsAllowedMixin

* fix: remove unused Mixin from proposal_views

* feat: add UserOrGroupsAllowedMixin to ProposalAttachmentDownloadView

* add cdh_files/ to .gitignore

* feat: add chair to required groups for attachment download

* Feature/validate attachments (#737)

* feat: Shortcut to check if a slot is required

* feat: Distinct AttachmentItem for getting attachment errors

* feat: Make the build_css_classes generic

* fix: Contingency for when an item doesn't have a form_class

* style: Black and djlint

* Revise attachments while preserving older versions (#719)

* fix: Remove old documents check while developing

* feat: Copy attachments to new proposal

* feat: Revise attachments owned by multiple objects

* fix: Bug that prevented creation of fresh attachments

* style: black and djlint

* feat: Forgotten detach_form.html template

* Feature/extra attachments (#743)

* feat: Link to add extra attachment

* feat: KIND_CHOICES constant for... Kind choices

* feat: AttachFormView can now handle extra attachments

* feat: Match extra attachments to additional slots

* feat: Remove extra arg, kinds are now selectable when editing

* feat: Avoid using kinds to determine attached model

* fix: Missing detach form

* style: Black and djlint

* docs: Add comment to attachment_slots

* fix: Wrong object PK

* fix: Improve description of action in attach form

* feat: Much nicer styling on the attachments page

* fix: Untranslated string

* Attachments review (#736)

* fix: Remove old documents check while developing

* feat: Copy attachments to new proposal

* feat: Revise attachments owned by multiple objects

* fix: Bug that prevented creation of fresh attachments

* style: black and djlint

* feat: New and old documents together

* wip: Work on better documents_list

* feat: Renderable now takes a template_name argument

* fix: Turn form buttons on attachments page into normal buttons

* feat: get_download_url method for Attachment

* feat: Use get_download_url method in single attachment template

* wip: documents_list for new attachments system

* feat: Forgotten detach_form.html template

* feat: Break out proposal urls into multiple files

* feat: AttachmentsList renderable and mixin

* feat: CompareAttachments view

* debug: Add mime type to error message

* fix: Remove documents checker

* feat: Move AttachmentList helpers into attachment utils

* style: Black and djlint

* feat: Friendly sunny icon when an attachment is new

* fix: Attachments in a new proposal are never new

* fix: Correction, attachments in a new proposal are *always* new

* feat: Break out document-getting from documents_list

* feat: Append legacy documents to Attachments page

* style: Black and djlint

* feat: Warning on detach_form

* feat: minor string changes and translations

* Feature/detailed review attachments view (#752)

* feat: Move utility functions from Item into Slot

* feat: New detailed attachments list view for reviewers

* feat: Link for getting FETC filename of attachments

* fix: Bring RDS up to speed with the changes

* i18n: Translations

* feat: Remove deprecated provision method

* feat: Remove deprecated dmp_edit_link remnants

* stucture: Move Attachmentslist &co to a more logical place

* feat: expansion of the ReviewSidebarMixin empire

* fix: Remove evil twin

* fix: Colectomy

* fix: Remove deprecated templatetag

* docs: Some comments

* feat: Whoops, forgot a template

* feat: Hide stepper when secretary edits documents

* fix: Unused or missing imports

* feat: Hide legacy documents if none are present

* fix: Missing migrations

* feat: Buttons to return to review detail page

* style: Black and djlint

* fix: Also hide form buttons on proposal attachments if secretary

* fix: get_legacy_documents now returns an empty list when no files are found

* fix: Conditionality for form buttons in attachments.html

* fix: Doclist now always returns a proposal container to hold the PDF

* feat: Attachment detailed list now works for supervisor reviews

* i18n: Minor translations

* merge: attachments-4

* style: black and djlint

* Feature/all attachment kinds (#753)

* feat: create all InformationLetter kinds

* feat: add correct informationletter in checker

* feat: check if Study has AV registration

* fix: bug, where legal basis can be 0 ... woopsie

* feature: add all possible kinds

* feature: add all slots, through checkers

* feat: implement navigation buttons for ProposalsAttachmentsView

* feature: a lotta translations

* style: black sabbath

* fix: Make get_kind_from_str resilient to unknown kinds

* feat: Rename OtherProposalAttachment

* feat: Optionality groups for attachment slots

* feat: Render help texts next to slots

* style: Black and djlint

* fix: logic of slots

* feature: implement match + match_and_set

* feat: has_adults() for Study

* feat: base ConsentForm on whether Study.has_adults()

* style: black betty

* fix: Give match_and_set() a return value

* fix: potential TypeError: addition of list and set

* merge: merge translations and do a style pass

---------

Co-authored-by: Michael Villeneuve <[email protected]>

---------

Co-authored-by: Edo Storm <[email protected]>
Co-authored-by: Edo Storm <[email protected]>

* fix: remove old dmp_file field

* fix: rearrange order of DMP page

* fix: rearrange checkers order to reflect form

* feat: add description to DMP attachment kind

* style: blck

* fix: research_settings_contains_schools bug

* fix: textual change Observation.is_nonpublic_space

* fix: ProposalOtherResearchersFormView.form_valid()

* fix: improve wmo_check

* fix: mark_soft_required boolean fix

* fix: StudyDesignForm & custom template improvements

* fix: study design error translation

* fix: my hacky inline js

* fix: make get_intervention not a property

* fix: change get_obsaervation to function call

* fix: make get_sessions function calls

* fix: replace has with get study type, when applicable

* fix: style

* fix: add missing migration

* fix: one forgotten has_obvervation

* fix: add get_form_item to StudyDesignChecker

* style: blck

* fix: legally_incapable question

* fix: task textual changes

* fix: study types text

* fix: personal data text

* fix: informed consent in Dutch

* feat: migrations for the textual changes

* fix: typo

* reference: auto-generated django.po

* feat: translation of textual changes & attachment stuff

* fix: registration help text

* fix: remove MTurk help text

* fix: textual changes recruitments

* fix: textual change institutions

* fix: redo migrations all-in-one

* reference: auto django.po

* fix: django.po changes

* style: style

* fix: update model documents date

* fix: colon in help_text

* Fix/recording attachmnt kinds (#783)

* feat: make adult kinds explicit and add recording agreement kinds for minors

* fix: add new kinds to STUDY_ATTACHMENTS

* feat: implement new attachments kinds and recording logic

* fix: ensure unique variable names in StudyAttachmentsChecker

* fix: make optionailty_group.members a list to fix order

* fix: minor tweak to optionilty_group.html margin bottom

* fix: alter styling of optionailty_group.html some more

* fix: alter_slot styling

* style: style

* fix: make has_recordings a method of Study model

* fix: move ability to add optionilty_group slots to stepper to optionality group

* style: blck

* Revert "style: blck"

This reverts commit ffe2cb3.

* Revert "fix: move ability to add optionilty_group slots to stepper to optionality group"

This reverts commit c66f93e.

* Revert "fix: make has_recordings a method of Study model"

This reverts commit f539246.

* Recording PR suggestions (#785)

* feat: New is_recording attr for Registrations

* fix: Wonky imports

* feat: Move has_recording in Study as a method

* feat: Update fixtures from prod with is_recording field added

* feat: Determine desiredness within optionality group

* feat: Remove OG desiredness setting from checker

* style

* fix: manage.py output erroneously added to fixtures

---------

Co-authored-by: Michael Villeneuve <[email protected]>

* Feature/bubble colours (#760)

* feat: Mark other researchers questions as required

* feat: Remove defaults from other researchers model fields

* feat: Add error on missing WMO object

* feat: Disable the "incomplete" CSS class for now

* feat: Stepper now inserts DisabledItems which are never complete

* fix: Remove old documents holdovers

* feat: Return one-time error to invalidate submit item

* feat: Make PlaceholderItems incomplete by default

* fix: Remove apparently unused build_css_classes

* style: Black and djlint

* feat: Mixin paradigm for get_errors, fixing AttachmentsItem

* feat: Add SVM to StudyDesignForm and ProposalSubmitForm

* fix: Erroneous backslash

* feat: Provide a form error on ProposalSubmit if proposal is not valid

* feat: No error display on proposalsubmitform

* feat: Create error if no document has been added yet

* style: Black and djlint

* undo: No longer add an error when no documents attached

* fix: Validate StudyEndForm with initial_clean()

* bonus: Apply checker errors by default for convenience

* fix: Validate OtherResearchersForm with mark_soft_required()

* style: Black and djlint

* fix: Merge migrations from branches (#792)

* fix: Only run initial clean when not POSTING (#797)

* Feat/attachment validation (#803)

* feat: New gatekeeper_document attribute on Settings

* feat: Methods to get highest gatekeeper requirement

* feat: Modify add_school_slots to use new gatekeeper attribute

* fix: Migration sync with major/4

* fix: Make attachment comments optional

* feat: Missing migration

* feat: More migrations!

* style

* Remove StudyConsent and available_urls (#804)

* feat: Provide fake stepper request if not initialized with one

* feat: Use stepper for continue_url

* feat: Remove available_urls and StudyConsent

* style

* feat: Remove unused helper function

* revert: Keep StudyConset for the duration of the transition period

* fix: remove old observation fields from observation table

* fix: textual change on observation.detail_frequency

* fix: use gettext_lazy for checkers

* feat: increase max_length of study.name to 30

* fix: preserve linebreaks for decision.comments in table

* fix: remove all remnants of old url stuff

* fix: untranslated text

* feat: put observation.details_frequency in observation_table.html

* fix: embargo_end_date logic

* fix: logic on ChangeArchiveStatus

* feat: remove embargo questions from PreAss proposals

* feat: ensure PreAss proposals are never in archive querysets

* fix: remove ChangeArchiveStatus review action for PreAss proposals

* black UwU

* fix: textual change (tc) decision_form.html

* fix: tc proposal_data_management.html

* fix: tc Observation.has_advanced_consent

* fix: tc switch helptext from other_applicants to other_stakeholders

* fix: tc: model documents

* fix: tc: capitalize one word

* fix: tc: start_date warning

* fix: tc: Proposal.self_assessment

* fix: tc: remove auto formatting from wmo doubt warning

* fix: tc: Study.age_groups

* fix: tc: Study.Compensation

* fix: tc: Study.hierarchy

* fix: tc: persoonlijke gegevens >> persoonsgegevens

* fix: tc: Study.legal_basis typo

* fix: tc: study.special_details stuff (also fixture!)

* fix: tc: study_design.html pluralize

* fix: tc: study_design.html

* fix: tc.is_anonymous

* fix: tc: task.feedback

* fix: tc: Session.tasks_duration

* fix: tc: Observation.has_advanced_consent v2

* feat: Improve StudyStart text (with translations) (#805)

* feat: Improve StudyStart text (with translations)

* i18n: More translations

* fix: tc: proposal_data_management.html

* fix: tc: more proposal_data_management.html

* fix: tc: typo translated_consent_forms.html

* fix: tc: Review.comments

* fix: tc: Session.tasks_duration edit 2

* fix: tc: task.description

* fix: tc: decision_form.html

* fix: tc: session description

* feat: lotta migrations (might cause merge issues ...)

* feat: auto generated django.po

* feat: lotta translations

* style: black

* fix: raise permission denied for archive access mixin

* fix: remove archive from home if no access

* style: black

* style: djlint

* Feat/nonstandard proposals (#808)

* feat: Intro text for attachments page

* feat: Apply layout and checker logic tot non-standard proposals

* i18n: translations

* feat: Remove datamanagement from PreAss checkerss

* feat: Use correct submit view for non-standard applications

* feat: Set correct next url for ProposalAttachments

* feat: Correct back_url for various views

* feat: Other Researchers always goes forward to funding

* fix: Preass gets submission validated as well

* style

* fix: WmoApplication checker always return Trajectories if completed

* fix: Attachments go back to WMO in preassessments

* fix: Forgotten wmo import

* fix: Preapproved view goes forward to data management

* fix: Data management takes pre-approved proposals into account

* fix: preas proposals go foward to attachments from WMO

* i18n: Translations

* fix: Use pre_approved submit view where applicable

* fix: Always continue to funding, even in preas

* fix: Go back to preas wmo update page

* fix: Back button for WmoCreate

* feat: Missing migration (just a textual change)

* fix: review requests

* fix: migrations order

* style: djlint

* Fix/supervisor editing (#822)

* fix: Replace stage check with supervisor_editing_flag

* fix: Mark the inform local staff label as safe in the model

* style

* feat: Supervisor editing flag is now provided by view mixin

* feat: Checkers now accept most view mixins

* style

* fix: logic for ChangeArchiveStatus

* fix: merge migrations

* style: black

* Feat/attachments pdf (#806)

* feat: make legacy docs optional in pdf

* feat: reorganize pdf_diff_stuff

* fix: more reorganizing code

* fix: weird unrelated bug that was in here ...

* feat: implement PersonalDataSection

* fix: reorganize back

* feat: create TitleSection helper

* feat: add new attachments to the pdf (sloppily)

* feat: renaming and reoirdering some sections

* feat: make a class for Attachment Sections pdf

* fix: bug with how sessions are fetched for diff

* feat: ensure handle_attachment can recognize revised attachment

* feat: create all sections for diff

* feat: remove all support for legacy docs

* feat: add verbose_name to Attachment.name & comments

* feat: add all documents titlesection

* feat: add all documents title section to diff

* black

* black

* feat: recursive AllAttachmentsSectionsDiff

* feat: docstrings

* style: black

* fix: remove rogue old_docs stuff

* style: black whitespace

* style: another black whitespace

* feat: implement logic for nonstandard proposals

* fix: some nonsense in AttachmentSection.

* fix: bugfix in _match_slot

* fix: stateful consistency

* style: black djlint

* add upload date to AttachmentSection

* style: black

* fix: remove "gewijzigd voor revisie" text

* feat: improve margins and do away with TitleSection

* fix: duplication bug

* fix: redo conflicting migrations

* i18n: Translations

* feat: Change attachment field order in diff and pdf

---------

Co-authored-by: Michael Villeneuve <[email protected]>

* fix: Remove mention of persoonlijke gegevens

* i18n: Translations

* Embargo validation fix (#828)

* fix: Embargo KeyError

* style

* fix: change trans to blocktrans on index.html

* fix: make inform_local_staff label like other_stakeholders label

* fix: remove redundant double mark_safe

* syle: black

* fix: avoid double validation of submit form

* style: black

* wip: Fixing proposal tests

* fix: use the test pdf for tests

* fix: bug concerning PreAss Wmo in tests

* fix: remove if True

* style: black

* feat: comment about final_validation

* feat: explicitly add wmo to proposal in tests

* style: black

* fix: submit validation error check for url instead of page

* Feature/attachment filename generator (#836)

* feat: Import code from old branch to avoid merge

* wip: Working on attachments in new branch

* fix: Mishmash of migrations

* wip: Various fixes for attachments

* feat: Attachment renderable templates & updates

* feat: Change var name and minor changes

* feat: Verbose name for Attachment.upload

* feat: Attachment views

* feat: Attachment form template

* wip: Minor changes

* feat: Add author field to Attachment

* feat: Classmethod to initialize kind from an attachment

* feat: Provide manager object to children

* feat: Download view for attachments

* feat: Break out BaseAttachFormView to make attachment edit view

* fix: Move classes around to prevent circular imports

* wip: Remove attachments manager for now

* feat: Initialize stepper outside of context-getting

* wip: Start managing attachments by Checkers

* feat: Make sure slots know what they're attaching to

* fix: Minor fixes and comment updates

* cleanup: Remove old code and simplify object getting

* feat: Just fill in study slots by hand for now

* feat: Detach functionality for Attachments

* feat: Get Attachment subclasses without kind

* feat: Make slots less dependent on kinds

* feat: Detach view and links, editing flag for AttachFormView

* feat: Extra/optional attachments with DMP example

* feat: New desiredness flags

* feat: New add_slot method

* feat: Template enhancements and cleanup

* style: Black

* style: djlint

* add cdh_files/ to .gitignore

* fix: create and implement attachment filename generator

* feat: proper implementation of filename generator

* fix: bug in Study.research_settings_contains_schools

* fix: Remove FnGen from model

* feat: Auto retrieve Kind from attachment if none provided

* feat: Classmethod to get a slot from a proposal

* wip: Get filename from slot instead of kind

* feat: Rename and finalize generate_filename() function

* feat: Point methods in right direction

* style

* feat: Custom fn_part for kinds

* feat: Add order variable for Slots and FnGen

* fix: Turn get_fn_part into classmethod

* fix: Kind derivation for empty slot matching

* fix: Delete anachronistic migration

* feat: Functions to enumerate slots

* feat: Template changes to display normalized filename after <br />

* feat: Download filenames in PDF and DIFF are now the normalized versions

* style

* Feat/fetc filename in pdf (#837)

* feat: create custom attachment row

* feat: make us of the custom attachment row

* style: black

* fix: Prevent collapsing of value in PDF

* fix: Hyphenate kind in fetc filename

* fix: Merge accident, double return statement

* fix: Actually implement stepper.filled_slots

* fix: We can't assume all owners are represented in att_dict

---------

Co-authored-by: Edo Storm <[email protected]>
Co-authored-by: Edo Storm <[email protected]>

* hotfix: Forgotten cls argument

* hotfix: Forgotten proposal argument

* hotfix: Always set content disposition to true for attachment items

---------

Co-authored-by: Edo Storm <[email protected]>
Co-authored-by: Edo Storm <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent 00e2b22 commit 4d4c1a4
Show file tree
Hide file tree
Showing 294 changed files with 14,292 additions and 7,636 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ __pycache__/
*.mo

### Project-specific ###
media/
media/*
!media/test_pdf.pdf
certs/
fetc/ldap_settings.py
fetc/saml_settings.py
*.sqlite3
cdh_files/
debug_settings.py

### Coverage ###
.coverage
Expand Down
1 change: 1 addition & 0 deletions attachments/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions attachments/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions attachments/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AttachmentsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "attachments"
291 changes: 291 additions & 0 deletions attachments/kinds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
from django.utils.translation import gettext as _
from django.urls import reverse

from proposals.models import Proposal
from studies.models import Study
from main.utils import renderable
from attachments.models import ProposalAttachment, StudyAttachment
from attachments.utils import AttachmentKind, desiredness


class ProposalAttachmentKind(AttachmentKind):

attached_object = Proposal
attachment_class = ProposalAttachment


class StudyAttachmentKind(AttachmentKind):

attached_object = Study
attachment_class = StudyAttachment


#####################
# Information letters
#####################


class InformationLetterAnonymous(StudyAttachmentKind):

db_name = "information_letter_anonymous"
name = _("Informatiebrief anoniem onderzoek")
description = _(
"Je verzamelt en verwerkt de gegevens van je deelnemers"
" anoniem. Je moet je deelnemers dan wél informeren op"
" ethische gronden (zodat ze kunnen beslissen of ze"
" vrijwillig willen meedoen), maar omdat de AVG niet"
" van toepassing is op anonieme gegevens, hoef je geen"
" informatie te verstrekken over de verwerking van"
" persoonsgegevens."
)
desiredness = desiredness.REQUIRED


class InformationLetterPublicInterest(StudyAttachmentKind):

db_name = "information_letter_public_interest"
name = _("Informatiebrief algemeen belang")
description = _(
"Je kiest ervoor om de verwerking van persoonsgegevens te"
" baseren op het algemeen belang. In beginsel is dit"
" de standaardwerkwijze. \n"
"Let op! Voor bepaalde aspecten van je onderzoek kan het"
" desondanks nodig zijn om toestemming te vragen."
)
desiredness = desiredness.REQUIRED


class InformationLetterConsent(StudyAttachmentKind):

db_name = "information_letter_consent"
name = _("Informatiebrief toestemming")
description = _(
"Er zijn redenen om de verwerking van persoonsgegevens"
" te baseren op toestemming van de deelnemers."
" Bijvoorbeeld als er gevoelige data wordt verzameld of"
" er met minderjarigen wordt gewerkt."
)
desiredness = desiredness.REQUIRED


LEGAL_BASIS_KIND_DICT = {
Study.LegalBases.ANONYMOUS: InformationLetterAnonymous,
Study.LegalBases.CONSENT: InformationLetterConsent,
Study.LegalBases.PUBLIC_INTEREST: InformationLetterPublicInterest,
}


###############
# Consent forms
###############


class ConsentFormAdults(StudyAttachmentKind):

db_name = "consent_form_adults"
name = _("Toestemmingsverklaring 16+")
description = _(
"Je baseert de verwerking van persoonsgegevens binnen je onderzoek op"
" de wettelijke grondslag toestemming. De deelnemers zijn volwassenen"
" (16 jaar en ouder)."
)
desiredness = desiredness.REQUIRED


class ConsentPublicInterestSpecialDetails(StudyAttachmentKind):

db_name = "consent_public_interest_special_details"
name = _("Toestemmingsverklaring algemeen belang bijzondere persoonsgegevens")
description = _(
"Je baseert de verwerking van persoonsgegevens binnen je onderzoek"
" weliswaar op de wettelijke grondslag algemeen belang, maar je"
" verzamelt zgn. bijzondere persoonsgegevens externe link en daarvoor"
" heb je toestemming nodig."
)
desiredness = desiredness.REQUIRED


class ConsentChildrenParents(StudyAttachmentKind):

db_name = "consent_children_w_parents"
name = _("Toestemmingsverklaring kinderen tot 16 jaar, ouders of voogden aanwezig")
description = _(
"Je baseert de verwerking van persoonsgegevens binnen je"
" onderzoek op de wettelijke grondslag toestemming. De"
" deelnemers zijn kinderen jonger dan 16 jaar en minimaal"
" één van de ouders of voogden is bij het onderzoek aanwezig."
)
desiredness = desiredness.REQUIRED


class ConsentChildrenNoParents(StudyAttachmentKind):

db_name = "consent_children_no_parents"
name = _("Toestemmingsverklaring kinderen tot 16 jaar, ouders of voogden afwezig")
description = _(
"Je baseert de verwerking van persoonsgegevens binnen je"
" onderzoek op de wettelijke grondslag toestemming. De"
" deelnemers zijn kinderen jonger dan 16 jaar en er zijn"
" geen ouders of voodgen aanwezig."
)
desiredness = desiredness.REQUIRED


####################
# Recordings consent
####################


class AgreementRecordingsAdults(StudyAttachmentKind):

db_name = "agreement_av_recordings_adults"
name = _("Akkoordverklaring beeld- en geluidsopnames algemeen belang 16+")
description = _(
"Je baseert de verwerking van persoonsgegevens op de"
" wettelijke grondslag algemeen belang, maar je maakt beeld- en/of"
" geluidsopnames van volwassenen en daar moeten je deelnemers op ethische gronden"
" mee instemmen. Ook voor het verdere gebruik van die opnames kun"
" je de afspraken schriftelijk vastleggen."
)
desiredness = desiredness.REQUIRED


class AgreementRecordingsChildrenParents(StudyAttachmentKind):

db_name = "agreement_av_recordings_children_w_parents"
name = _(
"Akkoordverklaring beeld- en geluidsopnames tot 16 jaar, ouders of voogden aanwezig"
)
description = _(
"Je baseert de verwerking van persoonsgegevens op de"
" wettelijke grondslag algemeen belang, maar je maakt beeld- en/of"
" geluidsopnames van kinderen in aanwezigheid van diens ouders of voogden."
" Daar moeten de ouders of voogden van de deelnemers op ethische gronden"
" mee instemmen. Ook voor het verdere gebruik van die opnames kun"
" je de afspraken schriftelijk vastleggen."
)
desiredness = desiredness.REQUIRED


class AgreementRecordingsChildrenNoParents(StudyAttachmentKind):

db_name = "agreement_av_recordings_children_no_parents"
name = _(
"Akkoordverklaring beeld- en geluidsopnames tot 16 jaar, ouders of voogden afwezig"
)
description = _(
"Je baseert de verwerking van persoonsgegevens op de"
" wettelijke grondslag algemeen belang, maar je maakt beeld- en/of"
" geluidsopnames van kinderen in aanwezigheid van diens ouders of voogden."
" Daar moeten de ouders of voogden van de deelnemers op ethische gronden"
" mee instemmen. Ook voor het verdere gebruik van die opnames kun"
" je de afspraken schriftelijk vastleggen."
)
desiredness = desiredness.REQUIRED


class ScriptVerbalConsentRecordings(StudyAttachmentKind):

db_name = "script_verbal_consent_recordings"
name = _("Script voor mondelinge toestemming opnames")
description = _(
"Je interviewt deelnemers en je maakt daarvan beeld- en/of"
" geluidsopnames. De toestemming daarvoor, en de eventuele"
" toestemming en afspraken met betrekking tot andere aspecten van"
" de verwerking van persoonsgegevens, leg je vast in een aparte opname."
)
desiredness = desiredness.REQUIRED


##############
# School stuff
##############


class SchoolInformationLetter(ProposalAttachmentKind):

db_name = "school_information_letter"
name = _("Informatiebrief gatekeeper/schoolleiding")
description = _(
"Je wilt onderzoek gaan doen binnen een bepaalde instelling (bijv."
" een school) en je verzoekt de leiding van die instelling om"
" medewerking. Voor het maken van een geïnformeerde keuze moet de"
" leiding van de instelling op de hoogte zijn van de opzet van je"
" onderzoek en van allerlei praktische aspecten."
)
desiredness = desiredness.REQUIRED


class SchoolConsentForm(ProposalAttachmentKind):

db_name = "school_consent_form"
name = _("Akkoordverklaring gatekeeper/schoolleiding")
description = _(
"Je wilt onderzoek gaan doen binnen een bepaalde instelling (bijv."
" een school) en je verzoekt de leiding van die instelling om"
" medewerking. De schoolleiding moet, na goed geïnformeerd te zijn"
" toestemming geven voor het onderzoek."
)
desiredness = desiredness.REQUIRED


#############
# Other stuff
#############


class DataManagementPlan(ProposalAttachmentKind):

db_name = "dmp"
name = _("Data Management Plan")
description = _(
"Een Data Management Plan (DMP) is een document, dat "
"voorafgaand aan een onderzoeksproject wordt opgesteld. Hierin "
"worden alle aspecten omtrent de omgang met onderzoeksdata, tijdens "
"en na afloop van het onderzoek, uiteengezet."
)
desiredness = desiredness.RECOMMENDED

def num_recommended(self):
return 1


class OtherAttachment(ProposalAttachmentKind):

db_name = "other"
name = _("Overig bestand")
description = _("Voor alle overige soorten bestanden")

def num_required(self):
return 0

def num_suggested(self):
"""
You may always add another miscellaneous file."""
return self.num_provided + 1


STUDY_ATTACHMENTS = [
InformationLetterAnonymous,
InformationLetterPublicInterest,
InformationLetterConsent,
AgreementRecordingsAdults,
AgreementRecordingsChildrenParents,
AgreementRecordingsChildrenNoParents,
ScriptVerbalConsentRecordings,
ConsentPublicInterestSpecialDetails,
ConsentChildrenParents,
ConsentChildrenNoParents,
ConsentFormAdults,
]

PROPOSAL_ATTACHMENTS = [
SchoolInformationLetter,
SchoolConsentForm,
DataManagementPlan,
OtherAttachment,
]

ATTACHMENTS = PROPOSAL_ATTACHMENTS + STUDY_ATTACHMENTS

KIND_CHOICES = list(((kind.db_name, kind.name) for kind in ATTACHMENTS))
Loading

0 comments on commit 4d4c1a4

Please sign in to comment.