From 3f7e101dd031beab46c425b11f987690af0ea1df Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Thu, 22 Aug 2024 15:05:51 +0200 Subject: [PATCH 01/22] feat: turn proposal export list into datatable --- .../proposals/proposal_export_list.html | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/proposals/templates/proposals/proposal_export_list.html b/proposals/templates/proposals/proposal_export_list.html index 8576afee0..0e9177c24 100644 --- a/proposals/templates/proposals/proposal_export_list.html +++ b/proposals/templates/proposals/proposal_export_list.html @@ -2,42 +2,47 @@ {% load static %} {% load i18n %} +{% load datatables %} {% block header_title %}Goedgekeurde aanvragen - {{ block.super }}{% endblock %} {% block content %}
-

Approved proposals

- - - {# No translations here, as the table should be in English #} - - - - - - - - {% for proposal in proposals %} +

Approved proposals

+
Reference NumberTitleApplicantResearcher with final responsibilityApproval DateFEtC-H chamber
+ - - - - - - + {# No translations here, as the table should be in English #} + + + + + + - {% endfor %} + + + {% for proposal in proposals %} + + + + + + + + + {% endfor %} +
{{ proposal.reference_number }}{{ proposal.title }}{{ proposal.created_by.get_full_name }} - {% if proposal.supervisor %}{{ proposal.supervisor.get_full_name }}{% endif %} - {{ proposal.date_confirmed|date:"d M Y" }} - {# Bad translation hack #} - {% if proposal.reviewing_committee.name == "AK" %} - GC - {% else %} - LC - {% endif %} - Reference NumberTitleApplicantResearcher with final responsibilityApproval DateFEtC-H chamber
{{ proposal.reference_number }}{{ proposal.title }}{{ proposal.created_by.get_full_name }} + {% if proposal.supervisor %}{{ proposal.supervisor.get_full_name }}{% endif %} + {{ proposal.date_confirmed|date:"d M Y" }} + {# Bad translation hack #} + {% if proposal.reviewing_committee.name == "AK" %} + GC + {% else %} + LC + {% endif %} +

From b67c5d4f2eea5a743e0cb3b7aeb16d7987032dbf Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 12:07:49 +0200 Subject: [PATCH 02/22] feat:rename stepper block to sidebar --- main/templates/base/fetc_form_base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/templates/base/fetc_form_base.html b/main/templates/base/fetc_form_base.html index b8db75a29..d637b5d6f 100644 --- a/main/templates/base/fetc_form_base.html +++ b/main/templates/base/fetc_form_base.html @@ -8,7 +8,7 @@ {# todo: responsive design #}
- {% block stepper %} + {% block sidebar %} {% include "base/stepper.html" %} {% endblock %} From 3c5b7fce4d0518d302112e2c953657ce304441bf Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 12:10:26 +0200 Subject: [PATCH 03/22] fix: change review_detail_sidebar to work with sidebar block on form_base --- reviews/templates/reviews/review_detail.html | 8 +++++--- reviews/templates/reviews/review_detail_sidebar.html | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reviews/templates/reviews/review_detail.html b/reviews/templates/reviews/review_detail.html index ec0545773..1813d2b79 100644 --- a/reviews/templates/reviews/review_detail.html +++ b/reviews/templates/reviews/review_detail.html @@ -18,9 +18,11 @@

{{ review.proposal.title }} - {{ review.proposal.reference_number }}

- {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} +
+ {% with review=review %} + {% include "reviews/review_detail_sidebar.html" %} + {% endwith %} +

{% trans "Reviewers" %}

{% include "reviews/review_table.html" %} diff --git a/reviews/templates/reviews/review_detail_sidebar.html b/reviews/templates/reviews/review_detail_sidebar.html index fd6219f38..a8c04e6d3 100644 --- a/reviews/templates/reviews/review_detail_sidebar.html +++ b/reviews/templates/reviews/review_detail_sidebar.html @@ -12,7 +12,7 @@ Remember to include it in a with statement if the view does not provide it. {% endcomment %} -
+

{% trans "Details" %}

  • {% trans "Referentie" %}: {{ review.proposal.reference_number }}
  • @@ -27,7 +27,7 @@

    {% trans "Details" %}

    {% endblocktrans %} + title="{% trans 'Toon verschillen' %}"> From c15261dff7009f340b47f95d4310e58c4409425a Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 12:11:11 +0200 Subject: [PATCH 04/22] fix: simplify form_buttons --- main/templates/base/fetc_form_base.html | 16 ++++++++------ main/templates/base/form_buttons.html | 28 ++++++++++++------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/main/templates/base/fetc_form_base.html b/main/templates/base/fetc_form_base.html index d637b5d6f..2d072151a 100644 --- a/main/templates/base/fetc_form_base.html +++ b/main/templates/base/fetc_form_base.html @@ -32,13 +32,17 @@ {% endblock %} {{ form }} - {% block form-buttons %} - {% block post-form-pre-buttons %}{% endblock %} - -
    -
    {% include "base/form_buttons.html" %}
    + {% block post-form-pre-buttons %}{% endblock %} + +
    +
    +
    + {% block form-buttons %} + {% include "base/form_buttons.html" %} + {% endblock %} +
    - {% endblock %} +
    {# A block one can use to add stuff after the form, but still next to the stepper #} {% block post-form %} diff --git a/main/templates/base/form_buttons.html b/main/templates/base/form_buttons.html index 1ae0be030..3d133bd98 100644 --- a/main/templates/base/form_buttons.html +++ b/main/templates/base/form_buttons.html @@ -1,17 +1,15 @@ {% load i18n %} -
    - {% if not no_back %} - - {% endif %} - {% if not no_forward %} - {% trans 'Opslaan en volgende stap >>' as default_next_text %} - - {% endif %} -
    +{% if not no_back %} + +{% endif %} +{% if not no_forward %} + {% trans 'Opslaan en volgende stap >>' as default_next_text %} + +{% endif %} From f31e4977611e25873d1d7b27294319a8e6971d5a Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:01:59 +0200 Subject: [PATCH 05/22] feat: restyle review_assign_form --- reviews/forms.py | 8 +-- .../templates/reviews/review_assign_form.html | 59 ++++++++----------- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/reviews/forms.py b/reviews/forms.py index 51743f736..ebba42aff 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -41,7 +41,7 @@ class Meta: model = Review fields = ["short_route"] widgets = { - "short_route": forms.RadioSelect(choices=SHORT_LONG_REVISE), + "short_route": BootstrapRadioSelect(choices=SHORT_LONG_REVISE), } def __init__(self, *args, **kwargs): @@ -64,12 +64,12 @@ def __init__(self, *args, **kwargs): self.fields["reviewers"] = forms.ModelMultipleChoiceField( initial=self.instance.current_reviewers(), queryset=reviewers, - widget=forms.SelectMultiple( - attrs={"data-placeholder": _("Selecteer de commissieleden")} - ), + widget=SearchableSelectWidget(), required=False, ) + self.fields["reviewers"].widget.allow_multiple_selected = True + def clean_reviewers(self): reviewers = self.cleaned_data["reviewers"] diff --git a/reviews/templates/reviews/review_assign_form.html b/reviews/templates/reviews/review_assign_form.html index e86bc2b3c..649aee0a5 100644 --- a/reviews/templates/reviews/review_assign_form.html +++ b/reviews/templates/reviews/review_assign_form.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -14,42 +14,33 @@ {% if review.proposal.is_pre_assessment %} // Hide short_route input for preliminary assessment Proposals - $('input[name="short_route"]').parents('tr').hide(); + $('input[name="short_route"]').parents('.uu-form-row').hide(); {% endif %} }); {% endblock %} -{% block content %} -
    - {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} -
    -

    {% trans "Commissieleden aanstellen" %}

    - {% url 'reviews:workload' review.proposal.reviewing_committee as workload_url %} - {% blocktrans trimmed with title=review.proposal.title %} -

    - Kies hier de geschikte route en commissieleden voor de aanvraag {{ title }}. - Klik hier voor een overzicht van de werkverdeling van deze commissie. -

    - {% endblocktrans %} -
    - {% csrf_token %} - - {{ form.as_table }} -
    - -
    - {% if not review.proposal.is_pre_assessment %} - {% include "reviews/auto_review.html" %} - {% endif %} -
    -
    +{% block sidebar %} + {% with review=review %} + {% include "reviews/review_detail_sidebar.html" %} + {% endwith %} +{% endblock %} + +{% block pre-form-text %} +

    {% trans "Commissieleden aanstellen" %}

    + {% url 'reviews:workload' review.proposal.reviewing_committee as workload_url %} + {% blocktrans trimmed with title=review.proposal.title %} +

    + Kies hier de geschikte route en commissieleden voor de aanvraag {{ title }}. + Klik hier voor een overzicht van de werkverdeling van deze commissie. +

    + {% endblocktrans %} + {% if not review.proposal.is_pre_assessment %} + {% include "reviews/auto_review.html" %} + {% endif %} {% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + +{% endblock %} \ No newline at end of file From a14cfe1dc6aa9f57a04c188cc2d92fc7eba35938 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:06:44 +0200 Subject: [PATCH 06/22] feat: restyle decision_form --- reviews/forms.py | 4 +- reviews/templates/reviews/decision_form.html | 192 +++++++++---------- 2 files changed, 95 insertions(+), 101 deletions(-) diff --git a/reviews/forms.py b/reviews/forms.py index ebba42aff..29864deb8 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -147,12 +147,12 @@ def __init__(self, *args, **kwargs): return super().__init__(*args, **kwargs) -class DecisionForm(forms.ModelForm): +class DecisionForm(TemplatedModelForm): class Meta: model = Decision fields = ["go", "comments"] widgets = { - "go": forms.RadioSelect(), + "go": BootstrapRadioSelect(), } def __init__(self, *args, **kwargs): diff --git a/reviews/templates/reviews/decision_form.html b/reviews/templates/reviews/decision_form.html index c16b32af7..4acb6c38d 100644 --- a/reviews/templates/reviews/decision_form.html +++ b/reviews/templates/reviews/decision_form.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -7,102 +7,96 @@ {% trans "Aanvraag beoordelen" %} - {{ block.super }} {% endblock %} -{% block content %} -
    - {% with review=decision.review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} -
    -

    {% trans "Aanvraag beoordelen" %}

    - {% with proposal=decision.review.proposal %} - {% url 'proposals:pdf' proposal.id as pdf_url %} - {% if user != proposal.supervisor %} -

    - {% blocktrans trimmed with title=proposal.title refnum=proposal.reference_number chamber=proposal.reviewing_committee %} - Je kunt nu een go of no-go geven voor de aanvraag {{ title }}, - {{ refnum }} in {{ chamber }}. - De aanvraag is hier in te zien (downloadt als PDF). - {% endblocktrans %} -

    - {% if decision.is_final_decision %} -
    - {% blocktrans trimmed %} - Attentie: jij bent de laatste beoordelaar van deze aanvraag. Daarom kun je na het versturen je oordeel en commentaar niet meer bewerken. Controleer je antwoorden goed. - {% endblocktrans %} -
    - {% endif %} - {% else %} -

    - {% blocktrans trimmed with title=proposal.title %} - Je kunt nu de aanvraag {{ title }} bekijken. -
    - {% endblocktrans %} -

    -

    - {% blocktrans trimmed %} - Als de aanvraag (incl. geïnformeerde toestemmingsformulieren) in orde is, klik dan op - ‘goedgekeurd’ en ‘Beslissing opslaan’ hieronder; dan wordt de aanvraag ingediend - bij de FETC-GW. - {% endblocktrans %} -

    -

    - {% blocktrans trimmed %} - Als de aanvraag nog niet in orde is, dan zijn er twee mogelijkheden om de aanvraag aan te - passen: - {% endblocktrans %} -

    -
      -
    1. - {% blocktrans trimmed %} - door de supervisor (jijzelf) -
      - Als supervisor kan je deze aanvraag hier - aanpassen. Daarna word je teruggeleid naar deze pagina en kun je hieronder de aanvraag - goedkeuren; dat betekent dat de aanvraag wordt ingediend bij de FETC-GW. - {% endblocktrans %} -
    2. -
    3. - {% blocktrans trimmed %} - door de indiener (je student of promovendus) -
      - Indien je wilt dat de indiener de aanvraag zelf aanpast voordat je de studie - kunt goedkeuren en daarmee bij de FETC-GW indient, selecteer dan 'revisie noodzakelijk' - of ‘niet goedgekeurd’ hieronder, voeg eventuele opmerkingen toe, en klik op 'Beslissing - opslaan'. Zodra je dit gedaan hebt kan de indiener weer aanpassingen doen. -
      - {% endblocktrans %} -
    4. - {# This list item is a somewhat hacky way to simulate a p tag, as you can't use those in a li #} -
    5. - {% blocktrans trimmed %} - Als de indiener de gevraagde wijzigingen heeft doorgevoerd en opnieuw heeft verstuurd, - zal je de aangepaste aanvraag opnieuw moeten beoordelen. - {% endblocktrans %} -
    6. -
    - {% endif %} - {% if proposal.is_revision %} -

    - {% url 'proposals:diff' proposal.id as diff_url %} - {% blocktrans trimmed %} - Dit is een revisie van of amendement op een vorige aanvraag. De verschillen met de vorige - aanvraag zijn hier in te zien. - {% endblocktrans %} -

    - {% endif %} -
    - {% csrf_token %} - - {{ form.as_table }} -
    - -
    - {% endwith %} -
    -
    +{% block sidebar %} + {% with review=decision.review %} + {% include "reviews/review_detail_sidebar.html" %} + {% endwith %} {% endblock %} + +{% block pre-form-text %} +

    {% trans "Aanvraag beoordelen" %}

    + {% with proposal=decision.review.proposal %} + {% url 'proposals:pdf' proposal.id as pdf_url %} + {% if user != proposal.supervisor %} +

    + {% blocktrans trimmed with title=proposal.title refnum=proposal.reference_number chamber=proposal.reviewing_committee %} + Je kunt nu een go of no-go geven voor de aanvraag {{ title }}, + {{ refnum }} in {{ chamber }}. + De aanvraag is hier in te zien (downloadt als PDF). + {% endblocktrans %} +

    + {% if decision.is_final_decision %} +
    + {% blocktrans trimmed %} + Attentie: jij bent de laatste beoordelaar van deze aanvraag. Daarom kun je na het versturen je oordeel en commentaar niet meer bewerken. Controleer je antwoorden goed. + {% endblocktrans %} +
    + {% endif %} + {% else %} +

    + {% blocktrans trimmed with title=proposal.title %} + Je kunt nu de aanvraag {{ title }} bekijken. +
    + {% endblocktrans %} +

    +

    + {% blocktrans trimmed %} + Als de aanvraag (incl. geïnformeerde toestemmingsformulieren) in orde is, klik dan op + ‘goedgekeurd’ en ‘Beslissing opslaan’ hieronder; dan wordt de aanvraag ingediend + bij de FETC-GW. + {% endblocktrans %} +

    +

    + {% blocktrans trimmed %} + Als de aanvraag nog niet in orde is, dan zijn er twee mogelijkheden om de aanvraag aan te + passen: + {% endblocktrans %} +

    +
      +
    1. + {% blocktrans trimmed %} + door de supervisor (jijzelf) +
      + Als supervisor kan je deze aanvraag hier + aanpassen. Daarna word je teruggeleid naar deze pagina en kun je hieronder de aanvraag + goedkeuren; dat betekent dat de aanvraag wordt ingediend bij de FETC-GW. + {% endblocktrans %} +
    2. +
    3. + {% blocktrans trimmed %} + door de indiener (je student of promovendus) +
      + Indien je wilt dat de indiener de aanvraag zelf aanpast voordat je de studie + kunt goedkeuren en daarmee bij de FETC-GW indient, selecteer dan 'revisie noodzakelijk' + of ‘niet goedgekeurd’ hieronder, voeg eventuele opmerkingen toe, en klik op 'Beslissing + opslaan'. Zodra je dit gedaan hebt kan de indiener weer aanpassingen doen. +
      + {% endblocktrans %} +
    4. + {# This list item is a somewhat hacky way to simulate a p tag, as you can't use those in a li #} +
    5. + {% blocktrans trimmed %} + Als de indiener de gevraagde wijzigingen heeft doorgevoerd en opnieuw heeft verstuurd, + zal je de aangepaste aanvraag opnieuw moeten beoordelen. + {% endblocktrans %} +
    6. +
    + {% endif %} + {% if proposal.is_revision %} +

    + {% url 'proposals:diff' proposal.id as diff_url %} + {% blocktrans trimmed %} + Dit is een revisie van of amendement op een vorige aanvraag. De verschillen met de vorige + aanvraag zijn hier in te zien. + {% endblocktrans %} +

    + {% endif %} + {% endwith %} +{% endblock %} + +{% block form-buttons %} +{% trans "Terug naar de vorige pagina" %} + +{% endblock %} \ No newline at end of file From 48cc4442de42ef63cc19f635577ef5b0716f38a8 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:09:05 +0200 Subject: [PATCH 07/22] feat: restyle review_close_form and some imports --- reviews/forms.py | 16 ++++--- .../templates/reviews/review_close_form.html | 45 ++++++++----------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/reviews/forms.py b/reviews/forms.py index 29864deb8..fa98293aa 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -7,7 +7,13 @@ from proposals.models import Proposal from .models import Review, Decision -from cdh.core.forms import DateField +from cdh.core.forms import ( + DateField, + BootstrapRadioSelect, + SearchableSelectWidget, + TemplatedModelForm, + BootstrapCheckboxInput, +) from django.core.exceptions import ValidationError @@ -83,7 +89,7 @@ def clean_reviewers(self): return self.cleaned_data["reviewers"] -class ReviewCloseForm(forms.ModelForm): +class ReviewCloseForm(ConditionalModelForm): in_archive = forms.BooleanField(initial=True, required=False) has_minor_revision = forms.BooleanField(initial=False, required=False) minor_revision_description = forms.Field(required=False) @@ -97,7 +103,7 @@ class Meta: "in_archive", ] widgets = { - "continuation": forms.RadioSelect(), + "continuation": BootstrapRadioSelect(), } def __init__(self, *args, **kwargs): @@ -117,12 +123,12 @@ def __init__(self, *args, **kwargs): ] self.fields["in_archive"].label = _("Voeg deze aanvraag toe aan het archief") - self.fields["in_archive"].widget = forms.RadioSelect(choices=YES_NO) + self.fields["in_archive"].widget = BootstrapRadioSelect(choices=YES_NO) self.fields["has_minor_revision"].label = _( "Is er een revisie geweest na het indienen van deze aanvraag?" ) - self.fields["has_minor_revision"].widget = forms.RadioSelect(choices=YES_NO) + self.fields["has_minor_revision"].widget = BootstrapRadioSelect(choices=YES_NO) self.fields["minor_revision_description"].label = _("Opmerkingen over revisie") self.fields["minor_revision_description"].widget = forms.Textarea() diff --git a/reviews/templates/reviews/review_close_form.html b/reviews/templates/reviews/review_close_form.html index 1f5417839..4d16559db 100644 --- a/reviews/templates/reviews/review_close_form.html +++ b/reviews/templates/reviews/review_close_form.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +div{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -8,6 +8,7 @@ {% endblock %} {% block html_head %} + {{ block.super }} {% endblock %} -{% block content %} -
    -
    -

    {% trans "Review afsluiten" %}

    -

    - {% blocktrans trimmed with title=review.proposal.title %} - Sluit hier de beoordeling van de aanvraag {{ title }} af. Hieronder volgen de individuele - beslissingen. - {% endblocktrans %} -

    -

    {% trans "Individuele beslissingen" %}

    - {% include "reviews/review_table.html" %} -

    {% trans "Uiteindelijk besluit" %}

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - -
    -
    -
    +{% block pre-form %} +

    {% trans "Review afsluiten" %}

    +

    + {% blocktrans trimmed with title=review.proposal.title %} + Sluit hier de beoordeling van de aanvraag {{ title }} af. Hieronder volgen de individuele + beslissingen. + {% endblocktrans %} +

    +

    {% trans "Individuele beslissingen" %}

    + {% include "reviews/review_table.html" %} +

    {% trans "Uiteindelijk besluit" %}

    {% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + +{% endblock %} + From 7393982d07edbaf0a9e15ed28da98f6da452e185 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:15:00 +0200 Subject: [PATCH 08/22] feat: restyle proposal_confirmation --- proposals/forms.py | 1 + .../proposals/proposal_confirmation.html | 49 +++++++------------ 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/proposals/forms.py b/proposals/forms.py index 7a2305b97..d6ee07c5f 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -530,6 +530,7 @@ class ProposalConfirmationForm(TemplatedModelForm): class Meta: model = Proposal fields = ["date_confirmed", "confirmation_comments"] + widgets = {"date_confirmed": DateInput} class WmoForm(SoftValidationMixin, ConditionalModelForm): diff --git a/proposals/templates/proposals/proposal_confirmation.html b/proposals/templates/proposals/proposal_confirmation.html index 9357ac150..7ad9f2e27 100644 --- a/proposals/templates/proposals/proposal_confirmation.html +++ b/proposals/templates/proposals/proposal_confirmation.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -7,37 +7,22 @@ {% trans "Bevestigingsbrief versturen" %} - {{ block.super }} {% endblock %} -{% block html_head %} - +{% block sidebar %} + {% endblock %} -{% block content %} -
    -
    -

    {% trans "Bevestigingsbrief versturen" %}

    -

    - {% blocktrans trimmed with title=review.proposal.title %} - Geef hieronder aan wanneer de bevestigingsbrief voor de aanvraag {{ title }} is verstuurd. - {% endblocktrans %} -

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - {% trans "Terug naar de vorige pagina" %} - -
    -
    -
    +{% block pre-form-text %} +

    {% trans "Bevestigingsbrief versturen" %}

    +

    + {% blocktrans trimmed with title=review.proposal.title %} + Geef hieronder aan wanneer de bevestigingsbrief voor de aanvraag {{ title }} is verstuurd. + {% endblocktrans %} +

    +{% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + {% endblock %} From a0e932377ae8c95fc9340bdbe3446e9bb0feb798 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:15:54 +0200 Subject: [PATCH 09/22] feat: restyle review_discontinue_form --- reviews/forms.py | 6 +- .../reviews/review_discontinue_form.html | 103 ++++++++---------- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/reviews/forms.py b/reviews/forms.py index fa98293aa..b2a116aa3 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -145,12 +145,8 @@ class Meta: "confirm_discontinue", ] - def __init__(self, *args, **kwargs): - """ - - Check that this review can be discontinued - """ + widgets = {"confirm_discontinue": BootstrapCheckboxInput()} - return super().__init__(*args, **kwargs) class DecisionForm(TemplatedModelForm): diff --git a/reviews/templates/reviews/review_discontinue_form.html b/reviews/templates/reviews/review_discontinue_form.html index 0b733f368..0024532f4 100644 --- a/reviews/templates/reviews/review_discontinue_form.html +++ b/reviews/templates/reviews/review_discontinue_form.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -8,6 +8,7 @@ {% endblock %} {% block html_head %} + {{ block.super }} {% endblock %} -{% block content %} -
    - {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} -
    -

    {% trans "Afhandeling definitief beëindigen" %}

    -

    - {% blocktrans trimmed %} - Als een aanvraag definitief niet meer door de FETC-GW - afgehandeld gaat worden, en deze in de weg staat, - kan er voor gekozen worden deze te beëindigen. - {% endblocktrans %} -

    -

    - {% blocktrans trimmed %} - Een beëindigde aanvraag verschijnt niet meer in de pagina's - van de secretaris en beoordelaars. Deze - aanvraag kan ook niet meer gereviseerd worden, - maar nog wel gekopieerd. De aanvraag is nog wel zichtbaar - in de lijst met "alle ingediende aanvragen". - {% endblocktrans %} -

    - {% if review.stage == review.Stages.CLOSED %} -

    - {% trans "Attentie" %}: - {% blocktrans trimmed %} - Deze aanvraag heeft op dit moment geen lopende beoordeling. Om deze aanvraag definitief te - beëindigen, moeten we de uitkomst van laatste beoordeling (zie linker balk) veranderen. - Dit kan verwarring veroorzaken bij de indiener, dus houd hier rekening mee. - {% endblocktrans %} -

    - {% endif %} -

    - {% trans "Aanvraag" %}: - {% blocktrans with title=review.proposal.title author=review.proposal.created_by trimmed %} - {{ title }} door {{ author }} - {% endblocktrans %} -

    - {% csrf_token %} - - {{ form.as_table }} -
    - -
    -
    -
    - {% endblock %} +{% block sidebar %} + {% with review=review %} + {% include "reviews/review_detail_sidebar.html" %} + {% endwith %} +{% endblock %} + +{% block pre-form-text %} +

    {% trans "Afhandeling definitief beëindigen" %}

    +

    + {% blocktrans trimmed %} + Als een aanvraag definitief niet meer door de FETC-GW + afgehandeld gaat worden, en deze in de weg staat, + kan er voor gekozen worden deze te beëindigen. + {% endblocktrans %} +

    +

    + {% blocktrans trimmed %} + Een beëindigde aanvraag verschijnt niet meer in de pagina's + van de secretaris en beoordelaars. Deze + aanvraag kan ook niet meer gereviseerd worden, + maar nog wel gekopieerd. De aanvraag is nog wel zichtbaar + in de lijst met "alle ingediende aanvragen". + {% endblocktrans %} +

    + {% if review.stage == review.Stages.CLOSED %} +

    + {% trans "Attentie" %}: + {% blocktrans trimmed %} + Deze aanvraag heeft op dit moment geen lopende beoordeling. Om deze aanvraag definitief te + beëindigen, moeten we de uitkomst van laatste beoordeling (zie linker balk) veranderen. + Dit kan verwarring veroorzaken bij de indiener, dus houd hier rekening mee. + {% endblocktrans %} +

    + {% endif %} +

    + {% trans "Aanvraag" %}: + {% blocktrans with title=review.proposal.title author=review.proposal.created_by trimmed %} + {{ title }} door {{ author }} + {% endblocktrans %} +

    +{% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + +{% endblock %} \ No newline at end of file From 10a9c2fce9985d5c304e09fcb018f78ce6a05257 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:16:31 +0200 Subject: [PATCH 10/22] feat:restyle proposal_update_date_start --- proposals/forms.py | 2 +- .../proposals/proposal_update_date_start.html | 32 ++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/proposals/forms.py b/proposals/forms.py index d6ee07c5f..74c4e0ca3 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -777,7 +777,7 @@ class Meta: fields = ["dmp_file"] -class ProposalUpdateDateStartForm(forms.ModelForm): +class ProposalUpdateDateStartForm(TemplatedModelForm): date_start = DateField(label=_("Nieuwe beoogde startdatum")) class Meta: diff --git a/proposals/templates/proposals/proposal_update_date_start.html b/proposals/templates/proposals/proposal_update_date_start.html index a784b6477..7c42f7860 100644 --- a/proposals/templates/proposals/proposal_update_date_start.html +++ b/proposals/templates/proposals/proposal_update_date_start.html @@ -1,15 +1,17 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} {% block header_title %} - {% trans "Formulieren aanpassen" %} - {{ block.super }} + {% trans "Formulieren aanpassen" %} {% endblock %} -{% block content %} -
    -
    +{% block sidebar %} + +{% endblock %} + +{% block pre-form-text %}

    {% trans "Startdatum aanpassen" %}

    {% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %} @@ -20,17 +22,11 @@

    {% trans "Startdatum aanpassen" %}

    {% endblocktrans %} portalsupport.gw@uu.nl.

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - - - {% trans "Terug naar de vorige pagina" %} -
    -
    -
    +{% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + {% endblock %} From 24225c5860f71ff0e969fe00330ad73a30f5dc6d Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:24:34 +0200 Subject: [PATCH 11/22] feat: restyle & rename proposal_update_dmp --- proposals/forms.py | 2 +- .../proposal_update_attachments.html | 33 ------------------- .../proposals/proposal_update_dmp.html | 29 ++++++++++++++++ proposals/views/proposal_views.py | 2 +- 4 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 proposals/templates/proposals/proposal_update_attachments.html create mode 100644 proposals/templates/proposals/proposal_update_dmp.html diff --git a/proposals/forms.py b/proposals/forms.py index 74c4e0ca3..baaf3f02e 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -771,7 +771,7 @@ def clean(self): ) -class ProposalUpdateDataManagementForm(forms.ModelForm): +class ProposalUpdateDataManagementForm(TemplatedModelForm): class Meta: model = Proposal fields = ["dmp_file"] diff --git a/proposals/templates/proposals/proposal_update_attachments.html b/proposals/templates/proposals/proposal_update_attachments.html deleted file mode 100644 index 9477196a0..000000000 --- a/proposals/templates/proposals/proposal_update_attachments.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base/fetc_base.html" %} - -{% load static %} -{% load i18n %} - -{% block header_title %} - {% trans "Formulieren aanpassen" %} - {{ block.super }} -{% endblock %} - -{% block content %} -
    -
    -

    {% trans "Formulieren aanpassen" %}

    -

    - {% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %} - Op deze pagina kan je de formulieren aanpassen behorende bij de aanvraag {{ title }} - (referentienummer {{ ref_number }}). - {% endblocktrans %} -

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - - - {% trans "Terug naar de vorige pagina" %} -
    -
    -
    -{% endblock %} diff --git a/proposals/templates/proposals/proposal_update_dmp.html b/proposals/templates/proposals/proposal_update_dmp.html new file mode 100644 index 000000000..580ba82e5 --- /dev/null +++ b/proposals/templates/proposals/proposal_update_dmp.html @@ -0,0 +1,29 @@ +{% extends "base/fetc_form_base.html" %} + +{% load static %} +{% load i18n %} + +{% block header_title %} + {% trans "Formulieren aanpassen" %} - {{ block.super }} +{% endblock %} + +{% block sidebar %} + +{% endblock %} + +{% block pre-form-text %} +

    {% trans "Formulieren aanpassen" %}

    +

    + {% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %} + Op deze pagina kan je de formulieren aanpassen behorende bij de aanvraag {{ title }} + (referentienummer {{ ref_number }}). + {% endblocktrans %} +

    +{% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + +{% endblock %} diff --git a/proposals/views/proposal_views.py b/proposals/views/proposal_views.py index c47957f48..9f5a84bb2 100644 --- a/proposals/views/proposal_views.py +++ b/proposals/views/proposal_views.py @@ -496,7 +496,7 @@ class ProposalUpdateDataManagement(GroupRequiredMixin, generic.UpdateView): """ model = Proposal - template_name = "proposals/proposal_update_attachments.html" + template_name = "proposals/proposal_update_dmp.html" form_class = ProposalUpdateDataManagementForm group_required = settings.GROUP_SECRETARY From d286713c9e375b08bbb7cd0698254c7eeed355fb Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:24:58 +0200 Subject: [PATCH 12/22] feat: restyle study_update_attachments --- studies/forms.py | 6 +-- .../studies/study_update_attachments.html | 40 ++++++++----------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/studies/forms.py b/studies/forms.py index 3b364dd16..df63c228b 100644 --- a/studies/forms.py +++ b/studies/forms.py @@ -348,17 +348,13 @@ def clean(self): ) -class StudyUpdateAttachmentsForm(forms.ModelForm): +class StudyUpdateAttachmentsForm(TemplatedModelForm): class Meta: model = Documents fields = [ - # 'passive_consent', "informed_consent", "briefing", "director_consent_declaration", "director_consent_information", "parents_information", ] - widgets = { - # 'passive_consent': forms.HiddenInput - } diff --git a/studies/templates/studies/study_update_attachments.html b/studies/templates/studies/study_update_attachments.html index c36dc200b..4c5033b03 100644 --- a/studies/templates/studies/study_update_attachments.html +++ b/studies/templates/studies/study_update_attachments.html @@ -1,4 +1,4 @@ -{% extends "base/fetc_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} @@ -7,27 +7,19 @@ {% trans "Formulieren aanpassen" %} - {{ block.super }} {% endblock %} -{% block content %} -
    -
    -

    {% trans "Formulieren aanpassen" %}

    -

    - {% blocktrans trimmed with title=documents.proposal.title ref_number=documents.proposal.reference_number order=documents.study.order %} - Op deze pagina kan je de formulieren aanpassen behorende bij de aanvraag {{ title }} - (referentienummer {{ ref_number }}), traject {{ order }}. - {% endblocktrans %} -

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - - - {% trans "Terug naar de vorige pagina" %} -
    -
    -
    +{% block pre-form-text %} +

    {% trans "Formulieren aanpassen" %}

    +

    + {% blocktrans trimmed with title=documents.proposal.title ref_number=documents.proposal.reference_number order=documents.study.order %} + Op deze pagina kan je de formulieren aanpassen behorende bij de aanvraag {{ title }} + (referentienummer {{ ref_number }}), traject {{ order }}. + {% endblocktrans %} +

    +{% endblock %} + +{% block form-buttons %} + {% trans "Terug naar de vorige pagina" %} + {% endblock %} From 593cebfac2d687a36fe31737506c1663a2d093e6 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:25:29 +0200 Subject: [PATCH 13/22] fix: update form_buttons block on proposal_submit --- proposals/templates/proposals/proposal_submit.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/proposals/templates/proposals/proposal_submit.html b/proposals/templates/proposals/proposal_submit.html index edbbdbc5c..179927b22 100644 --- a/proposals/templates/proposals/proposal_submit.html +++ b/proposals/templates/proposals/proposal_submit.html @@ -152,8 +152,6 @@
    {% trans "Controleer uw beoogde startdatum" %}
    {% endblock %} {% block form-buttons %} -
    -
    {% if troublesome_pages or is_practice %} {% include "base/form_buttons.html" with no_forward=1 %} {% else %} @@ -167,6 +165,4 @@
    {% trans "Controleer uw beoogde startdatum" %}
    {% include "base/form_buttons.html" with next_text=_("Aanmelding versturen") %} {% endif %} {% endif %} -
    -
    {% endblock %} From b702725790c4cbc38a14cf748331dc5685ea0257 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Tue, 27 Aug 2024 16:26:30 +0200 Subject: [PATCH 14/22] fix: some bugfixes to review_actions logic --- reviews/utils/review_actions.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reviews/utils/review_actions.py b/reviews/utils/review_actions.py index 3dcbc4bf8..f22dd1168 100644 --- a/reviews/utils/review_actions.py +++ b/reviews/utils/review_actions.py @@ -85,7 +85,7 @@ def get_available_decision(self): user = self.user review = self.review - if review.stage in (review.Stages.COMMISSION, review.Stages.SUPERVISOR): + if review.stage not in (Review.Stages.COMMISSION, Review.Stages.SUPERVISOR): return False try: @@ -100,10 +100,10 @@ def get_available_decision(self): def is_available(self): review = self.review - + if not self.get_available_decision(): return False - + return True def action_url(self): @@ -182,11 +182,10 @@ def is_available(self): user_groups = user.groups.values_list("name", flat=True) if not settings.GROUP_SECRETARY in user_groups: return False - - if self.review.stage not in [ - Review.Continuations.REVISION, - Review.Continuations.NO_GO, + + if self.review.stage in [ Review.Stages.CLOSING, + Review.Stages.CLOSED, ]: return False From c3483cc34291688cd7f77064fd5e4a745e05759f Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Wed, 28 Aug 2024 12:15:08 +0200 Subject: [PATCH 15/22] feat: restyle committee_members_workload.html --- reviews/forms.py | 3 ++- .../reviews/committee_members_workload.html | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/reviews/forms.py b/reviews/forms.py index b2a116aa3..a059e93b2 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -13,6 +13,7 @@ SearchableSelectWidget, TemplatedModelForm, BootstrapCheckboxInput, + TemplatedForm, ) from django.core.exceptions import ValidationError @@ -165,6 +166,6 @@ def __init__(self, *args, **kwargs): self.fields["go"].required = True -class StartEndDateForm(forms.Form): +class StartEndDateForm(TemplatedForm): start_date = DateField(label=_("Start datum periode:")) end_date = DateField(label=_("Eind datum periode:")) diff --git a/reviews/templates/reviews/committee_members_workload.html b/reviews/templates/reviews/committee_members_workload.html index 605dbbb39..1ceecda19 100644 --- a/reviews/templates/reviews/committee_members_workload.html +++ b/reviews/templates/reviews/committee_members_workload.html @@ -56,13 +56,11 @@

    {% trans 'Lopende reviews' %} {{ committee }}


    {% trans 'Werkverdeling overzicht van afgelopen periode' %}

    {% trans 'Vul hieronder een start- en einddatum in voor de periode van dit overzicht.' %}

    -
    - {% csrf_token %} - - {{ form.as_table }} -
    - -
    +
    + {% csrf_token %} + {{ form }} +
    From 4c29c770e74669ebafdc1ad04b6dca376e3ee0fc Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Wed, 28 Aug 2024 14:45:16 +0200 Subject: [PATCH 16/22] fix: formatting --- main/templates/base/fetc_form_base.html | 6 +- main/templates/base/form_buttons.html | 12 ++-- .../proposals/proposal_confirmation.html | 8 +-- .../templates/proposals/proposal_submit.html | 26 ++++---- .../proposals/proposal_update_date_start.html | 28 ++++----- .../proposals/proposal_update_dmp.html | 4 +- reviews/forms.py | 3 +- .../reviews/committee_members_workload.html | 60 ++++++++++--------- reviews/templates/reviews/decision_form.html | 10 ++-- .../templates/reviews/review_assign_form.html | 6 +- .../templates/reviews/review_close_form.html | 25 ++++---- .../reviews/review_detail_sidebar.html | 2 +- .../reviews/review_discontinue_form.html | 6 +- reviews/utils/review_actions.py | 6 +- 14 files changed, 102 insertions(+), 100 deletions(-) diff --git a/main/templates/base/fetc_form_base.html b/main/templates/base/fetc_form_base.html index 2d072151a..3bfbd48ed 100644 --- a/main/templates/base/fetc_form_base.html +++ b/main/templates/base/fetc_form_base.html @@ -33,17 +33,17 @@ {{ form }} {% block post-form-pre-buttons %}{% endblock %} - +
    {% block form-buttons %} {% include "base/form_buttons.html" %} {% endblock %} -
    + +
    - {# A block one can use to add stuff after the form, but still next to the stepper #} {% block post-form %}
    diff --git a/main/templates/base/form_buttons.html b/main/templates/base/form_buttons.html index 3d133bd98..2afd62914 100644 --- a/main/templates/base/form_buttons.html +++ b/main/templates/base/form_buttons.html @@ -2,14 +2,14 @@ {% if not no_back %} + type="submit" + name="save_back" + value="{% trans '<< Opslaan en vorige stap' %}" /> {% endif %} {% if not no_forward %} {% trans 'Opslaan en volgende stap >>' as default_next_text %} + type="submit" + name="save_continue" + value="{{ next_text|default:default_next_text }}" /> {% endif %} diff --git a/proposals/templates/proposals/proposal_confirmation.html b/proposals/templates/proposals/proposal_confirmation.html index 7ad9f2e27..e3067f8e1 100644 --- a/proposals/templates/proposals/proposal_confirmation.html +++ b/proposals/templates/proposals/proposal_confirmation.html @@ -7,9 +7,7 @@ {% trans "Bevestigingsbrief versturen" %} - {{ block.super }} {% endblock %} -{% block sidebar %} - -{% endblock %} +{% block sidebar %}{% endblock %} {% block pre-form-text %}

    {% trans "Bevestigingsbrief versturen" %}

    @@ -23,6 +21,6 @@

    {% trans "Bevestigingsbrief versturen" %}

    {% block form-buttons %} {% trans "Terug naar de vorige pagina" %} + type="submit" + value="{% trans 'Bevestigingsbrief verstuurd' %}" /> {% endblock %} diff --git a/proposals/templates/proposals/proposal_submit.html b/proposals/templates/proposals/proposal_submit.html index 179927b22..1aaed06f4 100644 --- a/proposals/templates/proposals/proposal_submit.html +++ b/proposals/templates/proposals/proposal_submit.html @@ -152,17 +152,17 @@
    {% trans "Controleer uw beoogde startdatum" %}
    {% endblock %} {% block form-buttons %} - {% if troublesome_pages or is_practice %} - {% include "base/form_buttons.html" with no_forward=1 %} - {% else %} - {% if proposal.is_pre_assessment %} - {% include "base/form_buttons.html" with next_text=_("Aanvraag voor voortoetsing versturen") %} - {% elif is_supervisor_edit_phase and is_supervisor %} - {% include "base/form_buttons.html" with next_text=_("Terug naar beoordeling >>") %} - {% elif proposal.relation.needs_supervisor %} - {% include "base/form_buttons.html" with next_text=_("Concept-aanmelding versturen") %} - {% else %} - {% include "base/form_buttons.html" with next_text=_("Aanmelding versturen") %} - {% endif %} - {% endif %} + {% if troublesome_pages or is_practice %} + {% include "base/form_buttons.html" with no_forward=1 %} + {% else %} + {% if proposal.is_pre_assessment %} + {% include "base/form_buttons.html" with next_text=_("Aanvraag voor voortoetsing versturen") %} + {% elif is_supervisor_edit_phase and is_supervisor %} + {% include "base/form_buttons.html" with next_text=_("Terug naar beoordeling >>") %} + {% elif proposal.relation.needs_supervisor %} + {% include "base/form_buttons.html" with next_text=_("Concept-aanmelding versturen") %} + {% else %} + {% include "base/form_buttons.html" with next_text=_("Aanmelding versturen") %} + {% endif %} + {% endif %} {% endblock %} diff --git a/proposals/templates/proposals/proposal_update_date_start.html b/proposals/templates/proposals/proposal_update_date_start.html index 7c42f7860..5ee8680b1 100644 --- a/proposals/templates/proposals/proposal_update_date_start.html +++ b/proposals/templates/proposals/proposal_update_date_start.html @@ -7,26 +7,24 @@ {% trans "Formulieren aanpassen" %} {% endblock %} -{% block sidebar %} - -{% endblock %} +{% block sidebar %}{% endblock %} {% block pre-form-text %} -

    {% trans "Startdatum aanpassen" %}

    -

    - {% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %} - Op deze pagina kan de startdatum worden aangepast van de aanvraag {{ title }} - (referentienummer {{ ref_number }}). Let op! Als de review al is afgerond, - wordt de nieuwe startdatum niet automatisch weergegeven in de PDF. Mocht je de PDF - opnieuw willen genereren, neem hierover dan contact op met - {% endblocktrans %} - portalsupport.gw@uu.nl. -

    +

    {% trans "Startdatum aanpassen" %}

    +

    + {% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %} + Op deze pagina kan de startdatum worden aangepast van de aanvraag {{ title }} + (referentienummer {{ ref_number }}). Let op! Als de review al is afgerond, + wordt de nieuwe startdatum niet automatisch weergegeven in de PDF. Mocht je de PDF + opnieuw willen genereren, neem hierover dan contact op met + {% endblocktrans %} + portalsupport.gw@uu.nl. +

    {% endblock %} {% block form-buttons %} {% trans "Terug naar de vorige pagina" %} + type="submit" + value="{% trans 'Startdatum aanpassen' %}" /> {% endblock %} diff --git a/proposals/templates/proposals/proposal_update_dmp.html b/proposals/templates/proposals/proposal_update_dmp.html index 580ba82e5..aaca835f0 100644 --- a/proposals/templates/proposals/proposal_update_dmp.html +++ b/proposals/templates/proposals/proposal_update_dmp.html @@ -7,9 +7,7 @@ {% trans "Formulieren aanpassen" %} - {{ block.super }} {% endblock %} -{% block sidebar %} - -{% endblock %} +{% block sidebar %}{% endblock %} {% block pre-form-text %}

    {% trans "Formulieren aanpassen" %}

    diff --git a/reviews/forms.py b/reviews/forms.py index a059e93b2..c07c769b5 100644 --- a/reviews/forms.py +++ b/reviews/forms.py @@ -146,8 +146,7 @@ class Meta: "confirm_discontinue", ] - widgets = {"confirm_discontinue": BootstrapCheckboxInput()} - + widgets = {"confirm_discontinue": BootstrapCheckboxInput()} class DecisionForm(TemplatedModelForm): diff --git a/reviews/templates/reviews/committee_members_workload.html b/reviews/templates/reviews/committee_members_workload.html index 1ceecda19..4f6f33901 100644 --- a/reviews/templates/reviews/committee_members_workload.html +++ b/reviews/templates/reviews/committee_members_workload.html @@ -56,34 +56,38 @@

    {% trans 'Lopende reviews' %} {{ committee }}


    {% trans 'Werkverdeling overzicht van afgelopen periode' %}

    {% trans 'Vul hieronder een start- en einddatum in voor de periode van dit overzicht.' %}

    - - {% csrf_token %} - {{ form }} - -
    -
    - - - - - - - - - - - {% for reviewer in reviewers %} + + {% csrf_token %} + {{ form }} + +
    +
    {% trans "Reviewer" %}{% trans "Totaal" %}{% trans "Korte route" %}{% trans "Lange Route" %}{% trans "Revisie" %}
    + - - - - - + + + + + - {% endfor %} - -
    {{ reviewer.get_full_name }}{{ reviewer.total }}{{ reviewer.num_short_route }}{{ reviewer.num_long_route }}{{ reviewer.num_revision }}{% trans "Reviewer" %}{% trans "Totaal" %}{% trans "Korte route" %}{% trans "Lange Route" %}{% trans "Revisie" %}
    + + + {% for reviewer in reviewers %} + + {{ reviewer.get_full_name }} + {{ reviewer.total }} + {{ reviewer.num_short_route }} + {{ reviewer.num_long_route }} + {{ reviewer.num_revision }} + + {% endfor %} + + +
-
-{% endblock %} + {% endblock %} diff --git a/reviews/templates/reviews/decision_form.html b/reviews/templates/reviews/decision_form.html index 4acb6c38d..1cdf50786 100644 --- a/reviews/templates/reviews/decision_form.html +++ b/reviews/templates/reviews/decision_form.html @@ -95,8 +95,8 @@

{% trans "Aanvraag beoordelen" %}

{% endblock %} {% block form-buttons %} -{% trans "Terug naar de vorige pagina" %} - -{% endblock %} \ No newline at end of file + {% trans "Terug naar de vorige pagina" %} + +{% endblock %} diff --git a/reviews/templates/reviews/review_assign_form.html b/reviews/templates/reviews/review_assign_form.html index 649aee0a5..06cb106d8 100644 --- a/reviews/templates/reviews/review_assign_form.html +++ b/reviews/templates/reviews/review_assign_form.html @@ -42,5 +42,7 @@

{% trans "Commissieleden aanstellen" %}

{% block form-buttons %} {% trans "Terug naar de vorige pagina" %} - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/reviews/templates/reviews/review_close_form.html b/reviews/templates/reviews/review_close_form.html index 4d16559db..d4698e97b 100644 --- a/reviews/templates/reviews/review_close_form.html +++ b/reviews/templates/reviews/review_close_form.html @@ -20,20 +20,21 @@ {% endblock %} {% block pre-form %} -

{% trans "Review afsluiten" %}

-

- {% blocktrans trimmed with title=review.proposal.title %} - Sluit hier de beoordeling van de aanvraag {{ title }} af. Hieronder volgen de individuele - beslissingen. - {% endblocktrans %} -

-

{% trans "Individuele beslissingen" %}

- {% include "reviews/review_table.html" %} -

{% trans "Uiteindelijk besluit" %}

+

{% trans "Review afsluiten" %}

+

+ {% blocktrans trimmed with title=review.proposal.title %} + Sluit hier de beoordeling van de aanvraag {{ title }} af. Hieronder volgen de individuele + beslissingen. + {% endblocktrans %} +

+

{% trans "Individuele beslissingen" %}

+ {% include "reviews/review_table.html" %} +

{% trans "Uiteindelijk besluit" %}

{% endblock %} {% block form-buttons %} {% trans "Terug naar de vorige pagina" %} - + {% endblock %} - diff --git a/reviews/templates/reviews/review_detail_sidebar.html b/reviews/templates/reviews/review_detail_sidebar.html index a8c04e6d3..f647789b6 100644 --- a/reviews/templates/reviews/review_detail_sidebar.html +++ b/reviews/templates/reviews/review_detail_sidebar.html @@ -27,7 +27,7 @@

{% trans "Details" %}

{% endblocktrans %} + title="{% trans 'Toon verschillen' %}"> diff --git a/reviews/templates/reviews/review_discontinue_form.html b/reviews/templates/reviews/review_discontinue_form.html index 0024532f4..7afde5f6a 100644 --- a/reviews/templates/reviews/review_discontinue_form.html +++ b/reviews/templates/reviews/review_discontinue_form.html @@ -65,5 +65,7 @@

{% trans "Afhandeling definitief beëindigen" %}

{% block form-buttons %} {% trans "Terug naar de vorige pagina" %} - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/reviews/utils/review_actions.py b/reviews/utils/review_actions.py index f22dd1168..faefa57f9 100644 --- a/reviews/utils/review_actions.py +++ b/reviews/utils/review_actions.py @@ -100,10 +100,10 @@ def get_available_decision(self): def is_available(self): review = self.review - + if not self.get_available_decision(): return False - + return True def action_url(self): @@ -182,7 +182,7 @@ def is_available(self): user_groups = user.groups.values_list("name", flat=True) if not settings.GROUP_SECRETARY in user_groups: return False - + if self.review.stage in [ Review.Stages.CLOSING, Review.Stages.CLOSED, From dee78792f1e890589059934ce21ebb487ee0682e Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Mon, 9 Sep 2024 11:14:42 +0200 Subject: [PATCH 17/22] fix: remove redundant with's --- reviews/templates/reviews/review_assign_form.html | 4 +--- reviews/templates/reviews/review_detail.html | 4 +--- reviews/templates/reviews/review_discontinue_form.html | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/reviews/templates/reviews/review_assign_form.html b/reviews/templates/reviews/review_assign_form.html index 06cb106d8..a09939a34 100644 --- a/reviews/templates/reviews/review_assign_form.html +++ b/reviews/templates/reviews/review_assign_form.html @@ -21,9 +21,7 @@ {% endblock %} {% block sidebar %} - {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} + {% include "reviews/review_detail_sidebar.html" %} {% endblock %} {% block pre-form-text %} diff --git a/reviews/templates/reviews/review_detail.html b/reviews/templates/reviews/review_detail.html index 1813d2b79..14436e85e 100644 --- a/reviews/templates/reviews/review_detail.html +++ b/reviews/templates/reviews/review_detail.html @@ -19,9 +19,7 @@

{{ review.proposal.title }} - {{ review.proposal.reference_number }}

- {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} + {% include "reviews/review_detail_sidebar.html" %}

{% trans "Reviewers" %}

diff --git a/reviews/templates/reviews/review_discontinue_form.html b/reviews/templates/reviews/review_discontinue_form.html index 7afde5f6a..48206d016 100644 --- a/reviews/templates/reviews/review_discontinue_form.html +++ b/reviews/templates/reviews/review_discontinue_form.html @@ -22,9 +22,7 @@ {% endblock %} {% block sidebar %} - {% with review=review %} - {% include "reviews/review_detail_sidebar.html" %} - {% endwith %} + {% include "reviews/review_detail_sidebar.html" %} {% endblock %} {% block pre-form-text %} From 04b5b2a25cbcfd2bacb487203935e27dfe42dbe8 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Mon, 9 Sep 2024 11:15:14 +0200 Subject: [PATCH 18/22] fix: remove lost div --- reviews/templates/reviews/review_close_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reviews/templates/reviews/review_close_form.html b/reviews/templates/reviews/review_close_form.html index d4698e97b..c333139c6 100644 --- a/reviews/templates/reviews/review_close_form.html +++ b/reviews/templates/reviews/review_close_form.html @@ -1,4 +1,4 @@ -div{% extends "base/fetc_form_base.html" %} +{% extends "base/fetc_form_base.html" %} {% load static %} {% load i18n %} From 5283ac4bc531c2843ab74fea0f04f4bfe2de7811 Mon Sep 17 00:00:00 2001 From: Edo Storm Date: Mon, 9 Sep 2024 11:15:29 +0200 Subject: [PATCH 19/22] feat: add review sidebar on review close --- reviews/templates/reviews/review_close_form.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reviews/templates/reviews/review_close_form.html b/reviews/templates/reviews/review_close_form.html index c333139c6..c600f9287 100644 --- a/reviews/templates/reviews/review_close_form.html +++ b/reviews/templates/reviews/review_close_form.html @@ -7,6 +7,10 @@ {% trans "Review afsluiten" %} - {{ block.super }} {% endblock %} +{% block sidebar %} + {% include "reviews/review_detail_sidebar.html" %} +{% endblock %} + {% block html_head %} {{ block.super }}