Skip to content

Commit

Permalink
Merge branch 'develop' into feat/minor_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoStorm96 committed Jan 15, 2025
2 parents a42b087 + d07be8d commit ac369d0
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 81 deletions.
3 changes: 1 addition & 2 deletions attachments/templates/attachments/attachments_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ <h6>{{ container.header }}</h6>
<img src="{% static 'proposals/images/arrow_divide.png' %}"
title="{% trans 'Toon verschillen' %}">
</a>
{% endif %}
{% if item.slot.is_new %}
{% elif item.slot.is_new %}
<img src="{% static 'proposals/images/weather-clear.png' %}"
title="{% trans 'Nieuw bestand' %}">
</a>
Expand Down
26 changes: 24 additions & 2 deletions attachments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ def get_fetc_filename(
):
return generate_filename(self)

def get_provision(
self,
):
if self.comparable:
return _("Gereviseerd")
if self.is_new:
return _("Nieuw bij deze aanvraag")
return "Bestaand bestand"

@property
def classes(self):
if self.required:
Expand All @@ -117,13 +126,26 @@ def classes(self):

@property
def is_new(self):
"""
Returns true if this attachment file has not been seen before
by the Ethics committee. Please note that this includes revised
files.
"""
ancestor_proposal = self.get_proposal().parent
# If this is a fresh proposal we must be new, regardless
# of if we have a parent.
if not ancestor_proposal:
return True
# Otherwise, we're new only if we have no parent.
return not self.attachment.parent
# We gather the set of ancestor objects
ancestor_objects = [ancestor_proposal] + list(ancestor_proposal.study_set.all())
for obj in ancestor_objects:
# If this object is attached to any of these ancestor objects,
# it is definitely not new
if self.attachment.attached_to.contains(obj):
return False
# If none of the above has returned yet, we consider the remaining
# attachments to be new.
return True

@property
def comparable(self):
Expand Down
96 changes: 51 additions & 45 deletions locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ msgstr ""

#: attachments/kinds.py:31
msgid "Informatiebrief anoniem onderzoek"
msgstr "Information about the researcher"
msgstr "Information letter for anonymous research"

#: attachments/kinds.py:33
msgid ""
Expand Down Expand Up @@ -245,7 +245,7 @@ msgstr "Other file type"
msgid "Voor alle overige soorten bestanden"
msgstr "For miscellaneous files"

#: attachments/models.py:24 proposals/utils/pdf_diff_utils.py:244
#: attachments/models.py:24 proposals/utils/pdf_diff_utils.py:267
#: reviews/templates/reviews/review_attachments.html:77
msgid "Bestand"
msgstr "File"
Expand Down Expand Up @@ -294,15 +294,15 @@ msgstr "View all"
#: attachments/templates/attachments/attachments_list.html:28
#: main/templatetags/compare_tags.py:63
#: proposals/templates/proposals/vue_templates/proposal_list.html:51
#: reviews/templates/reviews/review_attachments.html:69
#: reviews/templates/reviews/review_attachments.html:63
#: reviews/templates/reviews/review_detail_sidebar.html:30
#: reviews/templates/reviews/simple_compare_link.html:7
#: reviews/templates/reviews/vue_templates/decision_list.html:53
#: reviews/templates/reviews/vue_templates/review_list.html:54
msgid "Toon verschillen"
msgstr "Show differences"

#: attachments/templates/attachments/attachments_list.html:33
#: attachments/templates/attachments/attachments_list.html:32
msgid "Nieuw bestand"
msgstr "New document"

Expand Down Expand Up @@ -343,6 +343,16 @@ msgstr "Optional"
msgid "Extra"
msgstr "Extra"

#: attachments/utils.py:111
msgid "Gereviseerd"
msgstr "Revised"

#: attachments/utils.py:113
#: reviews/templates/reviews/review_attachments.html:67
#: reviews/templates/reviews/review_attachments.html:69
msgid "Nieuw bij deze aanvraag"
msgstr "New with this review"

#: faqs/menus.py:7
msgid "FETC-GW website"
msgstr "FEtC-H website"
Expand Down Expand Up @@ -474,7 +484,7 @@ msgstr "How many times a week will the intervention session take place?"

#: interventions/templates/interventions/intervention_form.html:7
#: interventions/templates/interventions/intervention_form.html:42
#: proposals/utils/pdf_diff_sections.py:244
#: proposals/utils/pdf_diff_sections.py:245
msgid "Het interventieonderzoek"
msgstr "Intervention study"

Expand All @@ -500,11 +510,11 @@ msgstr "Intervention saved"
msgid "Dit veld is verplicht."
msgstr "This field is required."

#: main/models.py:12 main/utils.py:17 proposals/utils/pdf_diff_utils.py:305
#: main/models.py:12 main/utils.py:17 proposals/utils/pdf_diff_utils.py:329
msgid "ja"
msgstr "yes"

#: main/models.py:13 main/utils.py:17 proposals/utils/pdf_diff_utils.py:305
#: main/models.py:13 main/utils.py:17 proposals/utils/pdf_diff_utils.py:329
msgid "nee"
msgstr "no"

Expand Down Expand Up @@ -1311,7 +1321,7 @@ msgstr "How many hours of observation will take place on average per day?"

#: observations/templates/observations/observation_form.html:7
#: observations/templates/observations/observation_form.html:32
#: proposals/utils/pdf_diff_sections.py:300
#: proposals/utils/pdf_diff_sections.py:301
msgid "Het observatieonderzoek"
msgstr "Observational study"

Expand Down Expand Up @@ -1888,7 +1898,7 @@ msgstr ""
"include it here. Supplying a DMP can expedite ethical assessment of "
"proposals."

#: proposals/models.py:463 proposals/utils/pdf_diff_sections.py:630
#: proposals/models.py:463 proposals/utils/pdf_diff_sections.py:634
msgid "Ruimte voor eventuele opmerkingen"
msgstr "Space for possible comments"

Expand Down Expand Up @@ -2222,8 +2232,8 @@ msgid "Toevoegen"
msgstr "Add"

#: proposals/templates/proposals/attachments.html:47
#: proposals/utils/pdf_diff_utils.py:382 proposals/utils/pdf_diff_utils.py:409
#: proposals/utils/pdf_diff_utils.py:418 proposals/utils/pdf_diff_utils.py:442
#: proposals/utils/pdf_diff_utils.py:406 proposals/utils/pdf_diff_utils.py:433
#: proposals/utils/pdf_diff_utils.py:442 proposals/utils/pdf_diff_utils.py:466
msgid "Traject "
msgstr "Trajectory "

Expand Down Expand Up @@ -2644,7 +2654,7 @@ msgstr ""

#: proposals/templates/proposals/proposal_form.html:7
#: proposals/templates/proposals/proposal_form.html:57
#: proposals/utils/pdf_diff_sections.py:40
#: proposals/utils/pdf_diff_sections.py:41
msgid "Algemene informatie over de aanvraag"
msgstr "General information about the application"

Expand Down Expand Up @@ -2850,7 +2860,7 @@ msgstr ""
#: proposals/templates/proposals/proposal_start.html:52
#: proposals/templates/proposals/proposal_start_practice.html:52
#: proposals/templates/proposals/study_start.html:67
#: proposals/utils/pdf_diff_utils.py:389
#: proposals/utils/pdf_diff_utils.py:413
#: reviews/templates/reviews/committee_members_workload.html:23
#: reviews/templates/reviews/review_attachments.html:42
msgid "Traject"
Expand Down Expand Up @@ -3150,7 +3160,7 @@ msgid "Concept-aanmelding versturen"
msgstr "Submit draft application"

#: proposals/templates/proposals/proposal_submit.html:155
#: proposals/utils/pdf_diff_sections.py:613
#: proposals/utils/pdf_diff_sections.py:617
msgid "Aanmelding versturen"
msgstr "Submit application"

Expand Down Expand Up @@ -3311,7 +3321,7 @@ msgstr "Additional forms"

#: proposals/templates/proposals/study_start.html:7
#: proposals/templates/proposals/study_start.html:59
#: proposals/utils/pdf_diff_sections.py:148
#: proposals/utils/pdf_diff_sections.py:149
msgid "Eén of meerdere trajecten?"
msgstr "One or more trajectories?"

Expand Down Expand Up @@ -3340,7 +3350,7 @@ msgstr "Current application"

#: proposals/templates/proposals/translated_consent_forms.html:7
#: proposals/templates/proposals/translated_consent_forms.html:20
#: proposals/utils/pdf_diff_sections.py:539
#: proposals/utils/pdf_diff_sections.py:540
msgid "Vertaling formulieren"
msgstr "Translation of documents"

Expand Down Expand Up @@ -3431,7 +3441,7 @@ msgstr "Revision/amendment of"

#: proposals/templates/proposals/wmo_application.html:7
#: proposals/templates/proposals/wmo_application.html:23
#: proposals/utils/pdf_diff_sections.py:135
#: proposals/utils/pdf_diff_sections.py:136
msgid "Aanmelding bij de METC"
msgstr "Registration with the METC"

Expand All @@ -3454,7 +3464,7 @@ msgstr "Start again"

#: proposals/templates/proposals/wmo_form.html:7
#: proposals/templates/proposals/wmo_form.html:28
#: proposals/utils/pdf_diff_sections.py:110
#: proposals/utils/pdf_diff_sections.py:111
msgid ""
"Ethische toetsing nodig door een Medische Ethische Toetsingscommissie (METC)?"
msgstr ""
Expand Down Expand Up @@ -3509,7 +3519,7 @@ msgstr "Conclusion trajectories"
msgid "Deelnemers"
msgstr "Participants"

#: proposals/utils/checkers.py:643 proposals/utils/pdf_diff_sections.py:166
#: proposals/utils/checkers.py:643 proposals/utils/pdf_diff_sections.py:167
#: studies/templates/studies/study_personal_data.html:7
#: studies/templates/studies/study_personal_data.html:22
msgid "Persoonsgegevens"
Expand Down Expand Up @@ -3548,38 +3558,38 @@ msgstr "Translations"
msgid "Indienen"
msgstr "Submit"

#: proposals/utils/pdf_diff_sections.py:200
#: proposals/utils/pdf_diff_sections.py:201
#: studies/templates/studies/study_form.html:7
#: studies/templates/studies/study_form.html:64
msgid "De deelnemers"
msgstr "Participants"

#: proposals/utils/pdf_diff_sections.py:402
#: proposals/utils/pdf_diff_sections.py:403
msgid "Het takenonderzoek en interviews"
msgstr "Task-based research and interviews"

#: proposals/utils/pdf_diff_sections.py:474
#: proposals/utils/pdf_diff_sections.py:475
#: studies/templates/studies/study_end.html:8
msgid "Overzicht en eigen beoordeling van het gehele onderzoek"
msgstr "Overview and self-assessment of the entire study"

#: proposals/utils/pdf_diff_sections.py:510
#: proposals/utils/pdf_diff_sections.py:511
msgid "Kennisveiligheid en risico onderzoekers"
msgstr "Knowledge security and researcher risk"

#: proposals/utils/pdf_diff_sections.py:605
#: proposals/utils/pdf_diff_sections.py:609
msgid "Data Management"
msgstr "Data Management"

#: proposals/utils/pdf_diff_sections.py:776
#: proposals/utils/pdf_diff_sections.py:780
msgid "Documenten - Aanvraag in het geheel"
msgstr "Documents - Application in general"

#: proposals/utils/pdf_diff_sections.py:778
#: proposals/utils/pdf_diff_sections.py:782
msgid "Documenten - Het hoofdtraject"
msgstr "Documents - The main trajectory"

#: proposals/utils/pdf_diff_sections.py:780
#: proposals/utils/pdf_diff_sections.py:784
msgid "Documenten - Traject "
msgstr "Documents - Trajectory "

Expand All @@ -3598,36 +3608,41 @@ msgstr ""
"This section was present in the original application, but was removed for "
"the revision."

#: proposals/utils/pdf_diff_utils.py:262 proposals/utils/pdf_diff_utils.py:346
#: proposals/utils/pdf_diff_utils.py:251
#: reviews/templates/reviews/review_attachments.html:57
msgid "Aanlevering"
msgstr "Provided as"

#: proposals/utils/pdf_diff_utils.py:285 proposals/utils/pdf_diff_utils.py:370
msgid "Niet aangeleverd"
msgstr "Not provided"

#: proposals/utils/pdf_diff_utils.py:281
#: proposals/utils/pdf_diff_utils.py:305
msgid "Uploaddatum"
msgstr "Date uploaded"

#: proposals/utils/pdf_diff_utils.py:311 reviews/models.py:112
#: proposals/utils/pdf_diff_utils.py:335 reviews/models.py:112
msgid "Onbekend"
msgstr "Unknown"

#: proposals/utils/pdf_diff_utils.py:343
#: proposals/utils/pdf_diff_utils.py:367
msgid "Download"
msgstr "Download"

#: proposals/utils/pdf_diff_utils.py:369
#: proposals/utils/pdf_diff_utils.py:393
#: tasks/templates/tasks/session_overview.html:7
msgid "Overzicht van het takenonderzoek"
msgstr "Overview of task-based research"

#: proposals/utils/pdf_diff_utils.py:412 proposals/utils/pdf_diff_utils.py:445
#: proposals/utils/pdf_diff_utils.py:436 proposals/utils/pdf_diff_utils.py:469
msgid "sessie "
msgstr "session "

#: proposals/utils/pdf_diff_utils.py:425 proposals/utils/pdf_diff_utils.py:453
#: proposals/utils/pdf_diff_utils.py:449 proposals/utils/pdf_diff_utils.py:477
msgid "Sessie "
msgstr "Session "

#: proposals/utils/pdf_diff_utils.py:447 proposals/utils/pdf_diff_utils.py:455
#: proposals/utils/pdf_diff_utils.py:471 proposals/utils/pdf_diff_utils.py:479
msgid ", taak "
msgstr ", task "

Expand Down Expand Up @@ -4238,16 +4253,7 @@ msgstr "Application in general"
msgid "Het hoofdtraject"
msgstr "The main trajectory"

#: reviews/templates/reviews/review_attachments.html:57
msgid "Aanlevering"
msgstr "Provided as"

#: reviews/templates/reviews/review_attachments.html:61
#: reviews/templates/reviews/review_attachments.html:63
msgid "Nieuw bij deze aanvraag"
msgstr "New with this review"

#: reviews/templates/reviews/review_attachments.html:66
#: reviews/templates/reviews/review_attachments.html:60
msgid "Gereviseerd bestand"
msgstr "Revised file"

Expand Down
6 changes: 3 additions & 3 deletions main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class Levels(models.IntegerChoices):
@property
def css_class(self):
if self.level == self.Levels.URGENT:
return "failed"
return "alert alert-danger"
if self.level == self.Levels.ATTENTION:
return "warning"
return "alert alert-warning"
if self.level == self.Levels.INFO:
return "info"
return "alert alert-info"

return ""

Expand Down
1 change: 1 addition & 0 deletions main/templates/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h2>{% trans "Startpagina" %} - {{ user.get_full_name }}</h2>
{% endblock %}

{% block content %}
{% include "main/index_parts/systemmessages.html" %}
{% include "main/index_parts/faculty_warning.html" %}
<div class="uu-container">
<div class="col-12 col-md-8 pe-5">
Expand Down
13 changes: 13 additions & 0 deletions main/templates/main/index_parts/systemmessages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if systemmessage_list %}
<div class="uu-container">
<div class="col-12">
{% for message in systemmessage_list %}
<div class="{{ message.css_class }}">
{% autoescape off %}
{{ message.message }}
{% endautoescape %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
Loading

0 comments on commit ac369d0

Please sign in to comment.